[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/mysql php_mysql.c

2008-03-04 Thread Felipe Pena
felipe  Tue Mar  4 22:25:36 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c 
  Log:
  Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1105r2=1.2027.2.547.2.1106diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1105 php-src/NEWS:1.2027.2.547.2.1106
--- php-src/NEWS:1.2027.2.547.2.1105Tue Mar  4 19:39:08 2008
+++ php-src/NEWSTue Mar  4 22:25:35 2008
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? Mar 2008, PHP 5.2.6
+- Fixed bug #44333 (SEGFAULT when using mysql_pconnect() with client_flags).
+  (Felipe)
 - Fixed bug #44325 (mssql_bind not correctly bind empty strings as parameter  
   value). (Ilia)
 - Fixed bug #44306 (Better detection of MIPS processors on Windows). (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.22r2=1.213.2.6.2.23diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.22 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.23
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.22Tue Feb 12 20:43:50 2008
+++ php-src/ext/mysql/php_mysql.c   Tue Mar  4 22:25:35 2008
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.22 2008/02/12 20:43:50 johannes Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.23 2008/03/04 22:25:35 felipe Exp $ */
 
 /* TODO:
  *
@@ -517,7 +517,7 @@
int  user_len, passwd_len, host_len;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
-   int client_flags = 0;
+   long client_flags = 0;
php_mysql_conn *mysql=NULL;
 #if MYSQL_VERSION_ID = 32230
void (*handler) (int);



-- 
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) / NEWS /ext/mysql php_mysql.c

2008-01-20 Thread Hannes Magnusson
bjori   Sun Jan 20 14:13:12 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysql  php_mysql.c 
/php-srcNEWS 
  Log:
  MFH: Fixed bug #43875 (Two error messages returned for $new and $flag 
argument in mysql_connect())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.19r2=1.213.2.6.2.20diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.19 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.20
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.19Mon Dec 31 07:20:08 2007
+++ php-src/ext/mysql/php_mysql.c   Sun Jan 20 14:13:11 2008
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.19 2007/12/31 07:20:08 sebastian Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.20 2008/01/20 14:13:11 bjori Exp $ */
 
 /* TODO:
  *
@@ -559,7 +559,7 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
|s!s!s!ll, host_and_port, host_len,
user, 
user_len, passwd, passwd_len, 

new_link, client_flags)==FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (!host_and_port) {
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1057r2=1.2027.2.547.2.1058diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1057 php-src/NEWS:1.2027.2.547.2.1058
--- php-src/NEWS:1.2027.2.547.2.1057Fri Jan 18 07:10:21 2008
+++ php-src/NEWSSun Jan 20 14:13:11 2008
@@ -10,6 +10,8 @@
 
 - Fixed faulty fix for bug #40189 (endless loop in zlib.inflate stream 
filter). 
   (Greg)
+- Fixed bug #43875 (Two error messages returned for $new and $flag argument
+  in mysql_connect()). (Hannes)
 - Fixed bug #43863 (str_word_count() breaks on cyrillic ya in locale cp1251).
   (phprus at gmail dot com, Tony)
 - Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file 
headers).

-- 
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) / NEWS /ext/mysql php_mysql.c

2007-12-19 Thread Ilia Alshanetsky
iliaa   Thu Dec 20 00:31:49 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mysql  php_mysql.c 
/php-srcNEWS 
  Log:
  
  MFB: Fixed bug #43635 (mysql extension ingores INI settings on NULL values
  passed to mysql_connect())
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.17r2=1.213.2.6.2.18diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.17 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.18
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.17Mon Oct  8 18:25:52 2007
+++ php-src/ext/mysql/php_mysql.c   Thu Dec 20 00:31:49 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.17 2007/10/08 18:25:52 andrey Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.18 2007/12/20 00:31:49 iliaa Exp $ */
 
 /* TODO:
  *
@@ -514,6 +514,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;
@@ -521,7 +522,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;
 
@@ -556,99 +556,32 @@
hashed_details_length = spprintf(hashed_details, 0, 
mysql__%s_, user);
client_flags = CLIENT_INTERACTIVE;
} else {
-   host_and_port = MySG(default_host);
-   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 = 

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

2007-06-25 Thread Scott MacVicar
scottmacMon Jun 25 16:01:30 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c 
/php-src/ext/mysqli mysqli.c 
  Log:
  Fixed bug #41350 (my_thread_global_end() error during request shutdown on 
Windows).
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.796r2=1.2027.2.547.2.797diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.796 php-src/NEWS:1.2027.2.547.2.797
--- php-src/NEWS:1.2027.2.547.2.796 Sun Jun 24 17:37:01 2007
+++ php-src/NEWSMon Jun 25 16:01:29 2007
@@ -76,6 +76,8 @@
 - Fixed bug #41527 (WDDX deserialize numeric string array key). (Matt, Ilia)
 - Fixed bug #41518 (file_exists() warns of open_basedir restriction on 
   non-existent file). (Tony)
+- Fixed bug #41350 (my_thread_global_end() error during request shutdown
+  on Windows). (Scott, Andrey)
 - Fixed bug #39330 (apache2handler does not call shutdown actions before 
   apache child die). (isk at ecommerce dot com, Gopal, Tony)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.14r2=1.213.2.6.2.15diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.14 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.15
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.14Mon Jun 18 21:51:32 2007
+++ php-src/ext/mysql/php_mysql.c   Mon Jun 25 16:01:30 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.14 2007/06/18 21:51:32 stas Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.15 2007/06/25 16:01:30 scottmac Exp $ */
 
 /* TODO:
  *
@@ -401,6 +401,10 @@
REGISTER_LONG_CONSTANT(MYSQL_CLIENT_INTERACTIVE, CLIENT_INTERACTIVE, 
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(MYSQL_CLIENT_IGNORE_SPACE, 
CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT); 
 
+   if (mysql_server_init(0, NULL, NULL)) {
+   return FAILURE;
+   }
+
return SUCCESS;
 }
 /* }}} */
