diff options
author | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2021-06-04 12:59:24 +0700 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-06-17 19:30:24 +0200 |
commit | fc71746a6a75e2b24a50a6c3afb026a667d409c6 (patch) | |
tree | 12d5084b4e2223722946b704a9526c9ab8f32447 /client/mysqltest.cc | |
parent | a72098421c73a961fb0b8193d7175820d5318b65 (diff) | |
download | mariadb-git-fc71746a6a75e2b24a50a6c3afb026a667d409c6.tar.gz |
MDEV-16708: Fixed ths issue with handling of ERR packet received by mysqltest
on response to COM_STMT_EXECUTE
The test cases like the following one
delimiter |;
CREATE PROCEDURE SP001()
BEGIN
DECLARE C1 CURSOR FOR SELECT 1;
OPEN C1;
SELECT 1;
CLOSE C1;
CLOSE C1;
END|
delimiter ;|
--error 1326
call SP001();
are failed since processing of ERR packet was missed by mysqltest
in case it is run with --ps-protocol
Additionally, the test sp-error was changed to don't run multi-statements
since they are not supported by PS protocol
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 0f052397d4f..a873618bf55 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8324,6 +8324,7 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, goto end; } + int err; do { /* @@ -8357,8 +8358,6 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, goto end; } - /* If we got here the statement was both executed and read successfully */ - handle_no_error(command); if (!disable_result_log) { /* @@ -8436,8 +8435,14 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command, } } } - } while ( !mysql_stmt_next_result(stmt)); + } while ( !(err= mysql_stmt_next_result(stmt))); + if (err > 0) + /* We got an error from mysql_next_result, maybe expected */ + handle_error(command, mysql_errno(mysql), mysql_error(mysql), + mysql_sqlstate(mysql), ds); + else + handle_no_error(command); end: if (!disable_warnings) { |