Fixed Special:AllPages under PostgreSQL. Thanks phirox from IRC.
authorDan
Mon, 04 Jan 2010 11:09:50 -0500
changeset 1199 8d85b52ac9b6
parent 1198 3ec9ac297045
child 1204 eaab1c22e237
Fixed Special:AllPages under PostgreSQL. Thanks phirox from IRC.
plugins/SpecialPageFuncs.php
--- a/plugins/SpecialPageFuncs.php	Mon Dec 28 16:53:19 2009 -0500
+++ b/plugins/SpecialPageFuncs.php	Mon Jan 04 11:09:50 2010 -0500
@@ -298,7 +298,12 @@
   
   $db->free_result();
   
-  $q = $db->sql_unbuffered_query('SELECT CONCAT("ns=",namespace,";pid=",urlname) AS identifier, name FROM '.table_prefix.'pages WHERE visible!=0 ORDER BY name ASC;');
+  // This query needs to be generated based on the DBMS
+  $concat_column = ENANO_DBLAYER == 'MYSQL'
+                     ? 'CONCAT("ns=",namespace,";pid=",urlname)'
+                     : "'ns=' || namespace || ';pid=' || urlname";
+  
+  $q = $db->sql_unbuffered_query("SELECT $concat_column AS identifier, name FROM " . table_prefix . "pages WHERE visible != 0 ORDER BY name ASC;");
   if ( !$q )
     $db->_die();