Re: [SMW-devel] Help tracking down bug with SQLStore's QueryEngine
Also, this appears to be the same as this issue: https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2532 - On Jan 23, 2020, at 9:59 PM, Mark A. Hershberger m...@everybody.org wrote: > "[[kgh]]" writes: > >> I guess always helps revealing what environment you use, e.g. PHP, >> MariaDB, MW, SMW, etc. Cheers, Karsten > > You're right, but in the meantime, I found a fix for my problem. > > In any case here are the specs: > > - PHP: 5.6.40 > - DB: Percona cluster with 3 servers. 5.7.23 > - MW 1.2.3 > - SMW: 2.5.7 (55b550a) > > So, this afternoon, i gained some understanding of why my code didn't > work. The table "{$wgDBprefix}t3" is supposed to exist -- it a temporary > table that is created in HierarchyTempTableBuilder -- and it was > created, but it is an in-memory temporary table that SMW knew was the > replica db. In-memory temporary tables, at least in my configuration, > are not replicated. > > So, when the query I sent was run, the temp table existed on the replica > but not on the master. And the query I sent was run against the master. > > I think this is a bug which I'll report tomorrow, but I've worked around > it in the meantime with the following in my LocalSettings.php: > >$smwgLocalConnectionConf = [ >'mw.db' => [ >'read' => DB_MASTER, >'write' => DB_MASTER >], >'mw.db.queryengine' => [ >'read' => DB_MASTER, >'write' => DB_MASTER >] >]; > > Thanks for your indulgence, > > Mark. > > > ___ > Semediawiki-devel mailing list > Semediawiki-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel ___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Re: [SMW-devel] Help tracking down bug with SQLStore's QueryEngine
"[[kgh]]" writes: > I guess always helps revealing what environment you use, e.g. PHP, > MariaDB, MW, SMW, etc. Cheers, Karsten You're right, but in the meantime, I found a fix for my problem. In any case here are the specs: - PHP: 5.6.40 - DB: Percona cluster with 3 servers. 5.7.23 - MW 1.2.3 - SMW: 2.5.7 (55b550a) So, this afternoon, i gained some understanding of why my code didn't work. The table "{$wgDBprefix}t3" is supposed to exist -- it a temporary table that is created in HierarchyTempTableBuilder -- and it was created, but it is an in-memory temporary table that SMW knew was the replica db. In-memory temporary tables, at least in my configuration, are not replicated. So, when the query I sent was run, the temp table existed on the replica but not on the master. And the query I sent was run against the master. I think this is a bug which I'll report tomorrow, but I've worked around it in the meantime with the following in my LocalSettings.php: $smwgLocalConnectionConf = [ 'mw.db' => [ 'read' => DB_MASTER, 'write' => DB_MASTER ], 'mw.db.queryengine' => [ 'read' => DB_MASTER, 'write' => DB_MASTER ] ]; Thanks for your indulgence, Mark. ___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Re: [SMW-devel] Help tracking down bug with SQLStore's QueryEngine
I guess always helps revealing what environment you use, e.g. PHP, MariaDB, MW, SMW, etc. Cheers, Karsten -- Karsten / MediaWiki and Semantic MediaWiki enthusiast / → https://professional.wiki/ Am 23.01.20 um 21:37 schrieb Mark A. Hershberger: > While trying to my wiki, I ran into the following error: > > [95e3cb7152fc75e5d21f4193] /wiki/Main_Page RuntimeException from line 228 of > .../extensions/SemanticMediaWiki/src/MediaWiki/Database.php: A database error > has occurred. Did you forget to run maintenance/update.php after upgrading? > See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script > Query: SELECT DISTINCT t0.smw_id AS id,t0.smw_title AS t,t0.smw_namespace AS > ns,t0.smw_iw AS iw,t0.smw_subobject AS so,t0.smw_sortkey AS > sortkey,t0.smw_sortkey FROM `wiki1smw_object_ids` AS t0 INNER JOIN > `wiki1smw_fpt_inst` AS t2 ON t0.smw_id=t2.s_id INNER JOIN `wiki1t3` AS t3 ON > t2.o_id=t3.id INNER JOIN `wiki1smw_fpt_inst` AS t4 ON t2.s_id=t4.s_id WHERE > ((t4.o_id='702993')) AND t0.smw_iw!=':smw' AND t0.smw_iw!=':smw-delete' AND > t0.smw_iw!=':smw-redi' ORDER BY t0.smw_sortkey ASC LIMIT 2005 > Function: SMW\SQLStore\QueryEngine\QueryEngine::getInstanceQueryResult > Error: 1146 Table 'wiki_d.wiki1t3' doesn't exist (...) > > The problem, it looks like, is that the code in > QuerySegmentListProcessor.php uses the table alias (t3 in this case) in > place of the table itself. I tried fixing this by altering the code so > that $smwtable is is used instead of the alias[1], but the tests didn't > pass. > > I wonder if anyone can help me understand this code better or fix the > problem. > > Mark. > > Footnotes: > [1] > https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4445/commits/fb84812974229e30531c95d4e297cc24cc2442a9 > > > > ___ > Semediawiki-devel mailing list > Semediawiki-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel > ___ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel