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

2007-04-23 Thread Georg Richter
Antony Dovgal wrote:

Tony,

why do you set reconnect as default? If someone needs to reconnect, he
should set mysqli.reconnect.

Your change will break BC: mysql_ping now tries to reconnect
automatically which has bad side effects: Several values of the
connection are reset and the php application doesn't know about.

Please revert!

/Georg
-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

-- 
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/mysqli mysqli_nonapi.c

2007-04-23 Thread Georg Richter
Antony Dovgal wrote:
 
 No, my change was supposed to make the function behave as documented.
 The BC has been broken long before, in MySQL API.

This change is documented in mysql api documentation - however we need
to update PHP docs.

/Georg
-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

-- 
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) /ext/ncurses ncurses.c

2007-04-11 Thread Georg Richter
georg   Wed Apr 11 18:37:16 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/ncursesncurses.c 
  Log:
  added support for HOME and END key
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ncurses/ncurses.c?r1=1.30.2.1.2.2r2=1.30.2.1.2.3diff_format=u
Index: php-src/ext/ncurses/ncurses.c
diff -u php-src/ext/ncurses/ncurses.c:1.30.2.1.2.2 
php-src/ext/ncurses/ncurses.c:1.30.2.1.2.3
--- php-src/ext/ncurses/ncurses.c:1.30.2.1.2.2  Fri Jan 12 12:17:32 2007
+++ php-src/ext/ncurses/ncurses.c   Wed Apr 11 18:37:15 2007
@@ -98,11 +98,12 @@
PHP_NCURSES_CONST(KEY_UP);
PHP_NCURSES_CONST(KEY_LEFT);
PHP_NCURSES_CONST(KEY_RIGHT);
+   PHP_NCURSES_CONST(KEY_HOME);
+   PHP_NCURSES_CONST(KEY_END);
PHP_NCURSES_CONST(KEY_BACKSPACE);
PHP_NCURSES_CONST(KEY_MOUSE);
PHP_NCURSES_CONST(KEY_F0);
 
-
/* TODO:this macro sux, we have 65 function key,
   so we need a little loop */
PHP_NCURSES_FKEY_CONST(1);

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2007-01-05 Thread Georg Richter
georg   Sat Jan  6 05:50:36 2007 UTC

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  merged from 5_2 (mysqli_info crash)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.141r2=1.142diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.141 
php-src/ext/mysqli/mysqli_api.c:1.142
--- php-src/ext/mysqli/mysqli_api.c:1.141   Tue Jan  2 05:49:05 2007
+++ php-src/ext/mysqli/mysqli_api.c Sat Jan  6 05:50:36 2007
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.141 2007/01/02 05:49:05 georg Exp $ 
+  $Id: mysqli_api.c,v 1.142 2007/01/06 05:50:36 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1099,7 +1099,7 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link, 
MYSQLI_STATUS_VALID);
 
-   RETURN_UTF8_STRING(mysql-mysql-info, ZSTR_DUPLICATE);
+   RETURN_UTF8_STRING((mysql-mysql-info) ? mysql-mysql-info : , 
ZSTR_DUPLICATE);
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2007-01-01 Thread Georg Richter
georg   Tue Jan  2 05:49:05 2007 UTC

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fixed parameters for unicode in mysqli_change_user
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.140r2=1.141diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.140 
php-src/ext/mysqli/mysqli_api.c:1.141
--- php-src/ext/mysqli/mysqli_api.c:1.140   Mon Jan  1 09:29:25 2007
+++ php-src/ext/mysqli/mysqli_api.c Tue Jan  2 05:49:05 2007
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.140 2007/01/01 09:29:25 sebastian Exp $ 
+  $Id: mysqli_api.c,v 1.141 2007/01/02 05:49:05 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -403,7 +403,6 @@
 }
 /* }}} */
 
-
 /* {{{ proto bool mysqli_change_user(object link, string user, string 
password, string database) U
Change logged-in user of the active connection */
 PHP_FUNCTION(mysqli_change_user)
@@ -414,7 +413,7 @@
int user_len, password_len, dbname_len;
ulong   rc;
 
-   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Osss, mysql_link, mysqli_link_class_entry, 
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Osss, mysql_link, mysqli_link_class_entry, 
user, 
user_len, UG(utf8_conv), password, password_len, UG(utf8_conv),

dbname, dbname_len, UG(utf8_conv)) == FAILURE) {
return;
@@ -432,7 +431,6 @@
 }
 /* }}} */
 
-
 /* {{{ proto string mysqli_character_set_name(object link) U
Returns the name of the character set used for this connection */
 PHP_FUNCTION(mysqli_character_set_name)

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



[PHP-CVS] cvs: php-src /ext/mysql php_mysql.c

2006-11-19 Thread Georg Richter
georg   Sun Nov 19 12:10:19 2006 UTC

  Modified files:  
/php-src/ext/mysql  php_mysql.c 
  Log:
  added unicode support for ext/mysql
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.226r2=1.227diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.226 php-src/ext/mysql/php_mysql.c:1.227
--- php-src/ext/mysql/php_mysql.c:1.226 Sun Oct  8 13:34:22 2006
+++ php-src/ext/mysql/php_mysql.c   Sun Nov 19 12:10:19 2006
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.226 2006/10/08 13:34:22 bjori Exp $ */
+/* $Id: php_mysql.c,v 1.227 2006/11/19 12:10:19 georg Exp $ */
 
 /* TODO:
  *
@@ -473,6 +473,7 @@
 static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, 
*tmp=NULL, *host=NULL;
+   int  user_len, passwd_len, host_len;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
int client_flags = 0;
@@ -480,7 +481,6 @@
 #if MYSQL_VERSION_ID = 32230
void (*handler) (int);
 #endif
-   zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL, **z_new_link=NULL, 
**z_client_flags=NULL;
zend_bool free_host=0, new_link=0;
long connect_timeout;
 
@@ -521,95 +521,22 @@
user = MySG(default_user);
passwd = MySG(default_password);

-   switch(ZEND_NUM_ARGS()) {
-   case 0: /* defaults */
-   break;
-   case 1: {   
-   if (zend_get_parameters_ex(1, 
z_host)==FAILURE) {
-   MYSQL_DO_CONNECT_RETURN_FALSE();
-   }
-   }
-   break;
-   case 2: {
-   if (zend_get_parameters_ex(2, z_host, 
z_user)==FAILURE) {
-   MYSQL_DO_CONNECT_RETURN_FALSE();
-   }
-   convert_to_string_ex(z_user);
-   user = Z_STRVAL_PP(z_user);
-   }
-   break;
-   case 3: {
-   if (zend_get_parameters_ex(3, z_host, 
z_user, z_passwd) == FAILURE) {
-   MYSQL_DO_CONNECT_RETURN_FALSE();
-   }
-   convert_to_string_ex(z_user);
-   convert_to_string_ex(z_passwd);
-   user = Z_STRVAL_PP(z_user);
-   passwd = Z_STRVAL_PP(z_passwd);
-   }
-   break;
-   case 4: {
-   if (!persistent) {
-   if (zend_get_parameters_ex(4, 
z_host, z_user, z_passwd, z_new_link) == FAILURE) {
-   
MYSQL_DO_CONNECT_RETURN_FALSE();
-   }
-   convert_to_string_ex(z_user);
-   convert_to_string_ex(z_passwd);
-   
convert_to_boolean_ex(z_new_link);
-   user = Z_STRVAL_PP(z_user);
-   passwd = Z_STRVAL_PP(z_passwd);
-   new_link = 
Z_BVAL_PP(z_new_link);
-   }
-   else {
-   if (zend_get_parameters_ex(4, 
z_host, z_user, z_passwd, z_client_flags) == FAILURE) {
-   
MYSQL_DO_CONNECT_RETURN_FALSE();
-   }
-   convert_to_string_ex(z_user);
-   convert_to_string_ex(z_passwd);
-   
convert_to_long_ex(z_client_flags);
-   user = Z_STRVAL_PP(z_user);
-   passwd = Z_STRVAL_PP(z_passwd);
-   client_flags = 
Z_LVAL_PP(z_client_flags);
-   }
-   }
-   break;
-   case 5: {
-   if 

[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c mysqli_nonapi.c

2006-10-31 Thread Georg Richter
georg   Tue Oct 31 15:23:16 2006 UTC

  Modified files:  
/php-src/ext/mysqli mysqli_nonapi.c mysqli_api.c 
  Log:
  Fixed function headers (added missing U)
  fixed socket parameter (was removed by mistake in a previous commit)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.66r2=1.67diff_format=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.66 
php-src/ext/mysqli/mysqli_nonapi.c:1.67
--- php-src/ext/mysqli/mysqli_nonapi.c:1.66 Sat Oct  7 18:24:51 2006
+++ php-src/ext/mysqli/mysqli_nonapi.c  Tue Oct 31 15:23:16 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.66 2006/10/07 18:24:51 iliaa Exp $ 
+  $Id: mysqli_nonapi.c,v 1.67 2006/10/31 15:23:16 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -52,6 +52,10 @@
return;
}
 
+   if (!socket_len) {
+   socket = NULL;
+   }
+
if (!passwd) {
passwd = MyG(default_pw);
if (!username){
@@ -157,7 +161,7 @@
 }
 /* }}} */
 
-/* {{{ proto mixed mysqli_fetch_object (object result [, string class_name [, 
NULL|array ctor_params]]) 
+/* {{{ proto mixed mysqli_fetch_object (object result [, string class_name [, 
NULL|array ctor_params]]) U
Fetch a result row as an object */
 PHP_FUNCTION(mysqli_fetch_object) 
 {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.137r2=1.138diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.137 
php-src/ext/mysqli/mysqli_api.c:1.138
--- php-src/ext/mysqli/mysqli_api.c:1.137   Sun Oct  8 13:34:22 2006
+++ php-src/ext/mysqli/mysqli_api.c Tue Oct 31 15:23:16 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.137 2006/10/08 13:34:22 bjori Exp $ 
+  $Id: mysqli_api.c,v 1.138 2006/10/31 15:23:16 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1084,7 +1084,7 @@
 }
 /* }}} */
 
-/* {{{ proto string mysqli_info(object link)
+/* {{{ proto string mysqli_info(object link) U
Get information about the most recent query */
 PHP_FUNCTION(mysqli_info)
 {
@@ -1631,7 +1631,7 @@
 }
 /* }}} */
 
-/* {{{ proto int mysqli_stmt_field_count(object stmt) { U
+/* {{{ proto int mysqli_stmt_field_count(object stmt) U
Return the number of result columns for the given statement */
 PHP_FUNCTION(mysqli_stmt_field_count)
 {

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



[PHP-CVS] cvs: php-src /ext/mysqli config.m4

2006-10-08 Thread Georg Richter
georg   Mon Oct  9 04:46:03 2006 UTC

  Modified files:  
/php-src/ext/mysqli config.m4 
  Log:
  Fix for bug #39085:
  PHP6 requires mysqli_set_character_set function which was introduced in 
  MySQL 4.1.13 and 5.0.7
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/config.m4?r1=1.24r2=1.25diff_format=u
Index: php-src/ext/mysqli/config.m4
diff -u php-src/ext/mysqli/config.m4:1.24 php-src/ext/mysqli/config.m4:1.25
--- php-src/ext/mysqli/config.m4:1.24   Thu Jun  1 19:15:31 2006
+++ php-src/ext/mysqli/config.m4Mon Oct  9 04:46:03 2006
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.24 2006/06/01 19:15:31 mike Exp $
+dnl $Id: config.m4,v 1.25 2006/10/09 04:46:03 georg Exp $
 dnl config.m4 for extension mysqli
 
 PHP_ARG_WITH(mysqli, for MySQLi support,
@@ -49,9 +49,9 @@
 PHP_EVAL_INCLINE($MYSQLI_INCLINE)
 PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
 AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
-PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_stmt_field_count,
+PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_character_set,
 [ ],[
-   AC_MSG_ERROR([MySQLI doesn't support versions  4.1.3 (for 
MySQL 4.1.x) and  5.0.1 for (MySQL 5.0.x) anymore. Please update your 
libraries.])
+   AC_MSG_ERROR([MySQLI doesn't support versions  4.1.13 (for 
MySQL 4.1.x) and  5.0.7 for (MySQL 5.0.x) anymore. Please update your 
libraries.])
],[$MYSQLI_LIBLINE])
   ],[
 AC_MSG_ERROR([wrong mysql library version or lib not found. Check 
config.log for more information.])

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_api.c mysqli_nonapi.c /ext/mysqli/tests 068.phpt

2006-10-01 Thread Georg Richter
georg   Sun Oct  1 21:01:31 2006 UTC

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_api.c mysqli_nonapi.c 
/php-src/ext/mysqli/tests   068.phpt 
  Log:
  unicode fixes
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.99r2=1.100diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.99 php-src/ext/mysqli/mysqli.c:1.100
--- php-src/ext/mysqli/mysqli.c:1.99Wed Sep 27 15:25:52 2006
+++ php-src/ext/mysqli/mysqli.c Sun Oct  1 21:01:31 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.99 2006/09/27 15:25:52 georg Exp $ 
+  $Id: mysqli.c,v 1.100 2006/10/01 21:01:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -901,7 +901,6 @@
int ulen;
 
zend_string_to_unicode(UG(utf8_conv), 
ustr, ulen, fields[i].name, strlen(fields[i].name) TSRMLS_CC);
-   /* maybe a bug in add_u_assoc_zval_ex: 
string is truncated when specifying ulen only */
add_u_assoc_zval_ex(return_value, 
IS_UNICODE, ZSTR(ustr), ulen + 1, res);
efree(ustr);
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.133r2=1.134diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.133 
php-src/ext/mysqli/mysqli_api.c:1.134
--- php-src/ext/mysqli/mysqli_api.c:1.133   Fri Sep 29 08:35:19 2006
+++ php-src/ext/mysqli/mysqli_api.c Sun Oct  1 21:01:31 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.133 2006/09/29 08:35:19 georg Exp $ 
+  $Id: mysqli_api.c,v 1.134 2006/10/01 21:01:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -444,7 +444,7 @@
 
csname = (char *)mysql_character_set_name(mysql-mysql);
  
-   ZVAL_UTF8_STRINGL(return_value, csname, strlen(csname), ZSTR_DUPLICATE);
+   RETURN_UTF8_STRING(csname, ZSTR_DUPLICATE);
 }
 /* }}} */
 
@@ -582,7 +582,7 @@
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link, 
MYSQLI_STATUS_VALID);
 
strerr = (char *)mysql_error(mysql-mysql);
-   ZVAL_UTF8_STRINGL(return_value, strerr, strlen(strerr), ZSTR_DUPLICATE);
+   RETURN_UTF8_STRING(strerr, ZSTR_DUPLICATE);
 }
 /* }}} */
 
@@ -709,15 +709,10 @@
uval = 
uval / 10;   
} while (--j  
0);
tmp[10]= '\0';
-   /* unsigned int 
 INT_MAX is 10 digis - ALWAYS */
+   /* unsigned int 
 INT_MAX is 10 digits - ALWAYS */
+   
ZVAL_UTF8_STRINGL(stmt-result.vars[i], tmp, 10, 0);
if 
(UG(unicode)) {
-   UChar 
*ubuf = NULL;
-   int 
ulen;
-   
zend_string_to_unicode(UG(ascii_conv), ubuf, ulen, tmp, strlen(tmp) 
TSRMLS_CC);
-   
ZVAL_UNICODEL(stmt-result.vars[i], ubuf, ulen, 0);

efree(tmp);
-   } else {
-   
ZVAL_STRINGL(stmt-result.vars[i], tmp, 10, 0);
}
break;
}
@@ -749,14 +744,7 @@
 * use 
MYSQLI_LL_SPEC.
 */
sprintf((char 
*)tmp, (stmt-stmt-fields[i].flags  UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : 
MYSQLI_LL_SPEC, llval);
-   if 
(UG(unicode)) {
-   UChar 
*ubuf = NULL;
-   int 
ulen

Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_api.c mysqli_driver.c mysqli_nonapi.c mysqli_prop.c php_mysqli.h

2006-09-29 Thread Georg Richter
Am Do, den 28.09.2006 schrieb Andrei Zmievski um 18:43:

Hello Andrei,
 
 A couple more notes.

Thanks, I will fix it this weekend.

 Also, I don't know much about MySQL client library, but it seems that 
 it only works in UTF-8 mode. Is this correct? Does it translate UTF-8 
 to other charsets when communicating with server that has tables in 
 those other charsets?

If a table or a column uses another charset, MySQL Server automatically
converts utf8 to another charset. When PHP runs in unicode, we
automatically set the client character set to utf8. UCS2 is not fully
supported currently.

/Georg

-- 
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) /ext/mysqli mysqli_api.c

2006-09-29 Thread Georg Richter
georg   Fri Sep 29 08:40:10 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  MFH: fixed error message
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.22.2.6r2=1.118.2.22.2.7diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.6 
php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.7
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.22.2.6  Fri Aug  4 22:13:59 2006
+++ php-src/ext/mysqli/mysqli_api.c Fri Sep 29 08:40:10 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.22.2.6 2006/08/04 22:13:59 iliaa Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.22.2.7 2006/09/29 08:40:10 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -942,7 +942,7 @@
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, 
mysqli_result, MYSQLI_STATUS_VALID);
 
if (fieldnr  0 || fieldnr = mysql_num_fields(result)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Function cannot be 
used with MYSQL_USE_RESULT);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid field 
offset);
RETURN_FALSE; 
}


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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_api.c mysqli_driver.c mysqli_nonapi.c mysqli_prop.c php_mysqli.h

2006-09-27 Thread Georg Richter
georg   Wed Sep 27 15:25:52 2006 UTC

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_api.c mysqli_driver.c 
mysqli_nonapi.c mysqli_prop.c php_mysqli.h 
  Log:
  ZTS fixes. Implemented Andrei's hints (simplifying unicode stuff)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.98r2=1.99diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.98 php-src/ext/mysqli/mysqli.c:1.99
--- php-src/ext/mysqli/mysqli.c:1.98Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/mysqli.c Wed Sep 27 15:25:52 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.98 2006/09/26 13:06:13 georg Exp $ 
+  $Id: mysqli.c,v 1.99 2006/09/27 15:25:52 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -166,6 +166,13 @@
 }
 /* }}} */
 
+/* {{{ mysql_driver_free_storage */
+static void mysqli_driver_free_storage(void *object TSRMLS_DC)
+{
+   mysqli_objects_free_storage(object TSRMLS_CC);
+}
+/* }}} */
+
 /* {{{ mysqli_stmt_free_storage
  */
 static void mysqli_stmt_free_storage(void *object TSRMLS_DC)
@@ -251,22 +258,13 @@
}
 
if (obj-prop_handler != NULL) {
-   ret = zend_u_hash_find(obj-prop_handler, 
UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, 
(void **) hnd);
+   ret = zend_u_hash_find(obj-prop_handler, ZEND_STR_TYPE, 
Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, (void **) hnd);
}
 
if (ret == SUCCESS) {
-   int is_driver;
 
-   if (UG(unicode)) {
-   UChar *ustr = USTR_MAKE(mysqli_driver);
-   is_driver = u_strcmp(obj-zo.ce-name.u, ustr);
-   USTR_FREE(ustr);
-   } else {
-   is_driver = strcmp(obj-zo.ce-name.s, mysqli_driver);
-   }
-   
-   if (is_driver  (!obj-ptr || ((MYSQLI_RESOURCE 
*)(obj-ptr))-status  MYSQLI_STATUS_INITIALIZED)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't 
fetch %R, UG(unicode)?IS_UNICODE:IS_STRING, obj-zo.ce-name );
+   if ((!obj-ptr || ((MYSQLI_RESOURCE *)(obj-ptr))-status  
MYSQLI_STATUS_INITIALIZED)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't 
fetch %v, obj-zo.ce-name );
retval = EG(uninitialized_zval_ptr);
return(retval);
}
@@ -396,7 +394,7 @@
mysqli_base_class = mysqli_base_class-parent;
}
 
-   zend_u_hash_find(classes, UG(unicode)?IS_UNICODE:IS_STRING, 
mysqli_base_class-name, mysqli_base_class-name_length + 1, 
+   zend_u_hash_find(classes, ZEND_STR_TYPE, mysqli_base_class-name, 
mysqli_base_class-name_length + 1, 
(void **) intern-prop_handler);
 
zend_object_std_init(intern-zo, class_type TSRMLS_CC);
@@ -406,6 +404,8 @@
/* link object */
if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) 
{
free_storage = mysqli_link_free_storage;
+   } else if (instanceof_function(class_type, mysqli_driver_class_entry 
TSRMLS_CC)) { /* stmt object */
+   free_storage = mysqli_driver_free_storage;
} else if (instanceof_function(class_type, mysqli_stmt_class_entry 
TSRMLS_CC)) { /* stmt object */
free_storage = mysqli_stmt_free_storage;
} else if (instanceof_function(class_type, mysqli_result_class_entry 
TSRMLS_CC)) { /* result object */
@@ -720,7 +720,8 @@
zval*mysql_link;
MY_STMT *stmt;
MYSQLI_RESOURCE *mysqli_resource;
-   MYSQLI_STRING   statement;
+   char*statement;
+   int statement_len;
 
switch (ZEND_NUM_ARGS())
{
@@ -735,19 +736,16 @@
stmt-stmt = mysql_stmt_init(mysql-mysql);
break;
case 2:
-   if (zend_parse_parameters(2 TSRMLS_CC, OT, 
mysql_link, mysqli_link_class_entry, MYSQLI_GET_STRING(statement))==FAILURE) {
+   if (zend_parse_parameters(2 TSRMLS_CC, Os, 
mysql_link, mysqli_link_class_entry, statement, statement_len, 
UG(utf8_conv))==FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, 
mysqli_link, MYSQLI_STATUS_VALID);
 
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
 
-   MYSQLI_CONVERT_PARAM_STRING(statement, 
MYSQLI_CONV_UTF8);
-   
if ((stmt-stmt = mysql_stmt_init(mysql-mysql))) {
-   mysql_stmt_prepare(stmt-stmt, (char

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

2006-07-30 Thread Georg Richter
georg   Sun Jul 30 11:03:30 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/mysqli/tests   bug37090.phpt 
  Log:
  Added testcase for bug #37090
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug37090.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/bug37090.phpt
+++ php-src/ext/mysqli/tests/bug37090.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_2) /ext/mysqli php_mysqli.h

2006-05-09 Thread Georg Richter
georg   Tue May  9 11:26:09 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli php_mysqli.h 
  Log:
  removed unused macro parameter
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/php_mysqli.h?r1=1.54.2.7.2.1r2=1.54.2.7.2.2diff_format=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.54.2.7.2.1 
php-src/ext/mysqli/php_mysqli.h:1.54.2.7.2.2
--- php-src/ext/mysqli/php_mysqli.h:1.54.2.7.2.1Mon May  8 16:19:43 2006
+++ php-src/ext/mysqli/php_mysqli.h Tue May  9 11:26:09 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.54.2.7.2.1 2006/05/08 16:19:43 georg Exp $ 
+  $Id: php_mysqli.h,v 1.54.2.7.2.2 2006/05/09 11:26:09 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -191,13 +191,13 @@
mysqli_entry = zend_register_internal_class(ce TSRMLS_CC); \
 } \
 
-#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval, __ce)  \
+#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval)  \
((mysqli_object *) zend_object_store_get_object(__zval TSRMLS_CC))-ptr 
= __ptr; \
 
 #define MYSQLI_RETURN_RESOURCE(__ptr, __ce) \
Z_TYPE_P(return_value) = IS_OBJECT; \
(return_value)-value.obj = mysqli_objects_new(__ce TSRMLS_CC); \
-   MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value, __ce)
+   MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value)
 
 #define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \
 {\
@@ -207,7 +207,7 @@
Z_TYPE_P(object) = IS_OBJECT;\
(object)-value.obj = mysqli_objects_new(__ce TSRMLS_CC);\
}\
-   MYSQLI_REGISTER_RESOURCE_EX(__ptr, object, __ce)\
+   MYSQLI_REGISTER_RESOURCE_EX(__ptr, object)\
 }
 
 #define MYSQLI_FETCH_RESOURCE(__ptr, __type, __id, __name, __check) \

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



[PHP-CVS] cvs: php-src /ext/mysqli/tests bug34785.phpt bug36745.phpt bug36802.phpt

2006-05-09 Thread Georg Richter
georg   Tue May  9 13:53:39 2006 UTC

  Modified files:  
/php-src/ext/mysqli/tests   bug34785.phpt bug36745.phpt bug36802.phpt 
  Log:
  merge from 5.2
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug34785.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysqli/tests/bug34785.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug34785.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug34785.phpt  Tue May  9 13:53:39 2006
@@ -0,0 +1,47 @@
+--TEST--
+Bug #32405
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+   include (connect.inc);
+
+   class my_stmt extends mysqli_stmt
+   {
+   public function __construct($link, $query) {
+   parent::__construct($link, $query);
+   }
+   }
+
+   class my_result extends mysqli_result
+   {
+   public function __construct($link, $query) {
+   parent::__construct($link, $query);
+   }
+   }
+
+   /*** test mysqli_connect 127.0.0.1 ***/
+   $link = mysqli_connect($host, $user, $passwd);
+   mysqli_query($link, SET sql_mode='');
+
+   $stmt = new my_stmt($link, SELECT 'foo' FROM DUAL);
+
+   $stmt-execute();
+   $stmt-bind_result($var);
+   $stmt-fetch();
+
+   $stmt-close();
+   var_dump($var);
+
+   mysqli_real_query($link, SELECT 'bar' FROM DUAL);
+   $result = new my_result($link, MYSQLI_STORE_RESULT);
+   $row = $result-fetch_row();
+   $result-close();
+
+   var_dump($row[0]);
+
+   mysqli_close($link);
+?
+--EXPECT--
+string(3) foo
+string(3) bar
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug36745.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysqli/tests/bug36745.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug36745.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug36745.phpt  Tue May  9 13:53:39 2006
@@ -0,0 +1,23 @@
+--TEST--
+bug #36745 : LOAD DATA LOCAL INFILE doesn't return correct error message   
 
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+   include (connect.inc);
+
+   /*** test mysqli_connect 127.0.0.1 ***/
+   $mysql = mysqli_connect($host, $user, $passwd, test);
+
+   $mysql-query(DROP TABLE IF EXISTS litest);
+   $mysql-query(CREATE TABLE litest (a VARCHAR(20)));
+
+   $mysql-query(LOAD DATA LOCAL INFILE 'filenotfound' INTO TABLE 
litest);
+   var_dump($mysql-error);
+
+   $mysql-close();
+   printf(Done);
+?
+--EXPECT--
+string(31) Can't find file 'filenotfound'.
+Done
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug36802.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysqli/tests/bug36802.phpt
diff -u /dev/null php-src/ext/mysqli/tests/bug36802.phpt:1.2
--- /dev/null   Tue May  9 13:53:39 2006
+++ php-src/ext/mysqli/tests/bug36802.phpt  Tue May  9 13:53:39 2006
@@ -0,0 +1,42 @@
+--TEST--
+bug #36802 : crashes with mysql_init   
 
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+
+   class my_mysqli extends mysqli {
+   function __construct() 
+   {
+   }
+   }
+
+   include connect.inc;
+
+
+   $mysql = mysqli_init();
+
+   /* following operations should not work */
+   $x[0] = @$mysql-set_charset('utf8');
+   $x[1] = @$mysql-query(SELECT 'foo' FROM DUAL);
+
+   /* following operations should work */ 
+   $x[2] = ($mysql-client_version  0);
+   $x[3] = $mysql-errno;
+   $mysql-close();
+   
+
+
+   var_dump($x);
+?
+--EXPECT--
+array(4) {
+  [0]=
+  NULL
+  [1]=
+  NULL
+  [2]=
+  bool(true)
+  [3]=
+  int(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_2) /ext/mysqli mysqli.c php_mysqli.h

2006-05-08 Thread Georg Richter
georg   Mon May  8 16:19:43 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysqli mysqli.c php_mysqli.h 
  Log:
  moved zend_class_entry variables to mysqli.c
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16r2=1.72.2.16.2.1diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16 
php-src/ext/mysqli/mysqli.c:1.72.2.16.2.1
--- php-src/ext/mysqli/mysqli.c:1.72.2.16   Sun Apr  2 09:40:19 2006
+++ php-src/ext/mysqli/mysqli.c Mon May  8 16:19:43 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.16 2006/04/02 09:40:19 georg Exp $ 
+  $Id: mysqli.c,v 1.72.2.16.2.1 2006/05/08 16:19:43 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -43,6 +43,13 @@
 static HashTable mysqli_stmt_properties;
 static HashTable mysqli_warning_properties;
 
+zend_class_entry *mysqli_link_class_entry;
+zend_class_entry *mysqli_stmt_class_entry;
+zend_class_entry *mysqli_result_class_entry;
+zend_class_entry *mysqli_driver_class_entry;
+zend_class_entry *mysqli_warning_class_entry;
+zend_class_entry *mysqli_exception_class_entry;
+
 extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS);
 
 typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/php_mysqli.h?r1=1.54.2.7r2=1.54.2.7.2.1diff_format=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.54.2.7 
php-src/ext/mysqli/php_mysqli.h:1.54.2.7.2.1
--- php-src/ext/mysqli/php_mysqli.h:1.54.2.7Wed Apr  5 12:17:08 2006
+++ php-src/ext/mysqli/php_mysqli.h Mon May  8 16:19:43 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.54.2.7 2006/04/05 12:17:08 georg Exp $ 
+  $Id: php_mysqli.h,v 1.54.2.7.2.1 2006/05/08 16:19:43 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -161,12 +161,12 @@
 extern int php_local_infile_error(void *, char *, uint);
 extern void php_set_local_infile_handler_default(MY_MYSQL *);
 extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno 
TSRMLS_DC, char *format, ...);
-zend_class_entry *mysqli_link_class_entry;
-zend_class_entry *mysqli_stmt_class_entry;
-zend_class_entry *mysqli_result_class_entry;
-zend_class_entry *mysqli_driver_class_entry;
-zend_class_entry *mysqli_warning_class_entry;
-zend_class_entry *mysqli_exception_class_entry;
+extern zend_class_entry *mysqli_link_class_entry;
+extern zend_class_entry *mysqli_stmt_class_entry;
+extern zend_class_entry *mysqli_result_class_entry;
+extern zend_class_entry *mysqli_driver_class_entry;
+extern zend_class_entry *mysqli_warning_class_entry;
+extern zend_class_entry *mysqli_exception_class_entry;
 
 #ifdef HAVE_SPL
 extern PHPAPI zend_class_entry *spl_ce_RuntimeException;

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli_api.c mysqli_prop.c php_mysqli.h

2006-04-05 Thread Georg Richter
georg   Wed Apr  5 12:17:08 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli_api.c mysqli_prop.c php_mysqli.h 
  Log:
  fixed bigint conversion on windows platforms
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.21r2=1.118.2.22diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.21 
php-src/ext/mysqli/mysqli_api.c:1.118.2.22
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.21  Sun Mar 26 21:10:13 2006
+++ php-src/ext/mysqli/mysqli_api.c Wed Apr  5 12:17:08 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.21 2006/03/26 21:10:13 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.22 2006/04/05 12:17:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -705,10 +705,10 @@
 #endif
char tmp[22];
/* even though 
lval is declared as unsigned, the value
-* may be 
negative. Therefor we cannot use %llu and must
-* use %lld.
+* may be 
negative. Therefor we cannot use MYSQLI_LLU_SPEC and must
+* use 
MYSQLI_LL_SPEC.
 */
-   sprintf((char 
*)tmp, (stmt-stmt-fields[i].flags  UNSIGNED_FLAG)? %llu:%lld, llval);
+   sprintf((char 
*)tmp, (stmt-stmt-fields[i].flags  UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : 
MYSQLI_LL_SPEC, llval);

ZVAL_STRING(stmt-result.vars[i], tmp, 1);
} else {

ZVAL_LONG(stmt-result.vars[i], llval);
@@ -1859,7 +1859,7 @@
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
-   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, 
MYSQLI_STATUS_VALID);
+   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, 
MYSQLI_STATUS_INITIALIZED);
 
RETURN_LONG(mysql_stmt_errno(stmt-stmt));
 }
@@ -1875,7 +1875,7 @@
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
-   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, 
MYSQLI_STATUS_VALID);
+   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt, 
MYSQLI_STATUS_INITIALIZED);

RETURN_STRING((char *)mysql_stmt_error(stmt-stmt),1);
 }
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_prop.c?r1=1.23.2.4r2=1.23.2.5diff_format=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.23.2.4 
php-src/ext/mysqli/mysqli_prop.c:1.23.2.5
--- php-src/ext/mysqli/mysqli_prop.c:1.23.2.4   Mon Apr  3 05:48:50 2006
+++ php-src/ext/mysqli/mysqli_prop.cWed Apr  5 12:17:08 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.23.2.4 2006/04/03 05:48:50 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.23.2.5 2006/04/05 12:17:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -86,7 +86,7 @@
ZVAL_LONG(*retval, l);\
} else { \
char ret[40]; \
-   sprintf(ret, %llu, (my_ulonglong)l); \
+   sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong)l); \
ZVAL_STRING(*retval, ret, 1); \
} \
}\
@@ -176,7 +176,7 @@
ZVAL_LONG(*retval, rc);
} else {
char ret[40];
-   sprintf(ret, %llu, (my_ulonglong) rc);
+   sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong) rc);
ZVAL_STRING(*retval, ret, 1);
}
}
@@ -295,7 +295,7 @@
ZVAL_LONG(*retval, rc);
} else {
char ret[40];
-   sprintf(ret, %llu, (my_ulonglong) rc);
+   sprintf(ret, MYSQLI_LLU_SPEC, (my_ulonglong) rc);
ZVAL_STRING(*retval, ret, 1);
}
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/php_mysqli.h?r1=1.54.2.6r2

[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2006-04-05 Thread Georg Richter
georg   Wed Apr  5 12:17:33 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  fixed bigint conversion errors (windows)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.493r2=1.2027.2.494diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.493 php-src/NEWS:1.2027.2.494
--- php-src/NEWS:1.2027.2.493   Wed Apr  5 11:36:13 2006
+++ php-src/NEWSWed Apr  5 12:17:33 2006
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 30 Mar 2006, PHP 5.1.3RC2
+- Fixed mysqli bigint conversion under Windows (Georg)
 - Fixed XSS inside phpinfo() with long inputs. (Ilia)
 - Check 2nd parameter of tempnam() against path components. (Ilia)
 - Fixed Apache2 SAPIs header handler modifying header strings. (Mike)

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli.c

2006-04-02 Thread Georg Richter
georg   Sun Apr  2 09:40:19 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli.c 
  Log:
  Added additional information for compiled header files.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.15r2=1.72.2.16diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.15 
php-src/ext/mysqli/mysqli.c:1.72.2.16
--- php-src/ext/mysqli/mysqli.c:1.72.2.15   Thu Mar 30 11:21:51 2006
+++ php-src/ext/mysqli/mysqli.c Sun Apr  2 09:40:19 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.15 2006/03/30 11:21:51 tony2001 Exp $ 
+  $Id: mysqli.c,v 1.72.2.16 2006/04/02 09:40:19 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -626,7 +626,8 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, MysqlI Support, enabled);
-   php_info_print_table_row(2, Client API version, 
mysql_get_client_info());
+   php_info_print_table_row(2, Client API library version, 
mysql_get_client_info());
+   php_info_print_table_row(2, Client API header version, 
MYSQL_SERVER_VERSION);
php_info_print_table_row(2, MYSQLI_SOCKET, MYSQL_UNIX_ADDR);



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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli_prop.c

2006-04-02 Thread Georg Richter
georg   Mon Apr  3 05:48:50 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli_prop.c 
  Log:
  fixed stmt property container and required status for error properties
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_prop.c?r1=1.23.2.3r2=1.23.2.4diff_format=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.23.2.3 
php-src/ext/mysqli/mysqli_prop.c:1.23.2.4
--- php-src/ext/mysqli/mysqli_prop.c:1.23.2.3   Fri Mar 24 09:32:24 2006
+++ php-src/ext/mysqli/mysqli_prop.cMon Apr  3 05:48:50 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.23.2.3 2006/03/24 09:32:24 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.23.2.4 2006/04/03 05:48:50 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -70,7 +70,7 @@
return SUCCESS; \
 } else { \
CHECK_STATUS(statusval);\
-   p = (MYSQL_STMT *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr; \
+   p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE 
*)(obj-ptr))-ptr)-stmt;\
 }
 
 #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, 