@@ -409,6 +413,16 @@
  */
 PHP_MSHUTDOWN_FUNCTION(mysql)
 {
+#ifdef PHP_WIN32
+   unsigned long client_ver = mysql_get_client_version;
+   /* Can't call mysql_server_end() multiple times prior to 5.0.42 on 
Windows */
+   if ((client_ver  50042  client_ver  50100) || client_ver  50122) {
+   mysql_server_end();
+   }
+#else
+   mysql_server_end();
+#endif
+
UNREGISTER_INI_ENTRIES();
return SUCCESS;
 }
@@ -418,12 +432,18 @@
  */
 PHP_RINIT_FUNCTION(mysql)
 {
+#ifdef ZTS
+   if (mysql_thread_init()) {
+   return FAILURE;
+   }
+#endif
MySG(default_link)=-1;
MySG(num_links) = MySG(num_persistent);
/* Reset connect error/errno on every request */
MySG(connect_error) = NULL;
MySG(connect_errno) =0;
MySG(result_allocated) = 0;
+
return SUCCESS;
 }
 /* }}} */
@@ -432,6 +452,10 @@
  */
 PHP_RSHUTDOWN_FUNCTION(mysql)
 {
+#ifdef ZTS
+   mysql_thread_end();
+#endif
+
if (MySG(trace_mode)) {
if (MySG(result_allocated)){
php_error_docref(function.mysql-free-result 
TSRMLS_CC, E_WARNING, %lu result set(s) not freed. Use mysql_free_result to 
free result sets which were requested using mysql_query(), 
MySG(result_allocated));
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16.2.15r2=1.72.2.16.2.16diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16.2.15 
php-src/ext/mysqli/mysqli.c:1.72.2.16.2.16
--- php-src/ext/mysqli/mysqli.c:1.72.2.16.2.15  Tue Mar 20 20:00:27 2007
+++ php-src/ext/mysqli/mysqli.c Mon Jun 25 16:01:30 2007
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli.c,v 1.72.2.16.2.15 2007/03/20 20:00:27 helly Exp $ 
+  $Id: mysqli.c,v 1.72.2.16.2.16 2007/06/25 16:01:30 scottmac Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -652,6 +652,10 @@
REGISTER_LONG_CONSTANT(MYSQLI_REPORT_ALL, MYSQLI_REPORT_ALL, CONST_CS 
| CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(MYSQLI_REPORT_OFF, 0, CONST_CS | 
CONST_PERSISTENT);
 
+   if (mysql_server_init(0, NULL, NULL)) {
+   return FAILURE;
+   }
+
return SUCCESS;
 }
 /* }}} */
@@ -660,6 +664,16 @@
  */
 PHP_MSHUTDOWN_FUNCTION(mysqli)
 {
+#ifdef PHP_WIN32
+   unsigned long client_ver = mysql_get_client_version;
+   /* Can't call mysql_server_end() multiple times prior to 5.0.42 on 
Windows */
+   if ((client_ver  50042  client_ver  50100) || client_ver  50122) {
+   mysql_server_end();
+   }
+#else
+   mysql_server_end();
+#endif
+
zend_hash_destroy(mysqli_driver_properties);
zend_hash_destroy(mysqli_result_properties);
zend_hash_destroy(mysqli_stmt_properties);
@@ -676,6 +690,11 @@
  */
 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/mysql php_mysql.c php_mysql.h

2007-05-14 Thread Scott MacVicar
scottmacMon May 14 17:10:47 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c php_mysql.h 
  Log:
  Add mysql_set_charset() so that the connection encoding can be changed. This 
is similar to the SET NAMES statement but allows the mysql_real_escape_string 
to use the correct character set.
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.700r2=1.2027.2.547.2.701diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.700 php-src/NEWS:1.2027.2.547.2.701
--- php-src/NEWS:1.2027.2.547.2.700 Mon May 14 11:45:38 2007
+++ php-src/NEWSMon May 14 17:10:46 2007
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 2007, PHP 5.2.3
+- Added function mysql_set_charset(). Allows connection encoding to be altered
+  at run time. (Scott)
 - Allow SOAP extension's handler() to work even when
   always_populate_raw_post_data is off. (Ilia)
 - Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.10r2=1.213.2.6.2.11diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.10 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.11
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.10Mon Apr 23 09:32:44 2007
+++ php-src/ext/mysql/php_mysql.c   Mon May 14 17:10:46 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.10 2007/04/23 09:32:44 tony2001 Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.11 2007/05/14 17:10:46 scottmac Exp $ */
 
 /* TODO:
  *
@@ -101,6 +101,10 @@
 #define MYSQL_HAS_YEAR
 #endif
 
+#if (MYSQL_VERSION_ID = 40113  MYSQL_VERSION_ID  5) || 
MYSQL_VERSION_ID = 50007
+#define MYSQL_HAS_SET_CHARSET
+#endif
+
 #define MYSQL_ASSOC10
 #define MYSQL_NUM  11
 #define MYSQL_BOTH (MYSQL_ASSOC|MYSQL_NUM)
@@ -181,7 +185,9 @@
 #endif
 
PHP_FE(mysql_info,  
NULL)
-
+#ifdef MYSQL_HAS_SET_CHARSET
+   PHP_FE(mysql_set_charset,   
NULL)
+#endif
/* for downwards compatability */
PHP_FALIAS(mysql,   mysql_db_query, 
NULL)
PHP_FALIAS(mysql_fieldname, mysql_field_name,   NULL)
@@ -1124,6 +1130,36 @@
 /* }}} */
 #endif
 
+#ifdef MYSQL_HAS_SET_CHARSET
+/* {{{ proto bool mysql_set_charset(string csname [, int link_identifier])
+   sets client character set */
+PHP_FUNCTION(mysql_set_charset)
+{
+   zval *mysql_link = NULL;
+   char *csname;
+   int id = -1, csname_len;
+   php_mysql_conn *mysql;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|r, csname, 
csname_len, mysql_link) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
+
+   if (ZEND_NUM_ARGS() == 1) {
+   id = 
php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+   CHECK_LINK(id);
+   }
+
+   ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, 
MySQL-Link, le_link, le_plink);
+
+   if (!mysql_set_character_set(mysql-conn, csname)) {
+   RETURN_TRUE;
+   } else {
+   RETURN_FALSE;
+   }
+}
+/* }}} */
+#endif
+
 #ifndef NETWARE/* The below two functions not supported on 
NetWare */
 #if MYSQL_VERSION_ID  4
 /* {{{ proto bool mysql_create_db(string database_name [, int link_identifier])
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.h?r1=1.37.2.1.2.1r2=1.37.2.1.2.2diff_format=u
Index: php-src/ext/mysql/php_mysql.h
diff -u php-src/ext/mysql/php_mysql.h:1.37.2.1.2.1 
php-src/ext/mysql/php_mysql.h:1.37.2.1.2.2
--- php-src/ext/mysql/php_mysql.h:1.37.2.1.2.1  Mon Jan  1 09:36:03 2007
+++ php-src/ext/mysql/php_mysql.h   Mon May 14 17:10:47 2007
@@ -17,7 +17,7 @@
 */
 
 
-/* $Id: php_mysql.h,v 1.37.2.1.2.1 2007/01/01 09:36:03 sebastian Exp $ */
+/* $Id: php_mysql.h,v 1.37.2.1.2.2 2007/05/14 17:10:47 scottmac Exp $ */
 
 #ifndef PHP_MYSQL_H
 #define PHP_MYSQL_H
@@ -91,6 +91,9 @@
 PHP_FUNCTION(mysql_thread_id);
 PHP_FUNCTION(mysql_client_encoding);
 PHP_FUNCTION(mysql_ping);
+#if (MYSQL_VERSION_ID = 40113  MYSQL_VERSION_ID  5) || 
MYSQL_VERSION_ID = 50007
+PHP_FUNCTION(mysql_set_charset);
+#endif
 
 ZEND_BEGIN_MODULE_GLOBALS(mysql)
long default_link;

-- 
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) / NEWS /ext/mysql php_mysql.c php_mysql.h

2007-05-14 Thread Antony Dovgal

On 05/14/2007 09:10 PM, Scott MacVicar wrote:

scottmacMon May 14 17:10:47 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src	NEWS 
/php-src/ext/mysql	php_mysql.c php_mysql.h 
  Log:
  Add mysql_set_charset() so that the connection encoding can be changed. 
This is similar to the SET NAMES statement but allows the mysql_real_escape_string to use the correct character set.


When and where was this discussed?

--
Wbr, 
Antony Dovgal


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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/mysql php_mysql.c php_mysql.h

2007-05-14 Thread Scott MacVicar
Was discussed last summer and again in January this year, I forgot about
 it for 5.2.2 until recently.

http://news.php.net/php.internals/27634

http://news.php.net/php.internals/27638

Spoke to ilia on IRC on Friday and his only comment was to use the new
param parsing API.

Scott

Antony Dovgal wrote:
 On 05/14/2007 09:10 PM, Scott MacVicar wrote:
 scottmacMon May 14 17:10:47 2007 UTC

   Modified files:  (Branch: PHP_5_2)
 /php-srcNEWS /php-src/ext/mysqlphp_mysql.c php_mysql.h
   Log:
   Add mysql_set_charset() so that the connection encoding can be
 changed. This is similar to the SET NAMES statement but allows the
 mysql_real_escape_string to use the correct character set.
 
 When and where was this discussed?
 

-- 
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) / NEWS /ext/mysql php_mysql.c php_mysql.h

