St. Mary's Anglican Church

From Charleswood Historical Society
Jump to navigation Jump to search

Todo: This was posted to https://www.mediawiki.org/wiki/Extension_talk:Cargo#WITHIN_statement_error_when_a_Hierarchy_item_has_an_apostrophe for support.

This is a problem we are tracking and actively working on. Ttenbergen bot (talk) 16:26, 2023 May 22 (CDT)

tracking this down

  • The error itself comes from MySQL, not Cargo (grep doesn't find the wording in the directory)
  • the within stuff appears to be dealt with in CargoSQLQuery.php near Line 1392
  • so how does it do the pattern matching for the plain where clause instead?

test

stripped down version of the query

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'St. Mary' ) )s Anglican Church") and not `cargo__CollectedIn`.`_pageName` Like "' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__CollectedIn`.`_pageName` AS `collected pages` FROM `cargo__CollectedIn` LEFT OUTER JOIN `cargo__Collection` ON ((`cargo__CollectedIn`.`_pageName`=`cargo__Collection`.`_pageName`)) WHERE `cargo__Collection`.`_pageName` is null and (Collection = "St. Mary's Anglican Church" or Collection IN ( SELECT `_value` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_left` >= ( SELECT `_left` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) AND `_right` <= ( SELECT `_right` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) )s Anglican Church") and not `cargo__CollectedIn`.`_pageName` Like "%.jpg" and not `cargo__CollectedIn`.`_pageName` Like "%.png" GROUP BY `cargo__CollectedIn`.`_pageName` ORDER BY `cargo__CollectedIn`.`_pageName` LIMIT 100


When used with = instead of WITHIN, the syntax works (but is empty) No results


The St. Mary's Anglican Church.

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'St. Mary' ) )s Anglican Church") \x0A and not `cargo__CollectedIn`.`_pageN' at line 2

Function: CargoSQLQuery::run Query: SELECT `cargo__CollectedIn`.`_pageName` AS `collected pages` FROM `cargo__CollectedIn` LEFT OUTER JOIN `cargo__Collection` ON ((`cargo__CollectedIn`.`_pageName`=`cargo__Collection`.`_pageName`)) WHERE `cargo__Collection`.`_pageName` is null

      and (Collection = "St. Mary's Anglican Church" or Collection IN ( SELECT `_value` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_left` >= ( SELECT `_left` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) AND `_right` <= ( SELECT `_right` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) )s Anglican Church") 
      and not `cargo__CollectedIn`.`_pageName` Like "%.jpg" and not `cargo__CollectedIn`.`_pageName` Like "%.png"  GROUP BY `cargo__CollectedIn`.`_pageName` ORDER BY `cargo__CollectedIn`.`_pageName` LIMIT 1000  
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'St. Mary' ) )s Anglican Church") and `cargo__Collection`.`_pageName`>"" GROUP B' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__Collection`.`_pageName` AS `_pageName` FROM `cargo__CollectedIn` LEFT OUTER JOIN `cargo__Collection` ON ((`cargo__CollectedIn`.`_pageName`=`cargo__Collection`.`_pageName`)) WHERE (Collection = "St. Mary's Anglican Church" or Collection IN ( SELECT `_value` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_left` >= ( SELECT `_left` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) AND `_right` <= ( SELECT `_right` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) )s Anglican Church") and `cargo__Collection`.`_pageName`>"" GROUP BY `cargo__CollectedIn`.`_pageName` ORDER BY `cargo__Collection`.`_pageName` LIMIT 1000

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'St. Mary' ) )s Anglican Church") and (`cargo__CollectedIn`.`_pageName` like "%.j' at line 1

Function: CargoSQLQuery::run Query: SELECT CONCAT("200px") AS `Image`,`Description` AS `Description` FROM `cargo__CollectedIn` LEFT OUTER JOIN `cargo__Image_description` ON ((`cargo__CollectedIn`.`_pageName`=`cargo__Image_description`.`_pageName`)) WHERE (Collection = "St. Mary's Anglican Church" or Collection IN ( SELECT `_value` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_left` >= ( SELECT `_left` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) AND `_right` <= ( SELECT `_right` FROM `cargo__CollectedIn__Collection__hierarchy` WHERE `_value` = "St. Mary' ) )s Anglican Church") and (`cargo__CollectedIn`.`_pageName` like "%.jpg" or `cargo__CollectedIn`.`_pageName` like "%.png") GROUP BY `cargo__CollectedIn`.`_pageName`, Description ORDER BY CONCAT("200px"),`Description` LIMIT 1000

This page is part of the Collection Churches/Religious.