__ret_type)\
@@ -307,9 +307,9 @@
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong);
-MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong);
-MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID));
-MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, 
MYSQLI_GET_STMT(MYSQLI_STATUS_VALID));
+MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, 
MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong);
+MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, 
MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED));
+MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, 
MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED));
 
 /* }}} */
 mysqli_property_entry mysqli_link_property_entries[] = {

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli/tests 017.phpt 049.phpt bug34810.phpt

2006-03-24 Thread Georg Richter
georg   Fri Mar 24 10:58:52 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli/tests   017.phpt 049.phpt bug34810.phpt 
  Log:
  fixed minor problems (thx to tony)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/017.phpt?r1=1.7r2=1.7.2.1diff_format=u
Index: php-src/ext/mysqli/tests/017.phpt
diff -u php-src/ext/mysqli/tests/017.phpt:1.7 
php-src/ext/mysqli/tests/017.phpt:1.7.2.1
--- php-src/ext/mysqli/tests/017.phpt:1.7   Fri Jan  7 14:59:59 2005
+++ php-src/ext/mysqli/tests/017.phpt   Fri Mar 24 10:58:52 2006
@@ -12,15 +12,13 @@
 
mysqli_select_db($link, test);
 
-   $stmt = mysqli_prepare($link, SELECT current_user(), database(), 
'foo');
+   $stmt = mysqli_prepare($link, SELECT md5('bar'), database(), 'foo');
mysqli_bind_result($stmt, $c0, $c1, $c2); 
mysqli_execute($stmt);
 
mysqli_fetch($stmt);
mysqli_stmt_close($stmt);
 
-   $c0 = ($c0 == $user . @ . $host) ? 1 : 0;
-
$test = array($c0, $c1, $c2);
 
var_dump($test);
@@ -29,7 +27,7 @@
 --EXPECT--
 array(3) {
   [0]=
-  int(1)
+  string(32) 37b51d194a7513e45b56f6524f2d51f2
   [1]=
   string(4) test
   [2]=
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/049.phpt?r1=1.4r2=1.4.2.1diff_format=u
Index: php-src/ext/mysqli/tests/049.phpt
diff -u php-src/ext/mysqli/tests/049.phpt:1.4 
php-src/ext/mysqli/tests/049.phpt:1.4.2.1
--- php-src/ext/mysqli/tests/049.phpt:1.4   Fri Jan  7 14:59:59 2005
+++ php-src/ext/mysqli/tests/049.phpt   Fri Mar 24 10:58:52 2006
@@ -11,14 +11,16 @@
$mysql = mysqli_connect($host, $user, $passwd);
 
$mysql-select_db(test);  
-   $result = $mysql-query(SELECT CURRENT_USER());
+   $result = $mysql-query(SELECT DATABASE());
$row = $result-fetch_row();
$result-close();
 
-   $ok = ($row[0] == $user . @ . $host); 
-   var_dump($ok);
+   var_dump($row);
 
$mysql-close();
 ?
 --EXPECT--
-bool(true)
+array(1) {
+  [0]=
+  string(4) test
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug34810.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/mysqli/tests/bug34810.phpt
diff -u php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.2 
php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.3
--- php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.2  Fri Mar 24 09:32:24 2006
+++ php-src/ext/mysqli/tests/bug34810.phpt  Fri Mar 24 10:58:52 2006
@@ -9,10 +9,10 @@
public function connect() {
include connect.inc;
 
-   $link = mysqli::connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd);
var_dump($link); 

-   $link = mysqli::init();
+   $link = mysqli_init();
var_dump($link);

$mysql = new mysqli($host, $user, $passwd, test);

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/mysqli mysqli.c /ext/mysqli/tests bug36745.phpt

2006-03-24 Thread Georg Richter
georg   Fri Mar 24 12:10:39 2006 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli mysqli.c 
  Log:
  fix and testcase for bug #36745
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.479r2=1.2027.2.480diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.479 php-src/NEWS:1.2027.2.480
--- php-src/NEWS:1.2027.2.479   Fri Mar 24 08:45:54 2006
+++ php-src/NEWSFri Mar 24 12:10:38 2006
@@ -19,6 +19,8 @@
 - Fixed bug #36808 (syslog ident becomes garbage between requests). (Tony)
 - Fixed bug #36802 (mysqli_set_charset() crash with a non-open connection).
   (Ilia)
+- Fixed bug #36745 (No error message when load data local file isn't found).
+  (Georg)
 - Fixed bug #36721 (The SoapServer is not able to send a header that it didn't
   receive). (Dmitry)
 - Fixed bug #36756 (DOMDocument::removeChild corrupts node). (Rob)
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.11r2=1.72.2.12diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.11 
php-src/ext/mysqli/mysqli.c:1.72.2.12
--- php-src/ext/mysqli/mysqli.c:1.72.2.11   Fri Mar 24 09:32:24 2006
+++ php-src/ext/mysqli/mysqli.c Fri Mar 24 12:10:38 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.11 2006/03/24 09:32:24 georg Exp $ 
+  $Id: mysqli.c,v 1.72.2.12 2006/03/24 12:10:38 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -976,6 +976,7 @@
mysql-li_stream = php_stream_open_wrapper_ex((char *)filename, r, 0, 
NULL, context);
 
if (mysql-li_stream == NULL) {
+   sprintf((char *)data-error_msg, Can't find file '%-.64s'., 
filename);
return 1;
}
 

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

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



Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c

2006-03-22 Thread Georg Richter
Am Di, den 21.03.2006 schrieb Ilia Alshanetsky um 16:35:

Hello Ilia,

  
 - if (mysql_set_character_set(mysql-mysql, cs_name)) {
 + if (!mysql-mysql-thread_id || mysql_set_character_set(mysql-mysql, 
 cs_name)) {

This fixes the problem only for this function - not in general. I'm
already working on a better fix. I will reopen the bug.

Please note, that checking thread_id will not work for embedded server.

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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



Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c

2006-03-22 Thread Georg Richter
Am Mi, den 22.03.2006 schrieb Ilia Alshanetsky um 18:10:

Hello Ilia,

 I tried a few other functions like get_warnings() and they don't seem to 
 mind a missing connection. So, I am not certain a generic solution is 
 required here.

All functions which need to send something to server will crash.
We will extend mysql-status (adding a new enum value
MYSQL_STATUS_INITIALIZED in MySQL 5.1 - for older versions I will
implement this in PHP).

I will commit fix tomorrow.

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli_api.c

2006-03-14 Thread Georg Richter
georg   Tue Mar 14 15:53:17 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fixed a 64-bit problem reported by Pierre
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.17r2=1.118.2.18diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.17 
php-src/ext/mysqli/mysqli_api.c:1.118.2.18
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.17  Sat Mar 11 11:16:03 2006
+++ php-src/ext/mysqli/mysqli_api.c Tue Mar 14 15:53:16 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.17 2006/03/11 11:16:03 georg Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.18 2006/03/14 15:53:16 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -295,7 +295,7 @@
convert_to_long_ex(args[i]);
stmt-result.buf[ofs].type = IS_LONG;
stmt-result.buf[ofs].buflen = 0;
-   stmt-result.buf[ofs].val = (char 
*)emalloc(sizeof(long));
+   stmt-result.buf[ofs].val = (char 
*)emalloc(sizeof(int));
bind[ofs].buffer_type = MYSQL_TYPE_LONG;
bind[ofs].buffer = stmt-result.buf[ofs].val;
bind[ofs].is_null = stmt-result.is_null[ofs];
@@ -663,7 +663,7 @@
if (!stmt-result.is_null[i]) {
switch (stmt-result.buf[i].type) {
case IS_LONG:
-   if ((sizeof(long) ==4)  
(stmt-stmt-fields[i].type == MYSQL_TYPE_LONG) 
+   if ((stmt-stmt-fields[i].type 
== MYSQL_TYPE_LONG) 
 
(stmt-stmt-fields[i].flags  UNSIGNED_FLAG)) 
{
/* unsigned int (11) */
@@ -684,7 +684,11 @@
break;
}
}
-   ZVAL_LONG(stmt-result.vars[i], 
*(int *)stmt-result.buf[i].val);
+   if (stmt-stmt-fields[i].flags 
 UNSIGNED_FLAG) { 
+   
ZVAL_LONG(stmt-result.vars[i], *(unsigned int *)stmt-result.buf[i].val);
+   } else {
+   
ZVAL_LONG(stmt-result.vars[i], *(int *)stmt-result.buf[i].val);
+   };
break;
case IS_DOUBLE:
memcpy(dval, 
stmt-result.buf[i].val, sizeof(dval));

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli_api.c

2006-03-11 Thread Georg Richter
georg   Sat Mar 11 11:16:03 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fix for MySQL 5.1 (see http://bugs.mysql.com/?id=16144)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.16r2=1.118.2.17diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.16 
php-src/ext/mysqli/mysqli_api.c:1.118.2.17
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.16  Sun Jan  1 16:55:01 2006
+++ php-src/ext/mysqli/mysqli_api.c Sat Mar 11 11:16:03 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.16 2006/01/01 16:55:01 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.17 2006/03/11 11:16:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -326,7 +326,12 @@
case MYSQL_TYPE_NEWDECIMAL:
 #endif
{
+#if VERSION_ID  50999
+   /* Changed to my_bool in MySQL 5.1. See MySQL 
Bug #16144 */
+   my_bool tmp;
+#else
ulong tmp;
+#endif
stmt-result.buf[ofs].type = IS_STRING;
/*
If the user has called 
$stmt-store_result() then we have asked
@@ -1822,7 +1827,7 @@
 {
MY_STMT *stmt;
zval*mysql_stmt;
-   ulong   value;
+   ulong   value = 0;
ulong   attr;
int rc;
 

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2006-01-14 Thread Georg Richter
georg   Sat Jan 14 10:15:08 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  Implemented feature request #36007: Support for BIT and NEW_DECIMAL field 
types
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.350r2=1.2027.2.351diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.350 php-src/NEWS:1.2027.2.351
--- php-src/NEWS:1.2027.2.350   Sat Jan 14 09:57:07 2006
+++ php-src/NEWSSat Jan 14 10:15:08 2006
@@ -2,6 +2,8 @@
 |||
 ?? ??? 2006, PHP 5.1.3
 - Added consumed stream filter. (Marcus)
+- Implemented feature request #36007 (support for BIT and NEWDECIMAL in mysqli
+  (Georg)
 - Fixed bug #35998 (SplFileInfo::getPathname() returns unix style filenames
   in win32). (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_1) / NEWS

2006-01-14 Thread Georg Richter
georg   Sat Jan 14 14:34:47 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  New field constants for BIT and NEWDECIMAL
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.352r2=1.2027.2.353diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.352 php-src/NEWS:1.2027.2.353
--- php-src/NEWS:1.2027.2.352   Sat Jan 14 12:05:59 2006
+++ php-src/NEWSSat Jan 14 14:34:47 2006
@@ -2,6 +2,7 @@
 |||
 ?? ??? 2006, PHP 5.1.3
 - Added consumed stream filter. (Marcus)
+- Added new mysqli field constants for BIT and NEW_DECIMAL (#36007). (Georg) 
 - Fixed bug #35998 (SplFileInfo::getPathname() returns unix style filenames
   in win32). (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_1) / NEWS /ext/mysqli mysqli_api.c /ext/mysqli/tests bug35517.phpt

2005-12-29 Thread Georg Richter
georg   Thu Dec 29 09:49:20 2005 EDT

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
  Fix for bug #35517:
added missing unsigned flag for result buffer
fixed returncode in mysql_stmt_fetch for data truncation
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.330r2=1.2027.2.331diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.330 php-src/NEWS:1.2027.2.331
--- php-src/NEWS:1.2027.2.330   Wed Dec 28 20:55:13 2005
+++ php-src/NEWSThu Dec 29 09:49:19 2005
@@ -14,6 +14,7 @@
 - Fixed bug #35781 (stream_filter_append() can cause segfault). (Tony)
 - Fixed bug #35759 (mysqli_stmt_bind_result() makes huge allocation when
   column empty). (Andrey)
+- Fixed bug #35517 (mysql_stmt_fetch returns NULL on data truncation). (Georg)
 - Fixed bug #29955 (mb_strtoupper() / lower() broken with Turkish encoding).
   (Rui)
 - Fixed bug #28899 (mb_substr() and substr() behave differently when
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.13r2=1.118.2.14diff_format=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.13 
php-src/ext/mysqli/mysqli_api.c:1.118.2.14
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.13  Fri Dec 23 22:22:41 2005
+++ php-src/ext/mysqli/mysqli_api.c Thu Dec 29 09:49:19 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.13 2005/12/23 22:22:41 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.14 2005/12/29 09:49:19 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -299,6 +299,7 @@
bind[ofs].buffer_type = MYSQL_TYPE_LONG;
bind[ofs].buffer = stmt-result.buf[ofs].val;
bind[ofs].is_null = stmt-result.is_null[ofs];
+   bind[ofs].is_unsigned = 
(stmt-stmt-fields[ofs].flags  UNSIGNED_FLAG) ? 1 : 0;
break;
 
case MYSQL_TYPE_LONGLONG:
@@ -309,6 +310,7 @@
bind[ofs].buffer = stmt-result.buf[ofs].val;
bind[ofs].is_null = stmt-result.is_null[ofs];
bind[ofs].buffer_length = 
stmt-result.buf[ofs].buflen;
+   bind[ofs].is_unsigned = 
(stmt-stmt-fields[ofs].flags  UNSIGNED_FLAG) ? 1 : 0;
break;
 
case MYSQL_TYPE_DATE:
@@ -721,6 +723,13 @@
 
switch (ret) {
case 0:
+#ifdef MYSQL_DATA_TRUNCATED
+   /* according to SQL standard truncation (e.g. loss of precision 
is
+  not an error) - for detecting possible truncation you have 
to 
+  check mysqli_stmt_warning
+   */
+   case MYSQL_DATA_TRUNCATED:
+#endif
RETURN_TRUE;
break;
case 1:

http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug35517.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/bug35517.phpt
+++ php-src/ext/mysqli/tests/bug35517.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_1) / NEWS /ext/mysqli mysqli_api.c

2005-10-15 Thread Georg Richter
georg   Sat Oct 15 02:32:27 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fixed an error in mysqli_fetch_fields (function returns NULL instead of array
  when row_number  num_fields).
  Thanks to Marc Deslisle and phpMyAdmin team for the report.
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.128r2=1.2027.2.129ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.128 php-src/NEWS:1.2027.2.129
--- php-src/NEWS:1.2027.2.128   Fri Oct 14 11:30:24 2005
+++ php-src/NEWSSat Oct 15 02:32:21 2005
@@ -34,6 +34,8 @@
 - Added new_link parameter to mssql_connect() (Bug #34369). (Frank)
 - Added missing safe_mode checks for image* functions and cURL. (Ilia)
 - Added missing safe_mode/open_basedir checks for file uploads. (Ilia)
+- Fixed an error in mysqli_fetch_fields (returned NULL instead of an
+  array when row number  field_count). (Georg)
 - Fixed possible INI setting leak via virtual() in Apache 2 sapi. (Ilia)
 - Fixed potential GLOBALS overwrite via import_request_variables() and
   possible crash and/or memory corruption. (Ilia)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.118.2.4r2=1.118.2.5ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.118.2.4 
php-src/ext/mysqli/mysqli_api.c:1.118.2.5
--- php-src/ext/mysqli/mysqli_api.c:1.118.2.4   Mon Oct 10 16:06:34 2005
+++ php-src/ext/mysqli/mysqli_api.c Sat Oct 15 02:32:26 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.118.2.4 2005/10/10 20:06:34 tony2001 Exp $ 
+  $Id: mysqli_api.c,v 1.118.2.5 2005/10/15 06:32:26 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -740,10 +740,6 @@
 
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, 
mysqli_result); 
 
-   if (!(field = mysql_fetch_field(result))) {
-   RETURN_FALSE;
-   }
-
array_init(return_value);
 
for (i = 0; i  mysql_num_fields(result); i++) {

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c

2005-10-15 Thread Georg Richter
georg   Sat Oct 15 03:33:14 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
   Fixed an error in mysqli_fetch_fields (returned NULL instead of an
array when row number  field_count). (Georg)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.500r2=1.1760.2.501ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.500 php-src/NEWS:1.1760.2.501
--- php-src/NEWS:1.1760.2.500   Thu Oct 13 11:24:25 2005
+++ php-src/NEWSSat Oct 15 03:33:01 2005
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? , PHP 5.0.6
+- Fixed an error in mysqli_fetch_fields (returned NULL instead of an
+  array when row number  field_count). (Georg)
 - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
 - Fixed bug #34856 (configure fails to detect libiconv's type). (Tony)
 - Fixed bug #34855 (ibase_service_attach() segfault on AMD64). 
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.24r2=1.87.2.25ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.24 
php-src/ext/mysqli/mysqli_api.c:1.87.2.25
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.24   Mon Oct 10 08:59:06 2005
+++ php-src/ext/mysqli/mysqli_api.c Sat Oct 15 03:33:12 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.24 2005/10/10 12:59:06 tony2001 Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.25 2005/10/15 07:33:12 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -742,10 +742,6 @@
 
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, 
mysqli_result); 
 
-   if (!(field = mysql_fetch_field(result))) {
-   RETURN_FALSE;
-   }
-
array_init(return_value);
 
for (i = 0; i  mysql_num_fields(result); i++) {

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2005-10-09 Thread Georg Richter
georg   Sun Oct  9 02:03:16 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  added Bugfix for #34785
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.100r2=1.2027.2.101ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.100 php-src/NEWS:1.2027.2.101
--- php-src/NEWS:1.2027.2.100   Sat Oct  8 10:31:14 2005
+++ php-src/NEWSSun Oct  9 02:03:13 2005
@@ -43,6 +43,7 @@
 - Fixed make test to work for phpized extensions. (Hartmut, Jani)
 - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
   (Andrey)
+- Fixed bug #34785 (subclassing of mysqli_stmt does not work). (Georg)
 - Fixed bug #34771 (strtotime() fails with 1-12am/pm). (Derick)
 - Fixed bug #34723 (array_count_values() strips leading zeroes). (Tony)
 - Fixed bug #34678 (__call(), is_callable() and static methods). (Dmitry)

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mysqli mysqli.c mysqli_fe.c /ext/mysqli/tests 003.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 020.phpt 023.phpt 024.phpt 025.phpt 026.phpt 042.phpt 060.phpt

2005-10-08 Thread Georg Richter
georg   Sat Oct  8 11:08:08 2005 EDT

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

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_fe.c 
/php-src/ext/mysqli/tests   003.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 010.phpt 020.phpt 023.phpt 
024.phpt 025.phpt 026.phpt 042.phpt 
060.phpt 065.phpt bug32405.phpt 
  Log:
  fix for bug 34785:
added support for parent::__construct (mysqli_statement and 
mysqli_resultset)
fixed failed testcases when sql_mode is in effect
  
  http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.72.2.1r2=1.72.2.2ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.1 
php-src/ext/mysqli/mysqli.c:1.72.2.2
--- php-src/ext/mysqli/mysqli.c:1.72.2.1Tue Sep 13 05:20:18 2005
+++ php-src/ext/mysqli/mysqli.c Sat Oct  8 11:08:03 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.1 2005/09/13 09:20:18 tony2001 Exp $ 
+  $Id: mysqli.c,v 1.72.2.2 2005/10/08 15:08:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -143,25 +143,23 @@
if (instanceof_function(intern-zo.ce, mysqli_link_class_entry 
TSRMLS_CC)) {
if (my_res  my_res-ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res-ptr;
-   
if (mysql-mysql) {
mysql_close(mysql-mysql);
}
-
php_clear_mysql(mysql);
efree(mysql);
-
my_res-ptr = NULL;
}
-   } else if (intern-zo.ce == mysqli_stmt_class_entry) { /* stmt object */
+   } else if (instanceof_function(intern-zo.ce, mysqli_stmt_class_entry 
TSRMLS_CC)) { /* stmt object */
if (my_res  my_res-ptr) {
-   php_clear_stmt_bind((MY_STMT *)my_res-ptr);
+   MY_STMT *stmt = (MY_STMT *)my_res-ptr;
+   php_clear_stmt_bind(stmt);
}
-   } else if (intern-zo.ce == mysqli_result_class_entry) { /* result 
object */
+   } else if (instanceof_function(intern-zo.ce, mysqli_result_class_entry 
TSRMLS_CC)) { /* stmt object */
if (my_res  my_res-ptr) {
mysql_free_result(my_res-ptr);
}
-   } else if (intern-zo.ce == mysqli_warning_class_entry) { /* warning 
object */
+   } else if (instanceof_function(intern-zo.ce, 
mysqli_warning_class_entry TSRMLS_CC)) { /* stmt object */
if (my_res  my_res-ptr) {
php_clear_warnings((MYSQLI_WARNING *)my_res-info);
}
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.49r2=1.49.2.1ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.49 
php-src/ext/mysqli/mysqli_fe.c:1.49.2.1
--- php-src/ext/mysqli/mysqli_fe.c:1.49 Wed Aug  3 10:07:30 2005
+++ php-src/ext/mysqli/mysqli_fe.c  Sat Oct  8 11:08:03 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.49 2005/08/03 14:07:30 sniper Exp $ 
+  $Id: mysqli_fe.c,v 1.49.2.1 2005/10/08 15:08:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -244,6 +244,7 @@
  * Every user visible function must have an entry in mysqli_result_functions[].
  */
 function_entry mysqli_result_methods[] = {
+   PHP_FALIAS(mysqli_result, mysqli_result_construct, NULL)
PHP_FALIAS(close,mysqli_free_result,NULL)
PHP_FALIAS(free,mysqli_free_result,NULL)
PHP_FALIAS(data_seek,mysqli_data_seek,NULL)
@@ -266,6 +267,7 @@
  * Every user visible function must have an entry in mysqli_stmt_functions[].
  */
 function_entry mysqli_stmt_methods[] = {
+   PHP_FALIAS(mysqli_stmt, mysqli_stmt_construct, NULL)
PHP_FALIAS(attr_get,mysqli_stmt_attr_get,NULL)
PHP_FALIAS(attr_set,mysqli_stmt_attr_set,NULL)

PHP_FALIAS(bind_param,mysqli_stmt_bind_param,second_arg_force_by_ref_rest)
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/003.phpt?r1=1.5r2=1.5.2.1ty=u
Index: php-src/ext/mysqli/tests/003.phpt
diff -u php-src/ext/mysqli/tests/003.phpt:1.5 
php-src/ext/mysqli/tests/003.phpt:1.5.2.1
--- php-src/ext/mysqli/tests/003.phpt:1.5   Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/003.phpt   Sat Oct  8 11:08:07 2005
@@ -7,9 +7,9 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, test);
 
-   mysqli_select_db($link, test);
+   mysqli_query($link, SET sql_mode

[PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c php_mysqli.h

2005-07-12 Thread Georg Richter
georg   Tue Jul 12 05:35:17 2005 EDT

  Modified files:  
/php-src/ext/mysqli php_mysqli.h mysqli_nonapi.c 
  Log:
  removed charset structure. libmysql now provides a function 
  mysqli_get_character_set_info (Vers. 5.0.10) 
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.50r2=1.51ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.50 
php-src/ext/mysqli/php_mysqli.h:1.51
--- php-src/ext/mysqli/php_mysqli.h:1.50Wed Jun 22 05:12:43 2005
+++ php-src/ext/mysqli/php_mysqli.h Tue Jul 12 05:35:16 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.50 2005/06/22 09:12:43 georg Exp $ 
+  $Id: php_mysqli.h,v 1.51 2005/07/12 09:35:16 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -26,6 +26,12 @@
 #endif
 
 #include mysql.h
+
+/* character set support */
+#if MYSQL_VERSION_ID  50009
+#define HAVE_MYSQLI_SET_CHARSET
+#endif
+
 #include errmsg.h
 
 #ifndef PHP_MYSQLI_H
@@ -96,32 +102,6 @@
void*userdata;
 } mysqli_local_infile;
 
-typedef struct {
-  uint number;
-  uint primary_number;
-  uint binary_number;
-  uint state;
-  const char   *csname;
-  const char   *name;
-  const char   *comment;
-  const char   *tailoring;
-  unsigned char*ctype;
-  unsigned char*to_lower;
-  unsigned char*to_upper;
-  unsigned char*sort_order;
-  unsigned short   *contractions;
-  unsigned short   **sort_order_big;
-  unsigned short   *tab_to_uni;
-  void *tab_from_uni;
-  unsigned char*state_map;
-  unsigned char*ident_map;
-  uint strxfrm_multiply;
-  uint mbminlen;
-  uint mbmaxlen;
-  unsigned short   min_sort_char;
-  unsigned short   max_sort_char; /* For LIKE optimization */
-} CHARSET_INFO;
-
 #define phpext_mysqli_ptr mysqli_module_entry
 
 #ifdef PHP_WIN32
@@ -130,10 +110,6 @@
 #define PHP_MYSQLI_API
 #endif
 
-#if (MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5) || MYSQL_VERSION_ID 
 50005
-#define HAVE_MYSQLI_SET_CHARSET
-#endif
-
 #ifdef ZTS
 #include TSRM.h
 #endif
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.48r2=1.49ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.48 
php-src/ext/mysqli/mysqli_nonapi.c:1.49
--- php-src/ext/mysqli/mysqli_nonapi.c:1.48 Mon Jun 27 13:33:56 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Tue Jul 12 05:35:16 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.48 2005/06/27 17:33:56 tony2001 Exp $ 
+  $Id: mysqli_nonapi.c,v 1.49 2005/07/12 09:35:16 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -329,7 +329,7 @@
 {
MY_MYSQL*mysql;
zval*mysql_link;
-   CHARSET_INFO*cs;
+   MY_CHARSET_INFO cs;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
@@ -338,13 +338,16 @@
 
object_init(return_value);
 
-   cs = (CHARSET_INFO *)mysql-mysql-charset;
+   mysql_get_character_set_info(mysql-mysql, cs);
 
-   add_property_string(return_value, charset, (cs-name) ? (char 
*)cs-csname : , 1);
-   add_property_string(return_value, collation,(cs-name) ? (char 
*)cs-name : , 1);
-   add_property_string(return_value, comment, (cs-comment) ? (char 
*)cs-comment : , 1);
-   add_property_long(return_value, min_length, cs-mbminlen);
-   add_property_long(return_value, max_length, cs-mbmaxlen);
+   add_property_string(return_value, charset, (cs.name) ? (char 
*)cs.csname : , 1);
+   add_property_string(return_value, collation,(cs.name) ? (char 
*)cs.name : , 1);
+   add_property_string(return_value, comment, (cs.comment) ? (char 
*)cs.comment : , 1);
+   add_property_string(return_value, dir, (cs.dir) ? (char *)cs.dir : 
, 1);
+   add_property_long(return_value, min_length, cs.mbminlen);
+   add_property_long(return_value, max_length, cs.mbmaxlen);
+   add_property_long(return_value, number, cs.number);
+   add_property_long(return_value, state, cs.state);
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c php_mysqli.h

2005-07-12 Thread Georg Richter
georg   Tue Jul 12 11:45:12 2005 EDT

  Modified files:  
/php-src/ext/mysqli php_mysqli.h mysqli_nonapi.c 
  Log:
  changed version dependency for charset functions
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.51r2=1.52ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.51 
php-src/ext/mysqli/php_mysqli.h:1.52
--- php-src/ext/mysqli/php_mysqli.h:1.51Tue Jul 12 05:35:16 2005
+++ php-src/ext/mysqli/php_mysqli.h Tue Jul 12 11:45:07 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.51 2005/07/12 09:35:16 georg Exp $ 
+  $Id: php_mysqli.h,v 1.52 2005/07/12 15:45:07 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -29,6 +29,10 @@
 
 /* character set support */
 #if MYSQL_VERSION_ID  50009
+#define HAVE_MYSQLI_GET_CHARSET
+#endif
+
+#if (MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5) || MYSQL_VERSION_ID 
 50005
 #define HAVE_MYSQLI_SET_CHARSET
 #endif
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.49r2=1.50ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.49 
php-src/ext/mysqli/mysqli_nonapi.c:1.50
--- php-src/ext/mysqli/mysqli_nonapi.c:1.49 Tue Jul 12 05:35:16 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Tue Jul 12 11:45:07 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.49 2005/07/12 09:35:16 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.50 2005/07/12 15:45:07 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -323,6 +323,7 @@
 /* }}} */
 #endif
 
+#ifdef HAVE_MYSQLI_GET_CHARSET 
 /* {{{ object mysqli_get_charset(object link) 
returns a character set object */
 PHP_FUNCTION(mysqli_get_charset)
@@ -350,6 +351,7 @@
add_property_long(return_value, state, cs.state);
 }
 /* }}} */
+#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/mysqli mysqli_nonapi.c

2005-06-25 Thread Georg Richter
georg   Sun Jun 26 00:44:03 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_nonapi.c 
  Log:
  fix for #33474
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.46r2=1.47ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.46 
php-src/ext/mysqli/mysqli_nonapi.c:1.47
--- php-src/ext/mysqli/mysqli_nonapi.c:1.46 Fri Jun  3 04:49:01 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Sun Jun 26 00:44:03 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.46 2005/06/03 08:49:01 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.47 2005/06/26 04:44:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -251,6 +251,54 @@
 }
 /* }}} */
 
+/* {{{ proto object mysqli_get_warnings(object link) */
+PHP_FUNCTION(mysqli_get_warnings)
+{
+   MY_MYSQL*mysql;
+   zval*mysql_link;
+   MYSQLI_RESOURCE *mysqli_resource;
+   MYSQLI_WARNING  *w;
+
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_link, mysqli_link_class_entry) == FAILURE) {
+   return;
+   }
+   MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, mysql_link, mysqli_link);
+
+   if (mysql_warning_count(mysql-mysql)) {
+   w = php_get_warnings(mysql-mysql); 
+   } else {
+   RETURN_FALSE;
+   }
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
+   mysqli_resource-ptr = mysqli_resource-info = (void *)w;
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
+}
+/* }}} */
+
+/* {{{ proto object mysqli_get_warnings(object link) */
+PHP_FUNCTION(mysqli_stmt_get_warnings)
+{
+   MY_STMT *stmt;
+   zval*stmt_link;
+   MYSQLI_RESOURCE *mysqli_resource;
+   MYSQLI_WARNING  *w;
+
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, stmt_link, mysqli_stmt_class_entry) == FAILURE) {
+   return;
+   }
+   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT*, stmt_link, mysqli_stmt);
+
+   if (mysql_warning_count(stmt-stmt-mysql)) {
+   w = php_get_warnings(stmt-stmt-mysql); 
+   } else {
+   RETURN_FALSE;
+   }
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
+   mysqli_resource-ptr = mysqli_resource-info = (void *)w;
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
+}
+/* }}} */
+
 #ifdef HAVE_MYSQLI_SET_CHARSET
 /* {{{ proto bool mysqli_set_charset(object link, string csname)
sets client character set */

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_fe.c

2005-06-24 Thread Georg Richter
georg   Fri Jun 24 10:44:46 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_fe.c 
  Log:
  reverted Ilias changes - added get_warnings methods
  (forgot to commit the file in my last commit)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.46r2=1.47ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.46 php-src/ext/mysqli/mysqli_fe.c:1.47
--- php-src/ext/mysqli/mysqli_fe.c:1.46 Wed Jun 22 22:15:04 2005
+++ php-src/ext/mysqli/mysqli_fe.c  Fri Jun 24 10:44:45 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.46 2005/06/23 02:15:04 iliaa Exp $ 
+  $Id: mysqli_fe.c,v 1.47 2005/06/24 14:44:45 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -92,6 +92,7 @@
PHP_FE(mysqli_get_proto_info,   
NULL)
PHP_FE(mysqli_get_server_info,  
NULL)
PHP_FE(mysqli_get_server_version,   
NULL)
+   PHP_FE(mysqli_get_warnings, 
NULL)
PHP_FE(mysqli_init, 
NULL)
PHP_FE(mysqli_info, 
NULL)
PHP_FE(mysqli_insert_id,
NULL)
@@ -131,6 +132,7 @@
PHP_FE(mysqli_stmt_bind_result, 
second_arg_force_by_ref_rest)
PHP_FE(mysqli_stmt_fetch,   
NULL)
PHP_FE(mysqli_stmt_free_result, 
NULL)
+   PHP_FE(mysqli_stmt_get_warnings,
NULL)
PHP_FE(mysqli_stmt_insert_id,   
NULL)
PHP_FE(mysqli_stmt_reset,   
NULL)
PHP_FE(mysqli_stmt_param_count, 
NULL)
@@ -195,7 +197,7 @@
PHP_FALIAS(get_charset,mysqli_get_charset,NULL)
PHP_FALIAS(get_client_info,mysqli_get_client_info,NULL)
PHP_FALIAS(get_server_info,mysqli_get_server_info,NULL)
-/* XXX: temp_fix   PHP_FALIAS(get_warnings, mysqli_warning_construct,  
NULL) */
+   PHP_FALIAS(get_warnings, mysqli_get_warnings, NULL)
PHP_FALIAS(init,mysqli_init,NULL)
PHP_FALIAS(kill,mysqli_kill,NULL)

PHP_FALIAS(set_local_infile_default,mysqli_set_local_infile_default,NULL)
@@ -268,7 +270,7 @@
PHP_FALIAS(data_seek,mysqli_stmt_data_seek,NULL)
PHP_FALIAS(execute,mysqli_stmt_execute,NULL)
PHP_FALIAS(fetch,mysqli_stmt_fetch,NULL)
-/* XXX: temp_fix   PHP_FALIAS(get_warnings, mysqli_warning_construct,  
NULL) */
+   PHP_FALIAS(get_warnings, mysqli_stmt_get_warnings,  NULL)
PHP_FALIAS(result_metadata, mysqli_stmt_result_metadata,NULL)
PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL)
PHP_FALIAS(send_long_data,mysqli_stmt_send_long_data,NULL)

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_warning.c php_mysqli.h

2005-06-22 Thread Georg Richter
))) {
+   if (w-next) {
+   w = w-next;
+   ((MYSQLI_RESOURCE *)(obj-ptr))-ptr = w;
RETURN_TRUE;
}
}
@@ -119,16 +112,19 @@
 }
 /* }}} */
 
-/* {{{ property mysqli_warning_error */
-int mysqli_warning_error(mysqli_object *obj, zval **retval TSRMLS_DC)
+/* {{{ property mysqli_warning_message */
+int mysqli_warning_message(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
MYSQLI_WARNING *w;
 
-   ALLOC_ZVAL(*retval);
-   w = obj-valid ? (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr 
: NULL;
+   if (!obj-ptr || !((MYSQLI_RESOURCE *)(obj-ptr))-ptr) {
+   return FAILURE;
+   }
 
-   if (w  w-row  w-row[2]) {
-   ZVAL_STRING(*retval, w-row[2], 1);
+   w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   ALLOC_ZVAL(*retval);
+   if (w-reason) {
+   ZVAL_STRING(*retval, w-reason, 1);
} else {
ZVAL_NULL(*retval);
}
@@ -136,35 +132,94 @@
 }
 /* }}} */
 
+/* {{{ property mysqli_warning_sqlstate */
+int mysqli_warning_sqlstate(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+   MYSQLI_WARNING *w;
+   
+   if (!obj-ptr || !((MYSQLI_RESOURCE *)(obj-ptr))-ptr) {
+   return FAILURE;
+   }
+
+   w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   ALLOC_ZVAL(*retval);
+   ZVAL_STRING(*retval, w-sqlstate, 1);
+   return SUCCESS;
+}
+/* }}} */
+
 /* {{{ property mysqli_warning_error */
 int mysqli_warning_errno(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
MYSQLI_WARNING *w;
 
+   if (!obj-ptr || !((MYSQLI_RESOURCE *)(obj-ptr))-ptr) {
+   return FAILURE;
+   }
+   w = (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
ALLOC_ZVAL(*retval);
-   w = obj-valid ? (MYSQLI_WARNING *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr 
: NULL;
+   ZVAL_LONG(*retval, w-errorno);
+   return SUCCESS;
+}
+/* }}} */
+
+/* {{{ mysqli_warning_construct(object obj) */
+PHP_METHOD(mysqli_warning, __construct)
+{
+   zval**z;
+   mysqli_object   *obj;
+   MYSQL   *hdl;
+   MYSQLI_WARNING  *w;
+   MYSQLI_RESOURCE *mysqli_resource;
+
+   if (ZEND_NUM_ARGS() != 1) {
+   WRONG_PARAM_COUNT;
+   }
+   if (zend_get_parameters_ex(1, z)==FAILURE) {
+   return;
+   }
+   obj = (mysqli_object *)zend_object_store_get_object(*(z) TSRMLS_CC);\
 
-   if (w  w-row  w-row[1]) {
-   ZVAL_LONG(*retval, atoi(w-row[1]));
+   if (obj-zo.ce == mysqli_link_class_entry) {
+   MY_MYSQL *mysql;
+   MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, z, mysqli_link);
+   hdl = mysql-mysql;
+   } else if (obj-zo.ce == mysqli_stmt_class_entry) {
+   MY_STMT *stmt;
+   MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, z, mysqli_stmt);
+   hdl = stmt-stmt-mysql;
} else {
-   ZVAL_NULL(*retval);
+   RETURN_FALSE;
}
-   return SUCCESS;
+
+   if (mysql_warning_count(hdl)) {
+   w = php_get_warnings(hdl); 
+   } else {
+   RETURN_FALSE;
+   }
+
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
+   mysqli_resource-ptr = mysqli_resource-info = (void *)w;
+
+   if (!getThis()) {
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, 
mysqli_link_class_entry);   
+   } else {
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-ptr = mysqli_resource;
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-valid = 1;
+   }
+
 }
 /* }}} */
 
-/* {{{ mysqli_warning_methods[]
- */
 function_entry mysqli_warning_methods[] = {
-   PHP_FALIAS(__construct,mysqli_warning_construct, NULL)
-   PHP_FALIAS(next,mysqli_warning_next,NULL)
+   PHP_ME(mysqli_warning, __construct, NULL, 
ZEND_ACC_PROTECTED)
+   PHP_ME(mysqli_warning, next,NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
-/* }}} */
-
 
 mysqli_property_entry mysqli_warning_property_entries[] = {
-   {error, mysqli_warning_error, NULL},
+   {message, mysqli_warning_message, NULL},
+   {sqlstate, mysqli_warning_sqlstate, NULL},
{errno, mysqli_warning_errno, NULL},
{NULL, NULL, NULL}
 };
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.69r2=1.70ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.69 php-src/ext/mysqli/mysqli.c:1.70
--- php-src/ext/mysqli/mysqli.c:1.69Mon May  9 18:29:21 2005
+++ php-src/ext/mysqli/mysqli.c Wed Jun 22 05:12:43 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.69 2005/05/09 22:29:21 andrey Exp

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

2005-06-22 Thread Georg Richter
georg   Wed Jun 22 06:14:34 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   067.phpt 
  Log:
  added testcase for cursors (nested selects)
  
  

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/067.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/067.phpt
+++ php-src/ext/mysqli/tests/067.phpt
--TEST--
function test: nested selects (cursors)
--SKIPIF--
?php 
require_once('skipif.inc'); 
/* skip cursor test for versions  50004 */
if (mysqli_get_client_version()  50009) {
die(skip Client library doesn't support cursors); 
}
?
--FILE--
?php

function open_cursor($mysql, $query) {
$stmt = $mysql-prepare($query);
$stmt-attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, 
MYSQLI_CURSOR_TYPE_READ_ONLY);
return $stmt;
}

include connect.inc;
$a = array();

/*** test mysqli_connect 127.0.0.1 ***/
$mysql = new mysqli($host, $user, $passwd, test);

for ($i=0;$i  3; $i++) {
$mysql-query(DROP TABLE IF EXISTS cursor$i);
$mysql-query(CREATE TABLE cursor$i (a int not null));
$mysql-query(INSERT INTO cursor$i VALUES 
(1),(2),(3),(4),(5),(6));
$stmt[$i] = open_cursor($mysql, SELECT a FROM cursor$i);
$stmt[$i]-execute();
$stmt[$i]-bind_result($a[$i]);
}


$cnt = 0;
while ($stmt[0]-fetch()) {
$stmt[1]-fetch();
$stmt[2]-fetch();
$cnt += $a[0] + $a[1] + $a[2];
}

for ($i=0; $i  3; $i++) {
$stmt[$i]-close();
}

$mysql-close();
var_dump($cnt);
?
--EXPECT--
int(63)

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



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

2005-06-22 Thread Georg Richter
georg   Wed Jun 22 06:15:37 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   066.phpt 
  Log:
  added testcase for mysqli_warning class
  
  

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/066.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/066.phpt
+++ php-src/ext/mysqli/tests/066.phpt
--TEST--
function test: mysqli_warning object
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php

include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
$mysql = new mysqli($host, $user, $passwd, test);

$mysql-query(DROP TABLE IF EXISTS test_warnings);

$mysql-query(CREATE TABLE test_warnings (a int not null));

$mysql-query(INSERT INTO test_warnings VALUES (1),(2),(NULL));

if (($warning = new mysqli_warning($mysql))) {
do {
printf(Warning\n);
} while ($warning-next());
}

$mysql-close();
?
--EXPECT--
Warning

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c /ext/mysqli/tests bug33263.phpt

2005-06-17 Thread Georg Richter
georg   Fri Jun 17 12:32:43 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   bug33263.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fix for bug #33263 (mysqli_real_escape doesn't work in __construct)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.116r2=1.117ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.116 
php-src/ext/mysqli/mysqli_api.c:1.117
--- php-src/ext/mysqli/mysqli_api.c:1.116   Sat May 21 04:38:53 2005
+++ php-src/ext/mysqli/mysqli_api.c Fri Jun 17 12:32:40 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.116 2005/05/21 08:38:53 georg Exp $ 
+  $Id: mysqli_api.c,v 1.117 2005/06/17 16:32:40 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1030,7 +1030,13 @@
 
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
mysqli_resource-ptr = (void *)mysql;
-   MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);   
+
+   if (!getThis()) {
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, 
mysqli_link_class_entry);   
+   } else {
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-ptr = mysqli_resource;
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-valid = 1;
+   }
 }
 /* }}} */
 
@@ -1743,7 +1749,7 @@
ulong   attr;
int rc;
 
-   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Olb, mysql_stmt, mysqli_stmt_class_entry, attr, mode) == FAILURE) {
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Oll, mysql_stmt, mysqli_stmt_class_entry, attr, mode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt); 

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug33263.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug33263.phpt
+++ php-src/ext/mysqli/tests/bug33263.phpt
--TEST--
bug #33263 (mysqli_real_connect in __construct) 
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php

include connect.inc;

class test extends mysqli
{
public function __construct($host, $user, $passwd, $db) {
parent::init();
parent::real_connect($host, $user, $passwd, $db);
}
}

