georg           Sat Oct  8 11:08:08 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/mysqli/tests   bug34785.phpt 

  Modified files:              
    /php-src/ext/mysqli mysqli.c mysqli_fe.c 
    /php-src/ext/mysqli/tests   003.phpt 006.phpt 007.phpt 008.phpt 
                                009.phpt 010.phpt 020.phpt 023.phpt 
                                024.phpt 025.phpt 026.phpt 042.phpt 
                                060.phpt 065.phpt bug32405.phpt 
  Log:
  fix for bug 34785:
    added support for parent::__construct (mysqli_statement and 
mysqli_resultset)
    fixed failed testcases when sql_mode is in effect
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.72.2.1&r2=1.72.2.2&ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.1 
php-src/ext/mysqli/mysqli.c:1.72.2.2
--- php-src/ext/mysqli/mysqli.c:1.72.2.1        Tue Sep 13 05:20:18 2005
+++ php-src/ext/mysqli/mysqli.c Sat Oct  8 11:08:03 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.72.2.1 2005/09/13 09:20:18 tony2001 Exp $ 
+  $Id: mysqli.c,v 1.72.2.2 2005/10/08 15:08:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -143,25 +143,23 @@
        if (instanceof_function(intern->zo.ce, mysqli_link_class_entry 
TSRMLS_CC)) {
                if (my_res && my_res->ptr) {
                        MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
-               
                        if (mysql->mysql) {
                                mysql_close(mysql->mysql);
                        }
-
                        php_clear_mysql(mysql);
                        efree(mysql);
-
                        my_res->ptr = NULL;
                }
-       } else if (intern->zo.ce == mysqli_stmt_class_entry) { /* stmt object */
+       } else if (instanceof_function(intern->zo.ce, mysqli_stmt_class_entry 
TSRMLS_CC)) { /* stmt object */
                if (my_res && my_res->ptr) {
-                       php_clear_stmt_bind((MY_STMT *)my_res->ptr);
+                       MY_STMT *stmt = (MY_STMT *)my_res->ptr;
+                       php_clear_stmt_bind(stmt);
                }
-       } else if (intern->zo.ce == mysqli_result_class_entry) { /* result 
object */
+       } else if (instanceof_function(intern->zo.ce, mysqli_result_class_entry 
TSRMLS_CC)) { /* stmt object */
                if (my_res && my_res->ptr) {
                        mysql_free_result(my_res->ptr);
                }
-       } else if (intern->zo.ce == mysqli_warning_class_entry) { /* warning 
object */
+       } else if (instanceof_function(intern->zo.ce, 
mysqli_warning_class_entry TSRMLS_CC)) { /* stmt object */
                if (my_res && my_res->ptr) {
                        php_clear_warnings((MYSQLI_WARNING *)my_res->info);
                }
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.49&r2=1.49.2.1&ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.49 
php-src/ext/mysqli/mysqli_fe.c:1.49.2.1
--- php-src/ext/mysqli/mysqli_fe.c:1.49 Wed Aug  3 10:07:30 2005
+++ php-src/ext/mysqli/mysqli_fe.c      Sat Oct  8 11:08:03 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_fe.c,v 1.49 2005/08/03 14:07:30 sniper Exp $ 
+  $Id: mysqli_fe.c,v 1.49.2.1 2005/10/08 15:08:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -244,6 +244,7 @@
  * Every user visible function must have an entry in mysqli_result_functions[].
  */
 function_entry mysqli_result_methods[] = {
+       PHP_FALIAS(mysqli_result, mysqli_result_construct, NULL)
        PHP_FALIAS(close,mysqli_free_result,NULL)
        PHP_FALIAS(free,mysqli_free_result,NULL)
        PHP_FALIAS(data_seek,mysqli_data_seek,NULL)
@@ -266,6 +267,7 @@
  * Every user visible function must have an entry in mysqli_stmt_functions[].
  */
 function_entry mysqli_stmt_methods[] = {
+       PHP_FALIAS(mysqli_stmt, mysqli_stmt_construct, NULL)
        PHP_FALIAS(attr_get,mysqli_stmt_attr_get,NULL)
        PHP_FALIAS(attr_set,mysqli_stmt_attr_set,NULL)
        
PHP_FALIAS(bind_param,mysqli_stmt_bind_param,second_arg_force_by_ref_rest)
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/003.phpt?r1=1.5&r2=1.5.2.1&ty=u
Index: php-src/ext/mysqli/tests/003.phpt
diff -u php-src/ext/mysqli/tests/003.phpt:1.5 
php-src/ext/mysqli/tests/003.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/003.phpt:1.5       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/003.phpt   Sat Oct  8 11:08:07 2005
@@ -7,9 +7,9 @@
        include "connect.inc";
        
        /*** test mysqli_connect 127.0.0.1 ***/
-       $link = mysqli_connect($host, $user, $passwd);
+       $link = mysqli_connect($host, $user, $passwd, "test");
 
-       mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
                
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
        mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, 
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/006.phpt?r1=1.4&r2=1.4.2.1&ty=u
Index: php-src/ext/mysqli/tests/006.phpt
diff -u php-src/ext/mysqli/tests/006.phpt:1.4 
php-src/ext/mysqli/tests/006.phpt:1.4.2.1
--- php-src/ext/mysqli/tests/006.phpt:1.4       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/006.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/007.phpt?r1=1.4&r2=1.4.2.1&ty=u
Index: php-src/ext/mysqli/tests/007.phpt
diff -u php-src/ext/mysqli/tests/007.phpt:1.4 
php-src/ext/mysqli/tests/007.phpt:1.4.2.1
--- php-src/ext/mysqli/tests/007.phpt:1.4       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/007.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/008.phpt?r1=1.4&r2=1.4.2.1&ty=u
Index: php-src/ext/mysqli/tests/008.phpt
diff -u php-src/ext/mysqli/tests/008.phpt:1.4 
php-src/ext/mysqli/tests/008.phpt:1.4.2.1
--- php-src/ext/mysqli/tests/008.phpt:1.4       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/008.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/009.phpt?r1=1.6&r2=1.6.2.1&ty=u
Index: php-src/ext/mysqli/tests/009.phpt
diff -u php-src/ext/mysqli/tests/009.phpt:1.6 
php-src/ext/mysqli/tests/009.phpt:1.6.2.1
--- php-src/ext/mysqli/tests/009.phpt:1.6       Tue Jul 19 20:18:24 2005
+++ php-src/ext/mysqli/tests/009.phpt   Sat Oct  8 11:08:07 2005
@@ -16,6 +16,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5,
@@ -53,7 +54,7 @@
   [4]=>
   int(0)
   [5]=>
-  string(13) "-333333333333"
+  int(0)
   [6]=>
   int(100)
 }
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/010.phpt?r1=1.5&r2=1.5.2.1&ty=u
Index: php-src/ext/mysqli/tests/010.phpt
diff -u php-src/ext/mysqli/tests/010.phpt:1.5 
php-src/ext/mysqli/tests/010.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/010.phpt:1.5       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/010.phpt   Sat Oct  8 11:08:07 2005
@@ -12,6 +12,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/020.phpt?r1=1.6&r2=1.6.2.1&ty=u
Index: php-src/ext/mysqli/tests/020.phpt
diff -u php-src/ext/mysqli/tests/020.phpt:1.6 
php-src/ext/mysqli/tests/020.phpt:1.6.2.1
--- php-src/ext/mysqli/tests/020.phpt:1.6       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/020.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
                
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
        mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time, 
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/023.phpt?r1=1.5&r2=1.5.2.1&ty=u
Index: php-src/ext/mysqli/tests/023.phpt
diff -u php-src/ext/mysqli/tests/023.phpt:1.5 
php-src/ext/mysqli/tests/023.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/023.phpt:1.5       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/023.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/024.phpt?r1=1.5&r2=1.5.2.1&ty=u
Index: php-src/ext/mysqli/tests/024.phpt
diff -u php-src/ext/mysqli/tests/024.phpt:1.5 
php-src/ext/mysqli/tests/024.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/024.phpt:1.5       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/024.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/025.phpt?r1=1.5&r2=1.5.2.1&ty=u
Index: php-src/ext/mysqli/tests/025.phpt
diff -u php-src/ext/mysqli/tests/025.phpt:1.5 
php-src/ext/mysqli/tests/025.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/025.phpt:1.5       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/025.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/026.phpt?r1=1.6&r2=1.6.2.1&ty=u
Index: php-src/ext/mysqli/tests/026.phpt
diff -u php-src/ext/mysqli/tests/026.phpt:1.6 
php-src/ext/mysqli/tests/026.phpt:1.6.2.1
--- php-src/ext/mysqli/tests/026.phpt:1.6       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/026.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 
text)");
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/042.phpt?r1=1.7&r2=1.7.2.1&ty=u
Index: php-src/ext/mysqli/tests/042.phpt
diff -u php-src/ext/mysqli/tests/042.phpt:1.7 
php-src/ext/mysqli/tests/042.phpt:1.7.2.1
--- php-src/ext/mysqli/tests/042.phpt:1.7       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/042.phpt   Sat Oct  8 11:08:07 2005
@@ -10,6 +10,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/060.phpt?r1=1.3&r2=1.3.2.1&ty=u
Index: php-src/ext/mysqli/tests/060.phpt
diff -u php-src/ext/mysqli/tests/060.phpt:1.3 
php-src/ext/mysqli/tests/060.phpt:1.3.2.1
--- php-src/ext/mysqli/tests/060.phpt:1.3       Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/060.phpt   Sat Oct  8 11:08:07 2005
@@ -16,6 +16,7 @@
        $link = mysqli_connect($host, $user, $passwd);
 
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_fetch");
        mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned,
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/065.phpt?r1=1.3&r2=1.3.2.1&ty=u
Index: php-src/ext/mysqli/tests/065.phpt
diff -u php-src/ext/mysqli/tests/065.phpt:1.3 
php-src/ext/mysqli/tests/065.phpt:1.3.2.1
--- php-src/ext/mysqli/tests/065.phpt:1.3       Mon Jun 27 06:34:42 2005
+++ php-src/ext/mysqli/tests/065.phpt   Sat Oct  8 11:08:07 2005
@@ -12,6 +12,7 @@
        include "connect.inc";
 
        $mysql = new mysqli($host, $user, $passwd);
+       mysqli_query($mysql, "SET sql_mode=''");
 
        $esc_str = chr(0xbf) . chr(0x5c);
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/bug32405.phpt?r1=1.1&r2=1.1.4.1&ty=u
Index: php-src/ext/mysqli/tests/bug32405.phpt
diff -u php-src/ext/mysqli/tests/bug32405.phpt:1.1 
php-src/ext/mysqli/tests/bug32405.phpt:1.1.4.1
--- php-src/ext/mysqli/tests/bug32405.phpt:1.1  Tue Apr 19 09:29:37 2005
+++ php-src/ext/mysqli/tests/bug32405.phpt      Sat Oct  8 11:08:07 2005
@@ -9,6 +9,7 @@
        /*** test mysqli_connect 127.0.0.1 ***/
        $link = mysqli_connect($host, $user, $passwd);
        mysqli_select_db($link, "test");
+       mysqli_query($link, "SET sql_mode=''");
        
        /* two fields are needed. the problem does not occur with 1 field only 
selected. */
        $link->query("CREATE TABLE test_users(user_id int(10) unsigned NOT NULL 
auto_increment, login varchar(50) default '', PRIMARY KEY (user_id))");

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug34785.phpt?r=1.1&p=1
Index: php-src/ext/mysqli/tests/bug34785.phpt
+++ php-src/ext/mysqli/tests/bug34785.phpt

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

Reply via email to