summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
committerSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
commitcd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch)
tree1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/mysqli
parent9ea47aab740772adf0c69d8c94b208a464e599ea (diff)
downloadphp-cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f.tar.gz
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/mysqli.c15
-rw-r--r--ext/mysqli/mysqli_api.c22
-rw-r--r--ext/mysqli/mysqli_driver.c2
-rw-r--r--ext/mysqli/mysqli_embedded.c2
-rw-r--r--ext/mysqli/mysqli_exception.c2
-rw-r--r--ext/mysqli/mysqli_fe.c25
-rw-r--r--ext/mysqli/mysqli_nonapi.c22
-rw-r--r--ext/mysqli/mysqli_prop.c14
-rw-r--r--ext/mysqli/mysqli_repl.c7
-rw-r--r--ext/mysqli/mysqli_report.c4
-rw-r--r--ext/mysqli/mysqli_report.h4
-rw-r--r--ext/mysqli/mysqli_warning.c2
-rw-r--r--ext/mysqli/php_mysqli.h9
-rw-r--r--ext/mysqli/tests/010.phpt2
-rw-r--r--ext/mysqli/tests/bug42548.phpt9
-rw-r--r--ext/mysqli/tests/bug45940.phpt18
16 files changed, 111 insertions, 48 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 90d941991..9252cd6a2 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli.c,v 1.72.2.16.2.25 2008/03/08 14:59:37 andrey Exp $
+ $Id: mysqli.c,v 1.72.2.16.2.28 2009/02/17 10:40:18 johannes Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -254,13 +254,6 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC)
}
if (ret == SUCCESS) {
- if (strcmp(obj->zo.ce->name, "mysqli_driver") &&
- (!obj->ptr || ((MYSQLI_RESOURCE *)(obj->ptr))->status < MYSQLI_STATUS_INITIALIZED)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name );
- retval = EG(uninitialized_zval_ptr);
- return(retval);
- }
-
ret = hnd->read_func(obj, &retval TSRMLS_CC);
if (ret == SUCCESS) {
/* ensure we're creating a temporary variable */
@@ -639,11 +632,13 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_SET_CHARSET_NAME", MYSQL_SET_CHARSET_NAME, CONST_CS | CONST_PERSISTENT);
+#ifdef HAVE_LIBMYSQL_REPLICATION
/* replication */
REGISTER_LONG_CONSTANT("MYSQLI_RPL_MASTER", MYSQL_RPL_MASTER, CONST_CS | CONST_PERSISTENT);
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);
-
+#endif
+
/* bind support */
REGISTER_LONG_CONSTANT("MYSQLI_NO_DATA", MYSQL_NO_DATA, CONST_CS | CONST_PERSISTENT);
#ifdef MYSQL_DATA_TRUNCATED
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 57cc96a88..2ea5bf7ee 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.118.2.22.2.20 2008/01/01 16:51:09 hholzgra Exp $
+ $Id: mysqli_api.c,v 1.118.2.22.2.22 2008/12/31 11:17:40 sebastian Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1425,14 +1425,20 @@ PHP_FUNCTION(mysqli_real_connect)
/* TODO: safe mode handling */
if (PG(sql_safe_mode)) {
} else {
+ if (!socket_len || !socket) {
+ socket = MyG(default_socket);
+ }
+ if (!port) {
+ port = MyG(default_port);
+ }
if (!passwd) {
passwd = MyG(default_pw);
- if (!username){
- username = MyG(default_user);
- if (!hostname) {
- hostname = MyG(default_host);
- }
- }
+ }
+ if (!username){
+ username = MyG(default_user);
+ }
+ if (!hostname) {
+ hostname = MyG(default_host);
}
}
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index 6fd4fb74a..b013a808f 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 042fb42ec..15023ff19 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index e523a6322..b63ab82ba 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c
index 1eb2ec83b..dcff7b295 100644
--- a/ext/mysqli/mysqli_fe.c
+++ b/ext/mysqli/mysqli_fe.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_fe.c,v 1.49.2.5.2.2 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_fe.c,v 1.49.2.5.2.4 2008/12/31 11:17:40 sebastian Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -62,11 +62,15 @@ zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_connect_error, NULL)
PHP_FE(mysqli_data_seek, NULL)
PHP_FE(mysqli_debug, NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FE(mysqli_disable_reads_from_master, NULL)
PHP_FE(mysqli_disable_rpl_parse, NULL)
+#endif
PHP_FE(mysqli_dump_debug_info, NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FE(mysqli_enable_reads_from_master, NULL)
PHP_FE(mysqli_enable_rpl_parse, NULL)
+#endif
PHP_FE(mysqli_embedded_server_end, NULL)
PHP_FE(mysqli_embedded_server_start, NULL)
PHP_FE(mysqli_errno, NULL)
@@ -101,7 +105,9 @@ zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_kill, NULL)
PHP_FE(mysqli_set_local_infile_default, NULL)
PHP_FE(mysqli_set_local_infile_handler, NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FE(mysqli_master_query, NULL)
+#endif
PHP_FE(mysqli_more_results, NULL)
PHP_FE(mysqli_multi_query, NULL)
PHP_FE(mysqli_next_result, NULL)
@@ -116,9 +122,11 @@ zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_real_escape_string, NULL)
PHP_FE(mysqli_real_query, NULL)
PHP_FE(mysqli_rollback, NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FE(mysqli_rpl_parse_enabled, NULL)
PHP_FE(mysqli_rpl_probe, NULL)
PHP_FE(mysqli_rpl_query_type, NULL)
+#endif
PHP_FE(mysqli_select_db, NULL)
#ifdef HAVE_MYSQLI_SET_CHARSET
PHP_FE(mysqli_set_charset, NULL)
@@ -138,8 +146,10 @@ zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_stmt_insert_id, NULL)
PHP_FE(mysqli_stmt_reset, NULL)
PHP_FE(mysqli_stmt_param_count, NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FE(mysqli_send_query, NULL)
PHP_FE(mysqli_slave_query, NULL)
+#endif
PHP_FE(mysqli_sqlstate, NULL)
PHP_FE(mysqli_ssl_set, NULL)
PHP_FE(mysqli_stat, NULL)
@@ -185,11 +195,15 @@ zend_function_entry mysqli_link_methods[] = {
PHP_FALIAS(commit,mysqli_commit,NULL)
PHP_FALIAS(connect,mysqli_connect,NULL)
PHP_FALIAS(debug,mysqli_debug,NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FALIAS(disable_reads_from_master,mysqli_disable_reads_from_master,NULL)
PHP_FALIAS(disable_rpl_parse,mysqli_disable_rpl_parse,NULL)
+#endif
PHP_FALIAS(dump_debug_info,mysqli_dump_debug_info,NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FALIAS(enable_reads_from_master,mysqli_enable_reads_from_master,NULL)
PHP_FALIAS(enable_rpl_parse,mysqli_enable_rpl_parse,NULL)
+#endif
#ifdef HAVE_MYSQLI_GET_CHARSET
PHP_FALIAS(get_charset,mysqli_get_charset,NULL)
#endif
@@ -200,7 +214,9 @@ zend_function_entry mysqli_link_methods[] = {
PHP_FALIAS(kill,mysqli_kill,NULL)
PHP_FALIAS(set_local_infile_default,mysqli_set_local_infile_default,NULL)
PHP_FALIAS(set_local_infile_handler,mysqli_set_local_infile_handler,NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FALIAS(master_query,mysqli_master_query,NULL)
+#endif
PHP_FALIAS(multi_query,mysqli_multi_query,NULL)
PHP_FALIAS(mysqli,mysqli_connect,NULL)
PHP_FALIAS(more_results,mysqli_more_results, NULL)
@@ -214,15 +230,20 @@ zend_function_entry mysqli_link_methods[] = {
PHP_FALIAS(escape_string, mysqli_real_escape_string,NULL)
PHP_FALIAS(real_query,mysqli_real_query,NULL)
PHP_FALIAS(rollback,mysqli_rollback,NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
PHP_FALIAS(rpl_parse_enabled,mysqli_rpl_parse_enabled,NULL)
PHP_FALIAS(rpl_probe,mysqli_rpl_probe,NULL)
PHP_FALIAS(rpl_query_type,mysqli_rpl_query_type,NULL)
+#endif
PHP_FALIAS(select_db,mysqli_select_db,NULL)
#ifdef HAVE_MYSQLI_SET_CHARSET
PHP_FALIAS(set_charset,mysqli_set_charset,NULL)
#endif
PHP_FALIAS(set_opt, mysqli_options,NULL)
+#ifdef HAVE_LIBMYSQL_REPLICATION
+ PHP_FALIAS(send_query,mysqli_send_query,NULL)
PHP_FALIAS(slave_query,mysqli_slave_query,NULL)
+#endif
PHP_FALIAS(ssl_set,mysqli_ssl_set,NULL)
PHP_FALIAS(stat,mysqli_stat,NULL)
PHP_FALIAS(stmt_init,mysqli_stmt_init, NULL)
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 3bc8fc183..ae8b9e63c 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_nonapi.c,v 1.54.2.7.2.6 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_nonapi.c,v 1.54.2.7.2.8 2008/12/31 11:17:40 sebastian Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -56,14 +56,20 @@ PHP_FUNCTION(mysqli_connect)
/* TODO: safe mode handling */
if (PG(sql_safe_mode)){
} else {
+ if (!socket_len || !socket) {
+ socket = MyG(default_socket);
+ }
+ if (!port) {
+ port = MyG(default_port);
+ }
if (!passwd) {
passwd = MyG(default_pw);
- if (!username){
- username = MyG(default_user);
- if (!hostname) {
- hostname = MyG(default_host);
- }
- }
+ }
+ if (!username){
+ username = MyG(default_user);
+ }
+ if (!hostname) {
+ hostname = MyG(default_host);
}
}
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 9fc9047e0..59753f819 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_prop.c,v 1.23.2.5.2.4 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_prop.c,v 1.23.2.5.2.6 2009/02/17 10:40:18 johannes Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -30,7 +30,7 @@
#include "php_mysqli.h"
#define CHECK_STATUS(value) \
- if (((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
+ if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
ZVAL_NULL(*retval); \
return SUCCESS; \
@@ -134,7 +134,6 @@ static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
ALLOC_ZVAL(*retval);
- CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
ZVAL_LONG(*retval, (long)MyG(error_no));
return SUCCESS;
}
@@ -144,8 +143,11 @@ static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
ALLOC_ZVAL(*retval);
- CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
- ZVAL_STRING(*retval, MyG(error_msg), 1);
+ if (MyG(error_msg)) {
+ ZVAL_STRING(*retval, MyG(error_msg), 1);
+ } else {
+ ZVAL_NULL(*retval);
+ }
return SUCCESS;
}
/* }}} */
diff --git a/ext/mysqli/mysqli_repl.c b/ext/mysqli/mysqli_repl.c
index bc4e89d79..977704502 100644
--- a/ext/mysqli/mysqli_repl.c
+++ b/ext/mysqli/mysqli_repl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_repl.c,v 1.3.2.2.2.2 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_repl.c,v 1.3.2.2.2.4 2008/12/31 11:17:40 sebastian Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -29,6 +29,7 @@
#include "ext/standard/info.h"
#include "php_mysqli.h"
+#ifdef HAVE_LIBMYSQL_REPLICATION
/* {{{ proto void mysqli_disable_reads_from_master(object link)
*/
PHP_FUNCTION(mysqli_disable_reads_from_master)
@@ -211,6 +212,8 @@ PHP_FUNCTION(mysqli_slave_query)
}
/* }}} */
+#endif /* HAVE_LIBMYSQL_REPLICATION */
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index 26a6ba267..9af0860e4 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_report.c,v 1.11.2.2.2.3 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_report.c,v 1.11.2.2.2.4 2008/12/31 11:17:40 sebastian Exp $
*/
#ifdef HAVE_CONFIG_H
diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h
index a4a9fda3d..89f912573 100644
--- a/ext/mysqli/mysqli_report.h
+++ b/ext/mysqli/mysqli_report.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_report.h,v 1.5.2.1.2.2 2007/12/31 07:20:08 sebastian Exp $
+ $Id: mysqli_report.h,v 1.5.2.1.2.3 2008/12/31 11:17:40 sebastian Exp $
*/
#ifndef __HAVE_MYSQLI_PROFILER_H__
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 5608ef1ac..f8351eb03 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h
index e83113aee..4177bf6fd 100644
--- a/ext/mysqli/php_mysqli.h
+++ b/ext/mysqli/php_mysqli.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: php_mysqli.h,v 1.54.2.7.2.7 2007/12/31 07:20:08 sebastian Exp $
+ $Id: php_mysqli.h,v 1.54.2.7.2.9 2008/12/31 11:17:40 sebastian Exp $
*/
/* A little hack to prevent build break, when mysql is used together with
@@ -301,6 +301,11 @@ if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && stmt->last_errno) { \
php_mysqli_report_error(stmt->sqlstate, stmt->last_errno, stmt->last_error TSRMLS_CC); \
}
+#if MYSQL_VERSION_ID > 32300 && MYSQL_VERSION_ID < 60000
+#define HAVE_LIBMYSQL_REPLICATION
+#endif
+
+
PHP_MYSQLI_API void mysqli_register_link(zval *return_value, void *link TSRMLS_DC);
PHP_MYSQLI_API void mysqli_register_stmt(zval *return_value, void *stmt TSRMLS_DC);
PHP_MYSQLI_API void mysqli_register_result(zval *return_value, void *result TSRMLS_DC);
diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt
index 6b79d62f4..40b9676cf 100644
--- a/ext/mysqli/tests/010.phpt
+++ b/ext/mysqli/tests/010.phpt
@@ -55,5 +55,5 @@ array(7) {
[5]=>
float(1)
[6]=>
- float(888888914608000)
+ float(8.88888914608E+14)
}
diff --git a/ext/mysqli/tests/bug42548.phpt b/ext/mysqli/tests/bug42548.phpt
index 541833cf9..d1e3d03b5 100644
--- a/ext/mysqli/tests/bug42548.phpt
+++ b/ext/mysqli/tests/bug42548.phpt
@@ -1,7 +1,14 @@
--TEST--
Bug #42548 PROCEDURE xxx can't return a result set in the given context (works in 5.2.3!!)
--SKIPIF--
-<?php if (!extension_loaded("mysqli")) print "skip"; ?>
+<?php
+require_once('skipif.inc');
+
+if (mysqli_get_server_version($con) <= 50000) {
+ die(sprintf('skip Needs MySQL 5.0+, found version %d.', mysqli_get_server_version($con)));
+}
+
+?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/bug45940.phpt b/ext/mysqli/tests/bug45940.phpt
new file mode 100644
index 000000000..5a8b6bb04
--- /dev/null
+++ b/ext/mysqli/tests/bug45940.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #45940 MySQLI OO does not populate connect_error property on failed connect
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "connect.inc";
+
+//a forced username/password mismatch
+$dbo = @new mysqli($host, 'hopenotexist', 'andifheexistshehasanotherpassword', 'my_db');
+
+var_dump($dbo->connect_error);
+var_dump(mysqli_connect_error());
+?>
+--EXPECTF--
+string(71) "Access denied for user 'hopenotexist'@'localhost' (using password: YES)"
+string(71) "Access denied for user 'hopenotexist'@'localhost' (using password: YES)"
+