$mysql = new test($host, $user, $passwd, test);

$stmt = $mysql-prepare(SELECT DATABASE());
$stmt-execute();
$stmt-bind_result($db);
$stmt-fetch();
$stmt-close();

var_dump($db);

$mysql-close();
?
--EXPECT--
string(4) test

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c /ext/mysqli/tests bug33263.phpt

2005-06-17 Thread Georg Richter
georg   Fri Jun 17 12:37:08 2005 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   bug33263.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
  MFH: fix for bug #33263
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.434r2=1.1760.2.435ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.434 php-src/NEWS:1.1760.2.435
--- php-src/NEWS:1.1760.2.434   Fri Jun 17 06:51:09 2005
+++ php-src/NEWSFri Jun 17 12:37:07 2005
@@ -18,6 +18,7 @@
 - Fixed bug #33277 (private method accessed by child class). (Dmitry)
 - Fixed bug #33268 (iconv_strlen() works only with a parameter of  3 in 
   length). (Ilia)
+- Fixed bug #33263 (mysqli_real_escape doesn't work in __construct) (Georg)
 - Fixed bug #33243 (ze1_compatibility_mode does not work as expected). (Dmitry)
 - Fixed bug #33242 (Mangled error message when stream fails). (Derick)
 - Fixed bug #33222 (segfault when CURL handle is closed in a callback). (Tony)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.21r2=1.87.2.22ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.21 
php-src/ext/mysqli/mysqli_api.c:1.87.2.22
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.21   Wed Jun 15 10:04:23 2005
+++ php-src/ext/mysqli/mysqli_api.c Fri Jun 17 12:37:07 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.21 2005/06/15 14:04:23 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.22 2005/06/17 16:37:07 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1032,7 +1032,13 @@
 
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
mysqli_resource-ptr = (void *)mysql;
-   MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);   
+
+   if (!getThis()) {
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, 
mysqli_link_class_entry);   
+   } else {
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-ptr = mysqli_resource;
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-valid = 1;
+   }
 }
 /* }}} */
 

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug33263.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug33263.phpt
+++ php-src/ext/mysqli/tests/bug33263.phpt
--TEST--
bug #33263 (mysqli_real_connect in __construct) 
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php

include connect.inc;

class test extends mysqli
{
public function __construct($host, $user, $passwd, $db) {
parent::init();
parent::real_connect($host, $user, $passwd, $db);
}
}

$mysql = new test($host, $user, $passwd, test);

$stmt = $mysql-prepare(SELECT DATABASE());
$stmt-execute();
$stmt-bind_result($db);
$stmt-fetch();
$stmt-close();

var_dump($db);

$mysql-close();
?
--EXPECT--
string(4) test

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c

2005-06-15 Thread Georg Richter
georg   Wed Jun 15 10:04:24 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fixed parameter parse string for mysqli_stmt_attr_set
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.20r2=1.87.2.21ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.20 
php-src/ext/mysqli/mysqli_api.c:1.87.2.21
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.20   Sat May 21 04:54:56 2005
+++ php-src/ext/mysqli/mysqli_api.c Wed Jun 15 10:04:23 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.20 2005/05/21 08:54:56 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.21 2005/06/15 14:04:23 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1779,7 +1779,7 @@
ulong   attr;
int rc;
 
-   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Olb, mysql_stmt, mysqli_stmt_class_entry, attr, mode) == FAILURE) {
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Oll, mysql_stmt, mysqli_stmt_class_entry, attr, mode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt); 


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



[PHP-CVS] cvs: php-src / NEWS /ext/mysqli mysqli_fe.c mysqli_nonapi.c php_mysqli.h

2005-06-03 Thread Georg Richter
georg   Fri Jun  3 04:49:01 2005 EDT

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli php_mysqli.h mysqli_nonapi.c mysqli_fe.c 
  Log:
  added new function mysqli_get_charset
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1904r2=1.1905ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1904 php-src/NEWS:1.1905
--- php-src/NEWS:1.1904 Sun May 29 12:51:24 2005
+++ php-src/NEWSFri Jun  3 04:48:58 2005
@@ -57,6 +57,13 @@
   . pg_result_error_field() - highly detailed error information, 
 most importantly the SQLSTATE error code.
   . pg_set_error_verbosity() - set verbosity of errors.
+- Improved extension mysqli (Georg)
+  . added constructor for mysqli_stmt and mysqli_result classes
+  . added new function mysqli_get_charset
+  . added new class mysqli_driver
+  . added new class mysqli_warning
+  . added new class mysqli_execption 
+  . added new class mysqli_sql_exception
 - Added optional fifth parameter count to preg_replace_callback() and
   preg_replace() to count the number of replacements made. FR #32275. (Andrey)
 - Added optional third parameter charlist to str_word_count() which
@@ -65,10 +72,7 @@
 - Added pg_field_type_oid() PostgreSQL function. (mauroi at digbang dot com)
 - Added zend_declare_property_...() and zend_update_property_...()
   API functions for bool, double and binary safe strings. (Hartmut)
-- Added new classes in mysqli: mysqli_driver, mysqli_warning, mysqli_exception,
-  and mysqli_sql_exception. (Georg)
 - Added possibility to access INI variables from within .ini file. (Andrei)
-- Added constructors for mysqli_stmt and mysqli_result classes. (Georg)
 - Added variable $_SERVER['REQUEST_TIME'] containing request start time. (Ilia)
 - Added optional float parameter to gettimeofday(). (Ilia)
 - Added apache_reset_timeout() Apache1 function. (Rasmus)
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.48r2=1.49ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.48 
php-src/ext/mysqli/php_mysqli.h:1.49
--- php-src/ext/mysqli/php_mysqli.h:1.48Sat May 21 04:46:45 2005
+++ php-src/ext/mysqli/php_mysqli.h Fri Jun  3 04:49:00 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.48 2005/05/21 08:46:45 georg Exp $ 
+  $Id: php_mysqli.h,v 1.49 2005/06/03 08:49:00 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -95,6 +95,32 @@
void*userdata;
 } mysqli_local_infile;
 
+typedef struct {
+  uint number;
+  uint primary_number;
+  uint binary_number;
+  uint state;
+  const char   *csname;
+  const char   *name;
+  const char   *comment;
+  const char   *tailoring;
+  unsigned char*ctype;
+  unsigned char*to_lower;
+  unsigned char*to_upper;
+  unsigned char*sort_order;
+  unsigned short   *contractions;
+  unsigned short   **sort_order_big;
+  unsigned short   *tab_to_uni;
+  void *tab_from_uni;
+  unsigned char*state_map;
+  unsigned char*ident_map;
+  uint strxfrm_multiply;
+  uint mbminlen;
+  uint mbmaxlen;
+  unsigned short   min_sort_char;
+  unsigned short   max_sort_char; /* For LIKE optimization */
+} CHARSET_INFO;
+
 #define phpext_mysqli_ptr mysqli_module_entry
 
 #ifdef PHP_WIN32
@@ -326,6 +352,7 @@
 PHP_FUNCTION(mysqli_field_seek);
 PHP_FUNCTION(mysqli_field_tell);
 PHP_FUNCTION(mysqli_free_result);
+PHP_FUNCTION(mysqli_get_charset);
 PHP_FUNCTION(mysqli_get_client_info);
 PHP_FUNCTION(mysqli_get_client_version);
 PHP_FUNCTION(mysqli_get_host_info);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.45r2=1.46ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.45 
php-src/ext/mysqli/mysqli_nonapi.c:1.46
--- php-src/ext/mysqli/mysqli_nonapi.c:1.45 Fri May 13 09:56:04 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Fri Jun  3 04:49:01 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.45 2005/05/13 13:56:04 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.46 2005/06/03 08:49:01 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -274,6 +274,31 @@
 /* }}} */
 #endif
 
+/* {{{ object mysqli_get_charset(object link) 
+   returns a character set object */
+PHP_FUNCTION(mysqli_get_charset)
+{
+   MY_MYSQL*mysql;
+   zval*mysql_link;
+   CHARSET_INFO

[PHP-CVS] cvs: php-src /ext/mysqli php_mysqli.h /ext/mysqli/tests bug33090.phpt

2005-05-21 Thread Georg Richter
georg   Sat May 21 04:46:47 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   bug33090.phpt 

  Modified files:  
/php-src/ext/mysqli php_mysqli.h 
  Log:
  enabled set_charset for MySQL Versions = 5.0.6
  added testcase for bug #33090
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.47r2=1.48ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.47 
php-src/ext/mysqli/php_mysqli.h:1.48
--- php-src/ext/mysqli/php_mysqli.h:1.47Fri May 13 09:30:22 2005
+++ php-src/ext/mysqli/php_mysqli.h Sat May 21 04:46:45 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.47 2005/05/13 13:30:22 georg Exp $ 
+  $Id: php_mysqli.h,v 1.48 2005/05/21 08:46:45 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -103,7 +103,7 @@
 #define PHP_MYSQLI_API
 #endif
 
-#if MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5
+#if (MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5) || MYSQL_VERSION_ID 
 50005
 #define HAVE_MYSQLI_SET_CHARSET
 #endif
 

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug33090.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug33090.phpt
+++ php-src/ext/mysqli/tests/bug33090.phpt
--TEST--
Bug #33090
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include (connect.inc);

/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user, $passwd);
mysqli_select_db($link, test);

if (!($link-prepare(this makes no sense))) {
printf(%d\n, $link-errno);
printf(%s\n, $link-sqlstate);
}   
$link-close();
?
--EXPECT--
1064
42000

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c php_mysqli.h /ext/mysqli/tests bug33090.phpt

2005-05-21 Thread Georg Richter
georg   Sat May 21 04:54:57 2005 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   bug33090.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli php_mysqli.h mysqli_api.c 
  Log:
  MFH:
  - fix for bug #33090 (mysqli_prepare doesn't return an error)
  - mysql_set_charset now works for MySQL = 5.0.6
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.391r2=1.1760.2.392ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.391 php-src/NEWS:1.1760.2.392
--- php-src/NEWS:1.1760.2.391   Fri May 20 10:24:16 2005
+++ php-src/NEWSSat May 21 04:54:50 2005
@@ -11,6 +11,7 @@
 - Fixed ext/mysqli to allocate less memory when fetching bound params
   of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #33090 (mysqli_prepare doesn't return an error). (Georg)
 - Fixed bug #33076 (str_ireplace() incorrectly counts result string length 
   and may cause segfault). (Tony)
 - Fixed bug #33059 (crash when moving xml attribute set in dtd). (Ilia)
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.38.2.5r2=1.38.2.6ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.38.2.5 
php-src/ext/mysqli/php_mysqli.h:1.38.2.6
--- php-src/ext/mysqli/php_mysqli.h:1.38.2.5Fri May 13 09:53:08 2005
+++ php-src/ext/mysqli/php_mysqli.h Sat May 21 04:54:56 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.38.2.5 2005/05/13 13:53:08 georg Exp $ 
+  $Id: php_mysqli.h,v 1.38.2.6 2005/05/21 08:54:56 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -95,7 +95,7 @@
 #define PHP_MYSQLI_API
 #endif
 
-#if MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5
+#if (MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5) || MYSQL_VERSION_ID 
 50005
 #define HAVE_MYSQLI_SET_CHARSET
 #endif
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.19r2=1.87.2.20ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.19 
php-src/ext/mysqli/mysqli_api.c:1.87.2.20
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.19   Mon May  9 18:31:52 2005
+++ php-src/ext/mysqli/mysqli_api.c Sat May 21 04:54:56 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.19 2005/05/09 22:31:52 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.20 2005/05/21 08:54:56 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1074,7 +1074,7 @@
 }
 /* }}} */
 
