change some LIKE '\\_' style queries to the sql standard LIKE '@_' ESCAPE '@' syntax...
authorxzilla <xzilla>
Sun, 24 Sep 2006 23:42:41 +0000 (23:42 +0000)
committerxzilla <xzilla>
Sun, 24 Sep 2006 23:42:41 +0000 (23:42 +0000)
Tested on 7.3 on demo server and looks like it works ok. I am sure there are others.

classes/database/Postgres73.php
classes/database/Postgres74.php
classes/plugins/Slony.php

index 44e8a8a16b842e5a11b419101d885570040149c6..f142bc8e5955dc0b3219f4e76e1edbb70196422f 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres73.php,v 1.158 2006/08/09 21:19:44 xzilla Exp $
+ * $Id: Postgres73.php,v 1.159 2006/09/24 23:42:41 xzilla Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -1009,7 +1009,7 @@ class Postgres73 extends Postgres72 {
                else
                        $where = "n.nspname = '{$this->_schema}'";
                // Never show system table types
-               $where2 = "AND c.relnamespace NOT IN (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname LIKE 'pg\\\\_%')";
+               $where2 = "AND c.relnamespace NOT IN (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname LIKE 'pg@_%' ESCAPE '@')";
 
                // Create type filter
                $tqry = "'c'";
index 76d4f2f9a0841d3d51a2698e2a1392e4ee08b412..a900132dba29bee3292faf0e86d989a214afabdd 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres74.php,v 1.54 2006/08/13 15:31:13 xzilla Exp $
+ * $Id: Postgres74.php,v 1.55 2006/09/24 23:42:41 xzilla Exp $
  */
 
 include_once('./classes/database/Postgres73.php');
@@ -174,7 +174,7 @@ class Postgres74 extends Postgres73 {
                global $conf, $slony;
 
                if (!$conf['show_system']) {
-                       $where = "WHERE nspname NOT LIKE 'pg\\\\_%' AND nspname != 'information_schema'";
+                       $where = "WHERE nspname NOT LIKE 'pg@_%' ESCAPE '@' AND nspname != 'information_schema'";
                        if (isset($slony) && $slony->isEnabled()) {
                                $temp = $slony->slony_schema;
                                $this->clean($temp);
index 91a4aaf835583eea60a1a80e88047111cb7025cd..88396431f008346976dfaabf90ffc7d3af15d22e 100755 (executable)
@@ -3,7 +3,7 @@
 /**
  * A class that implements the Slony 1.0.x support plugin
  *
- * $Id: Slony.php,v 1.10 2006/09/14 20:54:27 xzilla Exp $
+ * $Id: Slony.php,v 1.11 2006/09/24 23:42:41 xzilla Exp $
  */
 
 include_once('./classes/plugins/Plugin.php');
@@ -51,7 +51,7 @@ class Slony extends Plugin {
                                        WHERE pp.pronamespace=pn.oid
                                        AND pn.nspowner = pu.usesysid
                                        AND pp.proname='slonyversion'
-                                       AND pn.nspname LIKE '\\\\_%' 
+                                       AND pn.nspname LIKE '@_%' ESCAPE '@'  
                                        ORDER BY pn.nspname LIMIT 1";
                $rs = $data->selectSet($sql);
                if ($rs->recordCount() == 1) {