Fixed Bug #1388106: using the IN operator when selecting data
authormr-russ <mr-russ>
Thu, 5 Apr 2007 11:32:16 +0000 (11:32 +0000)
committermr-russ <mr-russ>
Thu, 5 Apr 2007 11:32:16 +0000 (11:32 +0000)
Fix IN/NOT IN to accept text input lists 'a','b'.
Escaping of the input value is not done when you use IN, it's expected that you complete that.

HISTORY
classes/database/Postgres.php

diff --git a/HISTORY b/HISTORY
index a3143207557e4f24dda45d84d86fa3589c475115..73dba1ec06bacdc625a01859080da24622504c56 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -6,6 +6,7 @@ Version 4.1.2
 
 Bugs
 * Fix PHP5 Strict mode complaints 
+* Fix IN/NOT IN to accept text input lists 'a','b'.
 
 Version 4.1.1
 -------------
index 9d8c2449eecd8340b84a407cf36d741deb2c6820..b7260cf548e0b06a9f85dd0556116fd94c7e9ae2 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.292.2.2 2007/03/03 14:29:53 xzilla Exp $
+ * $Id: Postgres.php,v 1.292.2.3 2007/04/05 11:32:16 mr-russ Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -3999,7 +3999,6 @@ class Postgres extends ADODB_base {
                        foreach ($values as $k => $v) {
                                if ($v != '' || $this->selectOps[$ops[$k]] == 'p') {
                                        $this->fieldClean($k);
-                                       $this->clean($v);
                                        if ($first) {
                                                $sql .= " WHERE ";
                                                $first = false;
@@ -4009,6 +4008,10 @@ class Postgres extends ADODB_base {
                                        // Different query format depending on operator type
                                        switch ($this->selectOps[$ops[$k]]) {
                                                case 'i':
+                                                       // Only clean the field for the inline case
+                                                       // this is because (x), subqueries need to
+                                                       // to allow 'a','b' as input.
+                                                       $this->clean($v);
                                                        $sql .= "\"{$k}\" {$ops[$k]} '{$v}'";
                                                        break;
                                                case 'p':