[geeklog-cvs] geeklog: minor bug(s) in dbsave

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jan 26 15:53:58 EST 2010


changeset 7652:fa8bbf005939
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/fa8bbf005939
user: stan <yankees26an at gmail.com>
date: Sat Aug 29 12:45:24 2009 -0400
description:
minor bug(s) in dbsave

diffstat:

 system/databases/pgsql.class.php |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 6de3bcbeb530 -r fa8bbf005939 system/databases/pgsql.class.php
--- a/system/databases/pgsql.class.php	Sat Aug 29 12:44:59 2009 -0400
+++ b/system/databases/pgsql.class.php	Sat Aug 29 12:45:24 2009 -0400
@@ -393,7 +393,7 @@
         $row = pg_fetch_row($result);
         if($row[0]==0) //nothing in the table yet
         {
-            $sql="INSERT INTO $table($fields) VALUES($values)";  
+            $this->dbQuery("INSERT INTO $table ($fields) VALUES ($values)"); 
         }
         else
         {
@@ -406,7 +406,7 @@
                     indrelid = pg_class.oid AND
                     pg_attribute.attrelid = pg_class.oid AND 
                     pg_attribute.attnum = any(pg_index.indkey)
-                    GROUP BY pg_attribute.attname, pg_attribute.attnum;';
+                    GROUP BY pg_attribute.attname,pg_class.reltype;';
       
             $result = $this->dbQuery($sql);
             while($fetched = pg_fetch_row($result))
@@ -421,6 +421,7 @@
                 {
                  $sql = "DELETE FROM $table WHERE {$row[0][0]}='{$values_array[$key]}'";
                  $result = $this->dbQuery($sql);
+                 $this->dbQuery("INSERT INTO $table ($fields) VALUES ($values)");
                 }
                 elseif($counter>1) //we will search for unique fields and see if they are getting duplicates
                 {
@@ -441,7 +442,7 @@
                     $row2 = pg_fetch_row($result);
                     if($row2[0]!=0){$sql = "DELETE FROM $table WHERE $where_clause'";}
                     
-                    $sql="INSERT INTO $table ($fields) VALUES ($values)";  
+                    $this->dbQuery("INSERT INTO $table ($fields) VALUES ($values)");  
                 }
                 else
                 {
@@ -450,11 +451,10 @@
             }
             else //no keys to worry about
             {
-                $sql="INSERT INTO $table ($fields) VALUES ($values)";  
+                $this->dbQuery("INSERT INTO $table ($fields) VALUES ($values)"); 
             }
         }
 
-        $this->dbQuery($sql);
 
         if ($this->isVerbose()) {
             $this->_errorlog("\n*** Leaving database->dbSave ***");



More information about the geeklog-cvs mailing list