summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_auth.c
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/mysqlnd/mysqlnd_auth.c
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/mysqlnd/mysqlnd_auth.c')
-rw-r--r--ext/mysqlnd/mysqlnd_auth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index 1bb08013c2..1a56e8ef0a 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -137,8 +137,7 @@ mysqlnd_auth_handshake(MYSQLND * conn,
strlcpy(conn->error_info.sqlstate, auth_resp_packet->sqlstate, sizeof(conn->error_info.sqlstate));
DBG_ERR_FMT("ERROR:%u [SQLSTATE:%s] %s", auth_resp_packet->error_no, auth_resp_packet->sqlstate, auth_resp_packet->error);
}
- conn->error_info.error_no = auth_resp_packet->error_no;
- strlcpy(conn->error_info.error, auth_resp_packet->error, sizeof(conn->error_info.error));
+ SET_CLIENT_ERROR(conn->error_info, auth_resp_packet->error_no, UNKNOWN_SQLSTATE, auth_resp_packet->error);
}
goto end;
}
@@ -235,7 +234,7 @@ mysqlnd_auth_change_user(MYSQLND * const conn,
}
ret = PACKET_READ(chg_user_resp, conn);
- conn->error_info = chg_user_resp->error_info;
+ COPY_CLIENT_ERROR(conn->error_info, chg_user_resp->error_info);
if (0xFE == chg_user_resp->response_code) {
ret = FAIL;