[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard url_scanner_ex.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 09:27:13 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   url_scanner_ex.c 
  Log:
  - Generated with a bit more recent re2c version
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.95.2.4.2.3.2.1r2=1.95.2.4.2.3.2.2diff_format=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.3.2.1 
php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.3.2.2
--- php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.3.2.1  Wed Oct 10 
00:34:40 2007
+++ php-src/ext/standard/url_scanner_ex.c   Wed Oct 10 09:27:13 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.0 on Tue Oct  9 20:28:45 2007 */
+/* Generated by re2c 0.12.1 on Wed Oct 10 12:26:17 2007 */
 #line 1 ext/standard/url_scanner_ex.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: url_scanner_ex.c,v 1.95.2.4.2.3.2.1 2007/10/10 00:34:40 iliaa Exp $ */
+/* $Id: url_scanner_ex.c,v 1.95.2.4.2.3.2.2 2007/10/10 09:27:13 jani Exp $ */
 
 #include php.h
 
@@ -109,48 +109,78 @@
q = (p = url-c) + url-len;
 
 scan:
-
-#line 114 ext/standard/url_scanner_ex.c
 {
-   YYCTYPE yych;
-
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':   goto yy6;
-   case ':':   goto yy2;
-   case '?':   goto yy4;
-   default:goto yy8;
-   }
-yy2:
-   ++YYCURSOR;
+   static const unsigned char yybm[] = {
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128,   0, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128,   0, 128, 128, 128, 128,   0, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   };
+
+#line 149 ext/standard/url_scanner_ex.c
+   {
+   YYCTYPE yych;
+
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+   goto yy8;
+   }
+   if(yych = '9') goto yy6;
+   if(yych = ';') goto yy4;
+   ++YYCURSOR;
 #line 116 ext/standard/url_scanner_ex.re
-   { smart_str_append(dest, url); return; }
-#line 130 ext/standard/url_scanner_ex.c
+   { smart_str_append(dest, url); return; }
+#line 163 ext/standard/url_scanner_ex.c
 yy4:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 117 ext/standard/url_scanner_ex.re
-   { sep = separator; goto scan; }
-#line 135 ext/standard/url_scanner_ex.c
+   { sep = separator; goto scan; }
+#line 168 ext/standard/url_scanner_ex.c
 yy6:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 118 ext/standard/url_scanner_ex.re
-   { bash = p - 1; goto done; }
-#line 140 ext/standard/url_scanner_ex.c
+   { bash = p - 1; goto done; }
+#line 173 ext/standard/url_scanner_ex.c
 yy8:
-   ++YYCURSOR;
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':
-   case ':':
-   case '?':   goto yy10;
-   default:goto yy8;
-   }
-yy10:
+   ++YYCURSOR;
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+  

[PHP-CVS] cvs: php-src /ext/standard url_scanner_ex.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 09:28:25 2007 UTC

  Modified files:  
/php-src/ext/standard   url_scanner_ex.c 
  Log:
  - Generated with more recent re2c version
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.107r2=1.108diff_format=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.107 
php-src/ext/standard/url_scanner_ex.c:1.108
--- php-src/ext/standard/url_scanner_ex.c:1.107 Wed Oct 10 00:36:25 2007
+++ php-src/ext/standard/url_scanner_ex.c   Wed Oct 10 09:28:25 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.0 on Tue Oct  9 20:36:17 2007 */
+/* Generated by re2c 0.12.1 on Wed Oct 10 12:27:56 2007 */
 #line 1 ext/standard/url_scanner_ex.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: url_scanner_ex.c,v 1.107 2007/10/10 00:36:25 iliaa Exp $ */
+/* $Id: url_scanner_ex.c,v 1.108 2007/10/10 09:28:25 jani Exp $ */
 
 #include php.h
 
@@ -109,48 +109,78 @@
q = (p = url-c) + url-len;
 
 scan:
-
-#line 114 ext/standard/url_scanner_ex.c
 {
-   YYCTYPE yych;
-
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':   goto yy6;
-   case ':':   goto yy2;
-   case '?':   goto yy4;
-   default:goto yy8;
-   }
-yy2:
-   ++YYCURSOR;
+   static const unsigned char yybm[] = {
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128,   0, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128,   0, 128, 128, 128, 128,   0, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   };
+
+#line 149 ext/standard/url_scanner_ex.c
+   {
+   YYCTYPE yych;
+
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+   goto yy8;
+   }
+   if(yych = '9') goto yy6;
+   if(yych = ';') goto yy4;
+   ++YYCURSOR;
 #line 116 ext/standard/url_scanner_ex.re
-   { smart_str_append(dest, url); return; }
-#line 130 ext/standard/url_scanner_ex.c
+   { smart_str_append(dest, url); return; }
+#line 163 ext/standard/url_scanner_ex.c
 yy4:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 117 ext/standard/url_scanner_ex.re
-   { sep = separator; goto scan; }
-#line 135 ext/standard/url_scanner_ex.c
+   { sep = separator; goto scan; }
+#line 168 ext/standard/url_scanner_ex.c
 yy6:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 118 ext/standard/url_scanner_ex.re
-   { bash = p - 1; goto done; }
-#line 140 ext/standard/url_scanner_ex.c
+   { bash = p - 1; goto done; }
+#line 173 ext/standard/url_scanner_ex.c
 yy8:
-   ++YYCURSOR;
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':
-   case ':':
-   case '?':   goto yy10;
-   default:goto yy8;
-   }
-yy10:
+   ++YYCURSOR;
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+   goto yy8;
+   }
 #line 119 ext/standard/url_scanner_ex.re
-   { goto scan; }

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard url_scanner_ex.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 09:28:51 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   url_scanner_ex.c 
  Log:
  - Generated with more recent re2c version
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url_scanner_ex.c?r1=1.95.2.4.2.4r2=1.95.2.4.2.5diff_format=u
Index: php-src/ext/standard/url_scanner_ex.c
diff -u php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.4 
php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.5
--- php-src/ext/standard/url_scanner_ex.c:1.95.2.4.2.4  Wed Oct 10 00:35:52 2007
+++ php-src/ext/standard/url_scanner_ex.c   Wed Oct 10 09:28:51 2007
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.11.0 on Tue Oct  9 20:35:35 2007 */
+/* Generated by re2c 0.12.1 on Wed Oct 10 12:28:46 2007 */
 #line 1 ext/standard/url_scanner_ex.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: url_scanner_ex.c,v 1.95.2.4.2.4 2007/10/10 00:35:52 iliaa Exp $ */
+/* $Id: url_scanner_ex.c,v 1.95.2.4.2.5 2007/10/10 09:28:51 jani Exp $ */
 
 #include php.h
 
@@ -109,48 +109,78 @@
q = (p = url-c) + url-len;
 
 scan:
-
-#line 114 ext/standard/url_scanner_ex.c
 {
-   YYCTYPE yych;
-
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':   goto yy6;
-   case ':':   goto yy2;
-   case '?':   goto yy4;
-   default:goto yy8;
-   }
-yy2:
-   ++YYCURSOR;
+   static const unsigned char yybm[] = {
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128,   0, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128,   0, 128, 128, 128, 128,   0, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   128, 128, 128, 128, 128, 128, 128, 128, 
+   };
+
+#line 149 ext/standard/url_scanner_ex.c
+   {
+   YYCTYPE yych;
+
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+   goto yy8;
+   }
+   if(yych = '9') goto yy6;
+   if(yych = ';') goto yy4;
+   ++YYCURSOR;
 #line 116 ext/standard/url_scanner_ex.re
-   { smart_str_append(dest, url); return; }
-#line 130 ext/standard/url_scanner_ex.c
+   { smart_str_append(dest, url); return; }
+#line 163 ext/standard/url_scanner_ex.c
 yy4:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 117 ext/standard/url_scanner_ex.re
-   { sep = separator; goto scan; }
-#line 135 ext/standard/url_scanner_ex.c
+   { sep = separator; goto scan; }
+#line 168 ext/standard/url_scanner_ex.c
 yy6:
-   ++YYCURSOR;
+   ++YYCURSOR;
 #line 118 ext/standard/url_scanner_ex.re
-   { bash = p - 1; goto done; }
-#line 140 ext/standard/url_scanner_ex.c
+   { bash = p - 1; goto done; }
+#line 173 ext/standard/url_scanner_ex.c
 yy8:
-   ++YYCURSOR;
-   if(YYLIMIT == YYCURSOR) YYFILL(1);
-   yych = *YYCURSOR;
-   switch(yych) {
-   case '#':
-   case ':':
-   case '?':   goto yy10;
-   default:goto yy8;
-   }
-yy10:
+   ++YYCURSOR;
+   if(YYLIMIT == YYCURSOR) YYFILL(1);
+   yych = *YYCURSOR;
+   if(yybm[0+yych]  128) {
+   goto yy8;
+   

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql/tests 001.phpt 002.phpt 003.phpt connect.inc skipif.inc

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 09:47:21 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysql/tests001.phpt 002.phpt 003.phpt connect.inc 
skipif.inc 
  Log:
  Starting to merge the latest set of tests from the mysqlnd development
  tree into the PHP 5_3 tree.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/001.phpt?r1=1.3.2.1r2=1.3.2.1.4.1diff_format=u
Index: php-src/ext/mysql/tests/001.phpt
diff -u php-src/ext/mysql/tests/001.phpt:1.3.2.1 
php-src/ext/mysql/tests/001.phpt:1.3.2.1.4.1
--- php-src/ext/mysql/tests/001.phpt:1.3.2.1Mon Feb  6 14:25:07 2006
+++ php-src/ext/mysql/tests/001.phptWed Oct 10 09:47:21 2007
@@ -4,22 +4,30 @@
 ?php include 'skipif.inc'; ?
 --FILE--
 ?php
-
-include 'connect.inc';
+require_once('connect.inc');
 $test = '';
 
+if ($socket)
+   $host = sprintf(%s:%s, $host, $socket);
+else if ($port)
+   $host = sprintf(%s:%s, $host, $port);
+
 /*** test mysql_connect localhost ***/
 $db = mysql_connect($host, $user, $passwd);
 $test .= ($db) ? '1' : '0';
 mysql_close($db);
 
 /*** test mysql_connect localhost:port ***/
-$db = mysql_connect({$host}:3306, $user, $passwd, '');
+$db = mysql_connect($host, $user, $passwd, true);
 $test .= ($db) ? '1' : '0';
 mysql_close($db);
 
 var_dump($test);
-
+print done!;
 ?
 --EXPECT--
 string(2) 11
+done!
+--UEXPECTF--
+unicode(2) 11
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/002.phpt?r1=1.1r2=1.1.8.1diff_format=u
Index: php-src/ext/mysql/tests/002.phpt
diff -u php-src/ext/mysql/tests/002.phpt:1.1 
php-src/ext/mysql/tests/002.phpt:1.1.8.1
--- php-src/ext/mysql/tests/002.phpt:1.1Mon Jan 12 02:31:08 2004
+++ php-src/ext/mysql/tests/002.phptWed Oct 10 09:47:21 2007
@@ -4,14 +4,13 @@
 ?php include 'skipif.inc'; ?
 --FILE--
 ?php
+require_once('connect.inc');
 
-include 'connect.inc';
+if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
+   printf([001] Cannot connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
+   $host, $user, $db, $port, $socket);
 
-$db = mysql_connect($host, $user, $passwd);
-
-var_dump($db);
-
-var_dump(mysql_select_db('test'));
+var_dump($link);
 
 var_dump(mysql_query('DROP TABLE IF EXISTS test'));
 
@@ -25,15 +24,16 @@
var_dump($data);
 }
 
-mysql_close($db);
+mysql_free_result($res);
+mysql_close($link);
 
+print done!;
 ?
 --EXPECTF--
 resource(%d) of type (mysql link)
 bool(true)
 bool(true)
 bool(true)
-bool(true)
 resource(%d) of type (mysql result)
 array(3) {
   [col1]=
@@ -51,3 +51,27 @@
   [col3]=
   string(3) bar
 }
+done!
+--UEXPECTF--
+resource(%d) of type (mysql link)
+bool(true)
+bool(true)
+bool(true)
+resource(%d) of type (mysql result)
+array(3) {
+  [ucol1]=
+  unicode(1) 1
+  [ucol2]=
+  unicode(3) foo
+  [ucol3]=
+  unicode(3) bar
+}
+array(3) {
+  [ucol1]=
+  unicode(1) 2
+  [ucol2]=
+  unicode(3) foo
+  [ucol3]=
+  unicode(3) bar
+}
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/003.phpt?r1=1.1r2=1.1.8.1diff_format=u
Index: php-src/ext/mysql/tests/003.phpt
diff -u php-src/ext/mysql/tests/003.phpt:1.1 
php-src/ext/mysql/tests/003.phpt:1.1.8.1
--- php-src/ext/mysql/tests/003.phpt:1.1Mon Jan 12 02:34:55 2004
+++ php-src/ext/mysql/tests/003.phptWed Oct 10 09:47:21 2007
@@ -4,8 +4,7 @@
 ?php include 'skipif.inc'; ?
 --FILE--
 ?php
-
-include 'connect.inc';
+include_once('connect.inc');
 
 class class24 {
function __construct() {
@@ -13,45 +12,44 @@
}
 }
 
-$data = array(
-   one,
-   two,
-   three
-   );
-
-$db = mysql_connect($host, $user, $passwd);
+$data = array(one, two, three);
 
-mysql_select_db(test);
+if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
+   printf([001] Cannot connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
+   $host, $user, $db, $port, $socket);
 
-mysql_query('DROP TABLE IF EXISTS test');
+if (!mysql_query('DROP TABLE IF EXISTS test', $link))
+   printf([002] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
-mysql_query(CREATE TABLE test(a varchar(10)));
+if (!mysql_query(CREATE TABLE test(a varchar(10)), $link))
+   printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
 foreach ($data as $str) {
-   mysql_query(INSERT INTO test VALUES('$str'));
-   var_dump($str);
+   if (!mysql_query(sprintf(INSERT INTO test VALUES('%s'), $str), $link))
+   printf([004 - %s] [%d] %s\n, $str, mysql_errno($link), 
mysql_error($link));
 }
 
 echo ==stdClass==\n;
-$res = mysql_query(SELECT a FROM test);
+if (!$res = mysql_query(SELECT a FROM test, $link))
+   printf([005] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
 while ($obj = mysql_fetch_object($res)) {
var_dump($obj);
 }
+mysql_free_result($res);
 
 echo ==class24==\n;
-$res = 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql/tests skipifconnectfailure.inc table.inc

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 09:49:38 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysql/teststable.inc skipifconnectfailure.inc 
  Log:
  New tests use more helper files.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/table.inc?view=markuprev=1.1
Index: php-src/ext/mysql/tests/table.inc
+++ php-src/ext/mysql/tests/table.inc
?PHP 
require_once('connect.inc');

// connect + select_db
if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) {
printf(Cannot connect to the server using host=%s/%s, user=%s, passwd=***, 
dbname=%s, port=%s, socket=%s\n,
$host, $myhost, $user, $db, $port, $socket);
exit(1);
}   

if (!mysql_query('DROP TABLE IF EXISTS test', $link)) {
printf(Failed to drop old test table: [%d] %s\n, mysql_errno($link), 
mysql_error($link));
exit(1);
}

if (!mysql_query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) 
ENGINE=' . $engine, $link)) {
printf(Failed to create test table: [%d] %s\n, mysql_errno($link), 
mysql_error($link));
exit(1);
}

if (!mysql_query('INSERT INTO test(id, label) VALUES (1, a), (2, b), (3, 
c), (4, d), (5, e), (6, f)', $link)) {
printf([%d] %s\n,  mysql_errno($link), mysql_error($link));
}
?
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/skipifconnectfailure.inc?view=markuprev=1.1
Index: php-src/ext/mysql/tests/skipifconnectfailure.inc
+++ php-src/ext/mysql/tests/skipifconnectfailure.inc
?php
$skip_on_connect_failure  = getenv(MYSQL_TEST_SKIP_CONNECT_FAILURE) ? 
getenv(MYSQL_TEST_SKIP_CONNECT_FAILURE) : false;
if ($skip_on_connect_failure) {
if ($socket)
$myhost = sprintf(%s:%s, $host, $socket);
else if ($port)
$myhost = sprintf(%s:%s, $host, $port);

if (!$link = @mysql_connect($myhost, $user, $passwd, true))
die(sprintf(skip Can't connect to MySQL Server - [%d] %s, 
mysql_errno(), mysql_error()));

if ([EMAIL PROTECTED]($db, $link))
die(sprintf(skip Can't connect to MySQL Server - [%d] %s, 
mysql_errno(), mysql_error()));

mysql_close($link);
}
?

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql/tests mysql_max_links.phpt mysql_max_persistent.phpt mysql_num_fields.phpt mysql_num_rows.phpt mysql_pconn_disable.phpt mysql_pconn_kill.phpt mysql_pconn_max

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 09:55:28 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysql/testsmysql_max_links.phpt 
mysql_max_persistent.phpt 
mysql_num_fields.phpt mysql_num_rows.phpt 
mysql_pconn_disable.phpt 
mysql_pconn_kill.phpt 
mysql_pconn_max_links.phpt 
mysql_pconn_reuse.phpt mysql_pconnect.phpt 
mysql_phpinfo.phpt mysql_ping.phpt 
  Log:
  Second last set of new tests for ext/mysql
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_max_links.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_max_links.phpt
+++ php-src/ext/mysql/tests/mysql_max_links.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_max_persistent.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_max_persistent.phpt
+++ php-src/ext/mysql/tests/mysql_max_persistent.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_num_fields.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_num_fields.phpt
+++ php-src/ext/mysql/tests/mysql_num_fields.phpt
--TEST--
mysql_num_fields()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;   
$link   = NULL;

if (!is_null($tmp = @mysql_num_fields()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);

if (false !== ($tmp = @mysql_num_fields($link)))
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');

function func_test_mysql_num_fields($link, $query, $expected, $offset, 
$test_free = false) {

if (!($res = mysql_query($query, $link))) {
printf([%03d] [%d] %s\n, $offset, mysql_errno($link), 
mysql_error($link));
return;
}

if ($expected !== ($tmp = mysql_num_fields($res)))
printf([%03d] Expecting %s/%d, got %s/%d\n, $offset + 1, 
gettype($expected), $expected,
gettype($tmp), $tmp);

mysql_free_result($res);

if ($test_free  (false !== ($tmp = mysql_num_fields($res
printf([%03d] Expecting boolean/false, got %s/%s\n, $offset + 2, 
gettype($tmp), $tmp);
}

func_test_mysql_num_fields($link, SELECT 1 AS a, 1, 5);
func_test_mysql_num_fields($link, SELECT id, label FROM test, 2, 10);
func_test_mysql_num_fields($link, SELECT 1 AS a, NULL AS b, 'foo' AS c, 
3, 15);
func_test_mysql_num_fields($link, SELECT id FROM test, 1, 20, true);

mysql_close($link); 

print done!;
?
--EXPECTF--
Warning: mysql_num_fields(): %d is not a valid MySQL result resource in %s on 
line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_num_rows.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_num_rows.phpt
+++ php-src/ext/mysql/tests/mysql_num_rows.phpt
--TEST--
mysql_num_rows()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;   
$link   = NULL;

if (!is_null($tmp = @mysql_num_rows()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);

if (false !== ($tmp = @mysql_num_rows($link)))
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');

function func_test_mysql_num_rows($link, $query, $expected, $offset, 
$test_free = false) {

if (!$res = mysql_query($query, $link)) {
printf([%03d] [%d] %s\n, $offset, mysql_errno($link), 
mysql_error($link));
return;
}

if ($expected !== ($tmp = mysql_num_rows($res)))
printf([%03d] Expecting %s/%d, got %s/%d\n, $offset + 1, 
gettype($expected), $expected,
gettype($tmp), $tmp);

mysql_free_result($res);

if ($test_free  (false !== ($tmp = mysql_num_rows($res
printf([%03d] Expecting boolean/false, got %s/%s\n, $offset + 2, 
gettype($tmp), $tmp);

}   

func_test_mysql_num_rows($link, SELECT 1 AS a, 1, 5);
func_test_mysql_num_rows($link, SHOW VARIABLES LIKE '%nixnutz%', 0, 10);
func_test_mysql_num_rows($link, INSERT INTO test(id, label) VALUES (100, 
'z'), false, 15);
func_test_mysql_num_rows($link, SELECT id FROM test LIMIT 2, 2, 20, true);

if ($res = mysql_query('SELECT COUNT(id) AS num FROM test', $link)) {

$row = mysql_fetch_assoc($res);
mysql_free_result($res);

func_test_mysql_num_rows($link, SELECT id, label FROM test, 
(int)$row['num'], 25);

} else {
   printf([030] [%d] %s\n, mysql_errno($link), 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql/tests mysql_list_dbs.phpt mysql_list_fields.phpt mysql_list_processes.phpt mysql_list_tables.phpt mysql_query.phpt mysql_query_load_data_openbasedir.phpt mys

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 09:56:48 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysql/testsmysql_list_dbs.phpt mysql_list_fields.phpt 
mysql_list_processes.phpt 
mysql_list_tables.phpt mysql_query.phpt 
mysql_query_load_data_openbasedir.phpt 
mysql_real_escape_string.phpt 
mysql_result.phpt mysql_select_db.phpt 
mysql_set_charset.phpt 
mysql_sql_safe_mode.phpt mysql_stat.phpt 
mysql_tablename.phpt mysql_thread_id.phpt 
mysql_trace_mode.phpt 
mysql_unbuffered_query.phpt 
  Log:
  And the last set of new tests for ext/mysql. new does not really mean new.
  We've checked them into HEAD/PHP6 before already.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_list_dbs.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_list_dbs.phpt
+++ php-src/ext/mysql/tests/mysql_list_dbs.phpt
--TEST--
mysql_list_dbs()
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include_once connect.inc;

$tmp= NULL;   
$link   = NULL;
   
if (false !== ($tmp = @mysql_list_dbs(NULL)))
printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

if (NULL !== ($tmp = @mysql_list_dbs($link, $link)))
printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp); 

require('table.inc');

if (!$res = mysql_list_dbs($link))
printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
if (!$num = mysql_num_rows($res))
printf([004] Empty database list? [%d] %s\n, mysql_errno($link), 
mysql_error($link));

$row = mysql_fetch_array($res, MYSQL_NUM);
if (ini_get('unicode.semantics')  !is_unicode($row[0])) {
printf([005] Check for unicode support\n);
var_inspect($row);
}

mysql_free_result($res);
mysql_close($link);

print done!\n; 
?
--EXPECTF--
done!

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_list_fields.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_list_fields.phpt
+++ php-src/ext/mysql/tests/mysql_list_fields.phpt
--TEST--
mysql_list_fields()
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include_once connect.inc;

$tmp= NULL;   
$link   = NULL;
   
if (false !== ($tmp = @mysql_list_fields($link, $link)))
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp); 

require('table.inc');
   
if (!$res = mysql_list_fields($db, 'test', $link))
printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
if (!($num = mysql_num_fields($res)))
printf([004] Empty field list? [%d] %s\n, mysql_errno($link), 
mysql_error($link));


mysql_free_result($res);
mysql_close($link);

print done!\n; 
?
--EXPECTF--
done!

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_list_processes.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_list_processes.phpt
+++ php-src/ext/mysql/tests/mysql_list_processes.phpt
--TEST--
mysql_list_processes()
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;   
$link   = NULL;
   
if (NULL !== ($tmp = @mysql_list_processes($link, $link)))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp); 

require('table.inc');
   
if (!$res = mysql_list_processes($link))
printf([002] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
if (!$num = mysql_num_rows($res))
printf([003] Empty process list? [%d] %s\n, mysql_errno($link), 
mysql_error($link));

$row = mysql_fetch_array($res, MYSQL_NUM);
if (ini_get('unicode.semantics')  !is_unicode($row[0])) {
printf([004] Check for unicode support\n);
var_inspect($row);
}

mysql_free_result($res);
mysql_close($link);

print done!\n; 
?
--EXPECTF--
done!

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_list_tables.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_list_tables.phpt
+++ php-src/ext/mysql/tests/mysql_list_tables.phpt
--TEST--
mysql_list_tables()
--SKIPIF--
?php
require_once('skipif.inc');
?
--FILE--
?php
include_once connect.inc;

$tmp= NULL;
$link   = NULL;

if (NULL !== ($tmp = @mysql_list_tables()))
printf([001] Expecting NULL got %s/%s\n, gettype($tmp), $tmp);

if (NULL !== ($tmp = @mysql_list_tables('too', 'many', 'arguments')))
printf([002] Expecting NULL got %s/%s\n, gettype($tmp), $tmp);

if (false !== ($tmp = @mysql_list_tables(NULL)))
printf([003] 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests connect.inc local_infile_tools.inc reflection_tools.inc skipif.inc skipifconnectfailure.inc skipifemb.inc skipifnotemb.inc skipifunicode.inc table.inc

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:04:46 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   local_infile_tools.inc 
reflection_tools.inc 
skipifconnectfailure.inc 
skipifunicode.inc table.inc 

  Modified files:  
/php-src/ext/mysqli/tests   connect.inc skipifemb.inc skipif.inc 
skipifnotemb.inc 
  Log:
  Starting to merge updated set of tests into 5.3. 
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/connect.inc?r1=1.6.2.1.2.2r2=1.6.2.1.2.2.2.1diff_format=u
Index: php-src/ext/mysqli/tests/connect.inc
diff -u php-src/ext/mysqli/tests/connect.inc:1.6.2.1.2.2 
php-src/ext/mysqli/tests/connect.inc:1.6.2.1.2.2.2.1
--- php-src/ext/mysqli/tests/connect.inc:1.6.2.1.2.2Tue Jul 11 23:43:55 2006
+++ php-src/ext/mysqli/tests/connect.incWed Oct 10 10:04:46 2007
@@ -1,25 +1,54 @@
 ?php
+   /*
+   Default values are localhost, root,
+   database phptest and empty password.
+   Change the MYSQL_TEST environment values
+   if you want to use another configuration
+   */
 
-  /* default values are localhost, root and empty password 
- Change the values if you use another configuration   */
-   $driver = new mysqli_driver;
-
-   if (!$driver-embedded) {
-   $host = localhost;
-   $user = root;
-   $passwd = ;
+   $driver= new mysqli_driver;
+
+   $host  = getenv(MYSQL_TEST_HOST) ? getenv(MYSQL_TEST_HOST) 
: localhost;
+   $port  = getenv(MYSQL_TEST_PORT) ? getenv(MYSQL_TEST_PORT) 
: 3306;
+   $user  = getenv(MYSQL_TEST_USER) ? getenv(MYSQL_TEST_USER) 
: root;
+   $passwd= getenv(MYSQL_TEST_PASSWD)   ? 
getenv(MYSQL_TEST_PASSWD) : ;
+   $db= getenv(MYSQL_TEST_DB)   ? getenv(MYSQL_TEST_DB) : 
phptest;
+   $engine= getenv(MYSQL_TEST_ENGINE)   ? 
getenv(MYSQL_TEST_ENGINE) : MyISAM;
+   $socket= getenv(MYSQL_TEST_SOCKET)   ? 
getenv(MYSQL_TEST_SOCKET) : null;
+
+   /* Development setting: test experimal features and/or feature requests 
that never worked before? */
+   $TEST_EXPERIMENTAL = (in_array(getenv(MYSQL_TEST_EXPERIMENTAL), 
array(0, 1))) ?
+   ((1 == getenv(MYSQL_TEST_EXPERIMENTAL)) ? 
true : false) :
+   false;
+
+   $IS_MYSQLND = stristr(mysqli_get_client_info(), mysqlnd);
+   if (!$IS_MYSQLND) {
+   $MYSQLND_VERSION = NULL;
} else {
-   $path =  dirname(__FILE__);
-   $host = :embedded;
-   $user = $passwd = NULL;
-   $args = array(
-   --datadir=$path, 
-   --innodb_data_home_dir=$path,
-   
--innodb_data_file_path=ibdata1:10M:autoextend,
-   --log-error=$path/testrun.log,
---init-connect='CREATE DATABASE IF 
NOT EXISTS test;'
-   );
-   $driver-embedded_server_start(TRUE, $args, NULL);
+   if (preg_match('@Revision:\s+(\d+)[EMAIL PROTECTED]', 
mysqli_get_client_info(), $matches)) {
+   $MYSQLND_VERSION = (int)$matches[1];
+   } else {
+   $MYSQLND_VERSION = -1;
+   }
}
 
-?
+   if (!function_exists('sys_get_temp_dir')) {
+   function sys_get_temp_dir() {
+
+   if (!empty($_ENV['TMP']))
+   return realpath( $_ENV['TMP'] );
+   if (!empty($_ENV['TMPDIR']))
+   return realpath( $_ENV['TMPDIR'] );
+   if (!empty($_ENV['TEMP']))
+   return realpath( $_ENV['TEMP'] );
+
+   $temp_file = tempnam(md5(uniqid(rand(), TRUE)), '');
+   if ($temp_file) {
+   $temp_dir = realpath(dirname($temp_file));
+   unlink($temp_file);
+   return $temp_dir;
+   }
+   return FALSE;
+   }
+   }
+?
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/skipifemb.inc?r1=1.1r2=1.1.6.1diff_format=u
Index: php-src/ext/mysqli/tests/skipifemb.inc
diff -u php-src/ext/mysqli/tests/skipifemb.inc:1.1 
php-src/ext/mysqli/tests/skipifemb.inc:1.1.6.1
--- php-src/ext/mysqli/tests/skipifemb.inc:1.1  Fri Jan  7 14:59:59 2005
+++ php-src/ext/mysqli/tests/skipifemb.inc  Wed Oct 10 10:04:46 2007
@@ -1,5 +1,5 @@
 ?php
-  $driver = new mysqli_driver();
-  if ($driver-embedded) 
-die(skip test doesn't run with embedded server);
-?
+   $driver = new mysqli_driver();
+   if ($driver-embedded)
+ 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:06:53 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   001.phpt 002.phpt 003.phpt 004.phpt 
005.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 
  Log:
  Changes to existing tests: 0*.phpt
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/001.phpt?r1=1.6r2=1.6.6.1diff_format=u
Index: php-src/ext/mysqli/tests/001.phpt
diff -u php-src/ext/mysqli/tests/001.phpt:1.6 
php-src/ext/mysqli/tests/001.phpt:1.6.6.1
--- php-src/ext/mysqli/tests/001.phpt:1.6   Fri Jan  7 14:59:59 2005
+++ php-src/ext/mysqli/tests/001.phpt   Wed Oct 10 10:06:53 2007
@@ -1,47 +1,63 @@
 --TEST--
 mysqli connect
 --SKIPIF--
-?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
 
-   $dbname = test;
$test = ;
 
/*** test mysqli_connect localhost:port ***/
-   $link = mysqli_connect($host, $user, $passwd, , 3306);
+   $link = mysqli_connect($host, $user, $passwd, , $port, $socket);
$test .= ($link) ? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect ***/
-   $link = mysqli_init();  
-   $test.= (mysqli_real_connect($link, $host, $user, $passwd)) 
+   $link = mysqli_init();
+   $test.= (mysqli_real_connect($link, $host, $user, $passwd, , $port, 
$socket) )
? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect with db ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname)) 
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket))
? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect with port ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 
3306))
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket))
? 1:0;
mysqli_close($link);
 
+   /* temporary addition for Kent's setup, Win32 box */
+   for ($i = 0; $i  10; $i++) {
+   if (!$link = mysqli_init())
+   printf([001 + %d] mysqli_init() failed, [%d] %s\n, 
$i, mysqli_connect_errno(), mysqli_connect_error());
+
+   if (!mysqli_real_connect($link, $host, $user, $passwd, $db, 
$port, $socket))
+   printf([002 + %d] mysqli_real_connect() failed, [%d] 
%s\n, $i, mysqli_connect_errno(), mysqli_connect_error());
+
+   mysqli_close($link);
+   }
+
/*** test mysqli_real_connect compressed ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0, 
NULL, MYSQLI_CLIENT_COMPRESS)) 
+   /*
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket, MYSQLI_CLIENT_COMPRESS))
? 1 : 0;
mysqli_close($link);
-
+  */
/* todo ssl connections */
 
var_dump($test);
+   print done!;
 ?
---EXPECT--
-string(5) 1
+--EXPECTF--
+%s(4) 
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/002.phpt?r1=1.4.2.1r2=1.4.2.1.4.1diff_format=u
Index: php-src/ext/mysqli/tests/002.phpt
diff -u php-src/ext/mysqli/tests/002.phpt:1.4.2.1 
php-src/ext/mysqli/tests/002.phpt:1.4.2.1.4.1
--- php-src/ext/mysqli/tests/002.phpt:1.4.2.1   Fri Mar 24 09:32:24 2006
+++ php-src/ext/mysqli/tests/002.phpt   Wed Oct 10 10:06:53 2007
@@ -1,30 +1,38 @@
 --TEST--
-mysqli bind_result 1 
+mysqli bind_result 1
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-$link-query(CREATE SCHEMA test);
+   if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+  printf([001] [%d] %s\n, mysqli_connect_errno(), 
mysqli_connect_error());
 
-   mysqli_select_db($link, test);
-   $rc = mysqli_query($link,DROP TABLE IF EXISTS test_fetch_null);
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_fetch_null))
+   printf([002] Cannot drop table, [%d] %s\n, 
mysqli_errno($link), mysqli_error($link));
 
-   $rc = mysqli_query($link,CREATE TABLE test_fetch_null(col1 tinyint, 
col2 smallint,
-   col3 int, col4 bigint, 
-   col5 float, col6 double,
-   col7 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:07:08 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   010.phpt 011.phpt 012.phpt 013.phpt 
014.phpt 015.phpt 016.phpt 017.phpt 
018.phpt 019.phpt 
  Log:
  Changes to all 01*.phpt tests
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/010.phpt?r1=1.5.2.1r2=1.5.2.1.4.1diff_format=u
Index: php-src/ext/mysqli/tests/010.phpt
diff -u php-src/ext/mysqli/tests/010.phpt:1.5.2.1 
php-src/ext/mysqli/tests/010.phpt:1.5.2.1.4.1
--- php-src/ext/mysqli/tests/010.phpt:1.5.2.1   Sat Oct  8 15:08:07 2005
+++ php-src/ext/mysqli/tests/010.phpt   Wed Oct 10 10:07:08 2007
@@ -3,26 +3,32 @@
 --INI--
 precision=12
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-
-   mysqli_select_db($link, test);
-   mysqli_query($link, SET sql_mode='');
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
+   if (!mysqli_query($link, SET sql_mode=''))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 float(3),
- c2 float,
- c3 float unsigned,
- c4 float,
- c5 float,
- c6 float,
- c7 float(10) unsigned));
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_bind_fetch))
+   printf([002] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+   
+   $rc = mysqli_query($link, CREATE TABLE test_bind_fetch(c1 float(3),
+   
 c2 float,
+   
 c3 float unsigned,
+   
 c4 float,
+   
 c5 float,
+   
 c6 float,  
+   
 c7 float(10) unsigned) ENGINE= . $engine);
+   if (!$rc)
+   printf([003] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
 
mysqli_query($link, INSERT INTO test_bind_fetch (c1,c2,c3,c4,c5,c6,c7) 
VALUES (3.1415926535,-0.01, -5, ,
@@ -39,6 +45,7 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 array(7) {
@@ -57,3 +64,4 @@
   [6]=
   float(88914608000)
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/011.phpt?r1=1.5r2=1.5.6.1diff_format=u
Index: php-src/ext/mysqli/tests/011.phpt
diff -u php-src/ext/mysqli/tests/011.phpt:1.5 
php-src/ext/mysqli/tests/011.phpt:1.5.6.1
--- php-src/ext/mysqli/tests/011.phpt:1.5   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/011.phpt   Wed Oct 10 10:07:08 2007
@@ -3,27 +3,34 @@
 --INI--
 precision=12
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-
-   mysqli_select_db($link, test);
-
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_result);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_query($link,CREATE TABLE test_bind_result(c1 tinyint, c2 
smallint, 
-c3 int, c4 bigint, 
-c5 float, c6 double,
-c7 varbinary(10), 
-c8 varchar(50)));
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_bind_result))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link,INSERT INTO test_bind_result 
VALUES(19,2999,3999,499,
-  
2345.6,5678.89563,
-  

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 020.phpt 021.phpt 022.phpt 023.phpt 024.phpt 025.phpt 026.phpt 027.phpt 028.phpt 029.phpt 030.phpt 031.phpt 032.phpt 033.phpt 034.phpt 035.phpt 036.ph

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:07:46 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   020.phpt 021.phpt 022.phpt 023.phpt 
024.phpt 025.phpt 026.phpt 027.phpt 
028.phpt 029.phpt 030.phpt 031.phpt 
032.phpt 033.phpt 034.phpt 035.phpt 
036.phpt 037.phpt 038.phpt 039.phpt 
  Log:
  Changes to 02*.phpt, 03*.phpt
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/020.phpt?r1=1.6.2.1r2=1.6.2.1.4.1diff_format=u
Index: php-src/ext/mysqli/tests/020.phpt
diff -u php-src/ext/mysqli/tests/020.phpt:1.6.2.1 
php-src/ext/mysqli/tests/020.phpt:1.6.2.1.4.1
--- php-src/ext/mysqli/tests/020.phpt:1.6.2.1   Sat Oct  8 15:08:07 2005
+++ php-src/ext/mysqli/tests/020.phpt   Wed Oct 10 10:07:46 2007
@@ -1,44 +1,51 @@
 --TEST--
 mysqli bind_param/bind_result date
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
+   /* NOTE: There's an option in mysqlnd which controls if data and
+   time are returned as unicode or not. Consider this if you consider
+   adding a UEXPECTF to the test. */
+
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
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, 
-c3 timestamp(14), 
-c4 year, 
-c5 datetime, 
-c6 timestamp(4), 
-c7 timestamp(6)));
+   mysqli_query($link,CREATE TABLE test_bind_result(c1 date, c2 time,
+   c3 timestamp(14),
+   c4 year,
+   c5 datetime,
+   c6 timestamp(4),
+   c7 timestamp(6)));
 
$stmt = mysqli_prepare($link, INSERT INTO test_bind_result VALUES 
(?,?,?,?,?,?,?));
mysqli_bind_param($stmt, sss, $d1, $d2, $d3, $d4, $d5, $d6, $d7);
 
-   $d1 = '2002-01-02';
-   $d2 = '12:49:00';
-   $d3 = '2002-01-02 17:46:59';
-   $d4 = 2010;
-   $d5 ='2010-07-10';
-   $d6 = '2020';
-   $d7 = '1999-12-29';
+   $d1 = 2002-01-02;
+   $d2 = 12:49:00;
+   $d3 = 2002-01-02 17:46:59;
+   $d4 = 2010;
+   $d5 = 2010-07-10;
+   $d6 = 2020;
+   $d7 = 1999-12-29;
 
mysqli_execute($stmt);
mysqli_stmt_close($stmt);
 
$stmt = mysqli_prepare($link, SELECT * FROM test_bind_result);
 
-   mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
-   
-   mysqli_execute($stmt);
+   mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
+
+   mysqli_execute($stmt);
mysqli_fetch($stmt);
 
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
@@ -47,21 +54,24 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+
+   print done!;
 ?
---EXPECT--
+--EXPECTF--
 array(7) {
   [0]=
-  string(10) 2002-01-02
+  %s(10) 2002-01-02
   [1]=
-  string(8) 12:49:00
+  %s(8) 12:49:00
   [2]=
-  string(19) 2002-01-02 17:46:59
+  %s(19) 2002-01-02 17:46:59
   [3]=
   int(2010)
   [4]=
-  string(19) 2010-07-10 00:00:00
+  %s(19) 2010-07-10 00:00:00
   [5]=
-  string(19) -00-00 00:00:00
+  %s(19) -00-00 00:00:00
   [6]=
-  string(19) 1999-12-29 00:00:00
+  %s(19) 1999-12-29 00:00:00
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/021.phpt?r1=1.5r2=1.5.6.1diff_format=u
Index: php-src/ext/mysqli/tests/021.phpt
diff -u php-src/ext/mysqli/tests/021.phpt:1.5 
php-src/ext/mysqli/tests/021.phpt:1.5.6.1
--- php-src/ext/mysqli/tests/021.phpt:1.5   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/021.phpt   Wed Oct 10 10:07:46 2007
@@ -1,18 +1,21 @@
 --TEST--
-mysqli bind_param+bind_result char/text 
+mysqli bind_param+bind_result char/text
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 char(10), c2 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 040.phpt 041.phpt 042.phpt 043.phpt 044.phpt 045.phpt 046.phpt 047.phpt 048.phpt 049.phpt 050.phpt 051.phpt 052.phpt 053.phpt 054.phpt 055.phpt 056.ph

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:08:29 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   040.phpt 041.phpt 042.phpt 043.phpt 
044.phpt 045.phpt 046.phpt 047.phpt 
048.phpt 049.phpt 050.phpt 051.phpt 
052.phpt 053.phpt 054.phpt 055.phpt 
056.phpt 057.phpt 058.phpt 059.phpt 
  Log:
  Changes to 04*.phpt, 05*.phpt.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/040.phpt?r1=1.3r2=1.3.6.1diff_format=u
Index: php-src/ext/mysqli/tests/040.phpt
diff -u php-src/ext/mysqli/tests/040.phpt:1.3 
php-src/ext/mysqli/tests/040.phpt:1.3.6.1
--- php-src/ext/mysqli/tests/040.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/040.phpt   Wed Oct 10 10:08:29 2007
@@ -1,16 +1,19 @@
 --TEST--
 function test: mysqli_num_rows()
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
 
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, DROP TABLE IF EXISTS test_result);
 
@@ -28,6 +31,8 @@
var_dump($num);
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/041.phpt?r1=1.5r2=1.5.6.1diff_format=u
Index: php-src/ext/mysqli/tests/041.phpt
diff -u php-src/ext/mysqli/tests/041.phpt:1.5 
php-src/ext/mysqli/tests/041.phpt:1.5.6.1
--- php-src/ext/mysqli/tests/041.phpt:1.5   Fri Jul  8 08:53:25 2005
+++ php-src/ext/mysqli/tests/041.phpt   Wed Oct 10 10:08:29 2007
@@ -1,15 +1,18 @@
 --TEST--
 function test: mysqli_warning_count()
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
 
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-   mysqli_select_db($link, test);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, DROP TABLE IF EXISTS test_warnings);
mysqli_query($link, DROP TABLE IF EXISTS test_warnings);
@@ -17,6 +20,8 @@
var_dump(mysqli_warning_count($link));
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/042.phpt?r1=1.7.2.1r2=1.7.2.1.4.1diff_format=u
Index: php-src/ext/mysqli/tests/042.phpt
diff -u php-src/ext/mysqli/tests/042.phpt:1.7.2.1 
php-src/ext/mysqli/tests/042.phpt:1.7.2.1.4.1
--- php-src/ext/mysqli/tests/042.phpt:1.7.2.1   Sat Oct  8 15:08:07 2005
+++ php-src/ext/mysqli/tests/042.phpt   Wed Oct 10 10:08:29 2007
@@ -1,25 +1,28 @@
 --TEST--
 mysqli_fetch_object
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
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,
- c2 smallint unsigned,
- c3 smallint,
- c4 smallint,
- c5 smallint,
- c6 smallint unsigned,
- c7 smallint));
+   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
+   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 smallint unsigned,
+   c2 smallint unsigned,
+   c3 smallint,
+   c4 smallint,
+   c5 smallint,
+   c6 smallint unsigned,
+   c7 smallint));
 