-/* {{{ proto mysqli_set_local_infile_default(object link)
+/* {{{ proto void mysqli_set_local_infile_default(object link)
unsets user defined handler for load local infile command */
 PHP_FUNCTION(mysqli_set_local_infile_default)
 {
@@ -1279,14 +1279,22 @@
 
if ((stmt-stmt = mysql_stmt_init(mysql-mysql))) {
if (mysql_stmt_prepare(stmt-stmt, query, query_len)) {
-   if (stmt-stmt-last_errno) {
-   /* if we close the statement handle, we have to 
copy the errors to connection handle */
-   mysql-mysql-net.last_errno = 
stmt-stmt-last_errno;
-   strcpy(mysql-mysql-net.last_error, 
stmt-stmt-last_error);
-   strcpy(mysql-mysql-net.sqlstate, 
stmt-stmt-sqlstate);
-   }
+   char  last_error[MYSQL_ERRMSG_SIZE];
+   char  sqlstate[SQLSTATE_LENGTH+1];  
+   unsigned int last_errno;
+
+   /* mysql_stmt_close clears errors, so we have to store 
them temporarily */
+   last_errno = stmt-stmt-last_errno;
+   memcpy(last_error, stmt-stmt-last_error, 
MYSQL_ERRMSG_SIZE);
+   memcpy(sqlstate, mysql-mysql-net.sqlstate, 
SQLSTATE_LENGTH+1);
+
mysql_stmt_close(stmt-stmt);
stmt-stmt = NULL;
+
+   /* restore error messages */
+   mysql-mysql-net.last_errno = last_errno;
+   memcpy(mysql-mysql-net.last_error, last_error, 
MYSQL_ERRMSG_SIZE);
+   memcpy(mysql-mysql-net.sqlstate, sqlstate, 
SQLSTATE_LENGTH+1);
}
} 


http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug33090.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug33090.phpt
+++ php-src/ext/mysqli/tests/bug33090.phpt
--TEST--
Bug #33090
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include (connect.inc);

/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect($host, $user

[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2005-05-21 Thread Georg Richter
georg   Sat May 21 04:38:56 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fix for bug #33090 (mysql_prepare doesn't return error)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.115r2=1.116ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.115 
php-src/ext/mysqli/mysqli_api.c:1.116
--- php-src/ext/mysqli/mysqli_api.c:1.115   Mon May  9 18:29:54 2005
+++ php-src/ext/mysqli/mysqli_api.c Sat May 21 04:38:53 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.115 2005/05/09 22:29:54 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.116 2005/05/21 08:38:53 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -1278,14 +1278,22 @@
 
if ((stmt-stmt = mysql_stmt_init(mysql-mysql))) {
if (mysql_stmt_prepare(stmt-stmt, query, query_len)) {
-   if (stmt-stmt-last_errno) {
-   /* if we close the statement handle, we have to 
copy the errors to connection handle */
-   mysql-mysql-net.last_errno = 
stmt-stmt-last_errno;
-   strcpy(mysql-mysql-net.last_error, 
stmt-stmt-last_error);
-   strcpy(mysql-mysql-net.sqlstate, 
stmt-stmt-sqlstate);
-   }
+   char  last_error[MYSQL_ERRMSG_SIZE];
+   char  sqlstate[SQLSTATE_LENGTH+1];  
+   unsigned int last_errno;
+
+   /* mysql_stmt_close clears errors, so we have to store 
them temporarily */
+   last_errno = stmt-stmt-last_errno;
+   memcpy(last_error, stmt-stmt-last_error, 
MYSQL_ERRMSG_SIZE);
+   memcpy(sqlstate, mysql-mysql-net.sqlstate, 
SQLSTATE_LENGTH+1);
+
mysql_stmt_close(stmt-stmt);
stmt-stmt = NULL;
+
+   /* restore error messages */
+   mysql-mysql-net.last_errno = last_errno;
+   memcpy(mysql-mysql-net.last_error, last_error, 
MYSQL_ERRMSG_SIZE);
+   memcpy(mysql-mysql-net.sqlstate, sqlstate, 
SQLSTATE_LENGTH+1);
}
} 


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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_fe.c mysqli_nonapi.c php_mysqli.h /ext/mysqli/tests 065.phpt

2005-05-13 Thread Georg Richter
georg   Fri May 13 09:11:41 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_nonapi.c mysqli_fe.c php_mysqli.h 
/php-src/ext/mysqli/tests   065.phpt 
  Log:
  - fixed compile error under windows. Functionality for changing the 
  character set was moved to libmysql (4.1 bk tree - will be merged into
  5.0 within the next days).
  - renamed mysql_set_character_set to mysqli_set_charset
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.43r2=1.44ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.43 
php-src/ext/mysqli/mysqli_nonapi.c:1.44
--- php-src/ext/mysqli/mysqli_nonapi.c:1.43 Sun May  8 04:39:54 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Fri May 13 09:11:40 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.43 2005/05/08 08:39:54 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.44 2005/05/13 13:11:40 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -254,12 +254,10 @@
 /* }}} */
 
 #ifdef HAVE_MYSQLI_SET_CHARSET
-/* {{{ proto bool mysqli_set_character_set_name(object link, string csname)
+/* {{{ proto bool mysqli_set_charset(object link, string csname)
sets client character set */
-PHP_FUNCTION(mysqli_set_character_set_name)
+PHP_FUNCTION(mysqli_set_charset)
 {
-   struct charset_info_st *cs;
-   const char *save_csdir = charsets_dir;
MY_MYSQL*mysql;
zval*mysql_link;
char*cs_name = NULL;
@@ -270,30 +268,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, mysql_link, mysqli_link);
 
-   if (mysql-mysql-options.charset_dir){
-   charsets_dir = mysql-mysql-options.charset_dir; 
-   }
-
-   cs = get_charset_by_csname(cs_name, 1, MYF(0));
-
-   if (cs) {
-   char buff[MY_CS_NAME_SIZE + 10];
-   charsets_dir = save_csdir;
-   sprintf(buff, SET NAMES %s, cs_name);
-   if (!mysql_query(mysql-mysql, buff)) {
-   mysql-mysql-charset = cs;
-   RETURN_TRUE;
-   } 
-   } else {
-   char cs_dir_name[FN_REFLEN];
-   get_charsets_dir(cs_dir_name);
-   mysql-mysql-net.last_errno=CR_CANT_READ_CHARSET;
-   strcpy(mysql-mysql-net.sqlstate, HY000);
-   sprintf(mysql-mysql-net.last_error, Can't initialize 
character set %-.32s (path: %-.100s), 
-   cs_name, cs_dir_name);
+   if (mysql_set_character_set(mysql-mysql, cs_name)) {
+   RETURN_FALSE;
}
-   charsets_dir = save_csdir;
-   RETURN_FALSE;
+   RETURN_TRUE;
 }
 /* }}} */
 #endif
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.43r2=1.44ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.43 php-src/ext/mysqli/mysqli_fe.c:1.44
--- php-src/ext/mysqli/mysqli_fe.c:1.43 Sun May  8 04:39:54 2005
+++ php-src/ext/mysqli/mysqli_fe.c  Fri May 13 09:11:40 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.43 2005/05/08 08:39:54 georg Exp $ 
+  $Id: mysqli_fe.c,v 1.44 2005/05/13 13:11:40 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -117,7 +117,7 @@
PHP_FE(mysqli_rpl_query_type,   
NULL)
PHP_FE(mysqli_select_db,
NULL)
 #ifdef HAVE_MYSQLI_SET_CHARSET
-   PHP_FE(mysqli_set_character_set_name,   NULL)
+   PHP_FE(mysqli_set_charset,  
NULL)
 #endif
PHP_FE(mysqli_stmt_attr_get,
NULL)
PHP_FE(mysqli_stmt_attr_set,
NULL)
@@ -181,7 +181,6 @@
 function_entry mysqli_link_methods[] = {
PHP_FALIAS(autocommit,mysqli_autocommit,NULL)
PHP_FALIAS(change_user,mysqli_change_user,NULL)
-   PHP_FALIAS(character_set_name,mysqli_character_set_name,NULL)
PHP_FALIAS(client_encoding, mysqli_character_set_name,NULL)
PHP_FALIAS(close,mysqli_close,NULL)
PHP_FALIAS(commit,mysqli_commit,NULL)
@@ -218,8 +217,7 @@
PHP_FALIAS(rpl_query_type,mysqli_rpl_query_type,NULL)
PHP_FALIAS(select_db,mysqli_select_db,NULL)
 #ifdef HAVE_MYSQLI_SET_CHARSET
-   PHP_FALIAS(set_character_set_name,mysqli_set_character_set_name,NULL)
-   PHP_FALIAS(set_client_encoding,mysqli_set_character_set_name,NULL)
+   PHP_FALIAS(set_charset,mysqli_set_charset,NULL)
 #endif
PHP_FALIAS(set_opt, mysqli_options,NULL)
PHP_FALIAS(slave_query,mysqli_slave_query

[PHP-CVS] cvs: php-src /ext/mysqli php_mysqli.h

2005-05-13 Thread Georg Richter
georg   Fri May 13 09:30:23 2005 EDT

  Modified files:  
/php-src/ext/mysqli php_mysqli.h 
  Log:
  mysql_set_charset now works version undependent for MySQL 4.1.13 and above
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.46r2=1.47ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.46 
php-src/ext/mysqli/php_mysqli.h:1.47
--- php-src/ext/mysqli/php_mysqli.h:1.46Fri May 13 09:11:40 2005
+++ php-src/ext/mysqli/php_mysqli.h Fri May 13 09:30:22 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.46 2005/05/13 13:11:40 georg Exp $ 
+  $Id: php_mysqli.h,v 1.47 2005/05/13 13:30:22 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -99,16 +99,14 @@
 
 #ifdef PHP_WIN32
 #define PHP_MYSQLI_API __declspec(dllexport)
-#if MYSQL_VERSION_ID  50005
-#define HAVE_MYSQLI_SET_CHARSET
-#elif MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5
-#define HAVE_MYSQLI_SET_CHARSET
-#endif
 #else
-#define HAVE_MYSQLI_SET_CHARSET
 #define PHP_MYSQLI_API
 #endif
 
+#if MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5
+#define HAVE_MYSQLI_SET_CHARSET
+#endif
+
 #ifdef ZTS
 #include TSRM.h
 #endif

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_nonapi.c

2005-05-13 Thread Georg Richter
georg   Fri May 13 09:56:04 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_nonapi.c 
  Log:
  charsets_dir is no longer needed
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.44 
php-src/ext/mysqli/mysqli_nonapi.c:1.45
--- php-src/ext/mysqli/mysqli_nonapi.c:1.44 Fri May 13 09:11:40 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Fri May 13 09:56:04 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.44 2005/05/13 13:11:40 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.45 2005/05/13 13:56:04 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -29,8 +29,6 @@
 #include ext/standard/info.h
 #include php_mysqli.h
 
-extern const char *charsets_dir;
-
 /* {{{ proto object mysqli_connect([string hostname [,string username [,string 
passwd [,string dbname [,int port [,string socket]])
Open a connection to a mysql server */ 
 PHP_FUNCTION(mysqli_connect)

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_fe.c mysqli_nonapi.c php_mysqli.h /ext/mysqli/tests 065.phpt

2005-05-13 Thread Georg Richter
georg   Fri May 13 09:53:09 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli php_mysqli.h mysqli_fe.c mysqli_nonapi.c 
/php-src/ext/mysqli/tests   065.phpt 
  Log:
  MFH:
  fixed windows compilation bug
  renamed mysqli_set_character_set_name to mysqli_set_charset
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.382r2=1.1760.2.383ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.382 php-src/NEWS:1.1760.2.383
--- php-src/NEWS:1.1760.2.382   Thu May 12 12:27:06 2005
+++ php-src/NEWSFri May 13 09:53:07 2005
@@ -2,7 +2,7 @@
 |||
 ?? ??? 2005, PHP 5.0.5
 - Removed php_check_syntax() function which never worked properly. (Ilia)
-- Added new function mysqli_set_character_set_name (Georg)
+- Added new function mysqli_set_charset (Georg)
 - Added man pages for phpize and php-config scripts. (Jakub Vrana)
 - Added support for .cc files in extensions. (Brian)
 - Added PHP_INT_MAX and PHP_INT_SIZE as predefined constants. (Andrey)
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.38.2.4r2=1.38.2.5ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.38.2.4 
php-src/ext/mysqli/php_mysqli.h:1.38.2.5
--- php-src/ext/mysqli/php_mysqli.h:1.38.2.4Sun May  8 04:47:39 2005
+++ php-src/ext/mysqli/php_mysqli.h Fri May 13 09:53:08 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: php_mysqli.h,v 1.38.2.4 2005/05/08 08:47:39 georg Exp $ 
+  $Id: php_mysqli.h,v 1.38.2.5 2005/05/13 13:53:08 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -25,9 +25,6 @@
 #undef LIST
 #endif
 
-#include my_global.h
-#include my_sys.h
-#include m_ctype.h
 #include mysql.h
 #include errmsg.h
 
@@ -94,16 +91,14 @@
 
 #ifdef PHP_WIN32
 #define PHP_MYSQLI_API __declspec(dllexport)
-#if MYSQL_VERSION_ID  50005
-#define HAVE_MYSQLI_SET_CHARSET
-#elif MYSQL_VERSION_ID  40110  MYSQL_VERSION_ID  5
-#define HAVE_MYSQLI_SET_CHARSET
-#endif
 #else
-#define HAVE_MYSQLI_SET_CHARSET
 #define PHP_MYSQLI_API
 #endif
 
+#if MYSQL_VERSION_ID  40112  MYSQL_VERSION_ID  5
+#define HAVE_MYSQLI_SET_CHARSET
+#endif
+
 #ifdef ZTS
 #include TSRM.h
 #endif
@@ -283,7 +278,7 @@
 PHP_FUNCTION(mysqli_change_user);
 PHP_FUNCTION(mysqli_character_set_name);
 #ifdef HAVE_MYSQLI_SET_CHARSET
-PHP_FUNCTION(mysqli_set_character_set_name);
+PHP_FUNCTION(mysqli_set_charset);
 #endif
 PHP_FUNCTION(mysqli_close);
 PHP_FUNCTION(mysqli_commit);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.40.2.2r2=1.40.2.3ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.40.2.2 
php-src/ext/mysqli/mysqli_fe.c:1.40.2.3
--- php-src/ext/mysqli/mysqli_fe.c:1.40.2.2 Sun May  8 04:47:39 2005
+++ php-src/ext/mysqli/mysqli_fe.c  Fri May 13 09:53:08 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.40.2.2 2005/05/08 08:47:39 georg Exp $ 
+  $Id: mysqli_fe.c,v 1.40.2.3 2005/05/13 13:53:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -118,7 +118,7 @@
PHP_FE(mysqli_rpl_query_type,   
NULL)
PHP_FE(mysqli_select_db,
NULL)
 #ifdef HAVE_MYSQLI_SET_CHARSET
-   PHP_FE(mysqli_set_character_set_name,   NULL)
+   PHP_FE(mysqli_set_charset,  
NULL)
 #endif
PHP_FE(mysqli_stmt_attr_get,
NULL)
PHP_FE(mysqli_stmt_attr_set,
NULL)
@@ -222,8 +222,7 @@
PHP_FALIAS(rpl_query_type,mysqli_rpl_query_type,NULL)
PHP_FALIAS(select_db,mysqli_select_db,NULL)
 #ifdef HAVE_MYSQLI_SET_CHARSET
-   PHP_FALIAS(set_character_set_name,mysqli_set_character_set_name,NULL)
-   PHP_FALIAS(set_client_encoding,mysqli_set_character_set_name,NULL)
+   PHP_FALIAS(set_charset,mysqli_set_charset,NULL)
 #endif
PHP_FALIAS(set_opt, mysqli_options,NULL)
PHP_FALIAS(slave_query,mysqli_slave_query,NULL)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.34.2.8r2=1.34.2.9ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.34.2.8 
php-src/ext/mysqli/mysqli_nonapi.c:1.34.2.9
--- php-src/ext/mysqli/mysqli_nonapi.c:1.34.2.8 Sun May  8 04:47:39 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Fri May 13 09:53:08 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED

Re: [PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c

2005-05-10 Thread Georg Richter
Am Mo, den 09.05.2005 schrieb Andrey Hristov um 23:47:

   warn the user if he wants to prepare before fetching all previous data
   (in case mysqli_stmt_store_result() wasn't called or not enough calls
   to mysqli_stmt_fetch()).

Did you check this behaviour with server side cursors (MySQL 5.0) too?

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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



Re: [PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/mysql/libmysql config-win.h

2005-05-10 Thread Georg Richter
Am Mo, den 09.05.2005 schrieb Jani Taskinen um 23:17:
  Just curious..why was it disabled..? :)
 
  --Jani
 

Afaik someone disabled it when PHP4 Windows didn't support zlib by
default.

/Georg

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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/mysql/libmysql config-win.h

2005-05-09 Thread Georg Richter
georg   Mon May  9 13:45:51 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
/php-src/ext/mysql/libmysql config-win.h 
  Log:
  fix for bug #32116 (mysql compressed connection doesn't work under win)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.896r2=1.1247.2.897ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.896 php-src/NEWS:1.1247.2.897
--- php-src/NEWS:1.1247.2.896   Sun May  8 12:06:24 2005
+++ php-src/NEWSMon May  9 13:45:49 2005
@@ -36,6 +36,8 @@
   (Moriyoshi)
 - Fixed bug #32245 (xml_parser_free() in a function assigned to the xml parser
   gives a segfault). (Rob)
+- Fixed bug #32116 (mysql compressed connection doesn't work under windows)
+  (Georg)
 - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP 
   response message). (Jani) 
 - Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance 
mode).
http://cvs.php.net/diff.php/php-src/ext/mysql/libmysql/config-win.h?r1=1.8.4.1r2=1.8.4.2ty=u
Index: php-src/ext/mysql/libmysql/config-win.h
diff -u php-src/ext/mysql/libmysql/config-win.h:1.8.4.1 
php-src/ext/mysql/libmysql/config-win.h:1.8.4.2
--- php-src/ext/mysql/libmysql/config-win.h:1.8.4.1 Thu Mar 27 08:29:59 2003
+++ php-src/ext/mysql/libmysql/config-win.h Mon May  9 13:45:50 2005
@@ -239,7 +239,7 @@
 #define HAVE_ALLOCA
 #define HAVE_STRPBRK
 #define HAVE_STRSTR
-/* #define HAVE_COMPRESS -- not with PHP, please */ 
+#define HAVE_COMPRESS
 
 #ifdef NOT_USED
 #define HAVE_SNPRINTF  /* Gave link error */

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_fe.c mysqli_nonapi.c php_mysqli.h /ext/mysqli/tests 065.phpt

2005-05-08 Thread Georg Richter
georg   Sun May  8 04:39:56 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   065.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli_nonapi.c mysqli_fe.c php_mysqli.h 
  Log:
  Added new function mysqli_set_character_set_name
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.42r2=1.43ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.42 
php-src/ext/mysqli/mysqli_nonapi.c:1.43
--- php-src/ext/mysqli/mysqli_nonapi.c:1.42 Fri May  6 06:09:42 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Sun May  8 04:39:54 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.42 2005/05/06 10:09:42 andrey Exp $ 
+  $Id: mysqli_nonapi.c,v 1.43 2005/05/08 08:39:54 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -29,6 +29,8 @@
 #include ext/standard/info.h
 #include php_mysqli.h
 
+extern const char *charsets_dir;
+
 /* {{{ proto object mysqli_connect([string hostname [,string username [,string 
passwd [,string dbname [,int port [,string socket]])
Open a connection to a mysql server */ 
 PHP_FUNCTION(mysqli_connect)
@@ -251,6 +253,51 @@
 }
 /* }}} */
 
+#ifdef HAVE_MYSQLI_SET_CHARSET
+/* {{{ proto bool mysqli_set_character_set_name(object link, string csname)
+   sets client character set */
+PHP_FUNCTION(mysqli_set_character_set_name)
+{
+   struct charset_info_st *cs;
+   const char *save_csdir = charsets_dir;
+   MY_MYSQL*mysql;
+   zval*mysql_link;
+   char*cs_name = NULL;
+   unsigned intlen;
+
+   if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Os, mysql_link, mysqli_link_class_entry, cs_name, len) == FAILURE) {
+   return;
+   }
+   MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL*, mysql_link, mysqli_link);
+
+   if (mysql-mysql-options.charset_dir){
+   charsets_dir = mysql-mysql-options.charset_dir; 
+   }
+
+   cs = get_charset_by_csname(cs_name, 1, MYF(0));
+
+   if (cs) {
+   char buff[MY_CS_NAME_SIZE + 10];
+   charsets_dir = save_csdir;
+   sprintf(buff, SET NAMES %s, cs_name);
+   if (!mysql_query(mysql-mysql, buff)) {
+   mysql-mysql-charset = cs;
+   RETURN_TRUE;
+   } 
+   } else {
+   char cs_dir_name[FN_REFLEN];
+   get_charsets_dir(cs_dir_name);
+   mysql-mysql-net.last_errno=CR_CANT_READ_CHARSET;
+   strcpy(mysql-mysql-net.sqlstate, HY000);
+   sprintf(mysql-mysql-net.last_error, Can't initialize 
character set %-.32s (path: %-.100s), 
+   cs_name, cs_dir_name);
+   }
+   charsets_dir = save_csdir;
+   RETURN_FALSE;
+}
+/* }}} */
+#endif
+
 /*
  * Local variables:
  * tab-width: 4
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_fe.c?r1=1.42r2=1.43ty=u
Index: php-src/ext/mysqli/mysqli_fe.c
diff -u php-src/ext/mysqli/mysqli_fe.c:1.42 php-src/ext/mysqli/mysqli_fe.c:1.43
--- php-src/ext/mysqli/mysqli_fe.c:1.42 Fri Jan  7 09:59:59 2005
+++ php-src/ext/mysqli/mysqli_fe.c  Sun May  8 04:39:54 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.42 2005/01/07 14:59:59 georg Exp $ 
+  $Id: mysqli_fe.c,v 1.43 2005/05/08 08:39:54 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -116,6 +116,9 @@
PHP_FE(mysqli_rpl_probe,
NULL)
PHP_FE(mysqli_rpl_query_type,   
NULL)
PHP_FE(mysqli_select_db,
NULL)
+#ifdef HAVE_MYSQLI_SET_CHARSET
+   PHP_FE(mysqli_set_character_set_name,   NULL)
+#endif
PHP_FE(mysqli_stmt_attr_get,
NULL)
PHP_FE(mysqli_stmt_attr_set,
NULL)
PHP_FE(mysqli_stmt_field_count, 
NULL)
@@ -214,6 +217,10 @@
PHP_FALIAS(rpl_probe,mysqli_rpl_probe,NULL)
PHP_FALIAS(rpl_query_type,mysqli_rpl_query_type,NULL)
PHP_FALIAS(select_db,mysqli_select_db,NULL)
+#ifdef HAVE_MYSQLI_SET_CHARSET
+   PHP_FALIAS(set_character_set_name,mysqli_set_character_set_name,NULL)
+   PHP_FALIAS(set_client_encoding,mysqli_set_character_set_name,NULL)
+#endif
PHP_FALIAS(set_opt, mysqli_options,NULL)
PHP_FALIAS(slave_query,mysqli_slave_query,NULL)
PHP_FALIAS(ssl_set,mysqli_ssl_set,NULL)
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1

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

2005-05-07 Thread Georg Richter
georg   Sat May  7 03:55:01 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   064.phpt 
  Log:
  fix for 5_0. Statement constructor doesn't exist in 5_0
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/064.phpt?r1=1.1.2.2r2=1.1.2.3ty=u
Index: php-src/ext/mysqli/tests/064.phpt
diff -u php-src/ext/mysqli/tests/064.phpt:1.1.2.2 
php-src/ext/mysqli/tests/064.phpt:1.1.2.3
--- php-src/ext/mysqli/tests/064.phpt:1.1.2.2   Thu May  5 09:30:31 2005
+++ php-src/ext/mysqli/tests/064.phpt   Sat May  7 03:55:01 2005
@@ -8,7 +8,7 @@
 
$mysql = new mysqli($host, $user, $passwd);
 
-   $stmt = new mysqli_stmt($mysql, SELECT NULL FROM DUAL);
+   $stmt = $mysql-prepare(SELECT NULL FROM DUAL);
$stmt-execute();
$stmt-bind_result($foo);
$stmt-fetch();

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



[PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2005-05-05 Thread Georg Richter
georg   Thu May  5 08:22:49 2005 EDT

  Modified files:  
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  fix for bug #32947 (Incorrect option for mysqli default password)
  
  
http://cvs.php.net/diff.php/php-src/php.ini-dist?r1=1.229r2=1.230ty=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.229 php-src/php.ini-dist:1.230
--- php-src/php.ini-dist:1.229  Thu Apr 28 21:37:19 2005
+++ php-src/php.ini-distThu May  5 08:22:48 2005
@@ -726,10 +726,10 @@
 
 ; Default password for mysqli_connect() (doesn't apply in safe mode).
 ; Note that this is generally a *bad* idea to store passwords in this file.
-; *Any* user with PHP access can run 'echo 
get_cfg_var(mysqli.default_password)
+; *Any* user with PHP access can run 'echo get_cfg_var(mysqli.default_pw)
 ; and reveal this password!  And of course, any users with read access to this
 ; file will be able to reveal the password as well.
-mysqli.default_password =
+mysqli.default_pw =
 
 ; Allow or prevent reconnect
 mysqli.reconnect = Off
http://cvs.php.net/diff.php/php-src/php.ini-recommended?r1=1.175r2=1.176ty=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.175 php-src/php.ini-recommended:1.176
--- php-src/php.ini-recommended:1.175   Thu Apr 28 21:37:19 2005
+++ php-src/php.ini-recommended Thu May  5 08:22:48 2005
@@ -784,10 +784,10 @@
 
 ; Default password for mysqli_connect() (doesn't apply in safe mode).
 ; Note that this is generally a *bad* idea to store passwords in this file.
-; *Any* user with PHP access can run 'echo 
get_cfg_var(mysqli.default_password)
+; *Any* user with PHP access can run 'echo get_cfg_var(mysqli.default_pw)
 ; and reveal this password!  And of course, any users with read access to this
 ; file will be able to reveal the password as well.
-mysqli.default_password =
+mysqli.default_pw =
 
 ; Allow or prevent reconnect
 mysqli.reconnect = Off

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS php.ini-dist php.ini-recommended

2005-05-05 Thread Georg Richter
georg   Thu May  5 08:33:56 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS php.ini-dist php.ini-recommended 
  Log:
  MFH: fix for bug #32947
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.368r2=1.1760.2.369ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.368 php-src/NEWS:1.1760.2.369
--- php-src/NEWS:1.1760.2.368   Wed May  4 07:16:54 2005
+++ php-src/NEWSThu May  5 08:33:56 2005
@@ -10,6 +10,7 @@
 - Fixed ext/mysqli to allocate less memory when fetching bound params
   of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
 - Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
 - Fixed bug #32852 (Crash with singleton and __destruct when
   zend.ze1_compatibility_mode = On). (Dmitry)
http://cvs.php.net/diff.php/php-src/php.ini-dist?r1=1.215.2.11r2=1.215.2.12ty=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.215.2.11 php-src/php.ini-dist:1.215.2.12
--- php-src/php.ini-dist:1.215.2.11 Thu Apr 28 21:37:37 2005
+++ php-src/php.ini-distThu May  5 08:33:56 2005
@@ -720,10 +720,10 @@
 
 ; Default password for mysqli_connect() (doesn't apply in safe mode).
 ; Note that this is generally a *bad* idea to store passwords in this file.
-; *Any* user with PHP access can run 'echo 
get_cfg_var(mysqli.default_password)
+; *Any* user with PHP access can run 'echo get_cfg_var(mysqli.default_pw)
 ; and reveal this password!  And of course, any users with read access to this
 ; file will be able to reveal the password as well.
-mysqli.default_password =
+mysqli.default_pw =
 
 ; Allow or prevent reconnect
 mysqli.reconnect = Off
http://cvs.php.net/diff.php/php-src/php.ini-recommended?r1=1.159.2.11r2=1.159.2.12ty=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.159.2.11 
php-src/php.ini-recommended:1.159.2.12
--- php-src/php.ini-recommended:1.159.2.11  Thu Apr 28 21:37:37 2005
+++ php-src/php.ini-recommended Thu May  5 08:33:56 2005
@@ -778,10 +778,10 @@
 
 ; Default password for mysqli_connect() (doesn't apply in safe mode).
 ; Note that this is generally a *bad* idea to store passwords in this file.
-; *Any* user with PHP access can run 'echo 
get_cfg_var(mysqli.default_password)
+; *Any* user with PHP access can run 'echo get_cfg_var(mysqli.default_pw)
 ; and reveal this password!  And of course, any users with read access to this
 ; file will be able to reveal the password as well.
-mysqli.default_password =
+mysqli.default_pw =
 
 ; Allow or prevent reconnect
 mysqli.reconnect = Off

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_api.c /ext/mysqli/tests 064.phpt

2005-05-05 Thread Georg Richter
georg   Thu May  5 09:02:32 2005 EDT

  Added files: 
/php-src/ext/mysqli/tests   064.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_api.c 
  Log:
  fixed memleak in mysqli_close
  fixed bug #32956 (mysqli_bind_result doesn't support MYSQL_TYPE_NULL)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.67r2=1.68ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.67 php-src/ext/mysqli/mysqli.c:1.68
--- php-src/ext/mysqli/mysqli.c:1.67Fri Apr 29 06:23:55 2005
+++ php-src/ext/mysqli/mysqli.c Thu May  5 09:02:31 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.67 2005/04/29 10:23:55 andrey Exp $ 
+  $Id: mysqli.c,v 1.68 2005/05/05 13:02:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -69,7 +69,7 @@
for (i=0; i  bbuf.var_cnt; i++) {
 
/* free temporary bind buffer */
-   if (type == FETCH_RESULT) {
+   if (type == FETCH_RESULT  bbuf.buf[i].val) {
efree(bbuf.buf[i].val);
}
 
@@ -133,9 +133,14 @@
if (my_res  my_res-ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res-ptr;

-   mysql_close(mysql-mysql);
+   if (mysql-mysql) {
+   mysql_close(mysql-mysql);
+   }
+
+   php_clear_mysql(mysql);
+   efree(mysql);
 
-   php_clear_mysql(mysql); 
+   my_res-ptr = NULL;
}
} else if (intern-zo.ce == mysqli_stmt_class_entry) { /* stmt object */
if (my_res  my_res-ptr) {
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.107r2=1.108ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.107 
php-src/ext/mysqli/mysqli_api.c:1.108
--- php-src/ext/mysqli/mysqli_api.c:1.107   Wed Apr 27 13:53:15 2005
+++ php-src/ext/mysqli/mysqli_api.c Thu May  5 09:02:31 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.107 2005/04/27 17:53:15 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.108 2005/05/05 13:02:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -277,6 +277,15 @@
bind[ofs].is_null = stmt-result.is_null[ofs];
break;
 
+   case MYSQL_TYPE_NULL:
+   stmt-result.buf[ofs].type = IS_NULL; 
+   stmt-result.buf[ofs].buflen = 0;
+   bind[ofs].buffer_type = MYSQL_TYPE_NULL;
+   bind[ofs].buffer = 0;
+   bind[ofs].is_null = stmt-result.is_null[ofs];
+   bind[ofs].buffer_length = 0;
+   break;
+
case MYSQL_TYPE_SHORT:
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_LONG:
@@ -423,7 +432,8 @@
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
mysql_close(mysql-mysql);
-   php_clear_mysql(mysql); 
+   php_clear_mysql(mysql);
+   efree(mysql);
MYSQLI_CLEAR_RESOURCE(mysql_link); 
RETURN_TRUE;
 }
@@ -1013,7 +1023,7 @@
 PHP_FUNCTION(mysqli_init)
 {
MYSQLI_RESOURCE *mysqli_resource;
-   MY_MYSQL *mysql = (MY_MYSQL *)calloc(1, sizeof(MY_MYSQL));
+   MY_MYSQL *mysql = (MY_MYSQL *)ecalloc(1, sizeof(MY_MYSQL));
 
if (!(mysql-mysql = mysql_init(NULL))) {
efree(mysql);

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/064.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/064.phpt
+++ php-src/ext/mysqli/tests/064.phpt
--TEST--
NULL binding 
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include connect.inc;

$mysql = new mysqli($host, $user, $passwd);

$stmt = new mysqli_stmt($mysql, SELECT NULL FROM DUAL);
$stmt-execute();
$stmt-bind_result($foo);
$stmt-fetch();
$stmt-close();
$mysql-close();

var_dump($foo);
?
--EXPECT--
NULL

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli.c mysqli_api.c /ext/mysqli/tests 064.phpt

2005-05-05 Thread Georg Richter
georg   Thu May  5 09:30:31 2005 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   064.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/mysqli mysqli.c mysqli_api.c 
  Log:
  MFH: fix for bug #32956
   fixed memleak in mysql_close
   fixed data truncation in test 009.phpt
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.369r2=1.1760.2.370ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.369 php-src/NEWS:1.1760.2.370
--- php-src/NEWS:1.1760.2.369   Thu May  5 08:33:56 2005
+++ php-src/NEWSThu May  5 09:30:30 2005
@@ -10,6 +10,7 @@
 - Fixed ext/mysqli to allocate less memory when fetching bound params
   of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #32956 (mysql_bind_result doesn't support MYSQL_TYPE_NULL). (Georg)
 - Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
 - Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
 - Fixed bug #32852 (Crash with singleton and __destruct when
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.43.2.15r2=1.43.2.16ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.43.2.15 
php-src/ext/mysqli/mysqli.c:1.43.2.16
--- php-src/ext/mysqli/mysqli.c:1.43.2.15   Fri Apr 29 06:22:35 2005
+++ php-src/ext/mysqli/mysqli.c Thu May  5 09:30:31 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.43.2.15 2005/04/29 10:22:35 andrey Exp $ 
+  $Id: mysqli.c,v 1.43.2.16 2005/05/05 13:30:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -66,7 +66,7 @@
for (i=0; i  bbuf.var_cnt; i++) {
 
/* free temporary bind buffer */
-   if (type == FETCH_RESULT) {
+   if (type == FETCH_RESULT  bbuf.buf[i].val) {
efree(bbuf.buf[i].val);
}
 
@@ -129,10 +129,13 @@
if (instanceof_function(intern-zo.ce, mysqli_link_class_entry 
TSRMLS_CC)) {
if (my_res  my_res-ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res-ptr;
-   
+
mysql_close(mysql-mysql);
 
-   php_clear_mysql(mysql); 
+   php_clear_mysql(mysql);
+   efree(mysql);
+
+   my_res-ptr = NULL;
}
} else if (intern-zo.ce == mysqli_stmt_class_entry) { /* stmt object */
if (my_res  my_res-ptr) {
@@ -512,6 +515,9 @@

/* bind blob support */
REGISTER_LONG_CONSTANT(MYSQLI_NO_DATA, MYSQL_NO_DATA, CONST_CS | 
CONST_PERSISTENT);
+#ifdef MYSQL_DATA_TRUNCATED
+   REGISTER_LONG_CONSTANT(MYSQLI_DATA_TRUNCATED, MYSQL_DATA_TRUNCATED, 
CONST_CS | CONST_PERSISTENT);
+#endif
 
/* reporting */
REGISTER_LONG_CONSTANT(MYSQLI_REPORT_INDEX, MYSQLI_REPORT_INDEX, 
CONST_CS | CONST_PERSISTENT);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.14r2=1.87.2.15ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.14 
php-src/ext/mysqli/mysqli_api.c:1.87.2.15
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.14   Wed Apr 27 13:58:53 2005
+++ php-src/ext/mysqli/mysqli_api.c Thu May  5 09:30:31 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.14 2005/04/27 17:58:53 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.15 2005/05/05 13:30:31 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -301,7 +301,14 @@
bind[ofs].is_null = stmt-result.is_null[ofs];
bind[ofs].buffer_length = 
stmt-result.buf[ofs].buflen;
break;
-
+   case MYSQL_TYPE_NULL:
+   stmt-result.buf[ofs].type = IS_NULL; 
+   stmt-result.buf[ofs].buflen = 0;
+   bind[ofs].buffer_type = MYSQL_TYPE_NULL;
+   bind[ofs].buffer = 0;
+   bind[ofs].is_null = stmt-result.is_null[ofs];
+   bind[ofs].buffer_length = 0;
+   break;
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_TIME:
case MYSQL_TYPE_DATETIME:
@@ -425,7 +432,9 @@
 
mysql_close(mysql-mysql);
php_clear_mysql(mysql); 
+   efree(mysql);
MYSQLI_CLEAR_RESOURCE(mysql_link); 
+
RETURN_TRUE;
 }
 /* }}} */
@@ -618,10 +627,15 @@
memset(stmt-result.buf[i].val, 0, 
stmt-result.buf[i].buflen

[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_api.c

2005-04-20 Thread Georg Richter
georg   Wed Apr 20 08:50:15 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_api.c 
  Log:
  added support for data truncation (bind_result) for MySQL 5.0.5
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.64r2=1.65ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.64 php-src/ext/mysqli/mysqli.c:1.65
--- php-src/ext/mysqli/mysqli.c:1.64Mon Apr 18 02:03:29 2005
+++ php-src/ext/mysqli/mysqli.c Wed Apr 20 08:50:13 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.64 2005/04/18 06:03:29 georg Exp $ 
+  $Id: mysqli.c,v 1.65 2005/04/20 12:50:13 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -561,8 +561,11 @@
REGISTER_LONG_CONSTANT(MYSQLI_RPL_SLAVE, MYSQL_RPL_SLAVE, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(MYSQLI_RPL_ADMIN, MYSQL_RPL_ADMIN, CONST_CS | 
CONST_PERSISTENT);

-   /* bind blob support */
+   /* bind support */
REGISTER_LONG_CONSTANT(MYSQLI_NO_DATA, MYSQL_NO_DATA, CONST_CS | 
CONST_PERSISTENT);
+#ifdef MYSQL_DATA_TRUNCATION
+   REGISTER_LONG_CONSTANT(MYSQLI_DATA_TRUNCATION, MYSQL_DATA_TRUNCATION, 
CONST_CS | CONST_PERSISTENT);
+#endif
 
/* reporting */
REGISTER_LONG_CONSTANT(MYSQLI_REPORT_INDEX, MYSQLI_REPORT_INDEX, 
CONST_CS | CONST_PERSISTENT);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.104r2=1.105ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.104 
php-src/ext/mysqli/mysqli_api.c:1.105
--- php-src/ext/mysqli/mysqli_api.c:1.104   Tue Apr 19 09:28:41 2005
+++ php-src/ext/mysqli/mysqli_api.c Wed Apr 20 08:50:13 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.104 2005/04/19 13:28:41 andrey Exp $ 
+  $Id: mysqli_api.c,v 1.105 2005/04/20 12:50:13 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -606,7 +606,12 @@
memset(stmt-result.buf[i].val, 0, 
stmt-result.buf[i].buflen);
}
}
-   if (!(ret = mysql_stmt_fetch(stmt-stmt))) {
+   ret = mysql_stmt_fetch(stmt-stmt);
+#ifdef MYSQL_DATA_TRUNCATED
+   if (!ret || ret == MYSQL_DATA_TRUNCATED) {
+#else
+   if (!ret || ret == MYSQL_DATA_TRUNCATED) {
+#endif
for (i = 0; i  stmt-result.var_cnt; i++) {
if (stmt-result.vars[i]-type == IS_STRING  
stmt-result.vars[i]-value.str.len) {
efree(stmt-result.vars[i]-value.str.val);

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2005-04-20 Thread Georg Richter
georg   Wed Apr 20 09:24:09 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  another fix for last commit (committed from wrong tree) :(
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.105r2=1.106ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.105 
php-src/ext/mysqli/mysqli_api.c:1.106
--- php-src/ext/mysqli/mysqli_api.c:1.105   Wed Apr 20 08:50:13 2005
+++ php-src/ext/mysqli/mysqli_api.c Wed Apr 20 09:24:08 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.105 2005/04/20 12:50:13 georg Exp $ 
+  $Id: mysqli_api.c,v 1.106 2005/04/20 13:24:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -610,7 +610,7 @@
 #ifdef MYSQL_DATA_TRUNCATED
if (!ret || ret == MYSQL_DATA_TRUNCATED) {
 #else
-   if (!ret || ret == MYSQL_DATA_TRUNCATED) {
+   if (!ret) {
 #endif
for (i = 0; i  stmt-result.var_cnt; i++) {
if (stmt-result.vars[i]-type == IS_STRING  
stmt-result.vars[i]-value.str.len) {

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c /ext/mysqli/tests 009.phpt

2005-04-20 Thread Georg Richter
georg   Wed Apr 20 09:03:01 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli.c 
/php-src/ext/mysqli/tests   009.phpt 
  Log:
  fixed typo in last commit :(
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.65r2=1.66ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.65 php-src/ext/mysqli/mysqli.c:1.66
--- php-src/ext/mysqli/mysqli.c:1.65Wed Apr 20 08:50:13 2005
+++ php-src/ext/mysqli/mysqli.c Wed Apr 20 09:03:01 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.65 2005/04/20 12:50:13 georg Exp $ 
+  $Id: mysqli.c,v 1.66 2005/04/20 13:03:01 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -563,8 +563,8 @@

/* bind support */
REGISTER_LONG_CONSTANT(MYSQLI_NO_DATA, MYSQL_NO_DATA, CONST_CS | 
CONST_PERSISTENT);
-#ifdef MYSQL_DATA_TRUNCATION
-   REGISTER_LONG_CONSTANT(MYSQLI_DATA_TRUNCATION, MYSQL_DATA_TRUNCATION, 
CONST_CS | CONST_PERSISTENT);
+#ifdef MYSQL_DATA_TRUNCATED
+   REGISTER_LONG_CONSTANT(MYSQLI_DATA_TRUNCATED, MYSQL_DATA_TRUNCATED, 
CONST_CS | CONST_PERSISTENT);
 #endif
 
/* reporting */
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/009.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/mysqli/tests/009.phpt
diff -u php-src/ext/mysqli/tests/009.phpt:1.4 
php-src/ext/mysqli/tests/009.phpt:1.5
--- php-src/ext/mysqli/tests/009.phpt:1.4   Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/009.phpt   Wed Apr 20 09:03:01 2005
@@ -25,7 +25,7 @@
$stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch);
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
mysqli_execute($stmt);
-   mysqli_fetch($stmt);
+   $rc = mysqli_fetch($stmt);
 
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
 

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



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

2005-04-18 Thread Georg Richter
georg   Mon Apr 18 02:03:32 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli.c 
  Log:
  cursor support for 5.0.4 (STMT_ATTR_CURSOR_TYPE changed to enum)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.63r2=1.64ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.63 php-src/ext/mysqli/mysqli.c:1.64
--- php-src/ext/mysqli/mysqli.c:1.63Wed Apr  6 02:47:12 2005
+++ php-src/ext/mysqli/mysqli.c Mon Apr 18 02:03:29 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.63 2005/04/06 06:47:12 georg Exp $ 
+  $Id: mysqli.c,v 1.64 2005/04/18 06:03:29 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -506,7 +506,7 @@
/* for mysqli_stmt_set_attr */
REGISTER_LONG_CONSTANT(MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, 
STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT);
 
-#ifdef STMT_ATTR_CURSOR_TYPE
+#if MYSQL_VERSION_ID  50003
REGISTER_LONG_CONSTANT(MYSQLI_STMT_ATTR_CURSOR_TYPE, 
STMT_ATTR_CURSOR_TYPE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(MYSQLI_CURSOR_TYPE_NO_CURSOR, 
CURSOR_TYPE_NO_CURSOR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(MYSQLI_CURSOR_TYPE_READ_ONLY, 
CURSOR_TYPE_READ_ONLY, CONST_CS | CONST_PERSISTENT);

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



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

2005-04-06 Thread Georg Richter
georg   Wed Apr  6 02:47:13 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli.c 
  Log:
  fix for bug #32282 (segfault in mysqli_fetch_array on 64-bit)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.62r2=1.63ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.62 php-src/ext/mysqli/mysqli.c:1.63
--- php-src/ext/mysqli/mysqli.c:1.62Sun Mar  6 16:40:01 2005
+++ php-src/ext/mysqli/mysqli.c Wed Apr  6 02:47:12 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.62 2005/03/06 21:40:01 helly Exp $ 
+  $Id: mysqli.c,v 1.63 2005/04/06 06:47:12 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -737,7 +737,7 @@
 {
MYSQL_RES   *result;
zval*mysql_result;
-   int fetchtype;
+   longfetchtype;
unsigned inti;
MYSQL_FIELD *fields;
MYSQL_ROW   row;

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli.c

2005-04-06 Thread Georg Richter
georg   Wed Apr  6 02:48:14 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli mysqli.c 
  Log:
  MFH: fix for #32282 (segfault in mysqli_fetch_array on 64-bit)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.310r2=1.1760.2.311ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.310 php-src/NEWS:1.1760.2.311
--- php-src/NEWS:1.1760.2.310   Tue Apr  5 10:48:26 2005
+++ php-src/NEWSWed Apr  6 02:48:12 2005
@@ -8,6 +8,7 @@
   longer then the original string). (Ilia)
 - Fixed bug #32491 (File upload error - unable to create a temporary file).
   (Uwe Schindler)
+- Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit) (Georg).
 - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
   (kameshj at fastmail dot fm)
 
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.43.2.12r2=1.43.2.13ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.43.2.12 
php-src/ext/mysqli/mysqli.c:1.43.2.13
--- php-src/ext/mysqli/mysqli.c:1.43.2.12   Sun Mar  6 16:41:38 2005
+++ php-src/ext/mysqli/mysqli.c Wed Apr  6 02:48:13 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.43.2.12 2005/03/06 21:41:38 helly Exp $ 
+  $Id: mysqli.c,v 1.43.2.13 2005/04/06 06:48:13 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -582,7 +582,7 @@
 {
MYSQL_RES   *result;
zval*mysql_result;
-   int fetchtype;
+   longfetchtype;
unsigned inti;
MYSQL_FIELD *fields;
MYSQL_ROW   row;

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



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

2005-02-25 Thread Georg Richter
georg   Fri Feb 25 03:42:31 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   bug30967.phpt 
  Log:
  fix for bug #31939
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/bug30967.phpt?r1=1.1.2.2r2=1.1.2.3ty=u
Index: php-src/ext/mysqli/tests/bug30967.phpt
diff -u php-src/ext/mysqli/tests/bug30967.phpt:1.1.2.2 
php-src/ext/mysqli/tests/bug30967.phpt:1.1.2.3
--- php-src/ext/mysqli/tests/bug30967.phpt:1.1.2.2  Sat Dec  4 04:01:34 2004
+++ php-src/ext/mysqli/tests/bug30967.phpt  Fri Feb 25 03:42:31 2005
@@ -12,7 +12,7 @@
class mysql2 extends mysql1 {
}
 
-   $mysql = new mysql2($host, root, , test);
+   $mysql = new mysql2($host, $user, $passwd, test);
 
$mysql-query(THIS DOES NOT WORK);
printf(%d\n, $mysql-errno);

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



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

2005-02-25 Thread Georg Richter
georg   Fri Feb 25 03:43:41 2005 EDT

  Modified files:  
/php-src/ext/mysqli/tests   bug30967.phpt 
  Log:
  fix for bug #31939
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/bug30967.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/bug30967.phpt
diff -u php-src/ext/mysqli/tests/bug30967.phpt:1.3 
php-src/ext/mysqli/tests/bug30967.phpt:1.4
--- php-src/ext/mysqli/tests/bug30967.phpt:1.3  Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/bug30967.phpt  Fri Feb 25 03:43:41 2005
@@ -12,7 +12,7 @@
class mysql2 extends mysql1 {
}
 
-   $mysql = new mysql2($host, root, , test);
+   $mysql = new mysql2($host, $user, $passwd, test);
 
$mysql-query(THIS DOES NOT WORK);
printf(%d\n, $mysql-errno);

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



[PHP-CVS] cvs: php-src /ext/mysqli config.m4

2005-02-05 Thread Georg Richter
georg   Sat Feb  5 05:59:38 2005 EDT

  Modified files:  
/php-src/ext/mysqli config.m4 
  Log:
  fix for bug #29329
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/config.m4?r1=1.19r2=1.20ty=u
Index: php-src/ext/mysqli/config.m4
diff -u php-src/ext/mysqli/config.m4:1.19 php-src/ext/mysqli/config.m4:1.20
--- php-src/ext/mysqli/config.m4:1.19   Fri Jan  7 09:59:59 2005
+++ php-src/ext/mysqli/config.m4Sat Feb  5 05:59:38 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.19 2005/01/07 14:59:59 georg Exp $
+dnl $Id: config.m4,v 1.20 2005/02/05 10:59:38 georg Exp $
 dnl config.m4 for extension mysqli
 
 PHP_ARG_WITH(mysqli, for MySQLi support,
@@ -47,7 +47,7 @@
 PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
 [ ],[
AC_MSG_ERROR([MySQLI doesn't support versions  4.1.3 (for 
MySQL 4.1.x) and  5.0.1 for (MySQL 5.0.x) anymore. Please update your 
libraries.])
-   ],[])
+   ],[$MYSQLI_LIBLINE])
   ],[
 AC_MSG_ERROR([wrong mysql library version or lib not found. Check 
config.log for more information.])
   ],[

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli config.m4

2005-02-05 Thread Georg Richter
georg   Sat Feb  5 06:02:10 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli config.m4 
  Log:
  MFH: fix for bug 29329
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.235r2=1.1760.2.236ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.235 php-src/NEWS:1.1760.2.236
--- php-src/NEWS:1.1760.2.235   Fri Feb  4 10:42:27 2005
+++ php-src/NEWSSat Feb  5 06:02:07 2005
@@ -89,6 +89,7 @@
 - Fixed bug #29767 (Weird behaviour of __set($name, $value)). (Dmitry)
 - Fixed bug #29733 (printf() handles repeated placeholders wrong).
   (bugs dot php dot net at bluetwanger dot de, Ilia)
+- Fixed bug #29329 (configure for mysqli with shared doesn't work). (Georg)
 - Fixed bug #29136 (make test - libtool failure on MacOSX). (Jani)
 - Fixed bug #28976 (mail(): use From: from headers if sendmail_from is 
empty).
   (Jani)
http://cvs.php.net/diff.php/php-src/ext/mysqli/config.m4?r1=1.17.2.1r2=1.17.2.2ty=u
Index: php-src/ext/mysqli/config.m4
diff -u php-src/ext/mysqli/config.m4:1.17.2.1 
php-src/ext/mysqli/config.m4:1.17.2.2
--- php-src/ext/mysqli/config.m4:1.17.2.1   Thu Jul 22 03:25:31 2004
+++ php-src/ext/mysqli/config.m4Sat Feb  5 06:02:10 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.17.2.1 2004/07/22 07:25:31 georg Exp $
+dnl $Id: config.m4,v 1.17.2.2 2005/02/05 11:02:10 georg Exp $
 dnl config.m4 for extension mysqli
 
 PHP_ARG_WITH(mysqli, for MySQLi support,
@@ -47,7 +47,7 @@
 PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
 [ ],[
AC_MSG_ERROR([MySQLI doesn't support versions  4.1.3 (for 
MySQL 4.1.x) and  5.0.1 for (MySQL 5.0.x) anymore. Please update your 
libraries.])
-   ],[])
+   ],[$MYSQLI_LIBLINE])
   ],[
 AC_MSG_ERROR([wrong mysql library version or lib not found. Check 
config.log for more information.])
   ],[

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c mysqli_prop.c

2005-01-28 Thread Georg Richter
georg   Fri Jan 28 12:37:42 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c mysqli_prop.c 
  Log:
  MFH: Fix for mysql_affected_rows and mysql_stmt_affected_rows
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.223r2=1.1760.2.224ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.223 php-src/NEWS:1.1760.2.224
--- php-src/NEWS:1.1760.2.223   Thu Jan 27 21:00:54 2005
+++ php-src/NEWSFri Jan 28 12:37:41 2005
@@ -6,6 +6,8 @@
 - Changed foreach() to throw an exception if IteratorAggregate::getIterator()
   does not return an Iterator. (Marcus)
 - Changed phpize not to require libtool. (Jani)
+- Fixed a bug in mysql_affected_rows and mysql_stmt_affected_rows when the
+  api function returns -1 (Georg)
 - Fixed several egregious leaks in ext/browscap and sapi/embed. (Andrei)
 - Fixed build system to always use bundled libtool files. (Jani)
 - Fixed a bug in mysqli_stmt_execute() (type conversion with NULL values). 
(Georg)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.10r2=1.87.2.11ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.10 
php-src/ext/mysqli/mysqli_api.c:1.87.2.11
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.10   Thu Jan 27 05:20:21 2005
+++ php-src/ext/mysqli/mysqli_api.c Fri Jan 28 12:37:42 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.10 2005/01/27 10:20:21 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.11 2005/01/28 17:37:42 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -44,6 +44,9 @@
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
rc = mysql_affected_rows(mysql-mysql);
+   if (rc == (my_ulonglong) -1) {
+   RETURN_LONG(-1);
+   }
MYSQLI_RETURN_LONG_LONG(rc);
 }
 /* }}} */
@@ -1480,6 +1483,9 @@
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, mysql_stmt, mysqli_stmt);
 
rc = mysql_stmt_affected_rows(stmt-stmt);
+   if (rc == (my_ulonglong) -1) {
+   RETURN_LONG(-1);
+   }
MYSQLI_RETURN_LONG_LONG(rc)
 }
 /* }}} */
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.14.2.4r2=1.14.2.5ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.14.2.4 
php-src/ext/mysqli/mysqli_prop.c:1.14.2.5
--- php-src/ext/mysqli/mysqli_prop.c:1.14.2.4   Wed Dec 29 06:47:03 2004
+++ php-src/ext/mysqli/mysqli_prop.cFri Jan 28 12:37:42 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.14.2.4 2004/12/29 11:47:03 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.14.2.5 2005/01/28 17:37:42 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -130,9 +130,36 @@
 }
 /* }}} */
 
+/* {{{ property link_affected_rows_read */
+int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+   MY_MYSQL *mysql;
+   my_ulonglong rc;
+
+   ALLOC_ZVAL(*retval); 
+   CHECK_OBJECT();
+
+   mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   rc = mysql_affected_rows(mysql-mysql);
+
+   if (rc == (my_ulonglong)-1) {
+   ZVAL_LONG(*retval, -1);
+   return SUCCESS;
+   } 
+
+   if (rc  LONG_MAX) {
+   ZVAL_LONG(*retval, rc);
+   } else {
+   char ret[40];
+   sprintf(ret, %llu, (my_ulonglong) rc);
+   ZVAL_STRING(*retval, ret, 1);
+   }
+
+   return SUCCESS;
+}
+/* }}} */
 
 /* link properties */
-MYSQLI_MAP_PROPERTY_FUNC_LONG(link_affected_rows_read, mysql_affected_rows, 
MYSQLI_GET_MYSQL(), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, 
MYSQLI_GET_MYSQL(), ulong);
 MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, 
MYSQLI_GET_MYSQL());
 MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, 
MYSQLI_GET_MYSQL(), ulong);
@@ -220,7 +247,35 @@
 }
 /* }}} */
 
-MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_affected_rows_read, 
mysql_stmt_affected_rows, MYSQLI_GET_STMT(), my_ulonglong);
+/* {{{ property stmt_affected_rows_read */
+int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+   MY_STMT *stmt;
+   my_ulonglong rc;
+
+   ALLOC_ZVAL(*retval); 
+   CHECK_OBJECT();
+
+   stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   rc = mysql_stmt_affected_rows(stmt-stmt);
+
+   if (rc == (my_ulonglong)-1) {
+   ZVAL_LONG(*retval, -1);
+   return SUCCESS;
+   } 
+
+   if (rc  LONG_MAX) {
+   ZVAL_LONG(*retval, rc);
+   } else {
+   char ret[40];
+   sprintf(ret, %llu, (my_ulonglong) rc);
+   ZVAL_STRING(*retval, ret, 1

[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2005-01-27 Thread Georg Richter
georg   Thu Jan 27 05:18:30 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  fix for bug #31710 (return value for mysql_rollback is reverted)
  fixed also same behaviour for mysql_commit and mysql_autocommit
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.99r2=1.100ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.99 
php-src/ext/mysqli/mysqli_api.c:1.100
--- php-src/ext/mysqli/mysqli_api.c:1.99Wed Jan 26 20:14:43 2005
+++ php-src/ext/mysqli/mysqli_api.c Thu Jan 27 05:18:28 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.99 2005/01/27 01:14:43 tony2001 Exp $ 
+  $Id: mysqli_api.c,v 1.100 2005/01/27 10:18:28 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -54,7 +54,6 @@
 {
MY_MYSQL*mysql;
zval*mysql_link;
-   unsigned long   rc;
unsigned long   automode;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Ob, mysql_link, mysqli_link_class_entry, automode) == FAILURE) {
@@ -62,9 +61,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
-   rc = (long) mysql_autocommit(mysql-mysql, automode);
-
-   RETURN_BOOL(rc);
+   if (mysql_autocommit(mysql-mysql, automode)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 
@@ -417,14 +417,15 @@
 {
MY_MYSQL*mysql;
zval*mysql_link;
-   ulong   rc;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
-   rc = mysql_commit(mysql-mysql);
-   RETURN_BOOL(rc);
+   if (mysql_commit(mysql-mysql)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 
@@ -1396,7 +1397,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
-   RETURN_BOOL(mysql_rollback(mysql-mysql));
+   if (mysql_rollback(mysql-mysql)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c

2005-01-27 Thread Georg Richter
georg   Thu Jan 27 05:20:21 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
  MFH: fix for bug #31710
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.219r2=1.1760.2.220ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.219 php-src/NEWS:1.1760.2.220
--- php-src/NEWS:1.1760.2.219   Wed Jan 26 20:18:13 2005
+++ php-src/NEWSThu Jan 27 05:20:19 2005
@@ -11,6 +11,8 @@
 - Fixed a bug in mysqli_stmt_execute() (type conversion with NULL values). 
(Georg)
 - Fixed segfault in mysqli_fetch_field_direct() when invalid field offset 
   is passed. (Tony)
+- Fixed bug #31710 (Wrong return values for mysqli_autocommit/commit/rollback).
+  (Georg)
 - Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings).
   (elod at itfais dot com)
 - Fixed bug #31699 (unserialize() float problem on non-English locales). (Ilia)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.9r2=1.87.2.10ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.9 
php-src/ext/mysqli/mysqli_api.c:1.87.2.10
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.9Wed Jan 26 20:11:15 2005
+++ php-src/ext/mysqli/mysqli_api.c Thu Jan 27 05:20:21 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.9 2005/01/27 01:11:15 tony2001 Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.10 2005/01/27 10:20:21 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -54,7 +54,6 @@
 {
MY_MYSQL*mysql;
zval*mysql_link;
-   unsigned long   rc;
unsigned long   automode;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
Ob, mysql_link, mysqli_link_class_entry, automode) == FAILURE) {
@@ -62,9 +61,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
-   rc = (long) mysql_autocommit(mysql-mysql, automode);
-
-   RETURN_BOOL(rc);
+   if (mysql_autocommit(mysql-mysql, automode)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 
@@ -418,14 +418,15 @@
 {
MY_MYSQL*mysql;
zval*mysql_link;
-   ulong   rc;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
O, mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
-   rc = mysql_commit(mysql-mysql);
-   RETURN_BOOL(rc);
+   if (mysql_commit(mysql-mysql)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 
@@ -1398,7 +1399,10 @@
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, mysqli_link);
 
-   RETURN_BOOL(mysql_rollback(mysql-mysql));
+   if (mysql_rollback(mysql-mysql)) {
+   RETURN_FALSE;
+   }
+   RETURN_TRUE;
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_embedded.c /ext/mysqli/tests connect.inc

2005-01-08 Thread Georg Richter
georg   Sat Jan  8 10:11:37 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_embedded.c 
/php-src/ext/mysqli/tests   connect.inc 
  Log:
  fixed compile bug under Windows (libmysql.def currently doesn't export 
mysql_server_init/end).
  Thanks to Sebastian Bergmann for reporting
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_embedded.c?r1=1.1r2=1.2ty=u
Index: php-src/ext/mysqli/mysqli_embedded.c
diff -u php-src/ext/mysqli/mysqli_embedded.c:1.1 
php-src/ext/mysqli/mysqli_embedded.c:1.2
--- php-src/ext/mysqli/mysqli_embedded.c:1.1Fri Jan  7 09:59:59 2005
+++ php-src/ext/mysqli/mysqli_embedded.cSat Jan  8 10:11:35 2005
@@ -31,6 +31,7 @@
initialize and start embedded server */
 PHP_FUNCTION(mysqli_embedded_server_start)
 {
+#ifdef HAVE_EMBEDDED_MYSQLI
int argc = 0;
char **arguments;
char **groups;
@@ -50,68 +51,63 @@
mysql_server_init(-1,NULL, NULL);
RETURN_TRUE;
}
+   /* get arguments */
+   if ((argc = zend_hash_num_elements(HASH_OF(*args {
+   arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
+   arguments[0] = NULL; 
 
-   if (MyG(embedded)) {
-   /* get arguments */
-   if ((argc = zend_hash_num_elements(HASH_OF(*args {
-   arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
-   arguments[0] = NULL; 
-   
-   zend_hash_internal_pointer_reset_ex(HASH_OF(*args), 
pos);
-
-   for (index = 0;; 
zend_hash_move_forward_ex(HASH_OF(*args), pos))   {
-   zval **item;
-
-   if 
(zend_hash_get_current_data_ex(HASH_OF(*args), (void **) item, pos) == 
FAILURE) {
-   break;
-   }
-
-   convert_to_string_ex(item);
-   
-   arguments[++index] = Z_STRVAL_PP(item);
+   zend_hash_internal_pointer_reset_ex(HASH_OF(*args), pos);
+
+   for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), 
pos))   {
+   zval **item;
+
+   if (zend_hash_get_current_data_ex(HASH_OF(*args), (void 
**) item, pos) == FAILURE) {
+   break;
}
-   argc++;
+
+   convert_to_string_ex(item);
+
+   arguments[++index] = Z_STRVAL_PP(item);
}
+   argc++;
+   }
+
+   /* get groups */
+   if ((zend_hash_num_elements(HASH_OF(*grps {
+   groups = safe_emalloc(sizeof(char *), 
zend_hash_num_elements(HASH_OF(*grps)) + 1, 0);
+   arguments[0] = NULL; 
 
-   /* get groups */
-   if ((zend_hash_num_elements(HASH_OF(*grps {
-   groups = safe_emalloc(sizeof(char *), 
zend_hash_num_elements(HASH_OF(*grps)) + 1, 0);
-   arguments[0] = NULL; 
-
-   zend_hash_internal_pointer_reset_ex(HASH_OF(*args), 
pos);
-
-   for (index = 0;; 
zend_hash_move_forward_ex(HASH_OF(*args), pos))   {
-   zval ** item;
-   
-   if 
(zend_hash_get_current_data_ex(HASH_OF(*args), (void **) item, pos) == 
FAILURE) {
-   break;
-   }
+   zend_hash_internal_pointer_reset_ex(HASH_OF(*args), pos);
 
-   convert_to_string_ex(item);
+   for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), 
pos))   {
+   zval ** item;
 
-   groups[++index] = Z_STRVAL_PP(item);
+   if (zend_hash_get_current_data_ex(HASH_OF(*args), (void 
**) item, pos) == FAILURE) {
+   break;
}
-   groups[index] = NULL;   
-   } else {
-   groups = safe_emalloc(sizeof(char *), 1, 0);
-   groups[0] = NULL;
-   }
 
-   rc = mysql_server_init(argc, arguments, NULL);
+   convert_to_string_ex(item);
 
-   if (argc) {
-   efree(arguments);
+   groups[++index] = Z_STRVAL_PP(item);
}
-   efree(groups);
+   groups[index] = NULL;   
+   } else {
+   groups = safe_emalloc(sizeof(char *), 1, 0);
+   groups[0] = NULL;
+   }
 
-   if (rc) {
-   RETURN_FALSE;
-   }
-   RETURN_TRUE;
+   rc = mysql_server_init(argc, arguments, NULL);
+
+   if (argc) {
+   efree(arguments);
}
+   efree(groups);
 
-   

[PHP-CVS] cvs: php-src /ext/mysqli config.m4 mysqli.c mysqli_api.c mysqli_driver.c mysqli_embedded.c mysqli_exception.c mysqli_fe.c mysqli_nonapi.c mysqli_prop.c mysqli_report.c mysqli_warning.c php_mysqli.h /ext/mysqli/tests 001.phpt 014.phpt 017.phpt 033.phpt 034.phpt 041.phpt 045.phpt 047.phpt 049.phpt 061.phpt connect.inc skipif.inc skipifemb.inc

2005-01-07 Thread Georg Richter
georg   Fri Jan  7 10:00:00 2005 EDT

  Added files: 
/php-src/ext/mysqli mysqli_driver.c mysqli_embedded.c 
mysqli_exception.c mysqli_warning.c 
/php-src/ext/mysqli/tests   skipifemb.inc 

  Modified files:  
/php-src/ext/mysqli config.m4 mysqli.c mysqli_api.c mysqli_fe.c 
mysqli_nonapi.c mysqli_prop.c mysqli_report.c 
php_mysqli.h 
/php-src/ext/mysqli/tests   001.phpt 014.phpt 017.phpt 033.phpt 
034.phpt 041.phpt 045.phpt 047.phpt 
049.phpt 061.phpt connect.inc skipif.inc 
  Log:
  Added new classes:
mysqli_driver
mysqli_warning
mysqli_exception
mysqli_sql_exception
  
  Improved embedded server support
  changed testsuite to work also with embedded server
  
  Made statement and resultset classes extendable
  
  minor fixes
  
  http://cvs.php.net/diff.php/php-src/ext/mysqli/config.m4?r1=1.18r2=1.19ty=u
Index: php-src/ext/mysqli/config.m4
diff -u php-src/ext/mysqli/config.m4:1.18 php-src/ext/mysqli/config.m4:1.19
--- php-src/ext/mysqli/config.m4:1.18   Thu Jul 22 03:24:55 2004
+++ php-src/ext/mysqli/config.m4Fri Jan  7 09:59:59 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.18 2004/07/22 07:24:55 georg Exp $
+dnl $Id: config.m4,v 1.19 2005/01/07 14:59:59 georg Exp $
 dnl config.m4 for extension mysqli
 
 PHP_ARG_WITH(mysqli, for MySQLi support,
@@ -54,6 +54,6 @@
 $MYSQLI_LIBLINE
   ])
 
-  PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c 
mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c, $ext_shared)
+  PHP_NEW_EXTENSION(mysqli, mysqli.c mysqli_api.c mysqli_prop.c 
mysqli_nonapi.c mysqli_fe.c mysqli_report.c mysqli_repl.c mysqli_driver.c 
mysqli_warning.c mysqli_exception.c mysqli_embedded.c, $ext_shared)
   PHP_SUBST(MYSQLI_SHARED_LIBADD)
 fi
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.57r2=1.58ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.57 php-src/ext/mysqli/mysqli.c:1.58
--- php-src/ext/mysqli/mysqli.c:1.57Sun Dec 26 08:16:38 2004
+++ php-src/ext/mysqli/mysqli.c Fri Jan  7 09:59:59 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.57 2004/12/26 13:16:38 georg Exp $ 
+  $Id: mysqli.c,v 1.58 2005/01/07 14:59:59 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -37,9 +37,12 @@
 ZEND_DECLARE_MODULE_GLOBALS(mysqli)
 static zend_object_handlers mysqli_object_handlers;
 static HashTable classes;
+static HashTable mysqli_driver_properties;
 static HashTable mysqli_link_properties;
 static HashTable mysqli_result_properties;
 static HashTable mysqli_stmt_properties;
+static HashTable mysqli_warning_properties;
+
 extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS);
 
 typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
@@ -142,6 +145,10 @@
if (my_res  my_res-ptr) {
mysql_free_result(my_res-ptr);
}
+   } else if (intern-zo.ce == mysqli_warning_class_entry) { /* warning 
object */
+   if (my_res  my_res-ptr) {
+   php_clear_warnings((MYSQLI_WARNING *)my_res-ptr);
+   }
}
my_efree(my_res);
efree(object);
@@ -282,7 +289,8 @@
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object 
TSRMLS_CC);
 
if (obj-zo.ce != mysqli_link_class_entry  obj-zo.ce != 
mysqli_stmt_class_entry 
-   obj-zo.ce != mysqli_result_class_entry) {
+   obj-zo.ce != mysqli_result_class_entry  obj-zo.ce != 
mysqli_driver_class_entry  
+   obj-zo.ce != mysqli_warning_class_entry) {
return obj-zo.ce-constructor;
} else {
static zend_internal_function f;
@@ -300,6 +308,10 @@
f.handler = ZEND_FN(mysqli_stmt_construct);
} else if (obj-zo.ce == mysqli_result_class_entry) {
f.handler = ZEND_FN(mysqli_result_construct);
+   } else if (obj-zo.ce == mysqli_driver_class_entry) {
+   f.handler = ZEND_FN(mysqli_driver_construct);
+   } else if (obj-zo.ce == mysqli_warning_class_entry) {
+   f.handler = ZEND_FN(mysqli_driver_construct);
}

return (union _zend_function*)f;
@@ -397,6 +409,11 @@
mysqli_globals-report_mode = 0;
mysqli_globals-report_ht = 0;
mysqli_globals-multi_query = 0;
+#ifdef HAVE_EMBEDDED_MYSQLI
+   mysqli_globals-embedded = 1;
+#else
+   mysqli_globals-embedded = 0;
+#endif
 }
 /* }}} */
 
@@ -404,9 +421,8 @@
  */
 PHP_MINIT_FUNCTION(mysqli)
 {
-   zend_class_entry *ce;
+   zend_class_entry *ce,cex

[PHP-CVS] cvs: php-src / NEWS

2005-01-07 Thread Georg Richter
georg   Fri Jan  7 10:05:12 2005 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  new mysqli stuff
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1828r2=1.1829ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1828 php-src/NEWS:1.1829
--- php-src/NEWS:1.1828 Wed Dec 29 19:59:28 2004
+++ php-src/NEWSFri Jan  7 10:05:09 2005
@@ -1,6 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2004, PHP 5.1.0
+- Added new classes in mysqli: mysqli_driver, mysqli_warning, mysqli_exception,
+  and mysqli_sql_exception (Georg)
+- Improved support for embedded server in mysqli (Georg)
 - Changed stream_filter_(ap|pre)pend() to return resource. (Sara)
 - Removed garbage manager in Zend Engine which results in more aggressive
   freeing of data. (Dmitry, Andi)

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



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

2005-01-07 Thread Georg Richter
georg   Fri Jan  7 11:34:55 2005 EDT

  Modified files:  
/php-src/ext/mysqli mysqli.c 
  Log:
  forgot to remove some comments in last commit:(
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.58r2=1.59ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.58 php-src/ext/mysqli/mysqli.c:1.59
--- php-src/ext/mysqli/mysqli.c:1.58Fri Jan  7 09:59:59 2005
+++ php-src/ext/mysqli/mysqli.c Fri Jan  7 11:34:55 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.58 2005/01/07 14:59:59 georg Exp $ 
+  $Id: mysqli.c,v 1.59 2005/01/07 16:34:55 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -578,7 +578,8 @@
  */
 PHP_MSHUTDOWN_FUNCTION(mysqli)
 {
-// zend_hash_destroy(mysqli_driver_properties);
+   zend_hash_destroy(mysqli_driver_properties);
+   zend_hash_destroy(mysqli_driver_properties);
zend_hash_destroy(mysqli_result_properties);
zend_hash_destroy(mysqli_stmt_properties);
zend_hash_destroy(mysqli_warning_properties);
@@ -750,7 +751,6 @@
int class_name_len;
 
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
getThis(), O|sz, mysql_result, mysqli_result_class_entry, class_name, 
class_name_len, ctor_params) == FAILURE) {
-   //  php_std_error_handling();
return;
}
if (ZEND_NUM_ARGS()  (getThis() ? 1 : 2)) {
@@ -766,14 +766,12 @@
} else {
if (override_flags) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() 
TSRMLS_CC, getThis(), O, mysql_result, mysqli_result_class_entry) == 
FAILURE) {
-   //php_std_error_handling();
return;
}
fetchtype = override_flags;
} else {
fetchtype = MYSQLI_BOTH;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() 
TSRMLS_CC, getThis(), O|l, mysql_result, mysqli_result_class_entry, 
fetchtype) == FAILURE) {
-   //  php_std_error_handling();
return;
}
}

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



Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli.c

2005-01-07 Thread Georg Richter
Am Sa, den 08.01.2005 schrieb Derick Rethans um 0:45:
 On Fri, 7 Jan 2005, Georg Richter wrote:
 
   PHP_MSHUTDOWN_FUNCTION(mysqli)
   {
  -// zend_hash_destroy(mysqli_driver_properties);
  +   zend_hash_destroy(mysqli_driver_properties);
  +   zend_hash_destroy(mysqli_driver_properties);

No, that is fixed already - but not checked in. 
Still waiting for Sebastian Bergmanns reply - I also fixed some Win32
compiler bugs. Will checkin later today.

/Georg

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_prop.c

2004-12-29 Thread Georg Richter
georg   Wed Dec 29 06:47:03 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_prop.c 
  Log:
  MFH: Added property 'id' to retrieve statement id (required by PEAR DB, to 
support
  mysqli prepared statements)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.14.2.3r2=1.14.2.4ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.14.2.3 
php-src/ext/mysqli/mysqli_prop.c:1.14.2.4
--- php-src/ext/mysqli/mysqli_prop.c:1.14.2.3   Mon Dec  6 00:15:36 2004
+++ php-src/ext/mysqli/mysqli_prop.cWed Dec 29 06:47:03 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.14.2.3 2004/12/06 05:15:36 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.14.2.4 2004/12/29 11:47:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -200,6 +200,26 @@
 MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, 
MYSQLI_GET_RESULT(), my_ulonglong);
 
 /* statement properties */
+
+/* {{{ property stmt_id_read */
+int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+   MY_STMT *p;
+
+   ALLOC_ZVAL(*retval); 
+   CHECK_OBJECT();
+
+   p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+
+   if (!p) {
+   ZVAL_NULL(*retval);
+   } else {
+   ZVAL_LONG(*retval, p-stmt-stmt_id);
+   }
+   return SUCCESS;
+}
+/* }}} */
+
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_affected_rows_read, 
mysql_stmt_affected_rows, MYSQLI_GET_STMT(), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, 
MYSQLI_GET_STMT(), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, 
MYSQLI_GET_STMT(), my_ulonglong);
@@ -244,15 +264,11 @@
{insert_id, stmt_insert_id_read, NULL},
{num_rows, stmt_num_rows_read, NULL},
{param_count, stmt_param_count_read, NULL},
-
-/*  TODO: stmt-field_count doesn't work currently, remove comments until 
mysqli_stmt_field_count
-is implemented in client library
-*/
{field_count, stmt_field_count_read, NULL},
-
{errno, stmt_errno_read, NULL},
{error, stmt_error_read, NULL},
{sqlstate, stmt_sqlstate_read, NULL},
+   {id, stmt_id_read, NULL},
{NULL, NULL, NULL}
 };
 

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_prop.c

2004-12-29 Thread Georg Richter
georg   Wed Dec 29 06:46:14 2004 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_prop.c 
  Log:
  added property 'id' to retrieve statement id (required by PEAR DB, to support
  mysqli prepared statements)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.17r2=1.18ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.17 
php-src/ext/mysqli/mysqli_prop.c:1.18
--- php-src/ext/mysqli/mysqli_prop.c:1.17   Mon Dec  6 00:15:03 2004
+++ php-src/ext/mysqli/mysqli_prop.cWed Dec 29 06:46:13 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.17 2004/12/06 05:15:03 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.18 2004/12/29 11:46:13 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -196,6 +196,26 @@
 MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, 
MYSQLI_GET_RESULT(), my_ulonglong);
 
 /* statement properties */
+
+/* {{{ property stmt_id_read */
+int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+   MY_STMT *p;
+
+   ALLOC_ZVAL(*retval); 
+   CHECK_OBJECT();
+
+   p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+
+   if (!p) {
+   ZVAL_NULL(*retval);
+   } else {
+   ZVAL_LONG(*retval, p-stmt-stmt_id);
+   }
+   return SUCCESS;
+}
+/* }}} */
+
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_affected_rows_read, 
mysql_stmt_affected_rows, MYSQLI_GET_STMT(), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, 
MYSQLI_GET_STMT(), my_ulonglong);
 MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, 
MYSQLI_GET_STMT(), my_ulonglong);
@@ -240,15 +260,11 @@
{insert_id, stmt_insert_id_read, NULL},
{num_rows, stmt_num_rows_read, NULL},
{param_count, stmt_param_count_read, NULL},
-
-/*  TODO: stmt-field_count doesn't work currently, remove comments until 
mysqli_stmt_field_count
-is implemented in client library
-*/
{field_count, stmt_field_count_read, NULL},
-
{errno, stmt_errno_read, NULL},
{error, stmt_error_read, NULL},
{sqlstate, stmt_sqlstate_read, NULL},
+   {id, stmt_id_read, NULL},
{NULL, NULL, NULL}
 };
 

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS

2004-12-27 Thread Georg Richter
georg   Mon Dec 27 06:54:09 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
  Log:
  feature request #31015
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.171r2=1.1760.2.172ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.171 php-src/NEWS:1.1760.2.172
--- php-src/NEWS:1.1760.2.171   Thu Dec 23 11:26:04 2004
+++ php-src/NEWSMon Dec 27 06:54:08 2004
@@ -2,6 +2,7 @@
 |||
 ?? ??? 2005, PHP 5.0.4
 - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
+- Added length and charsetnr for field array and object. (Georg)
 - Fixed a bug in mysql_stmt_execute (type conversion with NULL values). (Georg)
 - Fixed bug #31142 (imap_mail_compose() fails to generate correct output). 
(Ilia)
 - Fixed bug #31139 (XML Parser Functions seem to drop amp; when parsing). 
(Rob)

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2004-12-27 Thread Georg Richter
georg   Mon Dec 27 06:48:58 2004 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  Fix for feature request #31015: added length for field length
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.95r2=1.96ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.95 
php-src/ext/mysqli/mysqli_api.c:1.96
--- php-src/ext/mysqli/mysqli_api.c:1.95Mon Dec 20 11:39:14 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 27 06:48:57 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.95 2004/12/20 16:39:14 georg Exp $ 
+  $Id: mysqli_api.c,v 1.96 2004/12/27 11:48:57 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -682,6 +682,8 @@
add_property_string(return_value, orgtable,(field-org_table ? 
field-org_table : ), 1);
add_property_string(return_value, def,(field-def ? field-def : ), 
1);
add_property_long(return_value, max_length, field-max_length);
+   add_property_long(return_value, length, field-length);
+   add_property_long(return_value, charsetnr, field-charsetnr);
add_property_long(return_value, flags, field-flags);
add_property_long(return_value, type, field-type);
add_property_long(return_value, decimals, field-decimals);
@@ -724,6 +726,8 @@
add_property_string(obj, orgtable,(field-org_table ? 
field-org_table : ), 1);
add_property_string(obj, def,(field-def ? field-def : ), 
1);
add_property_long(obj, max_length, field-max_length);
+   add_property_long(obj, length, field-length);
+   add_property_long(obj, charsetnr, field-charsetnr);
add_property_long(obj, flags, field-flags);
add_property_long(obj, type, field-type);
add_property_long(obj, decimals, field-decimals);
@@ -980,12 +984,12 @@
 {
MY_MYSQL *mysql = (MY_MYSQL *)calloc(1, sizeof(MY_MYSQL));
 
-   MYSQLI_RESOURCE *mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
-
if (!(mysql-mysql = mysql_init(NULL))) {
efree(mysql);
RETURN_FALSE;
}
+
+   MYSQLI_RESOURCE *mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
mysqli_resource-ptr = (void *)mysql;
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);   
 }

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c

2004-12-27 Thread Georg Richter
georg   Mon Dec 27 06:52:08 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_api.c 
  Log:
  Fix for feature request #31015: Length for field object/array
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.6r2=1.87.2.7ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.6 
php-src/ext/mysqli/mysqli_api.c:1.87.2.7
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.6Mon Dec 20 11:42:20 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 27 06:52:08 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.6 2004/12/20 16:42:20 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.7 2004/12/27 11:52:08 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -683,6 +683,8 @@
add_property_string(return_value, orgtable,(field-org_table ? 
field-org_table : ), 1);
add_property_string(return_value, def,(field-def ? field-def : ), 
1);
add_property_long(return_value, max_length, field-max_length);
+   add_property_long(return_value, length, field-length);
+   add_property_long(return_value, charsetnr, field-charsetnr);
add_property_long(return_value, flags, field-flags);
add_property_long(return_value, type, field-type);
add_property_long(return_value, decimals, field-decimals);
@@ -725,6 +727,8 @@
add_property_string(obj, orgtable,(field-org_table ? 
field-org_table : ), 1);
add_property_string(obj, def,(field-def ? field-def : ), 
1);
add_property_long(obj, max_length, field-max_length);
+   add_property_long(obj, length, field-length);
+   add_property_long(obj, charsetnr, field-charsetnr);
add_property_long(obj, flags, field-flags);
add_property_long(obj, type, field-type);
add_property_long(obj, decimals, field-decimals);

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c /ext/mysqli/tests 047.phpt

2004-12-27 Thread Georg Richter
georg   Mon Dec 27 10:39:35 2004 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
/php-src/ext/mysqli/tests   047.phpt 
  Log:
  fixed testcase 047
  fixed windows compile error 
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.96r2=1.97ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.96 
php-src/ext/mysqli/mysqli_api.c:1.97
--- php-src/ext/mysqli/mysqli_api.c:1.96Mon Dec 27 06:48:57 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 27 10:39:34 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.96 2004/12/27 11:48:57 georg Exp $ 
+  $Id: mysqli_api.c,v 1.97 2004/12/27 15:39:34 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -982,6 +982,7 @@
Initialize mysqli and return a resource for use with mysql_real_connect */
 PHP_FUNCTION(mysqli_init)
 {
+   MYSQLI_RESOURCE *mysqli_resource;
MY_MYSQL *mysql = (MY_MYSQL *)calloc(1, sizeof(MY_MYSQL));
 
if (!(mysql-mysql = mysql_init(NULL))) {
@@ -989,7 +990,7 @@
RETURN_FALSE;
}
 
-   MYSQLI_RESOURCE *mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
mysqli_resource-ptr = (void *)mysql;
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);   
 }
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/047.phpt?r1=1.6r2=1.7ty=u
Index: php-src/ext/mysqli/tests/047.phpt
diff -u php-src/ext/mysqli/tests/047.phpt:1.6 
php-src/ext/mysqli/tests/047.phpt:1.7
--- php-src/ext/mysqli/tests/047.phpt:1.6   Sat Dec  4 03:50:33 2004
+++ php-src/ext/mysqli/tests/047.phpt   Mon Dec 27 10:39:35 2004
@@ -12,7 +12,7 @@
mysqli_select_db($link, test);
 
mysqli_query($link, DROP TABLE IF EXISTS test_affected);
-   mysqli_query($link, CREATE TABLE test_affected (foo int, bar 
varchar(10)));
+   mysqli_query($link, CREATE TABLE test_affected (foo int, bar 
varchar(10) character set latin1));
 
mysqli_query($link, INSERT INTO test_affected VALUES (1, 'Zak'),(2, 
'Greant'));
 
@@ -31,7 +31,7 @@
 --EXPECTF--
 array(2) {
   [0]=
-  object(stdClass)#%d (9) {
+  object(stdClass)#4 (11) {
 [name]=
 string(3) foo
 [orgname]=
@@ -44,6 +44,10 @@
 string(0) 
 [max_length]=
 int(0)
+[length]=
+int(11)
+[charsetnr]=
+int(63)
 [flags]=
 int(32768)
 [type]=
@@ -52,7 +56,7 @@
 int(0)
   }
   [1]=
-  object(stdClass)#%d (9) {
+  object(stdClass)#5 (11) {
 [name]=
 string(3) bar
 [orgname]=
@@ -65,6 +69,10 @@
 string(0) 
 [max_length]=
 int(0)
+[length]=
+int(10)
+[charsetnr]=
+int(8)
 [flags]=
 int(0)
 [type]=

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c /ext/mysqli/tests 047.phpt

2004-12-27 Thread Georg Richter
georg   Mon Dec 27 10:40:40 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_api.c 
/php-src/ext/mysqli/tests   047.phpt 
  Log:
  fixed possible leak in mysqli_init 
  fixed testcase 047.phpt
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.7r2=1.87.2.8ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.7 
php-src/ext/mysqli/mysqli_api.c:1.87.2.8
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.7Mon Dec 27 06:52:08 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 27 10:40:40 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.7 2004/12/27 11:52:08 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.8 2004/12/27 15:40:40 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -983,14 +983,15 @@
Initialize mysqli and return a resource for use with mysql_real_connect */
 PHP_FUNCTION(mysqli_init)
 {
+   MYSQLI_RESOURCE *mysqli_resource;
MY_MYSQL *mysql = (MY_MYSQL *)calloc(1, sizeof(MY_MYSQL));
 
-   MYSQLI_RESOURCE *mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
-
if (!(mysql-mysql = mysql_init(NULL))) {
efree(mysql);
RETURN_FALSE;
}
+
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
mysqli_resource-ptr = (void *)mysql;
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);   
 }
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/047.phpt?r1=1.4.2.1r2=1.4.2.2ty=u
Index: php-src/ext/mysqli/tests/047.phpt
diff -u php-src/ext/mysqli/tests/047.phpt:1.4.2.1 
php-src/ext/mysqli/tests/047.phpt:1.4.2.2
--- php-src/ext/mysqli/tests/047.phpt:1.4.2.1   Sat Dec  4 04:01:34 2004
+++ php-src/ext/mysqli/tests/047.phpt   Mon Dec 27 10:40:40 2004
@@ -12,7 +12,7 @@
mysqli_select_db($link, test);
 
mysqli_query($link, DROP TABLE IF EXISTS test_affected);
-   mysqli_query($link, CREATE TABLE test_affected (foo int, bar 
varchar(10)));
+   mysqli_query($link, CREATE TABLE test_affected (foo int, bar 
varchar(10) character set latin1));
 
mysqli_query($link, INSERT INTO test_affected VALUES (1, 'Zak'),(2, 
'Greant'));
 
@@ -31,7 +31,7 @@
 --EXPECTF--
 array(2) {
   [0]=
-  object(stdClass)#%d (9) {
+  object(stdClass)#4 (11) {
 [name]=
 string(3) foo
 [orgname]=
@@ -44,6 +44,10 @@
 string(0) 
 [max_length]=
 int(0)
+[length]=
+int(11)
+[charsetnr]=
+int(63)
 [flags]=
 int(32768)
 [type]=
@@ -52,7 +56,7 @@
 int(0)
   }
   [1]=
-  object(stdClass)#%d (9) {
+  object(stdClass)#5 (11) {
 [name]=
 string(3) bar
 [orgname]=
@@ -65,6 +69,10 @@
 string(0) 
 [max_length]=
 int(0)
+[length]=
+int(10)
+[charsetnr]=
+int(8)
 [flags]=
 int(0)
 [type]=

-- 
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_0) /ext/mysqli mysqli_api.c

2004-12-27 Thread Georg Richter
Am Mo, den 27.12.2004 schrieb Marcus Boerger um 14:45:
 Hello Georg,
 
   why do you add new features to a branch?
 

Hi Marcus,

cause it's an essential information: The metadata information for
prepared statements and normal statements differ, while one uses
max_length the other uses length.

Also MySQL  4.1.8 returned the length in bytes (which was wrong), MySQL
= 4.1.8 returns the length in characters. For example:

VARCHAR(50) CHARACTER SET UTF8 returned 150 before 4.1.8, in 4.1.8 it
returns 50. With information charsetnr + length you will be able to
handle this.

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c php_mysqli.h /ext/mysqli/tests 062.phpt 063.phpt

2004-12-26 Thread Georg Richter
georg   Sun Dec 26 08:16:40 2004 EDT

  Added files: 
/php-src/ext/mysqli/tests   062.phpt 063.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli.c php_mysqli.h 
  Log:
  added constructors for mysqli_stmt and mysqli_result classes
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.56r2=1.57ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.56 php-src/ext/mysqli/mysqli.c:1.57
--- php-src/ext/mysqli/mysqli.c:1.56Sat Dec 25 11:42:53 2004
+++ php-src/ext/mysqli/mysqli.c Sun Dec 26 08:16:38 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.56 2004/12/25 16:42:53 georg Exp $ 
+  $Id: mysqli.c,v 1.57 2004/12/26 13:16:38 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -281,23 +281,31 @@
 {
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object 
TSRMLS_CC);
 
-   if (obj-zo.ce != mysqli_link_class_entry) {
+   if (obj-zo.ce != mysqli_link_class_entry  obj-zo.ce != 
mysqli_stmt_class_entry 
+   obj-zo.ce != mysqli_result_class_entry) {
return obj-zo.ce-constructor;
} else {
static zend_internal_function f;
 
-   f.function_name = mysqli_link_class_entry-name;
-   f.scope = mysqli_link_class_entry;
+   f.function_name = obj-zo.ce-name;
+   f.scope = obj-zo.ce;
f.arg_info = NULL;
f.num_args = 0;
f.fn_flags = 0;
 
f.type = ZEND_INTERNAL_FUNCTION;
-   f.handler = ZEND_FN(mysqli_connect);
+   if (obj-zo.ce == mysqli_link_class_entry) {
+   f.handler = ZEND_FN(mysqli_connect);
+   } else if (obj-zo.ce == mysqli_stmt_class_entry) {
+   f.handler = ZEND_FN(mysqli_stmt_construct);
+   } else if (obj-zo.ce == mysqli_result_class_entry) {
+   f.handler = ZEND_FN(mysqli_result_construct);
+   }

return (union _zend_function*)f;
}
 }
+
 /* {{{ mysqli_objects_new
  */
 PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry 
*class_type TSRMLS_DC)
@@ -578,6 +586,109 @@
 }
 /* }}} */
 
+/* {{{ mixed mysqli_stmt_construct() 
+constructor for statement object.
+Parameters: 
+  object - mysqli_init
+  object, query - mysqli_prepare
+*/
+ZEND_FUNCTION(mysqli_stmt_construct)
+{
+   MY_MYSQL*mysql;
+   zval**mysql_link, **statement;
+   MY_STMT *stmt;
+   MYSQLI_RESOURCE *mysqli_resource;
+
+   switch (ZEND_NUM_ARGS())
+   {
+   case 1:  /* mysql_stmt_init */
+   if (zend_get_parameters_ex(1, mysql_link)==FAILURE) {
+   return;
+   }
+   MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, 
mysqli_link);
+
+   stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
+
+   stmt-stmt = mysql_stmt_init(mysql-mysql);
+   break;
+   case 2:
+   if (zend_get_parameters_ex(2, mysql_link, 
statement)==FAILURE) {
+   return;
+   }
+   MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, mysql_link, 
mysqli_link);
+   convert_to_string_ex(statement);
+
+   stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
+   
+   if ((stmt-stmt = mysql_stmt_init(mysql-mysql))) {
+   mysql_stmt_prepare(stmt-stmt, 
Z_STRVAL_PP(statement), strlen(Z_STRVAL_PP(statement)));
+   }
+   break;
+   default:
+   WRONG_PARAM_COUNT;
+   break;
+   }
+
+   if (!stmt-stmt) {
+   efree(stmt);
+   RETURN_FALSE;
+   }
+
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, 
sizeof(MYSQLI_RESOURCE));
+   mysqli_resource-ptr = (void *)stmt;
+   
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-ptr = mysqli_resource;
+   ((mysqli_object *) zend_object_store_get_object(getThis() 
TSRMLS_CC))-valid = 1;
+}
+/* }}} */
+
+/* {{{ mixed mysqli_result_construct() 
+constructor for result object.
+Parameters: 
+  object [, mode] - mysqli_store/use_result
+*/
+ZEND_FUNCTION(mysqli_result_construct)
+{
+   MY_MYSQL*mysql;
+   MYSQL_RES   *result;
+   zval**mysql_link, **mode;
+   MYSQLI_RESOURCE *mysqli_resource;
+   int resmode = MYSQLI_STORE_RESULT;
+
+   switch (ZEND_NUM_ARGS()) {
+   case

[PHP-CVS] cvs: php-src / NEWS

2004-12-26 Thread Georg Richter
georg   Sun Dec 26 08:17:03 2004 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  added constructors for mysqli_stmt and mysqli_resultset classes
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1826r2=1.1827ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1826 php-src/NEWS:1.1827
--- php-src/NEWS:1.1826 Tue Dec  7 03:46:14 2004
+++ php-src/NEWSSun Dec 26 08:17:03 2004
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2004, PHP 5.1.0
+- Added constructors for mysqli_stmt and mysqli_result classes. (Georg)
 - Made request start time be available via $_SERVER['REQUEST_TIME']. (Ilia)
 - Allow gettimeofday() return a float if optional argument is specified. (Ilia)
 - Improved performance of:

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c /ext/mysqli/tests bug31141.phpt

2004-12-25 Thread Georg Richter
georg   Sat Dec 25 11:42:53 2004 EDT

  Added files: 
/php-src/ext/mysqli/tests   bug31141.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli.c 
  Log:
  fix for bug 31141
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.55r2=1.56ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.55 php-src/ext/mysqli/mysqli.c:1.56
--- php-src/ext/mysqli/mysqli.c:1.55Thu Dec  9 03:22:06 2004
+++ php-src/ext/mysqli/mysqli.c Sat Dec 25 11:42:53 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.55 2004/12/09 08:22:06 tony2001 Exp $ 
+  $Id: mysqli.c,v 1.56 2004/12/25 16:42:53 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -218,7 +218,6 @@
} else {
std_hnd = zend_get_std_object_handlers();
retval = std_hnd-read_property(object, member, type TSRMLS_CC);
-   retval-refcount = 1;
}
 
if (member == tmp_member) {
@@ -398,6 +397,8 @@
 PHP_MINIT_FUNCTION(mysqli)
 {
zend_class_entry *ce;
+   zend_object_handlers *std_hnd = zend_get_std_object_handlers();
+

ZEND_INIT_MODULE_GLOBALS(mysqli, php_mysqli_init_globals, NULL);
REGISTER_INI_ENTRIES();
@@ -406,7 +407,7 @@
mysqli_object_handlers.clone_obj = NULL;
mysqli_object_handlers.read_property = mysqli_read_property;
mysqli_object_handlers.write_property = mysqli_write_property;
-   mysqli_object_handlers.get_property_ptr_ptr = NULL;
+   mysqli_object_handlers.get_property_ptr_ptr = 
std_hnd-get_property_ptr_ptr;
mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
 
zend_hash_init(classes, 0, NULL, NULL, 1);

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug31141.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug31141.phpt
+++ php-src/ext/mysqli/tests/bug31141.phpt
--TEST--
Bug #31141 testcase (properties)
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
class Test extends mysqli
{
public $test = array();

function foo()
{
$ar_test = array(foo, bar);
$this-test = $ar_test;
}
}

$my_test = new Test;
$my_test-foo();
var_dump($my_test-test);
?
--EXPECTF--
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) bar
}

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli.c /ext/mysqli/tests bug31141.phpt

2004-12-25 Thread Georg Richter
georg   Sat Dec 25 11:44:02 2004 EDT

  Added files: (Branch: PHP_5_0)
/php-src/ext/mysqli/tests   bug31141.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli.c 
  Log:
  MFH: Fix for bug #31141
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.43.2.9r2=1.43.2.10ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.43.2.9 
php-src/ext/mysqli/mysqli.c:1.43.2.10
--- php-src/ext/mysqli/mysqli.c:1.43.2.9Thu Dec  9 03:24:33 2004
+++ php-src/ext/mysqli/mysqli.c Sat Dec 25 11:44:02 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.43.2.9 2004/12/09 08:24:33 tony2001 Exp $ 
+  $Id: mysqli.c,v 1.43.2.10 2004/12/25 16:44:02 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -217,7 +217,6 @@
} else {
std_hnd = zend_get_std_object_handlers();
retval = std_hnd-read_property(object, member, type TSRMLS_CC);
-   retval-refcount = 1;
}
 
if (member == tmp_member) {
@@ -397,6 +396,7 @@
 PHP_MINIT_FUNCTION(mysqli)
 {
zend_class_entry *ce;
+   zend_object_handlers *std_hnd = zend_get_std_object_handlers();

ZEND_INIT_MODULE_GLOBALS(mysqli, php_mysqli_init_globals, NULL);
REGISTER_INI_ENTRIES();
@@ -405,7 +405,7 @@
mysqli_object_handlers.clone_obj = NULL;
mysqli_object_handlers.read_property = mysqli_read_property;
mysqli_object_handlers.write_property = mysqli_write_property;
-   mysqli_object_handlers.get_property_ptr_ptr = NULL;
+   mysqli_object_handlers.get_property_ptr_ptr = 
std_hnd-get_property_ptr_ptr;
mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
 
zend_hash_init(classes, 0, NULL, NULL, 1);

http://cvs.php.net/co.php/php-src/ext/mysqli/tests/bug31141.phpt?r=1.1p=1
Index: php-src/ext/mysqli/tests/bug31141.phpt
+++ php-src/ext/mysqli/tests/bug31141.phpt
--TEST--
Bug #31141 testcase (properties)
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
class Test extends mysqli
{
public $test = array();

function foo()
{
$ar_test = array(foo, bar);
$this-test = $ar_test;
}
}

$my_test = new Test;
$my_test-foo();
var_dump($my_test-test);
?
--EXPECTF--
array(2) {
  [0]=
  string(3) foo
  [1]=
  string(3) bar
}

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c

2004-12-20 Thread Georg Richter
georg   Mon Dec 20 11:39:15 2004 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_api.c 
  Log:
  prevent type conversion during mysql_stmt_execute for NULL variables
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.94r2=1.95ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.94 
php-src/ext/mysqli/mysqli_api.c:1.95
--- php-src/ext/mysqli/mysqli_api.c:1.94Mon Nov  1 02:19:23 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 20 11:39:14 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.94 2004/11/01 07:19:23 georg Exp $ 
+  $Id: mysqli_api.c,v 1.95 2004/12/20 16:39:14 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -539,24 +539,24 @@

for (i = 0; i  stmt-param.var_cnt; i++) { 
if (stmt-param.vars[i]) {
-   stmt-param.is_null[i] = (stmt-param.vars[i]-type == 
IS_NULL);
-
-   switch (stmt-stmt-params[i].buffer_type) {
-   case MYSQL_TYPE_VAR_STRING:
-   
convert_to_string_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
Z_STRVAL_PP(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer_length = 
strlen(Z_STRVAL_PP(stmt-param.vars[i]));
-   break;
-   case MYSQL_TYPE_DOUBLE:
-   
convert_to_double_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
-   break;
-   case MYSQL_TYPE_LONG:
-   
convert_to_long_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
-   break;
-   default:
-   break;
+   if ( !(stmt-param.is_null[i] = 
(stmt-param.vars[i]-type == IS_NULL)) ) {
+   switch (stmt-stmt-params[i].buffer_type) {
+   case MYSQL_TYPE_VAR_STRING:
+   
convert_to_string_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
Z_STRVAL_PP(stmt-param.vars[i]);
+   
stmt-stmt-params[i].buffer_length = strlen(Z_STRVAL_PP(stmt-param.vars[i]));
+   break;
+   case MYSQL_TYPE_DOUBLE:
+   
convert_to_double_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
+   break;
+   case MYSQL_TYPE_LONG:
+   
convert_to_long_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
+   break;
+   default:
+   break;
+   }
}   
}
}

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/mysqli mysqli_api.c

2004-12-20 Thread Georg Richter
georg   Mon Dec 20 11:42:20 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/mysqli mysqli_api.c 
  Log:
  MFH: Fixed type conversion for NULL values in mysql_stmt_execute
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.168r2=1.1760.2.169ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.168 php-src/NEWS:1.1760.2.169
--- php-src/NEWS:1.1760.2.168   Sun Dec 19 13:17:43 2004
+++ php-src/NEWSMon Dec 20 11:42:19 2004
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2005, PHP 5.0.4
+- Fixed a bug in mysql_stmt_execute (type conversion with NULL values). (Georg)
 - Fixed bug #31139 (XML Parser Functions seem to drop amp; when parsing). 
(Rob)
 - Fixed bug #3 (Compile failure of zend_strtod.c). (Derick)
 - Fixed bug #31110 (PHP 4.3.10 does not compile on Tru64 UNIX 5.1B). (Derick)
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_api.c?r1=1.87.2.5r2=1.87.2.6ty=u
Index: php-src/ext/mysqli/mysqli_api.c
diff -u php-src/ext/mysqli/mysqli_api.c:1.87.2.5 
php-src/ext/mysqli/mysqli_api.c:1.87.2.6
--- php-src/ext/mysqli/mysqli_api.c:1.87.2.5Mon Nov  1 02:57:45 2004
+++ php-src/ext/mysqli/mysqli_api.c Mon Dec 20 11:42:20 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_api.c,v 1.87.2.5 2004/11/01 07:57:45 georg Exp $ 
+  $Id: mysqli_api.c,v 1.87.2.6 2004/12/20 16:42:20 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -540,25 +540,25 @@

for (i = 0; i  stmt-param.var_cnt; i++) { 
if (stmt-param.vars[i]) {
-   stmt-param.is_null[i] = (stmt-param.vars[i]-type == 
IS_NULL);
-
-   switch (stmt-stmt-params[i].buffer_type) {
-   case MYSQL_TYPE_VAR_STRING:
-   
convert_to_string_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
Z_STRVAL_PP(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer_length = 
strlen(Z_STRVAL_PP(stmt-param.vars[i]));
-   break;
-   case MYSQL_TYPE_DOUBLE:
-   
convert_to_double_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
-   break;
-   case MYSQL_TYPE_LONG:
-   
convert_to_long_ex(stmt-param.vars[i]);
-   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
-   break;
-   default:
-   break;
-   }   
+   if ( !(stmt-param.is_null[i] = 
(stmt-param.vars[i]-type == IS_NULL)) ) {
+   switch (stmt-stmt-params[i].buffer_type) {
+   case MYSQL_TYPE_VAR_STRING:
+   
convert_to_string_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
Z_STRVAL_PP(stmt-param.vars[i]);
+   
stmt-stmt-params[i].buffer_length = strlen(Z_STRVAL_PP(stmt-param.vars[i]));
+   break;
+   case MYSQL_TYPE_DOUBLE:
+   
convert_to_double_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
+   break;
+   case MYSQL_TYPE_LONG:
+   
convert_to_long_ex(stmt-param.vars[i]);
+   stmt-stmt-params[i].buffer = 
(gptr)Z_LVAL_PP(stmt-param.vars[i]);
+   break;
+   default:
+   break;
+   }
+   }
}
}
if (mysql_stmt_execute(stmt-stmt)) {

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_prop.c

2004-12-05 Thread Georg Richter
georg   Mon Dec  6 00:15:04 2004 EDT

  Modified files:  
/php-src/ext/mysqli mysqli_prop.c 
  Log:
  fixed windows compile errors (Thx to Sebastian Bergmann)
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.16r2=1.17ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.16 
php-src/ext/mysqli/mysqli_prop.c:1.17
--- php-src/ext/mysqli/mysqli_prop.c:1.16   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/mysqli_prop.cMon Dec  6 00:15:03 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.16 2004/12/04 08:16:04 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.17 2004/12/06 05:15:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -37,19 +37,26 @@
} \
 
 #define MYSQLI_GET_MYSQL() \
-MYSQL *p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
+MYSQL *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT();\
+p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
 
 #define MYSQLI_GET_RESULT() \
-MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr
+MYSQL_RES *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT();\
+p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr
 
 #define MYSQLI_GET_STMT() \
-MYSQL_STMT *p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE 
*)(obj-ptr))-ptr)-stmt
+MYSQL_STMT *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT();\
+p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-stmt
 
 #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, 
__ret_type)\
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
 {\
-   ALLOC_ZVAL(*retval); \
-   CHECK_OBJECT(); \
__ret_type l;\
__get_type;\
if (!p) {\
@@ -71,8 +78,6 @@
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
 {\
char *c;\
-   ALLOC_ZVAL(*retval); \
-   CHECK_OBJECT(); \
__get_type;\
if (!p) {\
ZVAL_NULL(*retval);\
@@ -143,10 +148,11 @@
 /* {{{ property result_type_read */
 int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
+   MYSQL_RES *p;
+
ALLOC_ZVAL(*retval);
CHECK_OBJECT();
-
-   MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
 
if (!p) {
ZVAL_NULL(*retval);
@@ -160,11 +166,12 @@
 /* {{{ property result_lengths_read */
 int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
+   MYSQL_RES *p;
+
ALLOC_ZVAL(*retval);
CHECK_OBJECT();
 
-   MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
-
+   p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
if (!p || !p-field_count) {
ZVAL_NULL(*retval);
} else {

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_prop.c

2004-12-05 Thread Georg Richter
georg   Mon Dec  6 00:15:36 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli_prop.c 
  Log:
  MFH: fixed windows compile errors
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.14.2.2r2=1.14.2.3ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.14.2.2 
php-src/ext/mysqli/mysqli_prop.c:1.14.2.3
--- php-src/ext/mysqli/mysqli_prop.c:1.14.2.2   Sat Dec  4 04:01:33 2004
+++ php-src/ext/mysqli/mysqli_prop.cMon Dec  6 00:15:36 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.14.2.2 2004/12/04 09:01:33 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.14.2.3 2004/12/06 05:15:36 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -39,19 +39,26 @@
 
 
 #define MYSQLI_GET_MYSQL() \
-MYSQL *p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
+MYSQL *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT(); \
+p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
 
 #define MYSQLI_GET_RESULT() \
-MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr
+MYSQL_RES *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT(); \
+p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr
 
 #define MYSQLI_GET_STMT() \
-MYSQL_STMT *p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE 
*)(obj-ptr))-ptr)-stmt
+MYSQL_STMT *p; \
+ALLOC_ZVAL(*retval);\
+CHECK_OBJECT(); \
+p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-stmt
 
 #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, 
__ret_type)\
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
 {\
-   ALLOC_ZVAL(*retval); \
-   CHECK_OBJECT(); \
__ret_type l;\
__get_type;\
if (!p) {\
@@ -73,8 +80,6 @@
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
 {\
char *c;\
-   ALLOC_ZVAL(*retval); \
-   CHECK_OBJECT(); \
__get_type;\
if (!p) {\
ZVAL_NULL(*retval);\
@@ -145,10 +150,12 @@
 /* {{{ property result_type_read */
 int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
+   MYSQL_RES *p;
+
ALLOC_ZVAL(*retval); 
CHECK_OBJECT();
 
-   MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
 
if (!p) {
ZVAL_NULL(*retval);
@@ -162,12 +169,13 @@
 /* {{{ property result_lengths_read */
 int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
+   MYSQL_RES *p;
+
ALLOC_ZVAL(*retval); 
CHECK_OBJECT();
 
-   MYSQL_RES *p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
+   p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;
 
-   ALLOC_ZVAL(*retval);
if (!p || !p-field_count) {
ZVAL_NULL(*retval);
} else {

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



[PHP-CVS] cvs: php-src /ext/mysqli mysqli.c mysqli_prop.c /ext/mysqli/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt 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 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 060.phpt 061.phpt bug28817.phpt bug29311.phpt bug30967.phpt

2004-12-04 Thread Georg Richter
georg   Sat Dec  4 03:16:05 2004 EDT

  Added files: 
/php-src/ext/mysqli/tests   bug28817.phpt 

  Modified files:  
/php-src/ext/mysqli mysqli.c mysqli_prop.c 
/php-src/ext/mysqli/tests   001.phpt 002.phpt 003.phpt 004.phpt 
005.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 010.phpt 011.phpt 012.phpt 
013.phpt 014.phpt 015.phpt 016.phpt 
017.phpt 018.phpt 019.phpt 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 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 060.phpt 
061.phpt bug29311.phpt bug30967.phpt 
  Log:
  Fixed bug #30890 (testsuite)
  Fixed bug #28817 (property problems in extended class)
  
  http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.53r2=1.54ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.53 php-src/ext/mysqli/mysqli.c:1.54
--- php-src/ext/mysqli/mysqli.c:1.53Fri Dec  3 02:56:18 2004
+++ php-src/ext/mysqli/mysqli.c Sat Dec  4 03:16:03 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.53 2004/12/03 07:56:18 georg Exp $ 
+  $Id: mysqli.c,v 1.54 2004/12/04 08:16:03 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -179,11 +179,6 @@
ret = FAILURE;
obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
 
-   if (!obj-valid) {
-   retval = EG(uninitialized_zval_ptr);
-   return(retval);
-   }
-
if (member-type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(tmp_member);
@@ -194,6 +189,7 @@
if (obj-prop_handler != NULL) {
ret = zend_hash_find(obj-prop_handler, Z_STRVAL_P(member), 
Z_STRLEN_P(member)+1, (void **) hnd);
}
+
if (ret == SUCCESS) {
 
/* check if mysqli object is still valid */
@@ -223,6 +219,7 @@
} else {
std_hnd = zend_get_std_object_handlers();
retval = std_hnd-read_property(object, member, type TSRMLS_CC);
+   retval-refcount = 1;
}
 
if (member == tmp_member) {
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.15r2=1.16ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.15 
php-src/ext/mysqli/mysqli_prop.c:1.16
--- php-src/ext/mysqli/mysqli_prop.c:1.15   Mon Jul 26 01:44:06 2004
+++ php-src/ext/mysqli/mysqli_prop.cSat Dec  4 03:16:04 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.15 2004/07/26 05:44:06 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.16 2004/12/04 08:16:04 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -29,6 +29,13 @@
 #include ext/standard/info.h
 #include php_mysqli.h
 
+#define CHECK_OBJECT() \
+   if (!obj-valid) { \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Property access is 
not allowed yet. Call the default constructor of the object first); \
+   ZVAL_NULL(*retval); \
+   return SUCCESS; \
+   } \
+
 #define MYSQLI_GET_MYSQL() \
 MYSQL *p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
 
@@ -41,9 +48,10 @@
 #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, 
__ret_type)\
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
 {\
+   ALLOC_ZVAL(*retval); \
+   CHECK_OBJECT(); \
__ret_type l;\
__get_type;\
-   ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
@@ -63,8 +71,9 @@
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
 {\
char *c;\
+   ALLOC_ZVAL(*retval); \
+   CHECK_OBJECT(); \
__get_type;\
-   ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
@@ -95,18 +104,6 @@
return SUCCESS;
 }
 /* }}} */
-/* {{{ property link_test_read */
-int link_test_read(mysqli_object *obj, zval **retval TSRMLS_DC)
-{
-   longi;
-   ALLOC_ZVAL(*retval);
-   array_init(*retval);
-
-   for (i=0; i  10; i

[PHP-CVS] cvs: php-src /ext/mysqli/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt 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 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 060.phpt 061.phpt bug28817.phpt bug29311.phpt bug30967.phpt skipif.inc

2004-12-04 Thread Georg Richter
georg   Sat Dec  4 03:50:35 2004 EDT

  Added files: 
/php-src/ext/mysqli/tests   skipif.inc 

  Modified files:  
/php-src/ext/mysqli/tests   001.phpt 002.phpt 003.phpt 004.phpt 
005.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 010.phpt 011.phpt 012.phpt 
013.phpt 014.phpt 015.phpt 016.phpt 
017.phpt 018.phpt 019.phpt 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 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 060.phpt 
061.phpt bug28817.phpt bug29311.phpt 
bug30967.phpt 
  Log:
  added skipif section
  
  http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/001.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/mysqli/tests/001.phpt
diff -u php-src/ext/mysqli/tests/001.phpt:1.4 
php-src/ext/mysqli/tests/001.phpt:1.5
--- php-src/ext/mysqli/tests/001.phpt:1.4   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/001.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli connect
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/002.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/002.phpt
diff -u php-src/ext/mysqli/tests/002.phpt:1.3 
php-src/ext/mysqli/tests/002.phpt:1.4
--- php-src/ext/mysqli/tests/002.phpt:1.3   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/002.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli bind_result 1 
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/003.phpt?r1=1.4r2=1.5ty=u
Index: php-src/ext/mysqli/tests/003.phpt
diff -u php-src/ext/mysqli/tests/003.phpt:1.4 
php-src/ext/mysqli/tests/003.phpt:1.5
--- php-src/ext/mysqli/tests/003.phpt:1.4   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/003.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli connect
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/004.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/004.phpt
diff -u php-src/ext/mysqli/tests/004.phpt:1.3 
php-src/ext/mysqli/tests/004.phpt:1.4
--- php-src/ext/mysqli/tests/004.phpt:1.3   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/004.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli fetch char/text 
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include (connect.inc);
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/005.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/005.phpt
diff -u php-src/ext/mysqli/tests/005.phpt:1.3 
php-src/ext/mysqli/tests/005.phpt:1.4
--- php-src/ext/mysqli/tests/005.phpt:1.3   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/005.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli fetch char/text long 
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/006.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/006.phpt
diff -u php-src/ext/mysqli/tests/006.phpt:1.3 
php-src/ext/mysqli/tests/006.phpt:1.4
--- php-src/ext/mysqli/tests/006.phpt:1.3   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/006.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli fetch long values
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/007.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/007.phpt
diff -u php-src/ext/mysqli/tests/007.phpt:1.3 
php-src/ext/mysqli/tests/007.phpt:1.4
--- php-src/ext/mysqli/tests/007.phpt:1.3   Sat Dec  4 03:16:04 2004
+++ php-src/ext/mysqli/tests/007.phpt   Sat Dec  4 03:50:33 2004
@@ -1,5 +1,7 @@
 --TEST--
 mysqli fetch short values
+--SKIPIF--
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
http://cvs.php.net/diff.php/php-src/ext/mysqli/tests/008.phpt?r1=1.3r2=1.4ty=u
Index: php-src/ext/mysqli/tests/008.phpt
diff -u php-src/ext/mysqli/tests/008.phpt:1.3 
php-src/ext/mysqli/tests/008.phpt:1.4
--- php-src/ext/mysqli/tests/008.phpt:1.3   Sat 

[PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli.c mysqli_prop.c /ext/mysqli/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt 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 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 060.phpt 061.phpt bug29311.phpt bug30967.phpt

2004-12-04 Thread Georg Richter
georg   Sat Dec  4 04:01:34 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/mysqli mysqli.c mysqli_prop.c 
/php-src/ext/mysqli/tests   001.phpt 002.phpt 003.phpt 004.phpt 
005.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 010.phpt 011.phpt 012.phpt 
013.phpt 014.phpt 015.phpt 016.phpt 
017.phpt 018.phpt 019.phpt 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 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 060.phpt 
061.phpt bug29311.phpt bug30967.phpt 
  Log:
  MFH:
fix for bug #28817 (properties don't work in extended class)
fix for bug #30890 (testsuite)
  
  http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.43.2.7r2=1.43.2.8ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.43.2.7 
php-src/ext/mysqli/mysqli.c:1.43.2.8
--- php-src/ext/mysqli/mysqli.c:1.43.2.7Fri Dec  3 02:57:39 2004
+++ php-src/ext/mysqli/mysqli.c Sat Dec  4 04:01:33 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.43.2.7 2004/12/03 07:57:39 georg Exp $ 
+  $Id: mysqli.c,v 1.43.2.8 2004/12/04 09:01:33 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -179,11 +179,6 @@
ret = FAILURE;
obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
 
-   if (!obj-valid) {
-   retval = EG(uninitialized_zval_ptr);
-   return(retval);
-   }
-
if (member-type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(tmp_member);
@@ -223,6 +218,7 @@
} else {
std_hnd = zend_get_std_object_handlers();
retval = std_hnd-read_property(object, member, type TSRMLS_CC);
+   retval-refcount = 1;
}
 
if (member == tmp_member) {
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_prop.c?r1=1.14.2.1r2=1.14.2.2ty=u
Index: php-src/ext/mysqli/mysqli_prop.c
diff -u php-src/ext/mysqli/mysqli_prop.c:1.14.2.1 
php-src/ext/mysqli/mysqli_prop.c:1.14.2.2
--- php-src/ext/mysqli/mysqli_prop.c:1.14.2.1   Mon Jul 26 01:45:41 2004
+++ php-src/ext/mysqli/mysqli_prop.cSat Dec  4 04:01:33 2004
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_prop.c,v 1.14.2.1 2004/07/26 05:45:41 georg Exp $ 
+  $Id: mysqli_prop.c,v 1.14.2.2 2004/12/04 09:01:33 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -29,6 +29,15 @@
 #include ext/standard/info.h
 #include php_mysqli.h
 
+#define CHECK_OBJECT() \
+   if (!obj-valid) { \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Property access is 
not allowed yet. Call the default constructor of the object first); \
+   ZVAL_NULL(*retval); \
+   return SUCCESS; \
+   } \
+
+
+
 #define MYSQLI_GET_MYSQL() \
 MYSQL *p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr)-mysql;
 
@@ -41,9 +50,10 @@
 #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, 
__ret_type)\
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
 {\
+   ALLOC_ZVAL(*retval); \
+   CHECK_OBJECT(); \
__ret_type l;\
__get_type;\
-   ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
@@ -63,8 +73,9 @@
 int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
 {\
char *c;\
+   ALLOC_ZVAL(*retval); \
+   CHECK_OBJECT(); \
__get_type;\
-   ALLOC_ZVAL(*retval);\
if (!p) {\
ZVAL_NULL(*retval);\
} else {\
@@ -96,19 +107,6 @@
 }
 /* }}} */
 
-/* {{{ property link_test_read */
-int link_test_read(mysqli_object *obj, zval **retval TSRMLS_DC)
-{
-   longi;
-   ALLOC_ZVAL(*retval);
-   array_init(*retval);
-
-   for (i=0; i  10; i++)
-   add_index_long(*retval, i, i + 10);
-   return SUCCESS;
-}
-/*i }}} */
-
 /* {{{ property link_connect_errno_read */
 int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
 {
@@ -147,9 +145,11 @@
 /* {{{ property result_type_read

[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS

2004-12-04 Thread Georg Richter
georg   Sat Dec  4 04:03:37 2004 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
  Log:
  fixed bug #30890
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.139r2=1.1760.2.140ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.139 php-src/NEWS:1.1760.2.140
--- php-src/NEWS:1.1760.2.139   Fri Dec  3 02:57:38 2004
+++ php-src/NEWSSat Dec  4 04:03:36 2004
@@ -9,6 +9,7 @@
 - Fixed potential problems with unserializing invalid serialize data. (Marcus)
 - Fixed bug #30967 (properties in extended mysqli classes don't work). (Georg)
 - Fixed bug #30962 (mssql returns space for NULL columns). (Ilia)
+- Fixed bug #30890 (MySQLi testsuite)
 - Fixed bug #30856 (ReflectionClass::getStaticProperties segfaults). (Marcus)
 - Fixed bug #30832 (! stripped off comments in xml parser). (Rob)
 - Fixed bug #30799 (SoapServer doesn't handle private or protected properties).

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



Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli.c /ext/mysqli/tests bug30967.phpt

2004-12-04 Thread Georg Richter
Am Fr, den 03.12.2004 schrieb [EMAIL PROTECTED] um 9:31:
 Hi Georg,
 
 Would such a fix (in combination with the fix for #28430) also fix the problem
 described in #28817 (http://bugs.php.net/bug.php?id=28817)?
 
Bug #28817 is fixed in CVS now (mysqli part). I sent a patch to Rob for
ext/dom.

/Georg

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



Re: [PHP-CVS] cvs: php-src /ext/mysqli mysqli.c /ext/mysqli/tests bug30967.phpt

2004-12-03 Thread Georg Richter
Am Fr, den 03.12.2004 schrieb [EMAIL PROTECTED] um 9:31:

Hi!

 Would such a fix (in combination with the fix for #28430) also fix the problem
 described in #28817 (http://bugs.php.net/bug.php?id=28817)?
 

No, sorry.
I have a fix already for that, but it works in HEAD only, not in 5_0
branch (for dom and mysqli). Will still need some time.

/Georg

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



  1   2   3   >