[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] cvs: pear /MDB2 package_sqlite.php  /MDB2/MDB2/Driver/Manager sqlite.php
From:       "Lorenzo Alberton" <quipo () php ! net>
Date:       2008-05-31 10:39:58
Message-ID: cvsquipo1212230398 () cvsserver
[Download RAW message or body]

quipo		Sat May 31 10:39:58 2008 UTC

  Modified files:              
    /pear/MDB2/MDB2/Driver/Manager	sqlite.php 
    /pear/MDB2	package_sqlite.php 
  Log:
  fixed bug #13928: Invalid triggers created for 'ON UPDATE'
  
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Manager/sqlite.php?r1=1.74&r2=1.75&diff_format=u
                
Index: pear/MDB2/MDB2/Driver/Manager/sqlite.php
diff -u pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.74 \
                pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.75
--- pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.74	Wed Mar  5 11:08:53 2008
+++ pear/MDB2/MDB2/Driver/Manager/sqlite.php	Sat May 31 10:39:58 2008
@@ -43,7 +43,7 @@
 // |          Lorenzo Alberton <l.alberton@quipo.it>                      |
 // +----------------------------------------------------------------------+
 //
-// $Id: sqlite.php,v 1.74 2008/03/05 11:08:53 quipo Exp $
+// $Id: sqlite.php,v 1.75 2008/05/31 10:39:58 quipo Exp $
 //
 
 require_once 'MDB2/Driver/Manager/Common.php';
@@ -220,9 +220,11 @@
     /**
      * create a new table
      *
-     * @param string $name   Name of the database that should be created
-     * @param array $fields  Associative array that contains the definition of each \
                field of the new table
-     * @param array $options  An associative array of table options
+     * @param string $name    Name of the database that should be created
+     * @param array  $fields  Associative array that contains the definition
+     *                        of each field of the new table
+     * @param array  $options An associative array of table options
+     *
      * @return mixed MDB2_OK on success, a MDB2 error on failure
      * @access public
      */
@@ -300,7 +302,12 @@
                     $new_values[]  = $table_fields[$i] .' = \
NEW.'.$referenced_fields[$i];  $null_values[] = $table_fields[$i] .' = NULL';
                 }
-                $restrict_action .= implode(' AND ', $conditions).') IS NOT NULL';
+                $conditions2 = array();
+                for ($i=0; $i<count($referenced_fields); $i++) {
+                    $conditions2[]  = 'NEW.'.$referenced_fields[$i] .' <> \
OLD.'.$referenced_fields[$i]; +                }
+                $restrict_action .= implode(' AND ', $conditions).') IS NOT NULL'
+                                 .' AND (' .implode(' OR ', $conditions2) .')';
 
                 $cascade_action_update = 'UPDATE '.$name.' SET '.implode(', ', \
                $new_values) .' WHERE '.implode(' AND ', $conditions);
                 $cascade_action_delete = 'DELETE FROM '.$name.' WHERE '.implode(' \
AND ', $conditions); @@ -1159,6 +1166,7 @@
      * @param string $table  table name
      * @param string $fkname FOREIGN KEY constraint name
      * @param string $referenced_table  referenced table name
+     *
      * @return mixed MDB2_OK on success, a MDB2 error on failure
      * @access private
      */
@@ -1186,7 +1194,7 @@
         return MDB2_OK;
     }
 
-    // }]]
+    // }}}
     // {{{ listTableConstraints()
 
     /**
http://cvs.php.net/viewvc.cgi/pear/MDB2/package_sqlite.php?r1=1.121&r2=1.122&diff_format=u
                
Index: pear/MDB2/package_sqlite.php
diff -u pear/MDB2/package_sqlite.php:1.121 pear/MDB2/package_sqlite.php:1.122
--- pear/MDB2/package_sqlite.php:1.121	Sat May  3 10:30:14 2008
+++ pear/MDB2/package_sqlite.php	Sat May 31 10:39:58 2008
@@ -7,6 +7,7 @@
 $state = 'beta';
 $notes = <<<EOT
 - fixed bug #13815: incomplete regexp in the Reverse module
+- fixed bug #13928: Invalid triggers created for 'ON UPDATE'
 
 note:
 open todo items:



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic