cvs: pear /MDB2 package_mysql.php package_mysqli.php /MDB2/MDB2/Driver mysql.php mysqli.php
| From: | Lorenzo Alberton | Date: | Thu, 16 Nov 2006 09:56:49 +0000 |
| Subject: | cvs: pear /MDB2 package_mysql.php package_mysqli.php /MDB2/MDB2/Driver mysql.php mysqli.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-43095@lists.php.net to get a copy of this message | ||
quipo Thu Nov 16 09:56:49 2006 UTC
Modified files:
/pear/MDB2/MDB2/Driver mysql.php mysqli.php
/pear/MDB2 package_mysql.php package_mysqli.php
Log:
Request #9257: use "SET NAMES" in setCharset()
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.170&r2=1.171&diff_format=u
Index: pear/MDB2/MDB2/Driver/mysql.php
diff -u pear/MDB2/MDB2/Driver/mysql.php:1.170 pear/MDB2/MDB2/Driver/mysql.php:1.171
--- pear/MDB2/MDB2/Driver/mysql.php:1.170 Tue Oct 31 18:46:43 2006
+++ pear/MDB2/MDB2/Driver/mysql.php Thu Nov 16 09:56:49 2006
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.170 2006/10/31 18:46:43 lsmith Exp $
+// $Id: mysql.php,v 1.171 2006/11/16 09:56:49 quipo Exp $
//
/**
@@ -531,15 +531,8 @@
return $connection;
}
}
-
- $query = "SET character_set_client = '".mysql_real_escape_string($charset,
$connection)."'";
- $result = @mysql_query($query, $connection);
- if (!$result) {
- return $this->raiseError(null, null, null,
- 'Unable to set client charset: '.$charset, __FUNCTION__);
- }
-
- return MDB2_OK;
+ $query = "SET NAMES '".mysql_real_escape_string($charset,
$connection)."'";
+ return $this->_doQuery($query, true, $connection);
}
// }}}
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.149&r2=1.150&diff_format=u
Index: pear/MDB2/MDB2/Driver/mysqli.php
diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.149 pear/MDB2/MDB2/Driver/mysqli.php:1.150
--- pear/MDB2/MDB2/Driver/mysqli.php:1.149 Tue Oct 31 18:46:43 2006
+++ pear/MDB2/MDB2/Driver/mysqli.php Thu Nov 16 09:56:49 2006
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysqli.php,v 1.149 2006/10/31 18:46:43 lsmith Exp $
+// $Id: mysqli.php,v 1.150 2006/11/16 09:56:49 quipo Exp $
//
/**
@@ -519,19 +519,8 @@
return $connection;
}
}
-
- if (function_exists('mysqli_set_charset')) {
- $result = @mysqli_set_charset($connection, $charset);
- } else {
- $query = "SET character_set_client =
'".mysqli_real_escape_string($connection, $charset)."'";
- $result = @mysqli_query($connection, $query);
- }
-
- if (!$result) {
- return $this->raiseError(null, null, null,
- 'Unable to set client charset: '.$charset, __FUNCTION__);
- }
- return MDB2_OK;
+ $query = "SET NAMES '".mysql_real_escape_string($charset,
$connection)."'";
+ return $this->_doQuery($query, true, $connection);
}
// }}}
http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysql.php?r1=1.85&r2=1.86&diff_format=u
Index: pear/MDB2/package_mysql.php
diff -u pear/MDB2/package_mysql.php:1.85 pear/MDB2/package_mysql.php:1.86
--- pear/MDB2/package_mysql.php:1.85 Thu Nov 16 09:36:16 2006
+++ pear/MDB2/package_mysql.php Thu Nov 16 09:56:49 2006
@@ -8,6 +8,7 @@
$notes = <<<EOT
- fixed bug #9283: missing support for BINARY/VARBINARY data types (thanks to Tom Hendrikx)
- propagate errors in getTableFieldDefinition() in the Reverse module
+- setCharset() now uses "SET NAMES" instead of "SET character_set_client"
note:
- the multi_query test failes because this is not supported by ext/mysql
http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysqli.php?r1=1.88&r2=1.89&diff_format=u
Index: pear/MDB2/package_mysqli.php
diff -u pear/MDB2/package_mysqli.php:1.88 pear/MDB2/package_mysqli.php:1.89
--- pear/MDB2/package_mysqli.php:1.88 Thu Nov 16 09:36:16 2006
+++ pear/MDB2/package_mysqli.php Thu Nov 16 09:56:49 2006
@@ -8,6 +8,7 @@
$notes = <<<EOT
- fixed bug #9283: missing support for BINARY/VARBINARY data types (thanks to Tom Hendrikx)
- propagate errors in getTableFieldDefinition() in the Reverse module
+- setCharset() now uses "SET NAMES" instead of "SET character_set_client"
open todo items:
- use a trigger to emulate setting default now()