2007-05-14 Thread Ilia Alshanetsky

Tony,

it was also discussed on internals back in 5.2.1 days, but it was too  
late to include due to the state of the release cycle at the time.


On 14-May-07, at 1:21 PM, Antony Dovgal wrote:


On 05/14/2007 09:10 PM, Scott MacVicar wrote:

scottmacMon May 14 17:10:47 2007 UTC
  Modified files:  (Branch: PHP_5_2)
/php-src	NEWS /php-src/ext/mysql	php_mysql.c php_mysql.h
Log:
  Add mysql_set_charset() so that the connection encoding can be  
changed. This is similar to the SET NAMES statement but allows the  
mysql_real_escape_string to use the correct character set.


When and where was this discussed?

--
Wbr, Antony Dovgal

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



Ilia Alshanetsky

--
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) / NEWS /ext/mysql php_mysql.c

2007-05-14 Thread Scott MacVicar
scottmacMon May 14 18:09:20 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c 
  Log:
  Prefix NEWS item so documentation team know of new function and typo from old 
parsing API spotted by bjori
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.701r2=1.2027.2.547.2.702diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.701 php-src/NEWS:1.2027.2.547.2.702
--- php-src/NEWS:1.2027.2.547.2.701 Mon May 14 17:10:46 2007
+++ php-src/NEWSMon May 14 18:09:19 2007
@@ -1,7 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2007, PHP 5.2.3
-- Added function mysql_set_charset(). Allows connection encoding to be altered
+- [DOC] Added function mysql_set_charset(). Allows connection encoding to be 
altered
   at run time. (Scott)
 - Allow SOAP extension's handler() to work even when
   always_populate_raw_post_data is off. (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.11r2=1.213.2.6.2.12diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.11 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.12
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.11Mon May 14 17:10:46 2007
+++ php-src/ext/mysql/php_mysql.c   Mon May 14 18:09:20 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.11 2007/05/14 17:10:46 scottmac Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.12 2007/05/14 18:09:20 scottmac Exp $ */
 
 /* TODO:
  *
@@ -1141,7 +1141,7 @@
php_mysql_conn *mysql;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|r, csname, 
csname_len, mysql_link) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (ZEND_NUM_ARGS() == 1) {

-- 
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) / NEWS /ext/mysql php_mysql.c

2007-05-14 Thread Nuno Lopes

Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.701 php-src/NEWS:1.2027.2.547.2.702
--- php-src/NEWS:1.2027.2.547.2.701 Mon May 14 17:10:46 2007
+++ php-src/NEWS Mon May 14 18:09:19 2007
@@ -1,7 +1,7 @@
PHP 
NEWS

|||
?? ??? 2007, PHP 5.2.3
-- Added function mysql_set_charset(). Allows connection encoding to be 
altered
+- [DOC] Added function mysql_set_charset(). Allows connection encoding to 
be altered


well the [DOC] tag is supposed to be used in the cvs commit log and not in 
the NEWS files, so that the commit message is forwarded automatically to the 
doc team.


Thanks,
Nuno 


--
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) / NEWS /ext/mysql php_mysql.c

2007-04-22 Thread Ilia Alshanetsky
iliaa   Sun Apr 22 15:19:09 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c 
  Log:
  
  Fixed bug #41159 (mysql_pconnect() hash does not account for connect
  flags).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.655r2=1.2027.2.547.2.656diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.655 php-src/NEWS:1.2027.2.547.2.656
--- php-src/NEWS:1.2027.2.547.2.655 Thu Apr 19 23:21:21 2007
+++ php-src/NEWSSun Apr 22 15:19:08 2007
@@ -2,6 +2,8 @@
 |||
 ?? Apr 2007, PHP 5.2.2RC2
 - Upgraded SQLite 3 to version 3.3.16 (Ilia)
+- Fixed bug #41159 (mysql_pconnect() hash does not account for connect
+  flags). (Ilia)
 - Fixed bug #41121 (range() overflow handling for large numbers on 32bit
   machines). (Ilia)
 - Fixed bug #41109 (recursiveiterator.inc says implements Iterator instead of
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.8r2=1.213.2.6.2.9diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.8 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.9
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.8 Sat Apr 14 10:19:19 2007
+++ php-src/ext/mysql/php_mysql.c   Sun Apr 22 15:19:08 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.8 2007/04/14 10:19:19 tony2001 Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.9 2007/04/22 15:19:08 iliaa Exp $ */
 
 /* TODO:
  *
@@ -618,7 +618,7 @@
}
}
 
-   hashed_details_length = spprintf(hashed_details, 0, 
mysql_%s_%s_%s, SAFE_STRING(host_and_port), SAFE_STRING(user), 
SAFE_STRING(passwd));
+   hashed_details_length = spprintf(hashed_details, 0, 
mysql_%s_%s_%s_%d, SAFE_STRING(host_and_port), SAFE_STRING(user), 
SAFE_STRING(passwd), client_flags);
}
 
/* We cannot use mysql_port anymore in windows, need to use

-- 
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) / NEWS /ext/mysql php_mysql.c

2007-04-14 Thread Antony Dovgal
tony2001Sat Apr 14 10:19:20 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/mysql  php_mysql.c 
  Log:
  MFH: fix #41083 (mysql_ping() requires MYSQL_OPT_RECONNECT to be set since 
MySQL 5.0.13)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.646r2=1.2027.2.547.2.647diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.646 php-src/NEWS:1.2027.2.547.2.647
--- php-src/NEWS:1.2027.2.547.2.646 Fri Apr 13 14:51:40 2007
+++ php-src/NEWSSat Apr 14 10:19:19 2007
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? Apr 2007, PHP 5.2.2RC2
+- Fixed bug #41083 (mysql_ping() requires MYSQL_OPT_RECONNECT to be set since 
+  MySQL 5.0.13). (xiaojb at gmail dot com, Tony)
 - Fixed bug #41075 (memleak when creating default object caused exception). 
   (Dmitry)
 - Fixed bug #41063 (chdir doesn't like root paths). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.7r2=1.213.2.6.2.8diff_format=u
Index: php-src/ext/mysql/php_mysql.c
diff -u php-src/ext/mysql/php_mysql.c:1.213.2.6.2.7 
php-src/ext/mysql/php_mysql.c:1.213.2.6.2.8
--- php-src/ext/mysql/php_mysql.c:1.213.2.6.2.7 Sat Feb 24 02:17:25 2007
+++ php-src/ext/mysql/php_mysql.c   Sat Apr 14 10:19:19 2007
@@ -18,7 +18,7 @@
+--+
 */
  
-/* $Id: php_mysql.c,v 1.213.2.6.2.7 2007/02/24 02:17:25 helly Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.8 2007/04/14 10:19:19 tony2001 Exp $ */
 
 /* TODO:
  *
@@ -487,6 +487,9 @@
 #if MYSQL_VERSION_ID = 32230
void (*handler) (int);
 #endif
+#if MYSQL_VERSION_ID  50012
+   my_bool my_true = 1;
+#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;
@@ -669,8 +672,14 @@
 #if MYSQL_VERSION_ID  32199 /* this lets us set the port number */
mysql_init(mysql-conn);
 
-   if (connect_timeout != -1)
+#if MYSQL_VERSION_ID  50012
+   /* Reconnect has been off by default since MySQL 5.0.3; 
+  this option is new in 5.0.13 and provides a way to 
set reconnection behavior explicitly. */
+   mysql_options(mysql-conn, MYSQL_OPT_RECONNECT, (const 
char *)my_true);
+#endif
+   if (connect_timeout != -1) {
mysql_options(mysql-conn, 
MYSQL_OPT_CONNECT_TIMEOUT, (const char *)connect_timeout);
+   }
 
if (mysql_real_connect(mysql-conn, host, user, 
passwd, NULL, port, socket, client_flags)==NULL) {
 #else
@@ -774,8 +783,15 @@
 #if MYSQL_VERSION_ID  32199 /* this lets us set the port number */
mysql_init(mysql-conn);
 
-   if (connect_timeout != -1)
-   mysql_options(mysql-conn, 
MYSQL_OPT_CONNECT_TIMEOUT, (const char *)connect_timeout);
+#if MYSQL_VERSION_ID  50012
+   /* Reconnect has been off by default since MySQL 5.0.3; 
+this option is new in 5.0.13 and provides a way to set 
reconnection behavior explicitly. */
+   mysql_options(mysql-conn, MYSQL_OPT_RECONNECT, (const char 
*)my_true);
+#endif
+
+   if (connect_timeout != -1) {
+   mysql_options(mysql-conn, MYSQL_OPT_CONNECT_TIMEOUT, 
(const char *)connect_timeout);
+   }
 
if (mysql_real_connect(mysql-conn, host, user, passwd, NULL, 
port, socket, client_flags)==NULL) {
 #else

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