$stmt = mysqli_prepare($link, INSERT INTO test_bind_fetch VALUES 
(?,?,?,?,?,?,?));
mysqli_bind_param($stmt, iii, $c1,$c2,$c3,$c4,$c5,$c6,$c7);
@@ -42,6 +45,7 @@
var_dump($test);
 
mysqli_close($link);
+   print done!
 ?
 --EXPECTF--
 object(stdClass)#%d (7) {
@@ -60,3 +64,22 @@
   [c7]=
   string(1) 0
 }
+done!
+--UEXPECTF--
+object(stdClass)#%d (7) {
+  [uc1]=
+  

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests bug28817.phpt bug29311.phpt bug30967.phpt bug31141.phpt bug31668.phpt bug32405.phpt bug33090.phpt bug33263.phpt bug33491.phpt bug34785.phpt bug34810.p

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:10:59 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   bug28817.phpt bug29311.phpt bug30967.phpt 
bug31141.phpt bug31668.phpt bug32405.phpt 
bug33090.phpt bug33263.phpt bug33491.phpt 
bug34785.phpt bug34810.phpt bug35103.phpt 
bug35517.phpt bug35759.phpt bug36420.phpt 
bug36745.phpt bug36802.phpt bug36949.phpt 
bug37090.phpt bug38710.phpt 
  Log:
  Further changes to regression/bug-verification tests.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug28817.phpt?r1=1.2.4.1r2=1.2.4.1.2.1diff_format=u
Index: php-src/ext/mysqli/tests/bug28817.phpt
diff -u php-src/ext/mysqli/tests/bug28817.phpt:1.2.4.1 
php-src/ext/mysqli/tests/bug28817.phpt:1.2.4.1.2.1
--- php-src/ext/mysqli/tests/bug28817.phpt:1.2.4.1  Mon May  7 18:02:59 2007
+++ php-src/ext/mysqli/tests/bug28817.phpt  Wed Oct 10 10:10:59 2007
@@ -1,7 +1,10 @@
 --TEST--
 Bug #28817 (problems with properties declared in the class extending MySQLi)
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
@@ -21,19 +24,19 @@
var_dump($mysql-p_test);
@var_dump($mysql-errno);
 
-   $mysql-connect($host, $user, $passwd);
+   $mysql-connect($host, $user, $passwd, $db, $port, $socket);
$mysql-select_db(nonexistingdb);
 
var_dump($mysql-errno  0);
 
-   $mysql-close();
+   $mysql-close();
 ?
 --EXPECTF--
 array(2) {
   [0]=
-  string(3) foo
+  %s(3) foo
   [1]=
-  string(3) bar
+  %s(3) bar
 }
 NULL
-bool(true)
+bool(true)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug29311.phpt?r1=1.3r2=1.3.6.1diff_format=u
Index: php-src/ext/mysqli/tests/bug29311.phpt
diff -u php-src/ext/mysqli/tests/bug29311.phpt:1.3 
php-src/ext/mysqli/tests/bug29311.phpt:1.3.6.1
--- php-src/ext/mysqli/tests/bug29311.phpt:1.3  Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/bug29311.phpt  Wed Oct 10 10:10:59 2007
@@ -1,48 +1,51 @@
 --TEST--
 constructor test
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
-   
+
/* class 1 calls parent constructor */
class mysql1 extends mysqli {
function __construct() {
-   global $host, $user, $passwd;
-   parent::__construct($host, $user, $passwd, test);
+   global $host, $user, $passwd, $db, $port, $socket;
+   parent::__construct($host, $user, $passwd, $db, $port, 
$socket);
}
}
 
/* class 2 has an own constructor */
class mysql2 extends mysqli {
-   
+
function __construct() {
-   global $host, $user, $passwd;
-   $this-connect($host, $user, $passwd, test);
+   global $host, $user, $passwd, $db, $port, $socket;
+   $this-connect($host, $user, $passwd, $db, $port, 
$socket);
}
}
 
/* class 3 has no constructor */
class mysql3 extends mysqli {
-   
+
}
 
-   $foo[0] = new mysql1(); 
-   $foo[1] = new mysql2(); 
-   $foo[2] = new mysql3($host, $user, $passwd, test);
+   $foo[0] = new mysql1();
+   $foo[1] = new mysql2();
+   $foo[2] = new mysql3($host, $user, $passwd, $db, $port, $socket);
 
 
for ($i=0; $i  3; $i++) {
if (($result = $foo[$i]-query(SELECT DATABASE( {
$row = $result-fetch_row();
-   printf(%d: %s\n, $i, $row[0]);
+   if ($row[0] != $db)
+   printf(%d: %s\n, $i, $row[0]);
$result-close();
}
$foo[$i]-close();
}
+   print done!;
 ?
 --EXPECTF--
-0: test
-1: test
-2: test
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug30967.phpt?r1=1.4.4.1r2=1.4.4.1.2.1diff_format=u
Index: php-src/ext/mysqli/tests/bug30967.phpt
diff -u php-src/ext/mysqli/tests/bug30967.phpt:1.4.4.1 
php-src/ext/mysqli/tests/bug30967.phpt:1.4.4.1.2.1
--- php-src/ext/mysqli/tests/bug30967.phpt:1.4.4.1  Mon May  7 18:03:00 2007
+++ php-src/ext/mysqli/tests/bug30967.phpt  Wed Oct 10 10:10:59 2007
@@ -1,7 +1,10 @@
 --TEST--
 Bug #30967 (problems with properties declared in the class extending the class 
extending MySQLi)
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 060.phpt 061.phpt 062.phpt 063.phpt 064.phpt 065.phpt 066.phpt 067.phpt 068.phpt 069.phpt 070.phpt 071.phpt 072.phpt 073.phpt 074.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:10:14 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   069.phpt 070.phpt 074.phpt 

  Modified files:  
/php-src/ext/mysqli/tests   060.phpt 061.phpt 062.phpt 063.phpt 
064.phpt 065.phpt 066.phpt 067.phpt 
068.phpt 071.phpt 072.phpt 073.phpt 
  Log:
  Last set of changes to the classical 0*.phpt - 06*.phpt/07*.phpt
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/060.phpt?r1=1.3.2.1r2=1.3.2.1.4.1diff_format=u
Index: php-src/ext/mysqli/tests/060.phpt
diff -u php-src/ext/mysqli/tests/060.phpt:1.3.2.1 
php-src/ext/mysqli/tests/060.phpt:1.3.2.1.4.1
--- php-src/ext/mysqli/tests/060.phpt:1.3.2.1   Sat Oct  8 15:08:07 2005
+++ php-src/ext/mysqli/tests/060.phpt   Wed Oct 10 10:10:14 2007
@@ -1,42 +1,45 @@
 --TEST--
 mysqli_fetch_object with classes
 --SKIPIF--
-?php require_once('skipif.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
-   
+
class test_class {
function __construct($arg1, $arg2) {
echo __METHOD__ . ($arg1,$arg2)\n;
}
}
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
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,
- c2 smallint unsigned,
- c3 smallint,
- c4 smallint,
- c5 smallint,
- c6 smallint unsigned,
- c7 smallint));
+   mysqli_query($link,DROP TABLE IF EXISTS test_fetch);
+   mysqli_query($link,CREATE TABLE test_fetch(c1 smallint unsigned,
+   c2 smallint unsigned,
+   c3 smallint,
+   c4 smallint,
+   c5 smallint,
+   c6 smallint unsigned,
+   c7 smallint));
 
-   mysqli_query($link, INSERT INTO test_fetch VALUES ( -23, 35999, NULL, 
-500, -999, -0, 0)); 
+   mysqli_query($link, INSERT INTO test_fetch VALUES ( -23, 35999, NULL, 
-500, -999, -0, 0));
 
-   $result = mysqli_query($link, SELECT * FROM test_bind_fetch);
+   $result = mysqli_query($link, SELECT * FROM test_fetch);
$test = mysqli_fetch_object($result, 'test_class', array(1, 2));
mysqli_free_result($result);
 
var_dump($test);
 
mysqli_close($link);
-   
+
echo Done\n;
 ?
 --EXPECTF--
@@ -58,3 +61,22 @@
   string(1) 0
 }
 Done
+--UEXPECTF--
+test_class::__construct(1,2)
+object(test_class)#%d (7) {
+  [uc1]=
+  unicode(1) 0
+  [uc2]=
+  unicode(5) 35999
+  [uc3]=
+  NULL
+  [uc4]=
+  unicode(4) -500
+  [uc5]=
+  unicode(6) -32768
+  [uc6]=
+  unicode(1) 0
+  [uc7]=
+  unicode(1) 0
+}
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/061.phpt?r1=1.5.4.1r2=1.5.4.1.2.1diff_format=u
Index: php-src/ext/mysqli/tests/061.phpt
diff -u php-src/ext/mysqli/tests/061.phpt:1.5.4.1 
php-src/ext/mysqli/tests/061.phpt:1.5.4.1.2.1
--- php-src/ext/mysqli/tests/061.phpt:1.5.4.1   Tue Dec 12 08:09:40 2006
+++ php-src/ext/mysqli/tests/061.phpt   Wed Oct 10 10:10:14 2007
@@ -1,8 +1,10 @@
 --TEST--
 local infile handler
 --SKIPIF--
-?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
+?php 
+require_once('skipif.inc'); 
+require_once('skipifconnectfailure.inc');
+?
 --FILE--
 ?php
include connect.inc;
@@ -11,36 +13,49 @@
$buffer = strrev(fread($fp, $buflen));
return(strlen($buffer));
}
-   
-   /*** test mysqli_real_connect 127.0.0.1 ***/
-   $link = mysqli_init();
-   mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, 1);
-   mysqli_real_connect($link, $host, $user, $passwd, test);
+
+   /*** test mysqli_connect 127.0.0.1 ***/
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
/* create temporary file */
$filename = dirname(__FILE__) . 061.csv;
$fp = fopen($filename, w);
-   fwrite($fp, foo;bar);
+   fwrite($fp, bfoo;bar);
fclose($fp);
 
