summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2011-08-04 09:51:26 +0000
committerAndrey Hristov <andrey@php.net>2011-08-04 09:51:26 +0000
commitc9e7716cfd137b7c9ec2980273b3bbd4bc743e1f (patch)
tree078196a1b05032c38ed91c487438f32f3a10dc10 /ext/mysqli
parentd8f08192effdd786e00dfc4da8ee762b066382b6 (diff)
downloadphp-git-c9e7716cfd137b7c9ec2980273b3bbd4bc743e1f.tar.gz
Add mysqli_error_list() that returns an array with errors. Typically only
one and just one for libmysql. mysqlnd can return generate more than one error during its work and with mysqli_error() only the last error is being reported. In the array returned by mysqli_error_list() / $mysqli->error_list, all errors will be found. The list is reset when the next command is executed
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/mysqli_fe.c2
-rw-r--r--ext/mysqli/mysqli_fe.h2
-rw-r--r--ext/mysqli/mysqli_nonapi.c88
-rw-r--r--ext/mysqli/mysqli_prop.c98
-rw-r--r--ext/mysqli/tests/057.phpt3
-rw-r--r--ext/mysqli/tests/bug34810.phpt5
-rw-r--r--ext/mysqli/tests/mysqli_class_mysqli_interface.phpt8
-rw-r--r--ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt9
-rw-r--r--ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt8
-rw-r--r--ext/mysqli/tests/mysqli_connect.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_connect_oo.phpt2
-rw-r--r--ext/mysqli/tests/mysqli_kill.phpt12
-rw-r--r--ext/mysqli/tests/mysqli_real_connect.phpt4
-rw-r--r--ext/mysqli/tests/mysqli_real_connect_pconn.phpt2
15 files changed, 245 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c
index eb133b1a80..a126148b29 100644
--- a/ext/mysqli/mysqli_fe.c
+++ b/ext/mysqli/mysqli_fe.c
@@ -352,6 +352,7 @@ const zend_function_entry mysqli_functions[] = {
#endif
PHP_FE(mysqli_errno, arginfo_mysqli_only_link)
PHP_FE(mysqli_error, arginfo_mysqli_only_link)
+ PHP_FE(mysqli_error_list, arginfo_mysqli_only_link)
PHP_FE(mysqli_stmt_execute, arginfo_mysqli_only_statement)
PHP_FALIAS(mysqli_execute, mysqli_stmt_execute, arginfo_mysqli_only_statement)
PHP_FE(mysqli_fetch_field, arginfo_mysqli_only_result)
@@ -424,6 +425,7 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_stmt_data_seek, arginfo_mysqli_stmt_data_seek)
PHP_FE(mysqli_stmt_errno, arginfo_mysqli_only_statement)
PHP_FE(mysqli_stmt_error, arginfo_mysqli_only_statement)
+ PHP_FE(mysqli_stmt_error_list, arginfo_mysqli_only_statement)
PHP_FE(mysqli_stmt_fetch, arginfo_mysqli_only_statement)
PHP_FE(mysqli_stmt_field_count, arginfo_mysqli_only_statement)
PHP_FE(mysqli_stmt_free_result, arginfo_mysqli_only_statement)
diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h
index bf2a70ab56..9dc7843110 100644
--- a/ext/mysqli/mysqli_fe.h
+++ b/ext/mysqli/mysqli_fe.h
@@ -38,6 +38,7 @@ PHP_FUNCTION(mysqli_debug);
PHP_FUNCTION(mysqli_dump_debug_info);
PHP_FUNCTION(mysqli_errno);
PHP_FUNCTION(mysqli_error);
+PHP_FUNCTION(mysqli_error_list);
PHP_FUNCTION(mysqli_fetch_all);
PHP_FUNCTION(mysqli_fetch_array);
PHP_FUNCTION(mysqli_fetch_assoc);
@@ -111,6 +112,7 @@ PHP_FUNCTION(mysqli_stmt_close);
PHP_FUNCTION(mysqli_stmt_data_seek);
PHP_FUNCTION(mysqli_stmt_errno);
PHP_FUNCTION(mysqli_stmt_error);
+PHP_FUNCTION(mysqli_stmt_error_list);
PHP_FUNCTION(mysqli_stmt_free_result);
PHP_FUNCTION(mysqli_stmt_get_result);
PHP_FUNCTION(mysqli_stmt_get_warnings);
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 11c0618c49..8dbaed2bff 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -385,6 +385,7 @@ PHP_FUNCTION(mysqli_fetch_all)
/* }}} */
+
/* {{{ proto array mysqli_get_client_stats(void)
Returns statistics about the zval cache */
PHP_FUNCTION(mysqli_get_client_stats)
@@ -415,6 +416,93 @@ PHP_FUNCTION(mysqli_get_connection_stats)
#endif
/* }}} */
+/* {{{ proto mixed mysqli_error_list (object connection)
+ Fetches all client errors */
+PHP_FUNCTION(mysqli_error_list)
+{
+ MY_MYSQL *mysql;
+ zval *mysql_link;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
+ array_init(return_value);
+#if defined(MYSQLI_USE_MYSQLND)
+ if (mysql->mysql->error_info.error_list) {
+ MYSQLND_ERROR_LIST_ELEMENT * message;
+ zend_llist_position pos;
+ for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(mysql->mysql->error_info.error_list, &pos);
+ message;
+ message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(mysql->mysql->error_info.error_list, &pos))
+ {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
+ add_next_index_zval(return_value, single_error);
+ }
+ }
+#else
+ if (mysql_errno(mysql->mysql)) {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_errno(mysql->mysql));
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_sqlstate(mysql->mysql), 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_error(mysql->mysql), 1);
+ add_next_index_zval(return_value, single_error);
+ }
+#endif
+}
+/* }}} */
+
+
+/* {{{ proto string mysqli_stmt_error_list(object stmt)
+*/
+PHP_FUNCTION(mysqli_stmt_error_list)
+{
+ MY_STMT *stmt;
+ zval *mysql_stmt;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ return;
+ }
+ MYSQLI_FETCH_RESOURCE_STMT(stmt, &mysql_stmt, MYSQLI_STATUS_INITIALIZED);
+ array_init(return_value);
+#if defined(MYSQLI_USE_MYSQLND)
+ if (stmt->stmt && stmt->stmt->data && stmt->stmt->data->error_info.error_list) {
+ MYSQLND_ERROR_LIST_ELEMENT * message;
+ zend_llist_position pos;
+ for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(stmt->stmt->data->error_info.error_list, &pos);
+ message;
+ message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(stmt->stmt->data->error_info.error_list, &pos))
+ {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
+ add_next_index_zval(return_value, single_error);
+ }
+ }
+#else
+ if (mysql_stmt_errno(stmt->stmt)) {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_stmt_errno(stmt->stmt));
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_stmt_sqlstate(stmt->stmt), 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_stmt_error(stmt->stmt), 1);
+ add_next_index_zval(return_value, single_error);
+ }
+#endif
+}
+/* }}} */
+
/* {{{ proto mixed mysqli_fetch_object (object result [, string class_name [, NULL|array ctor_params]])
Fetch a result row as an object */
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 8a5eef2dcd..9e233022c0 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -189,6 +189,54 @@ static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
+
+/* {{{ property link_error_list_read */
+static int link_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ MY_MYSQL *mysql;
+
+ MAKE_STD_ZVAL(*retval);
+
+ CHECK_STATUS(MYSQLI_STATUS_VALID);
+
+ mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
+
+ array_init(*retval);
+ if (mysql) {
+#if defined(MYSQLI_USE_MYSQLND)
+ if (mysql->mysql->error_info.error_list) {
+ MYSQLND_ERROR_LIST_ELEMENT * message;
+ zend_llist_position pos;
+ for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(mysql->mysql->error_info.error_list, &pos);
+ message;
+ message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(mysql->mysql->error_info.error_list, &pos))
+ {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
+ add_next_index_zval(*retval, single_error);
+ }
+ }
+#else
+ if (mysql_errno(mysql->mysql)) {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_errno(mysql->mysql));
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_sqlstate(mysql->mysql), 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_error(mysql->mysql), 1);
+ add_next_index_zval(*retval, single_error);
+ }
+#endif
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+
/* link properties */
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
@@ -202,6 +250,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version
MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
+
/* result properties */
/* {{{ property result_type_read */
@@ -306,6 +355,51 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
+/* {{{ property stmt_error_list_read */
+static int stmt_error_list_read(mysqli_object *obj, zval **retval TSRMLS_DC)
+{
+ MY_STMT * stmt;
+
+ MAKE_STD_ZVAL(*retval);
+ CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+
+ stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
+ array_init(*retval);
+ if (stmt && stmt->stmt) {
+#if defined(MYSQLI_USE_MYSQLND)
+ if (stmt->stmt->data && stmt->stmt->data->error_info.error_list) {
+ MYSQLND_ERROR_LIST_ELEMENT * message;
+ zend_llist_position pos;
+ for (message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_first_ex(stmt->stmt->data->error_info.error_list, &pos);
+ message;
+ message = (MYSQLND_ERROR_LIST_ELEMENT *) zend_llist_get_next_ex(stmt->stmt->data->error_info.error_list, &pos))
+ {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), message->error_no);
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), message->sqlstate, 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), message->error, 1);
+ add_next_index_zval(*retval, single_error);
+ }
+ }
+#else
+ if (mysql_stmt_errno(stmt->stmt)) {
+ zval * single_error;
+ MAKE_STD_ZVAL(single_error);
+ array_init(single_error);
+ add_assoc_long_ex(single_error, "errno", sizeof("errno"), mysql_stmt_errno(stmt->stmt));
+ add_assoc_string_ex(single_error, "sqlstate", sizeof("sqlstate"), mysql_stmt_sqlstate(stmt->stmt), 1);
+ add_assoc_string_ex(single_error, "error", sizeof("error"), mysql_stmt_error(stmt->stmt), 1);
+ add_next_index_zval(*retval, single_error);
+ }
+#endif
+ }
+ return SUCCESS;
+}
+/* }}} */
+
+
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
@@ -323,6 +417,7 @@ const mysqli_property_entry mysqli_link_property_entries[] = {
{"connect_error", sizeof("connect_error") - 1, link_connect_error_read, NULL},
{"errno", sizeof("errno") - 1, link_errno_read, NULL},
{"error", sizeof("error") - 1, link_error_read, NULL},
+ {"error_list", sizeof("error_list") - 1, link_error_list_read, NULL},
{"field_count", sizeof("field_count") - 1, link_field_count_read, NULL},
{"host_info", sizeof("host_info") - 1, link_host_info_read, NULL},
{"info", sizeof("info") - 1, link_info_read, NULL},
@@ -345,6 +440,7 @@ const zend_property_info mysqli_link_property_info_entries[] = {
{ZEND_ACC_PUBLIC, "connect_error", sizeof("connect_error") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "errno", sizeof("errno") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "error", sizeof("error") - 1, -1, 0, NULL, 0, NULL},
+ {ZEND_ACC_PUBLIC, "error_list", sizeof("error_list") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "field_count", sizeof("field_count") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "host_info", sizeof("host_info") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "info", sizeof("info") - 1, -1, 0, NULL, 0, NULL},
@@ -385,6 +481,7 @@ const mysqli_property_entry mysqli_stmt_property_entries[] = {
{"field_count", sizeof("field_count") - 1, stmt_field_count_read, NULL},
{"errno", sizeof("errno") - 1, stmt_errno_read, NULL},
{"error", sizeof("error") - 1, stmt_error_read, NULL},
+ {"error_list", sizeof("error_list") - 1, stmt_error_list_read, NULL},
{"sqlstate", sizeof("sqlstate") - 1, stmt_sqlstate_read, NULL},
{"id", sizeof("id") - 1, stmt_id_read, NULL},
{NULL, 0, NULL, NULL}
@@ -399,6 +496,7 @@ const zend_property_info mysqli_stmt_property_info_entries[] = {
{ZEND_ACC_PUBLIC, "field_count",sizeof("field_count") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "errno", sizeof("errno") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "error", sizeof("error") - 1, -1, 0, NULL, 0, NULL},
+ {ZEND_ACC_PUBLIC, "error_list", sizeof("error_list") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "sqlstate", sizeof("sqlstate") - 1, -1, 0, NULL, 0, NULL},
{ZEND_ACC_PUBLIC, "id", sizeof("id") - 1, -1, 0, NULL, 0, NULL},
{0, NULL, 0, -1, 0, NULL, 0, NULL}
diff --git a/ext/mysqli/tests/057.phpt b/ext/mysqli/tests/057.phpt
index 8c8b3eeed7..2cb887506a 100644
--- a/ext/mysqli/tests/057.phpt
+++ b/ext/mysqli/tests/057.phpt
@@ -91,6 +91,9 @@ object(mysqli_stmt)#%d (%d) {
int(0)
[%u|b%"error"]=>
%unicode|string%(0) ""
+ [%u|b%"error_list"]=>
+ array(0) {
+ }
[%u|b%"sqlstate"]=>
%unicode|string%(5) "00000"
[%u|b%"id"]=>
diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt
index 35eb717534..c6158b9913 100644
--- a/ext/mysqli/tests/bug34810.phpt
+++ b/ext/mysqli/tests/bug34810.phpt
@@ -77,6 +77,9 @@ object(mysqli)#%d (%d) {
int(0)
[%u|b%"error"]=>
%unicode|string%(0) ""
+ [%u|b%"error_list"]=>
+ array(0) {
+ }
[%u|b%"field_count"]=>
int(0)
[%u|b%"host_info"]=>
@@ -113,6 +116,8 @@ object(mysqli)#%d (%d) {
int(0)
[%u|b%"error"]=>
%unicode|string%(0) ""
+ [%u|b%"error_list"]=>
+ NULL
[%u|b%"field_count"]=>
NULL
[%u|b%"host_info"]=>
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
index a3bd92fcfc..9eff426911 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
@@ -131,6 +131,11 @@ require_once('skipifconnectfailure.inc');
$mysqli->error, gettype($mysqli->error),
mysqli_error($link), gettype(mysqli_error($link)));
+ assert(mysqli_error_list($link) === $mysqli->error_list);
+ printf("mysqli->error_list = '%s'/%s ('%s'/%s)\n",
+ $mysqli->error_list, gettype($mysqli->error_list),
+ mysqli_error_list($link), gettype(mysqli_error_list($link)));
+
assert(mysqli_field_count($link) === $mysqli->field_count);
printf("mysqli->field_count = '%s'/%s ('%s'/%s)\n",
$mysqli->field_count, gettype($mysqli->field_count),
@@ -222,6 +227,7 @@ connect_errno
connect_error
errno
error
+error_list
field_count
host_info
info
@@ -241,6 +247,7 @@ connect_errno
connect_error
errno
error
+error_list
field_count
host_info
info
@@ -258,6 +265,7 @@ mysqli->client_info = '%s'/%unicode|string% ('%s'/%unicode|string%)
mysqli->client_version = '%d'/integer ('%d'/integer)
mysqli->errno = '0'/integer ('0'/integer)
mysqli->error = ''/%unicode|string% (''/%unicode|string%)
+mysqli->error_list = 'Array'/array ('Array'/array)
mysqli->field_count = '0'/integer ('0'/integer)
mysqli->insert_id = '0'/integer ('0'/integer)
mysqli->sqlstate = '00000'/%unicode|string% ('00000'/%unicode|string%)
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
index d0940a7561..61630b0961 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt
@@ -151,6 +151,7 @@ connect_errno = '%s'
connect_error = ''%s'
errno = 'NULL'
error = 'NULL'
+error_list = 'NULL'
field_count = 'NULL'
host_info = 'NULL'
info = 'NULL'
@@ -170,6 +171,7 @@ connect_errno = '%s'
connect_error = '%s'
errno = 'NULL'
error = 'NULL'
+error_list = 'NULL'
field_count = 'NULL'
host_info = 'NULL'
info = 'NULL'
@@ -220,6 +222,7 @@ connect_errno = '%s'
connect_error = '%s'
errno = 'NULL'
error = 'NULL'
+error_list = 'NULL'
field_count = 'NULL'
host_info = 'NULL'
info = 'NULL'
@@ -239,6 +242,7 @@ connect_errno = '%s'
connect_error = '%s'
errno = 'NULL'
error = 'NULL'
+error_list = 'NULL'
field_count = 'NULL'
host_info = 'NULL'
info = 'NULL'
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
index 3ce2b588f8..c7f348323e 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
@@ -1129,6 +1129,14 @@ isStatic: no
isDefault: yes
Modifiers: 256
+Inspecting property 'error_list'
+isPublic: yes
+isPrivate: no
+isProtected: no
+isStatic: no
+isDefault: yes
+Modifiers: 256
+
Inspecting property 'field_count'
isPublic: yes
isPrivate: no
@@ -1215,6 +1223,7 @@ Default property 'connect_errno'
Default property 'connect_error'
Default property 'errno'
Default property 'error'
+Default property 'error_list'
Default property 'field_count'
Default property 'host_info'
Default property 'info'
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt
index 7cbb127212..acf7379198 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt
@@ -97,6 +97,9 @@ printf("stmt->errno = '%s'\n", $stmt->errno);
assert(mysqli_stmt_error($stmt) === $stmt->error);
printf("stmt->error = '%s'\n", $stmt->error);
+assert(mysqli_stmt_error_list($stmt) === $stmt->error_list);
+var_dump("stmt->error = ", $stmt->error_list);
+
assert(mysqli_stmt_field_count($stmt) === $stmt->field_count);
printf("stmt->field_count = '%s'\n", $stmt->field_count);
@@ -143,6 +146,7 @@ Class variables:
affected_rows
errno
error
+error_list
field_count
id
insert_id
@@ -158,6 +162,7 @@ param_count
field_count
errno
error
+error_list
sqlstate
id
@@ -173,6 +178,9 @@ stmt->affected_rows = ''
stmt->affected_rows = '1'
stmt->errno = '0'
stmt->error = ''
+string(14) "stmt->error = "
+array(0) {
+}
stmt->field_count = '0'
stmt->id = '%d'
stmt->insert_id = '0'
diff --git a/ext/mysqli/tests/mysqli_connect.phpt b/ext/mysqli/tests/mysqli_connect.phpt
index cf7c7bede8..e9d6ed543f 100644
--- a/ext/mysqli/tests/mysqli_connect.phpt
+++ b/ext/mysqli/tests/mysqli_connect.phpt
@@ -146,7 +146,7 @@ mysqli_connect()
print "done!";
?>
--EXPECTF--
-Warning: mysqli_connect(): (%d/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_connect(): (%s/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
array(1) {
[%u|b%"testing"]=>
%unicode|string%(21) "mysqli.default_socket"
diff --git a/ext/mysqli/tests/mysqli_connect_oo.phpt b/ext/mysqli/tests/mysqli_connect_oo.phpt
index d406e24845..af257ca6df 100644
--- a/ext/mysqli/tests/mysqli_connect_oo.phpt
+++ b/ext/mysqli/tests/mysqli_connect_oo.phpt
@@ -144,7 +144,7 @@ new mysqli()
print "done!";
?>
--EXPECTF--
-Warning: mysqli::mysqli(): (%d/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d
+Warning: mysqli::mysqli(): (%s/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d
... and now Exceptions
Access denied for user '%s'@'%s' (using password: %s)
done! \ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt
index 5706adf46d..bb83dd6c05 100644
--- a/ext/mysqli/tests/mysqli_kill.phpt
+++ b/ext/mysqli/tests/mysqli_kill.phpt
@@ -96,6 +96,18 @@ object(mysqli)#%d (%d) {
int(2006)
[%u|b%"error"]=>
%unicode|string%(%d) "%s"
+ [%u|b%"error_list"]=>
+ array(1) {
+ [0]=>
+ array(3) {
+ [%u|b%"errno"]=>
+ int(2006)
+ [%u|b%"sqlstate"]=>
+ %unicode|string%(5) "%s"
+ [%u|b%"error"]=>
+ %unicode|string%(%d) "%s"
+ }
+ }
[%u|b%"field_count"]=>
int(0)
[%u|b%"host_info"]=>
diff --git a/ext/mysqli/tests/mysqli_real_connect.phpt b/ext/mysqli/tests/mysqli_real_connect.phpt
index 2c371328b9..350c30092e 100644
--- a/ext/mysqli/tests/mysqli_real_connect.phpt
+++ b/ext/mysqli/tests/mysqli_real_connect.phpt
@@ -175,7 +175,7 @@ require_once('skipifconnectfailure.inc');
require_once("clean_table.inc");
?>
--EXPECTF--
-Warning: mysqli_real_connect(): (%d/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
object(mysqli)#%d (%d) {
[%u|b%"affected_rows"]=>
NULL
@@ -191,6 +191,8 @@ object(mysqli)#%d (%d) {
%s
[%u|b%"error"]=>
%s
+ [%u|b%"error_list"]=>
+ NULL
[%u|b%"field_count"]=>
NULL
[%u|b%"host_info"]=>
diff --git a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt
index 5dedd47c96..4cc18198c6 100644
--- a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt
+++ b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt
@@ -151,5 +151,5 @@ mysqli.max_persistent=10
require_once("clean_table.inc");
?>
--EXPECTF--
-Warning: mysqli_real_connect(): (%d/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_real_connect(): (%s/%d): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d
done!