-   mysqli_query($link,DROP TABLE IF EXISTS t_061);
-   mysqli_query($link,CREATE TABLE t_061 (c1 varchar(10), c2 
varchar(10)));
+   if (!mysqli_query($link,DROP TABLE IF EXISTS t_061))
+   printf(Cannot drop table: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+   if (!mysqli_query($link,CREATE 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysql/tests mysql_data_seek.phpt mysql_db_name.phpt mysql_db_query.phpt mysql_drop_db.phpt mysql_get_client_info.phpt mysql_get_host_info.phpt mysql_get_proto_info

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 09:53:34 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysql/testsmysql_data_seek.phpt mysql_db_name.phpt 
mysql_db_query.phpt mysql_drop_db.phpt 
mysql_get_client_info.phpt 
mysql_get_host_info.phpt 
mysql_get_proto_info.phpt 
mysql_get_server_info.phpt mysql_info.phpt 
mysql_insert_id.phpt 
  Log:
  Next set of new tests - more to follow. Trying to find reasonable commit 
size...
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_data_seek.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_data_seek.phpt
+++ php-src/ext/mysql/tests/mysql_data_seek.phpt
--TEST--
mysql_data_seek()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;   
$link   = NULL;
   
if (NULL !== ($tmp = @mysql_data_seek()))
printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

if (NULL !== ($tmp = @mysql_data_seek($link)))
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

if (false !== ($tmp = @mysql_data_seek($link, $link)))
printf([003] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');
if (!$res = mysql_query('SELECT * FROM test ORDER BY id LIMIT 4', $link)) 
printf([004] [%d] %s\n, mysql_errno($link), mysql_error($link));

if (true !== ($tmp = mysql_data_seek($res, 3)))
printf([005] Expecting boolean/true, got %s/%s\n, gettype($tmp), 
$tmp);

$row = mysql_fetch_assoc($res);
if (4 != $row['id'])
printf([006] Expecting record 4/d, got record %s/%s\n, $row['id'], 
$row['label']);

if (true !== ($tmp = mysql_data_seek($res, 0)))
printf([007] Expecting boolean/true, got %s/%s\n, gettype($tmp), 
$tmp);

$row = mysql_fetch_assoc($res);
if (1 != $row['id'])
printf([008] Expecting record 1/a, got record %s/%s\n, $row['id'], 
$row['label']);

if (false !== ($tmp = mysql_data_seek($res, 4)))
printf([009] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

if (false !== ($tmp = mysql_data_seek($res, -1)))
printf([010] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

mysql_free_result($res);

if (!$res = mysql_unbuffered_query('SELECT * FROM test ORDER BY id', 
$link)) 
printf([011] [%d] %s\n, mysql_errno($link), mysql_error($link));

if (false !== ($tmp = mysql_data_seek($res, 3)))
printf([012] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

mysql_free_result($res);

if (false !== ($tmp = mysql_data_seek($res, 1)))
printf([013] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);

mysql_close($link);

print done!\n; 
?
--EXPECTF--
Warning: mysql_data_seek(): Offset 4 is invalid for MySQL result index %d (or 
the query data is unbuffered) in %s on line %d

Warning: mysql_data_seek(): Offset -1 is invalid for MySQL result index %d (or 
the query data is unbuffered) in %s on line %d

Warning: mysql_data_seek(): Offset 3 is invalid for MySQL result index %d (or 
the query data is unbuffered) in %s on line %d

Warning: mysql_data_seek(): %d is not a valid MySQL result resource in %s on 
line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_db_name.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_db_name.phpt
+++ php-src/ext/mysql/tests/mysql_db_name.phpt
--TEST--
mysql_db_name()
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;   
$link   = NULL;
   
if (NULL !== ($tmp = @mysql_db_name()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);

if (false !== ($tmp = @mysql_db_name($link, $link)))
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp); 

require('table.inc');

if (!$res = mysql_list_dbs($link))
printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
if (!$num = mysql_num_rows($res))
printf([004] Empty database list? [%d] %s\n, mysql_errno($link), 
mysql_error($link));

if (false !== ($tmp = mysql_db_name($res, -1)))
printf([005] Expecting boolean/false, got %s/%s. [%d] %s\n, 
gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));

if (false !== ($tmp = mysql_db_name($res, $num + 1)))
printf([006] Expecting boolean/false, got %s/%s. [%d] %s\n, 
gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));

$unicode = (boolean)ini_get('unicode.semantics');
for ($i = 0; 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests bug42378.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:11:27 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   bug42378.phpt 
  Log:
  Test code for bug #42378
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug42378.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/bug42378.phpt
+++ php-src/ext/mysqli/tests/bug42378.phpt

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests mysqli_thread_id.phpt mysqli_thread_safe.phpt mysqli_unclonable.phpt mysqli_use_result.phpt mysqli_warning_count.phpt mysqli_warning_unclonable.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:20:11 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   mysqli_thread_id.phpt 
mysqli_thread_safe.phpt 
mysqli_unclonable.phpt 
mysqli_use_result.phpt 
mysqli_warning_count.phpt 
mysqli_warning_unclonable.phpt 
  Log:
  Last bunch of new tests.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_thread_id.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_thread_id.phpt
+++ php-src/ext/mysqli/tests/mysqli_thread_id.phpt
--TEST--
mysqli_thread_id()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;
$link   = NULL;

if (!is_null($tmp = @mysqli_thread_id()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!is_null($tmp = @mysqli_thread_id($link)))
printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');

if (!is_int($tmp = mysqli_thread_id($link)) || (0 === $tmp))
printf([003] Expecting int/any but zero, got %s/%s. [%d] %s\n,
gettype($tmp), $tmp, mysqli_errno($link), 
mysqli_error($link));

// should work if the thread id is correct
mysqli_kill($link, mysqli_thread_id($link));

mysqli_close($link);

if (NULL !== ($tmp = mysqli_thread_id($link)))
printf([005] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

print done!;
?
--EXPECTF--
Warning: mysqli_thread_id(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_thread_safe.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_thread_safe.phpt
+++ php-src/ext/mysqli/tests/mysqli_thread_safe.phpt
--TEST--
mysqli_thread_safe()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
if (!is_bool($tmp = mysqli_thread_safe()))
printf([001] Expecting boolean/any, got %s/%s.\n, 
gettype($tmp), $tmp);

print done!;
?
--EXPECTF--
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_unclonable.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_unclonable.phpt
+++ php-src/ext/mysqli/tests/mysqli_unclonable.phpt
--TEST--
Trying to clone mysqli object
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf([001] Cannot connect to the server using host=%s, 
user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n,
$host, $user, $db, $port, $socket);

$link_clone = clone $link;
mysqli_close($link);

print done!;
?
--EXPECTF--
Fatal error: Trying to clone an uncloneable object of class mysqli in %s on 
line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_use_result.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_use_result.phpt
+++ php-src/ext/mysqli/tests/mysqli_use_result.phpt
--TEST--
mysqli_use_result()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;
$link   = NULL;

if (!is_null($tmp = @mysqli_use_result()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!is_null($tmp = @mysqli_use_result($link)))
printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');

if (!$res = mysqli_real_query($link, SELECT id, label FROM test ORDER 
BY id))
printf([003] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));

if (!is_object($res = mysqli_use_result($link)))
printf([004] Expecting object, got %s/%s. [%d] %s\n,
gettype($res), $res, mysqli_errno($link), 
mysqli_error($link));

if (false !== ($tmp = mysqli_data_seek($res, 2)))
printf([005] Expecting boolean/true, got %s/%s. [%d] %s\n,
gettype($tmp), $tmp, mysqli_errno($link), 
mysqli_error($link));

mysqli_free_result($res);

if (!mysqli_query($link, DELETE FROM test))
printf([006] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));

if (false !== ($res = mysqli_use_result($link)))
printf([007] Expecting boolean/false, got %s/%s. [%d] %s\n,
gettype($res), $res, mysqli_errno($link), 
mysqli_error($link));

if (!$res = mysqli_query($link, SELECT id, label FROM test ORDER BY 
id))
printf([008] [%d] %s\n, 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests mysqli_master_query.phpt mysqli_max_links.phpt mysqli_more_results.phpt mysqli_multi_query.phpt mysqli_mysqli_result_invalid_mode.phpt mysqli_next_res

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:17:38 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   mysqli_master_query.phpt 
mysqli_max_links.phpt 
mysqli_more_results.phpt 
mysqli_multi_query.phpt 
mysqli_mysqli_result_invalid_mode.phpt 
mysqli_next_result.phpt 
mysqli_no_reconnect.phpt 
mysqli_num_fields.phpt 
mysqli_num_rows.phpt 
mysqli_options_init_command.phpt 
mysqli_options_openbasedir.phpt 
mysqli_options.phpt 
mysqli_pconn_disabled.phpt 
mysqli_pconnect.phpt 
mysqli_pconn_kill.phpt 
mysqli_pconn_limits.phpt 
mysqli_pconn_max_links.phpt 
mysqli_pconn_reuse.phpt 
mysqli_phpinfo.phpt mysqli_ping.phpt 
mysqli_prepare_no_object.phpt 
mysqli_prepare.phpt 
  Log:
  Adding new tests: mysqli_m*.phpt mysqli_n*.phpt mysqli_o*.phpt mysqli_p*.phpt
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_master_query.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_master_query.phpt
+++ php-src/ext/mysqli/tests/mysqli_master_query.phpt
--TEST--
mysqli_master_query()
--SKIPIF--
?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_master_query')) {
die(skip mysqli_master_query() not available);
}
require_once('connect.inc');
if (!$TEST_EXPERIMENTAL)
die(skip - experimental (= unsupported) feature);
?
--FILE--
?php
/* NOTE: tests is a stub, but function is deprecated, as long as it 
does not crash when invoking it... */
include connect.inc;

$tmp= NULL;
$link   = NULL;

if (NULL !== ($tmp = @mysqli_master_query()))
printf([001] Expecting NULL/NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (NULL !== ($tmp = @mysqli_master_query($link)))
printf([002] Expecting NULL/NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, 
$socket)) {
printf([003] Cannot connect to the server using host=%s, 
user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n,
$host, $user, $db, $port, $socket);
}

if (!is_bool($tmp = mysqli_master_query($link, 'SELECT 1')))
printf([004] Expecting boolean/[true|false] value, got 
%s/%s\n, gettype($tmp), $tmp);

mysqli_close($link);

if (NULL !== ($tmp = mysqli_master_query($link)))
printf([005] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

print done!;
?
--EXPECTF--
Warning: mysqli_master_query(): Couldn't fetch mysqli in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_max_links.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_max_links.phpt
+++ php-src/ext/mysqli/tests/mysqli_max_links.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_more_results.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_more_results.phpt
+++ php-src/ext/mysqli/tests/mysqli_more_results.phpt
--TEST--
mysqli_more_results()
--SKIPIF--
?php
require_once('skipif.inc');
require_once('skipifemb.inc');
?
--FILE--
?php
include connect.inc;

$strict_on = false;
if (defined('E_STRICT')) {
error_reporting(((int)ini_get('error_reporting')) | E_STRICT );
$strict_on = true;
}

$tmp= NULL;
$link   = NULL;

if (!is_null($tmp = @mysqli_more_results()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!is_null($tmp = @mysqli_more_results($link)))
printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

require('table.inc');

print [004]\n;
var_dump(mysqli_more_results($link));

if (!mysqli_multi_query($link, SELECT 1 AS a; SELECT 1 AS a, 2 AS b; 
SELECT id FROM test ORDER BY id LIMIT 3))
printf([005] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
print [006]\n;
$i = 1;

if ($strict_on)
ob_start();

if (mysqli_get_server_version($link)  41000  !($ret = 
mysqli_more_results($link)))
printf([007] Expecting boolean/true, got %s/%s\n, 
gettype($ret), $ret);
do {
$res = mysqli_store_result($link);

[PHP-CVS] cvs: php-src /ext/mysqli/tests bug29311.phpt bug33263.phpt mysqli_affected_rows_oo.phpt mysqli_autocommit.phpt mysqli_autocommit_oo.phpt mysqli_class_mysqli_interface.phpt mysqli_class_mysql

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:49:00 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   bug29311.phpt bug33263.phpt 
mysqli_affected_rows_oo.phpt 
mysqli_autocommit_oo.phpt 
mysqli_autocommit.phpt 
mysqli_class_mysqli_interface.phpt 
mysqli_class_mysqli_reflection.phpt 
mysqli_connect.phpt 
mysqli_fetch_all_oo.phpt 
mysqli_fetch_all.phpt 
mysqli_fetch_assoc.phpt 
mysqli_fetch_object.phpt 
  Log:
  Commiting changes into HEAD = synching with 5_3
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug29311.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/bug29311.phpt
diff -u php-src/ext/mysqli/tests/bug29311.phpt:1.4 
php-src/ext/mysqli/tests/bug29311.phpt:1.5
--- php-src/ext/mysqli/tests/bug29311.phpt:1.4  Thu Aug  9 09:43:28 2007
+++ php-src/ext/mysqli/tests/bug29311.phpt  Wed Oct 10 10:49:00 2007
@@ -1,14 +1,14 @@
 --TEST--
 constructor test
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?
 --FILE--
 ?php
include connect.inc;
-   
+
/* class 1 calls parent constructor */
class mysql1 extends mysqli {
function __construct() {
@@ -19,7 +19,7 @@
 
/* class 2 has an own constructor */
class mysql2 extends mysqli {
-   
+
function __construct() {
global $host, $user, $passwd, $db, $port, $socket;
$this-connect($host, $user, $passwd, $db, $port, 
$socket);
@@ -28,24 +28,24 @@
 
/* class 3 has no constructor */
class mysql3 extends mysqli {
-   
+
}
 
-   $foo[0] = new mysql1(); 
-   $foo[1] = new mysql2(); 
+   $foo[0] = new mysql1();
+   $foo[1] = new mysql2();
$foo[2] = new mysql3($host, $user, $passwd, $db, $port, $socket);
 
 
for ($i=0; $i  3; $i++) {
if (($result = $foo[$i]-query(SELECT DATABASE( {
$row = $result-fetch_row();
-   printf(%d: %s\n, $i, $row[0]);
+   if ($row[0] != $db)
+   printf(%d: %s\n, $i, $row[0]);
$result-close();
}
$foo[$i]-close();
}
+   print done!;
 ?
 --EXPECTF--
-0: test
-1: test
-2: test
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug33263.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/bug33263.phpt
diff -u php-src/ext/mysqli/tests/bug33263.phpt:1.5 
php-src/ext/mysqli/tests/bug33263.phpt:1.6
--- php-src/ext/mysqli/tests/bug33263.phpt:1.5  Thu Aug  9 09:43:28 2007
+++ php-src/ext/mysqli/tests/bug33263.phpt  Wed Oct 10 10:49:00 2007
@@ -1,8 +1,8 @@
 --TEST--
-Bug #33263 (mysqli_real_connect in __construct) 
+Bug #33263 (mysqli_real_connect in __construct)
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
 ?
@@ -23,13 +23,16 @@
 
$stmt = $mysql-prepare(SELECT DATABASE());
$stmt-execute();
-   $stmt-bind_result($db);
+   $stmt-bind_result($database);
$stmt-fetch();
$stmt-close();
 
-   var_dump($db);
+   if ($database != $db)
+   printf([001] Expecting '%s' got %s/'%s'.\n,
+   gettype($database), $database);
 
$mysql-close();
+   print done!;
 ?
 --EXPECTF--
-%s(4) test
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt
diff -u php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt:1.2 
php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt:1.3
--- php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt:1.2   Thu Aug  9 
10:01:19 2007
+++ php-src/ext/mysqli/tests/mysqli_affected_rows_oo.phpt   Wed Oct 10 
10:49:00 2007
@@ -1,7 +1,7 @@
 --TEST--
 mysqli-affected_rows
 --SKIPIF--
-?php 
+?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
@@ -10,13 +10,17 @@
 ?php
include connect.inc;
 
+   $mysqli = new mysqli();
+   if (NULL !== ($tmp = @$mysqli-affected_rows))
+   printf([000a] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);
+
if (!$mysqli = new mysqli($host, $user, $passwd, $db, $port, $socket)) {
printf([001] Cannot connect to the server using host=%s, 
user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n,

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_max_links.phpt mysql_max_persistent.phpt mysql_pconn_disable.phpt mysql_pconn_kill.phpt mysql_pconn_max_links.phpt mysql_pconn_reuse.phpt mysql_pconnect.p

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:55:52 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_max_links.phpt 
mysql_max_persistent.phpt 
mysql_pconn_disable.phpt 
mysql_pconn_kill.phpt 
mysql_pconn_max_links.phpt 
mysql_pconn_reuse.phpt 
mysql_query_load_data_openbasedir.phpt 
mysql_sql_safe_mode.phpt 
mysql_trace_mode.phpt mysql_pconnect.phpt 
  Log:
  Adding tests to ext/mysql in HEAD = synching with 5_3
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_max_links.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_max_links.phpt
diff -u /dev/null php-src/ext/mysql/tests/mysql_max_links.phpt:1.2
--- /dev/null   Wed Oct 10 10:55:52 2007
+++ php-src/ext/mysql/tests/mysql_max_links.phptWed Oct 10 10:55:52 2007
@@ -0,0 +1,69 @@
+--TEST--
+mysql_[p]connect() - max_links/max_persistent
+--SKIPIF--
+?php
+require_once('skipif.inc');
+?
+--INI--
+mysql.max_links=2
+--FILE--
+?php
+require_once('connect.inc');
+
+function my_connect($offset, $host, $user, $passwd, $db, $port, $socket) {
+   if ($socket)
+   $host = sprintf(%s:%s, $host, $socket);
+   else if ($port)
+   $host = sprintf(%s:%s, $host, $port);
+
+   $link = mysql_connect($host, $user, $passwd, true);
+
+   if (!$link) {
+   printf([%03d] Cannot connect using host '%s', user '%s', 
password '', [%d] %s\n,
+   $offset, $host, $user, $passwd,
+   mysql_errno(), mysql_error());
+   return false;
+   }
+
+   return $link;
+}
+
+$links = array();
+
+// try to open 3 links
+$links[0] = my_connect(10, $host, $user, $passwd, $db, $port, $socket);
+$links[1] = my_connect(20, $host, $user, $passwd, $db, $port, $socket);
+$links[2] = my_connect(30, $host, $user, $passwd, $db, $port, $socket);
+if (false !== $links[2])
+   printf([040] Last connection should not have been allowed!\n);
+
+// free some links but let index 1 remain
+unset($links[2]);
+mysql_close($links[0]);
+unset($links[0]);
+
+// should be allowed - second open connection
+$links[0] = my_connect(50, $host, $user, $passwd, $db, $port, $socket);
+$links[2] = my_connect(60, $host, $user, $passwd, $db, $port, $socket);
+ksort($links);
+var_dump($links);
+
+mysql_close($links[0]);
+mysql_close($links[1]);
+print done!\n;
+?
+--EXPECTF--
+Warning: mysql_connect(): Too many open links (2) in %s on line %s
+[030] Cannot connect using host '%s', user '%s', password '', [0] 0
+
+Warning: mysql_connect(): Too many open links (2) in %s on line %s
+[060] Cannot connect using host '%s', user '%s', password '', [0] 0
+array(3) {
+  [0]=
+  resource(%d) of type (mysql link)
+  [1]=
+  resource(%d) of type (mysql link)
+  [2]=
+  bool(false)
+}
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_max_persistent.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_max_persistent.phpt
diff -u /dev/null php-src/ext/mysql/tests/mysql_max_persistent.phpt:1.2
--- /dev/null   Wed Oct 10 10:55:52 2007
+++ php-src/ext/mysql/tests/mysql_max_persistent.phpt   Wed Oct 10 10:55:52 2007
@@ -0,0 +1,90 @@
+--TEST--
+mysql_[p]connect() - max_links/max_persistent
+--SKIPIF--
+?php
+require_once('skipif.inc');
+require_once('connect.inc');
+
+$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket);
+if (!$link)
+   die(skip Cannot connect to MySQL);
+
+mysql_close($link);
+
+mysqli_query('DROP USER pcontest', $link);
+if (!mysql_query('CREATE USER pcontest IDENTIFIED BY pcontest', $link)) {
+   printf(skip Cannot create second DB user [%d] %s, mysql_errno($link), 
mysql_error($link));
+   mysql_close($link);
+   die();
+}
+
+// we might be able to specify the host using CURRENT_USER(), but...
+if (!mysql_query(sprintf(GRANT SELECT ON TABLE %s.test TO pcontest@'%%', 
$db), $link)) {
+   printf(skip Cannot GRANT SELECT to second DB user [%d] %s, 
mysql_errno($link), mysql_error($link));
+   mysql_query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM pcontest', $link);
+   mysql_query('DROP USER pcontest', $link);
+   mysql_close($link);
+   die();
+}
+mysql_close($link);
+?
+--INI--
+mysql.max_links=2
+mysql.allow_persistent=1
+mysql.max_persistent=1
+--FILE--
+?php
+require_once('connect.inc');
+
+function my_connect($offset, $host, $user, $passwd, $db, $port, $socket) {
+   if ($socket)
+   $host = sprintf(%s:%s, $host, $socket);
+   else if ($port)
+   $host = sprintf(%s:%s, $host, $port);
+
+
+   $link = mysql_pconnect($host, $user, $passwd);
+   if (!$link) {
+   printf([%03d] Cannot connect using host '%s', user '%s', 
password '', [%d] 

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_fetch_assoc.phpt mysql_fetch_field.phpt mysql_fetch_object.phpt mysql_list_fields.phpt mysql_result.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:56:33 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_fetch_assoc.phpt 
mysql_fetch_field.phpt 
mysql_fetch_object.phpt 
mysql_list_fields.phpt mysql_result.phpt 
  Log:
  Test changes for HEAD = synching with 5_3
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_assoc.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysql/tests/mysql_fetch_assoc.phpt
diff -u php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.3 
php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.4
--- php-src/ext/mysql/tests/mysql_fetch_assoc.phpt:1.3  Thu Aug  9 11:53:17 2007
+++ php-src/ext/mysql/tests/mysql_fetch_assoc.phpt  Wed Oct 10 10:56:33 2007
@@ -1,8 +1,8 @@
 --TEST--
 mysql_fetch_assoc()
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?
 --FILE--
@@ -46,6 +46,16 @@
 
 mysql_close($link);
 
+include('table.inc');
+if (!$res = mysql_query(SELECT id, label, id AS _id, CONCAT(label, 'a') 
_label, NULL as _foo FROM test _test ORDER BY id ASC LIMIT 1, $link)) {
+   printf([009] [%d] %s\n, mysql_errno($link), $mysql_error($link));
+}
+print [010]\n;
+var_dump(mysql_fetch_assoc($res));
+mysql_free_result($res);
+
+mysql_close($link);
+
 print done!;
 ?
 --EXPECTF--
@@ -73,6 +83,19 @@
 }
 
 Warning: mysql_fetch_assoc(): %d is not a valid MySQL result resource in %s on 
line %d
+[010]
+array(5) {
+  [id]=
+  string(1) 1
+  [label]=
+  string(1) a
+  [_id]=
+  string(1) 1
+  [_label]=
+  string(2) aa
+  [_foo]=
+  NULL
+}
 done!
 --UEXPECTF--
 [005]
@@ -99,4 +122,17 @@
 }
 
 Warning: mysql_fetch_assoc(): %d is not a valid MySQL result resource in %s on 
line %d
+[010]
+array(5) {
+  [uid]=
+  unicode(1) 1
+  [ulabel]=
+  unicode(1) a
+  [u_id]=
+  unicode(1) 1
+  [u_label]=
+  unicode(2) aa
+  [u_foo]=
+  NULL
+}
 done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_fetch_field.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysql/tests/mysql_fetch_field.phpt
diff -u php-src/ext/mysql/tests/mysql_fetch_field.phpt:1.4 
php-src/ext/mysql/tests/mysql_fetch_field.phpt:1.5
--- php-src/ext/mysql/tests/mysql_fetch_field.phpt:1.4  Thu Aug  9 11:53:17 2007
+++ php-src/ext/mysql/tests/mysql_fetch_field.phpt  Wed Oct 10 10:56:33 2007
@@ -1,8 +1,8 @@
 --TEST--
 mysql_fetch_field()
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?
 --FILE--
@@ -21,7 +21,6 @@
 
require('table.inc');
 
-
$version = mysql_get_server_info($link);
if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
printf([003] Cannot get server version\n);
@@ -105,6 +104,32 @@
mysql_free_result($res);
}
 
+   if (!mysql_query(DROP TABLE IF EXISTS test, $link))
+   printf([013] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+
+   if (!mysql_query(CREATE TABLE test(id INT DEFAULT 1)))
+   printf([014] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+
+   if (!mysql_query(INSERT INTO test(id) VALUES (2)))
+   printf([015] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+
+   if (!$res = mysql_query(SELECT id FROM test, $link)) {
+   printf([016] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+   }
+
+   var_dump(mysql_fetch_field($res));
+   mysql_free_result($res);
+
+   if (!$res = mysql_query(SELECT id FROM test, $link)) {
+   printf([017] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+   }
+   $res = mysql_list_fields($db, 'test');
+   while ($tmp = mysql_fetch_field($res))
+   if ($tmp-name == 'id')
+   var_dump($tmp);
+
+   mysql_free_result($res);
+
mysql_close($link);
print done!;
 ?
@@ -170,6 +195,62 @@
 Warning: mysql_fetch_field(): Bad field offset in %s on line %d
 
 Warning: mysql_fetch_field(): %d is not a valid MySQL result resource in %s on 
line %d
+object(stdClass)#%d (13) {
+  [name]=
+  string(2) id
+  [table]=
+  string(4) test
+  [def]=
+  string(0) 
+  [max_length]=
+  int(1)
+  [not_null]=
+  int(0)
+  [primary_key]=
+  int(0)
+  [multiple_key]=
+  int(0)
+  [unique_key]=
+  int(0)
+  [numeric]=
+  int(1)
+  [blob]=
+  int(0)
+  [type]=
+  string(3) int
+  [unsigned]=
+  int(0)
+  [zerofill]=
+  int(0)
+}
+object(stdClass)#%d (13) {
+  [name]=
+  string(2) id
+  [table]=
+  string(4) test
+  [def]=
+  string(1) 1
+  [max_length]=
+  int(0)
+  [not_null]=
+  int(0)
+  [primary_key]=
+  int(0)
+  [multiple_key]=
+  int(0)
+  [unique_key]=
+  int(0)
+  [numeric]=
+  int(1)
+  [blob]=
+  int(0)
+  [type]=
+  string(3) int
+  [unsigned]=
+  int(0)
+  [zerofill]=
+  int(0)
+}
 done!
 --UEXPECTF--
 object(stdClass)#%d (13) {
@@ -233,4 

[PHP-CVS] cvs: php-src /ext/mysqli/tests mysqli_constants.phpt mysqli_get_connection_stats.phpt mysqli_options.phpt mysqli_phpinfo.phpt mysqli_real_connect.phpt mysqli_report.phpt mysqli_set_charset.p

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:51:34 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   mysqli_set_local_infile_default.phpt 

mysqli_set_local_infile_handler_bad_character.phpt 

mysqli_set_local_infile_handler_buffer_overflow.phpt 
mysqli_set_local_infile_handler_closefile.phpt 
mysqli_set_local_infile_handler_close_link.phpt 
mysqli_set_local_infile_handler_kill_link.phpt 

mysqli_set_local_infile_handler_negative_len.phpt 

mysqli_set_local_infile_handler_nested_call.phpt 
mysqli_set_local_infile_handler_new_query.phpt 
mysqli_set_local_infile_handler_nofileop.phpt 
mysqli_set_local_infile_handler.phpt 

mysqli_set_local_infile_handler_replace_buffer.phpt 
mysqli_set_local_infile_handler_short_len.phpt 
mysqli_set_local_infile_handler_unregister.phpt 
mysqli_constants.phpt 
mysqli_get_connection_stats.phpt 
mysqli_options.phpt mysqli_phpinfo.phpt 
mysqli_real_connect.phpt 
mysqli_report.phpt 
mysqli_set_charset.phpt 
mysqli_stmt_attr_set.phpt 
mysqli_stmt_bind_param.phpt 
mysqli_stmt_bind_result_bit.phpt 
mysqli_stmt_bind_result.phpt 
mysqli_stmt_get_warnings.phpt 
mysqli_stmt_init.phpt 
mysqli_stmt_send_long_data.phpt 
  Log:
  More changes = synching HEAD with 5_3
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt
diff -u php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt:1.2 
php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt:1.3
--- php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt:1.2   Thu Aug 
 9 10:01:20 2007
+++ php-src/ext/mysqli/tests/mysqli_set_local_infile_default.phpt   Wed Oct 
10 10:51:34 2007
@@ -1,18 +1,18 @@
 --TEST--
 mysqli_set_local_infile_default()
 --SKIPIF--
-?php 
+?php
 require_once('skipif.inc');
-require_once('skipifemb.inc'); 
+require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
 
 if (!function_exists('mysqli_set_local_infile_handler'))
die(skip - function not available.);
 
 require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-   die(skip - experimental (= unsupported) feature);
 ?
+--INI--
+mysqli.allow_local_infile=1
 --FILE--
 ?php
require_once('connect.inc');
@@ -25,6 +25,10 @@
if (!is_null($tmp = @mysqli_set_local_infile_default($link)))
printf([002] Expecting NULL got %s/%s\n, gettype($tmp), $tmp);
 
+   $link = new mysqli();
+   if (!is_null($tmp = @mysqli_set_local_infile_default($link)))
+   printf([002a] Expecting NULL got %s/%s\n, gettype($tmp), 
$tmp);
+
include(table.inc);
 
if (!is_null($tmp = @mysqli_set_local_infile_default($link, 'foo')))
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt?r1=1.2r2=1.3diff_format=u
Index: 
php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt
diff -u 
php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.2 
php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.3
--- 
php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt:1.2 
Thu Aug  9 10:01:20 2007
+++ php-src/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt 
Wed Oct 10 10:51:34 2007
@@ -1,9 +1,9 @@
 --TEST--
 mysqli_set_local_infile_handler() - random ASCII character including \0
 --SKIPIF--
-?php 
+?php
 require_once('skipif.inc');
-require_once('skipifemb.inc'); 
+require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
 require_once('connect.inc');
 
@@ -12,7 +12,25 @@
 
 if (!$TEST_EXPERIMENTAL)
 die(skip - experimental (= unsupported) feature);
+
+if (!$link = mysqli_connect($host, $user, $passwb, $db, $port, $socket))
+   die(skip Cannot connect to MySQL);
+
+if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE local_infile')) {
+   mysqli_close($link);
+   die(skip Cannot check if Server variable 'local_infile' is set to 
'ON');
+}
+
+$row = mysqli_fetch_assoc($res);
+mysqli_free_result($res);
+mysqli_close($link);
+
+if ('ON' != $row['Value'])
+  

[PHP-CVS] cvs: php-src /ext/mysqli/tests bug42378.phpt mysqli_real_connect_pconn.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 10:54:03 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   bug42378.phpt 
mysqli_real_connect_pconn.phpt 
  Log:
  Should be the last commit for HEAD. Now HEAD and 5_3 should have the latest
  set of ext/mysqli tests. On Linux 32bit we've about 10 tests failing. 
  Before the commit we had about 20 tests failing with HEAD.
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug42378.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysqli/tests/bug42378.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug42378.phpt:1.2
--- /dev/null   Wed Oct 10 10:54:03 2007
+++ php-src/ext/mysqli/tests/bug42378.phpt  Wed Oct 10 10:54:02 2007
@@ -0,0 +1,193 @@
+--TEST--
+SELECT column, FORMAT(...) AS _format
+--SKIPIF--
+?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?
+--INI--
+memory_limit=83886080
+--FILE--
+?php
+   require_once(connect.inc);
+
+   function create_table($link, $column, $min, $max, $engine, $offset) {
+
+   if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
+   printf([%03d] Cannot drop table test, [%d] %s\n,
+   $offset,
+   mysqli_errno($link), mysqli_error($link));
+   return array();
+   }
+   print $column\n;
+
+   $sql = sprintf(CREATE TABLE test(id INT AUTO_INCREMENT PRIMARY 
KEY, col1 %s) ENGINE=%s,
+   $column, $engine);
+   if (!mysqli_query($link, $sql)) {
+   printf([%03d] Cannot create table test, [%d] %s\n,
+   $offset + 1,
+   mysqli_errno($link), mysqli_error($link));
+   return array();
+   }
+
+   $values = array();
+   for ($i = 1; $i = 100; $i++) {
+   $col1 = mt_rand($min, $max);
+   $values[$i] = $col1;
+   $sql = sprintf(INSERT INTO test(id, col1) VALUES (%d, 
%f),
+   $i, $col1);
+   if (!mysqli_query($link, $sql)) {
+   printf([%03d] Cannot insert data, [%d] %s\n,
+   $offset + 2,
+   mysqli_errno($link), 
mysqli_error($link));
+   return array();
+   }
+   }
+
+   return $values;
+   }
+
+   function test_format($link, $format, $from, $order_by, $expected, 
$offset) {
+
+   if (!$stmt = mysqli_stmt_init($link)) {
+   printf([%03d] Cannot create PS, [%d] %s\n,
+   $offset,
+   mysqli_errno($link), mysqli_error($link));
+   return false;
+   }
+   print $format\n;
+
+   if ($order_by)
+   $sql = sprintf('SELECT %s AS _format FROM %s ORDER BY 
%s', $format, $from, $order_by);
+   else
+   $sql = sprintf('SELECT %s AS _format FROM %s', $format, 
$from);
+
+   if (!mysqli_stmt_prepare($stmt, $sql)) {
+   printf([%03d] Cannot prepare PS, [%d] %s\n,
+   $offset + 1,
+   mysqli_stmt_errno($stmt), 
mysqli_stmt_error($stmt));
+   return false;
+   }
+
+   if (!mysqli_stmt_execute($stmt)) {
+   printf([%03d] Cannot execute PS, [%d] %s\n,
+   $offset + 2,
+   mysqli_stmt_errno($stmt), 
mysqli_stmt_error($stmt));
+   return false;
+   }
+
+   if (!mysqli_stmt_store_result($stmt)) {
+   printf([%03d] Cannot store result set, [%d] %s\n,
+   $offset + 3,
+   mysqli_stmt_errno($stmt), 
mysqli_stmt_error($stmt));
+   return false;
+   }
+
+   if (!is_array($expected)) {
+
+   $result = null;
+   if (!mysqli_stmt_bind_result($stmt, $result)) {
+   printf([%03d] Cannot bind result, [%d] %s\n,
+   $offset + 4,
+   mysqli_stmt_errno($stmt), 
mysqli_stmt_error($stmt));
+   return false;
+   }
+
+   if (!mysqli_stmt_fetch($stmt)) {
+   printf([%03d] Cannot fetch result,, [%d] %s\n,
+   $offset + 5,
+   mysqli_stmt_errno($stmt), 
mysqli_stmt_error($stmt));
+  

[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:44:30 2007 UTC

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  - Use correct definition
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.106r2=1.107diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.106 
php-src/ext/standard/streamsfuncs.c:1.107
--- php-src/ext/standard/streamsfuncs.c:1.106   Sun Oct  7 05:15:06 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:44:29 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.106 2007/10/07 05:15:06 davidw Exp $ */
+/* $Id: streamsfuncs.c,v 1.107 2007/10/10 12:44:29 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -656,7 +656,7 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   int this_fd, ret = 0;
+   php_socket_t this_fd, ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:44:46 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.2r2=1.58.2.6.2.15.2.3diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.2 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.2   Sun Oct  7 
05:22:07 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:44:46 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.2 2007/10/07 05:22:07 davidw Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.3 2007/10/10 12:44:46 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -608,7 +608,7 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   int this_fd, ret = 0;
+   php_socket_t this_fd, ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
@@ -1399,8 +1399,8 @@
 
RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how 
TSRMLS_CC) == 0);
 }
-#endif
 /* }}} */
+#endif
 
 /*
  * Local variables:

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



[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:51:06 2007 UTC

  Modified files:  
/php-src/ext/standard   streamsfuncs.c 
  Log:
  ret is still int
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.107r2=1.108diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.107 
php-src/ext/standard/streamsfuncs.c:1.108
--- php-src/ext/standard/streamsfuncs.c:1.107   Wed Oct 10 12:44:29 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:51:06 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.107 2007/10/10 12:44:29 jani Exp $ */
+/* $Id: streamsfuncs.c,v 1.108 2007/10/10 12:51:06 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -656,7 +656,8 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   php_socket_t this_fd, ret = 0;
+   php_socket_t this_fd;
+   int ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard streamsfuncs.c

2007-10-10 Thread Jani Taskinen
janiWed Oct 10 12:58:42 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   streamsfuncs.c 
  Log:
  MFH
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.3r2=1.58.2.6.2.15.2.4diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.4
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.3   Wed Oct 10 
12:44:46 2007
+++ php-src/ext/standard/streamsfuncs.c Wed Oct 10 12:58:41 2007
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.3 2007/10/10 12:44:46 jani Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.4 2007/10/10 12:58:41 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -574,6 +574,7 @@
zval **elem;
php_stream *stream;
php_socket_t this_fd;
+   int cnt = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
@@ -598,9 +599,10 @@
if (this_fd  *max_fd) {
*max_fd = this_fd;
}
+   cnt++;
}
}
-   return 1;
+   return cnt ? 1 : 0;
 }
 
 static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
@@ -608,7 +610,8 @@
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
-   php_socket_t this_fd, ret = 0;
+   php_socket_t this_fd;
+   int ret = 0;
 
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests 061.phpt bug31668.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 14:31:29 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   061.phpt bug31668.phpt 
  Log:
  Version specific EXPECF sections would be wonderful (bug31668.phpt).
  And sometimes it helps to read the commit messages to keep tests up to date:
  we removed mysqli_set_local_infile_handler() from mysqlnd (061.phpt) some 
  time ago.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/061.phpt?r1=1.5.4.1.2.1r2=1.5.4.1.2.2diff_format=u
Index: php-src/ext/mysqli/tests/061.phpt
diff -u php-src/ext/mysqli/tests/061.phpt:1.5.4.1.2.1 
php-src/ext/mysqli/tests/061.phpt:1.5.4.1.2.2
--- php-src/ext/mysqli/tests/061.phpt:1.5.4.1.2.1   Wed Oct 10 10:10:14 2007
+++ php-src/ext/mysqli/tests/061.phpt   Wed Oct 10 14:31:28 2007
@@ -1,9 +1,11 @@
 --TEST--
 local infile handler
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
+if (!function_exists('mysqli_set_local_infile_handler'))
+   die(skip - function not available.);
 ?
 --FILE--
 ?php
@@ -58,4 +60,4 @@
 unicode-unicode
 rab-oof
 unicode-unicode
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug31668.phpt?r1=1.2.4.1.2.1r2=1.2.4.1.2.2diff_format=u
Index: php-src/ext/mysqli/tests/bug31668.phpt
diff -u php-src/ext/mysqli/tests/bug31668.phpt:1.2.4.1.2.1 
php-src/ext/mysqli/tests/bug31668.phpt:1.2.4.1.2.2
--- php-src/ext/mysqli/tests/bug31668.phpt:1.2.4.1.2.1  Wed Oct 10 10:10:59 2007
+++ php-src/ext/mysqli/tests/bug31668.phpt  Wed Oct 10 14:31:28 2007
@@ -1,10 +1,12 @@
 --TEST--
 Bug #31668 (multi_query works exactly every other time (multi_query was 
global, now per connection))
 --SKIPIF--
-?php 
-require_once('skipif.inc'); 
+?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?
+--INI--
+error_reporting = E_ALL  ~E_STRICT
 --FILE--
 ?php
include connect.inc;

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



[PHP-CVS] cvs: php-src /ext/odbc php_odbc.c

2007-10-10 Thread Andrey Hristov
andrey  Wed Oct 10 14:32:01 2007 UTC

  Modified files:  
/php-src/ext/odbc   php_odbc.c 
  Log:
  MFB and unify code
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.204r2=1.205diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.204 php-src/ext/odbc/php_odbc.c:1.205
--- php-src/ext/odbc/php_odbc.c:1.204   Sun Oct  7 05:15:04 2007
+++ php-src/ext/odbc/php_odbc.c Wed Oct 10 14:32:01 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.204 2007/10/07 05:15:04 davidw Exp $ */
+/* $Id: php_odbc.c,v 1.205 2007/10/10 14:32:01 andrey Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1567,8 +1567,7 @@
result-fetched++;
 
for(i = 0; i  result-numcols; i++) {
-   ALLOC_ZVAL(tmp);
-   Z_SET_REFCOUNT_P(tmp, 1);
+   MAKE_STD_ZVAL(tmp);
Z_TYPE_P(tmp) = IS_STRING;
Z_STRLEN_P(tmp) = 0;
sql_c_type = SQL_C_CHAR;

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/odbc php_odbc.c

2007-10-10 Thread Andrey Hristov
andrey  Wed Oct 10 14:29:27 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/odbc   php_odbc.c 
  Log:
  Fix ODBC, the GC patch missed this one leading to compilation failure.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.1r2=1.189.2.4.2.7.2.2diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.1 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.2
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.1   Thu Sep 27 18:00:41 2007
+++ php-src/ext/odbc/php_odbc.c Wed Oct 10 14:29:27 2007
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.1 2007/09/27 18:00:41 dmitry Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.2 2007/10/10 14:29:27 andrey Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1573,8 +1573,7 @@
result-fetched++;
 
for(i = 0; i  result-numcols; i++) {
-   ALLOC_ZVAL(tmp);
-   tmp-refcount = 1;
+   MAKE_STD_ZVAL(tmp);
Z_TYPE_P(tmp) = IS_STRING;
Z_STRLEN_P(tmp) = 0;
sql_c_type = SQL_C_CHAR;

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests mysqli_stmt_field_count.phpt

2007-10-10 Thread Ulf Wendel
uw  Wed Oct 10 15:04:59 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqli/tests   mysqli_stmt_field_count.phpt 
  Log:
  Fixing the test. Might the PHP 5.2 run-tests.php have fooled me? I could 
swear, 
  I saw this test passing with 5.2 before...
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt?r1=1.2.2.2r2=1.2.2.3diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt
diff -u php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt:1.2.2.2 
php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt:1.2.2.3
--- php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt:1.2.2.2   Wed Oct 
10 10:18:50 2007
+++ php-src/ext/mysqli/tests/mysqli_stmt_field_count.phpt   Wed Oct 10 
15:04:59 2007
@@ -88,6 +88,8 @@
 Warning: mysqli_stmt_field_count(): invalid object or resource mysqli_stmt
  in %s on line %d
 
+Warning: mysqli_stmt_bind_param(): Number of variables doesn't match number of 
parameters in prepared statement in %s on line %d
+
 Warning: mysqli_stmt_prepare(): Couldn't fetch mysqli_stmt in %s on line %d
 
 Warning: mysqli_stmt_field_count(): Couldn't fetch mysqli_stmt in %s on line %d

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqli/tests mysqli_stmt_field_count.phpt

2007-10-10 Thread Antony Dovgal
On 10.10.2007 19:04, Ulf Wendel wrote:
 uwWed Oct 10 15:04:59 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/mysqli/tests mysqli_stmt_field_count.phpt 
   Log:
   Fixing the test. Might the PHP 5.2 run-tests.php have fooled me? I could 
 swear, 
   I saw this test passing with 5.2 before...

Most likely it's caused by the recent change in '%s' behavior:
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.34r2=1.226.2.37.2.35

-- 
Wbr, 
Antony Dovgal

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



Re: [PHP-CVS] cvs: php-src /ext/standard/tests/strings nl2br_error.phpt nl2br_variation1.phpt nl2br_variation2.phpt nl2br_variation3.phpt nl2br_variation4.phpt nl2br_variation5.phpt

2007-10-10 Thread Marcus Boerger
Hello Raghubansh,

Monday, October 8, 2007, 2:55:11 PM, you wrote:

 Hi Marcus,
 maybe safe a few keystrokes and go with the suggested *_001 instead or
*_variation1 style.
 Did you mean that we name the testcases without indicating *variationcount
 or you mean, we should name the testcases *variation_001.phpt rather than *
 variation1.phpt ?

More or less the latter (name_001.phpt instead of name_variation1.phpt), as
it is shorter :-)

marcus

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



Re: [PHP-CVS] cvs: php-src /ext/standard/tests/strings strcspn_basic.phpt wordwrap_variation3.phpt

2007-10-10 Thread Marcus Boerger
Hello Raghubansh,

Tuesday, October 9, 2007, 1:58:52 PM, you wrote:

 kraghubaTue Oct  9 11:58:52 2007 UTC

   Modified files:  
 /php-src/ext/standard/tests/strings wordwrap_variation3.phpt 
 strcspn_basic.phpt 
   Log:
   added unicode output
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/wordwrap_variation3.phpt?r1=1.2r2=1.3diff_format=u
 Index: php-src/ext/standard/tests/strings/wordwrap_variation3.phpt
 diff -u php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.2
 php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.3
 --- php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.2 Fri 
 Sep 14 19:09:11 2007
 +++ php-src/ext/standard/tests/strings/wordwrap_variation3.phpt Tue Oct  9 
 11:58:52 2007
 @@ -300,3 +300,203 @@
  Warning: wordwrap(): Break string cannot be empty in %s on line %d
  bool(false)
  Done
 +--UEXPECTF--
 +--UEXPECTF--

Isn't this duplication causing trouble?

Best regards,
 Marcus

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard url_scanner_ex.c

2007-10-10 Thread Marcus Boerger
Hello Jani,

  how about requiring 0.12.2 or even 0.12.3?

marcus

Wednesday, October 10, 2007, 11:28:51 AM, you wrote:

 janiWed Oct 10 09:28:51 2007 UTC

   Modified files:  (Branch: PHP_5_2)
 /php-src/ext/standard   url_scanner_ex.c 
   Log:
   - Generated with more recent re2c version
   



Best regards,
 Marcus

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



[PHP-CVS] cvs: php-src(PHP_5_3) /main safe_mode.c

2007-10-10 Thread Robert Thompson
ab5602  Wed Oct 10 22:52:59 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   safe_mode.c 
  Log:
  
  Fix for bug 41899, safe mode and relative paths with Solaris's broken 
getcwd().
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/safe_mode.c?r1=1.62.2.1.2.10r2=1.62.2.1.2.10.2.1diff_format=u
Index: php-src/main/safe_mode.c
diff -u php-src/main/safe_mode.c:1.62.2.1.2.10 
php-src/main/safe_mode.c:1.62.2.1.2.10.2.1
--- php-src/main/safe_mode.c:1.62.2.1.2.10  Sun Sep 23 15:19:21 2007
+++ php-src/main/safe_mode.cWed Oct 10 22:52:58 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: safe_mode.c,v 1.62.2.1.2.10 2007/09/23 15:19:21 iliaa Exp $ */
+/* $Id: safe_mode.c,v 1.62.2.1.2.10.2.1 2007/10/10 22:52:58 ab5602 Exp $ */
 
 #include php.h
 
@@ -86,7 +86,15 @@
 * If that fails, passthrough and check directory...
 */
if (mode != CHECKUID_ALLOW_ONLY_DIR) {
-   expand_filepath(filename, path TSRMLS_CC);
+
+char ftest[MAXPATHLEN];
+strcpy(ftest,filename);
+if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
+strcpy(path,filename);
+} else {
+expand_filepath(filename, path TSRMLS_CC);
+}
+
ret = VCWD_STAT(path, sb);
if (ret  0) {
if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) {

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



[PHP-CVS] cvs: php-src /main network.c php_network.h

2007-10-10 Thread Elizabeth Marie Smith
auroraeosrose   Wed Oct 10 23:23:54 2007 UTC

  Modified files:  
/php-src/main   network.c php_network.h 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/main/network.c?r1=1.127r2=1.128diff_format=u
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.127 php-src/main/network.c:1.128
--- php-src/main/network.c:1.127Wed Jul 18 09:04:37 2007
+++ php-src/main/network.c  Wed Oct 10 23:23:54 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: network.c,v 1.127 2007/07/18 09:04:37 jani Exp $ */
+/* $Id: network.c,v 1.128 2007/10/10 23:23:54 auroraeosrose Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 
@@ -90,6 +90,9 @@
 # define SOCK_ERR INVALID_SOCKET
 # define SOCK_CONN_ERR SOCKET_ERROR
 # define PHP_TIMEOUT_ERROR_VALUE   WSAETIMEDOUT
+
+struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */
+
 #else
 # define SOCK_ERR -1
 # define SOCK_CONN_ERR -1
http://cvs.php.net/viewvc.cgi/php-src/main/php_network.h?r1=1.58r2=1.59diff_format=u
Index: php-src/main/php_network.h
diff -u php-src/main/php_network.h:1.58 php-src/main/php_network.h:1.59
--- php-src/main/php_network.h:1.58 Mon Jan  1 09:29:35 2007
+++ php-src/main/php_network.h  Wed Oct 10 23:23:54 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_network.h,v 1.58 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: php_network.h,v 1.59 2007/10/10 23:23:54 auroraeosrose Exp $ */
 
 #ifndef _PHP_NETWORK_H
 #define _PHP_NETWORK_H
@@ -121,12 +121,14 @@
 
 PHPAPI int php_poll2(php_pollfd *ufds, unsigned int nfds, int timeout);
 
+#ifndef POLLIN
 # define POLLIN  0x0001/* There is data to read */
 # define POLLPRI 0x0002/* There is urgent data to read */
 # define POLLOUT 0x0004/* Writing now will not block */
 # define POLLERR 0x0008/* Error condition */
 # define POLLHUP 0x0010/* Hung up */
 # define POLLNVAL0x0020/* Invalid request: fd not open */
+#endif
 
 # ifndef PHP_USE_POLL_2_EMULATION
 #  define PHP_USE_POLL_2_EMULATION 1

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main safe_mode.c

2007-10-10 Thread Robert Thompson
ab5602  Wed Oct 10 23:54:39 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main   safe_mode.c 
  Log:
  
  Fix for bug 41899, safe mode and relative paths with Solaris's broken 
getcwd().
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/safe_mode.c?r1=1.62.2.1.2.10r2=1.62.2.1.2.11diff_format=u
Index: php-src/main/safe_mode.c
diff -u php-src/main/safe_mode.c:1.62.2.1.2.10 
php-src/main/safe_mode.c:1.62.2.1.2.11
--- php-src/main/safe_mode.c:1.62.2.1.2.10  Sun Sep 23 15:19:21 2007
+++ php-src/main/safe_mode.cWed Oct 10 23:54:39 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: safe_mode.c,v 1.62.2.1.2.10 2007/09/23 15:19:21 iliaa Exp $ */
+/* $Id: safe_mode.c,v 1.62.2.1.2.11 2007/10/10 23:54:39 ab5602 Exp $ */
 
 #include php.h
 
@@ -86,7 +86,15 @@
 * If that fails, passthrough and check directory...
 */
if (mode != CHECKUID_ALLOW_ONLY_DIR) {
-   expand_filepath(filename, path TSRMLS_CC);
+
+char ftest[MAXPATHLEN];
+strcpy(ftest,filename);
+if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
+strcpy(path,filename);
+} else {
+expand_filepath(filename, path TSRMLS_CC);
+}
+
ret = VCWD_STAT(path, sb);
if (ret  0) {
if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) {

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard var.c

2007-10-10 Thread Marcus Boerger
helly   Thu Oct 11 01:03:03 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   var.c 
  Log:
  - MFH debug object helper
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.203.2.7.2.18.2.1r2=1.203.2.7.2.18.2.2diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.203.2.7.2.18.2.1 
php-src/ext/standard/var.c:1.203.2.7.2.18.2.2
--- php-src/ext/standard/var.c:1.203.2.7.2.18.2.1   Sun Oct  7 05:22:07 2007
+++ php-src/ext/standard/var.c  Thu Oct 11 01:03:03 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: var.c,v 1.203.2.7.2.18.2.1 2007/10/07 05:22:07 davidw Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.18.2.2 2007/10/11 01:03:03 helly Exp $ */
 
 
 
@@ -98,6 +98,7 @@
char *class_name;
zend_uint class_name_len;
int (*php_element_dump_func)(zval**, int, va_list, zend_hash_key*);
+   int is_temp;
 
if (level  1) {
php_printf(%*c, level - 1, ' ');
@@ -129,9 +130,10 @@
}
php_printf(%sarray(%d) {\n, COMMON, 
zend_hash_num_elements(myht));
php_element_dump_func = php_array_element_dump;
+   is_temp = 0;
goto head_done;
case IS_OBJECT:
-   myht = Z_OBJPROP_PP(struc);
+   myht = Z_OBJDEBUG_PP(struc, is_temp);
if (myht  myht-nApplyCount  1) {
PUTS(*RECURSION*\n);
return;
@@ -144,6 +146,10 @@
 head_done:
if (myht) {
zend_hash_apply_with_arguments(myht, 
(apply_func_args_t) php_element_dump_func, 1, level);
+   if (is_temp) {
+   zend_hash_destroy(myht);
+   efree(myht);
+   }
}
if (level  1) {
php_printf(%*c, level-1, ' ');

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/simplexml simplexml.c

2007-10-10 Thread Marcus Boerger
helly   Thu Oct 11 01:03:19 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/simplexml  simplexml.c 
  Log:
  - MFH debug object helper
  http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.35.2.2r2=1.151.2.22.2.35.2.3diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.2 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.3
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.35.2.2   Sun Oct  7 
05:22:06 2007
+++ php-src/ext/simplexml/simplexml.c   Thu Oct 11 01:03:19 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.35.2.2 2007/10/07 05:22:06 davidw Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.35.2.3 2007/10/11 01:03:19 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -136,7 +136,7 @@
 static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, long offset, 
xmlNodePtr node, long *cnt) /* {{{ */
 {
long nodendx = 0;
-   
+
if (sxe-iter.type == SXE_ITER_NONE) {
if (offset == 0) {
if (cnt) {
@@ -161,7 +161,7 @@
 next_iter:
node = node-next;
}
-   
+
if (cnt) {
*cnt = nodendx;
}
@@ -275,7 +275,7 @@
 
if (sxe-iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
-   elements = 0;   
+   elements = 0;
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
attr = (xmlAttrPtr)node;
test = sxe-iter.name != NULL;
@@ -337,7 +337,7 @@
}
} else if (member) {
node = sxe_get_element_by_offset(sxe, 
Z_LVAL_P(member), node, cnt);
-   } else {
+   } else {
node = NULL;
}
if (node) {
@@ -502,7 +502,7 @@
 
if (sxe-iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
-   elements = 0;   
+   elements = 0;
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
attr = (xmlAttrPtr)node;
test = sxe-iter.name != NULL;
@@ -639,7 +639,7 @@
if (!node) {
if (!member || Z_TYPE_P(member) == IS_LONG) {
newnode = 
xmlNewTextChild(mynode-parent, mynode-ns, mynode-name, value ? (xmlChar 
*)Z_STRVAL_P(value) : NULL);
-   } else {
+   } else {
newnode = xmlNewTextChild(mynode, 
mynode-ns, (xmlChar *)Z_STRVAL_P(member), value ? (xmlChar *)Z_STRVAL_P(value) 
: NULL);
}
} else if (!member || Z_TYPE_P(member) == IS_LONG) {
@@ -711,6 +711,9 @@
_node_as_zval(sxe, node, return_value, type, name, sxe-iter.nsprefix, 
sxe-iter.isprefix TSRMLS_CC);
 
sxe = php_sxe_fetch_object(return_value TSRMLS_CC);
+   if (sxe-tmp) {
+   zval_ptr_dtor(sxe-tmp);
+   }
sxe-tmp = return_value;
Z_SET_ISREF_P(return_value);
 
@@ -752,7 +755,7 @@
 
if (sxe-iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
-   elements = 0;   
+   elements = 0;
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
attr = (xmlAttrPtr)node;
test = sxe-iter.name != NULL;
@@ -814,7 +817,7 @@
}
if (node) {
exists = 1;
-if (check_empty == 1  
+if (check_empty == 1 
(!node-children || 
(node-children-type == XML_TEXT_NODE  !node-children-next 
(!node-children-content || 
!node-children-content[0] || !xmlStrcmp(node-children-content, 0 ) {
exists = 0;
@@ -882,7 +885,7 @@
 
if (sxe-iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
-   elements = 0;   
+   elements = 0;
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
attr = (xmlAttrPtr)node;
test = sxe-iter.name != NULL;
@@ -978,7 +981,7 @@
char*res = estrdup((char*)tmp);
 
xmlFree(tmp);
-   
+
return res;
 }
 
@@ -1038,9 +1041,9 @@
}
 }
 
-/* {{{ sxe_properties_get()
+/* {{{ sxe_get_prop_hash()
  */
-static HashTable * sxe_properties_get(zval *object TSRMLS_DC)

Re: [PHP-CVS] cvs: php-src /ext/standard/tests/strings strcspn_basic.phpt wordwrap_variation3.phpt

2007-10-10 Thread Raghubansh
Hi Marcus, Thats fixed now. Thanks

On 10/10/07, Marcus Boerger [EMAIL PROTECTED] wrote:

 Hello Raghubansh,

 Tuesday, October 9, 2007, 1:58:52 PM, you wrote:

  kraghubaTue Oct  9 11:58:52 2007 UTC

Modified files:
  /php-src/ext/standard/tests/strings wordwrap_variation3.phpt
  strcspn_basic.phpt
Log:
added unicode output
 
 
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/wordwrap_variation3.phpt?r1=1.2r2=1.3diff_format=u
  Index: php-src/ext/standard/tests/strings/wordwrap_variation3.phpt
  diff -u php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.2
  php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.3
  --- php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.2
 Fri Sep 14 19:09:11 2007
  +++ php-src/ext/standard/tests/strings/wordwrap_variation3.phpt Tue
 Oct  9 11:58:52 2007
  @@ -300,3 +300,203 @@
   Warning: wordwrap(): Break string cannot be empty in %s on line %d
   bool(false)
   Done
  +--UEXPECTF--
  +--UEXPECTF--

 Isn't this duplication causing trouble?

 Best regards,
 Marcus

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




-- 
with Regards,
Raghubansh


[PHP-CVS] cvs: php-src /ext/standard/tests/strings wordwrap_variation3.phpt

2007-10-10 Thread Raghubansh Kumar
kraghubaThu Oct 11 03:17:08 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings wordwrap_variation3.phpt 
  Log:
  fix test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/wordwrap_variation3.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/wordwrap_variation3.phpt
diff -u php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.3 
php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.4
--- php-src/ext/standard/tests/strings/wordwrap_variation3.phpt:1.3 Tue Oct 
 9 11:58:52 2007
+++ php-src/ext/standard/tests/strings/wordwrap_variation3.phpt Thu Oct 11 
03:17:08 2007
@@ -301,7 +301,6 @@
 bool(false)
 Done
 --UEXPECTF--
---UEXPECTF--
 *** Testing wordwrap() : usage variations ***
 
 --- Testing wordwrap() by supplying different values for 'break' argument ---

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main safe_mode.c

2007-10-10 Thread Antony Dovgal
On 11.10.2007 02:52, Robert Thompson wrote:
 ab5602Wed Oct 10 22:52:59 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/main safe_mode.c 
   Log:
   
   Fix for bug 41899, safe mode and relative paths with Solaris's broken 
 getcwd().

Please do not commit such things without discussing them on the list or in IRC.
Btw, you have problems with whitespaces in the patch.

 @@ -86,7 +86,15 @@
* If that fails, passthrough and check directory...
*/
   if (mode != CHECKUID_ALLOW_ONLY_DIR) {
 - expand_filepath(filename, path TSRMLS_CC);
 +
 +char ftest[MAXPATHLEN];
 +strcpy(ftest,filename);
 +if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
 +strcpy(path,filename);
 +} else {
 +expand_filepath(filename, path TSRMLS_CC);
 +}
 +
   ret = VCWD_STAT(path, sb);
   if (ret  0) {
   if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) {
 


-- 
Wbr, 
Antony Dovgal

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