mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-17610 Unexpected connection abort after certain operations from within stored procedure
Always set SERVER_MORE_RESULTS_EXIST when executing stored procedure statements If statements produce a result, EOF packet needs this flag (SP ends with an OK packet). IF statetement does not produce a result, affected rows count are part of the final OK packet.
This commit is contained in:
@ -8106,3 +8106,19 @@ DROP PROCEDURE sp;
|
|||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
# End of 5.5 test
|
# End of 5.5 test
|
||||||
|
CREATE PROCEDURE sp() ALTER TABLE non_existing_table OPTIMIZE PARTITION p0;
|
||||||
|
CALL sp;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.non_existing_table optimize Error Table 'test.non_existing_table' doesn't exist
|
||||||
|
test.non_existing_table optimize status Operation failed
|
||||||
|
SELECT 1;
|
||||||
|
1
|
||||||
|
1
|
||||||
|
DROP PROCEDURE sp;
|
||||||
|
CREATE PROCEDURE sp() SHOW USER_STATISTICS;
|
||||||
|
CALL sp;
|
||||||
|
User Total_connections Concurrent_connections Connected_time Busy_time Cpu_time Bytes_received Bytes_sent Binlog_bytes_written Rows_read Rows_sent Rows_deleted Rows_inserted Rows_updated Select_commands Update_commands Other_commands Commit_transactions Rollback_transactions Denied_connections Lost_connections Access_denied Empty_queries
|
||||||
|
SELECT 1;
|
||||||
|
1
|
||||||
|
1
|
||||||
|
DROP PROCEDURE sp;
|
||||||
|
@ -9416,3 +9416,13 @@ DROP VIEW v1;
|
|||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
--echo # End of 5.5 test
|
--echo # End of 5.5 test
|
||||||
|
|
||||||
|
#MDEV-17610
|
||||||
|
CREATE PROCEDURE sp() ALTER TABLE non_existing_table OPTIMIZE PARTITION p0;
|
||||||
|
CALL sp;
|
||||||
|
SELECT 1;
|
||||||
|
DROP PROCEDURE sp;
|
||||||
|
CREATE PROCEDURE sp() SHOW USER_STATISTICS;
|
||||||
|
CALL sp;
|
||||||
|
SELECT 1;
|
||||||
|
DROP PROCEDURE sp;
|
||||||
|
@ -4088,15 +4088,16 @@ create_sp_error:
|
|||||||
my_error(ER_SP_BADSELECT, MYF(0), sp->m_qname.str);
|
my_error(ER_SP_BADSELECT, MYF(0), sp->m_qname.str);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
If SERVER_MORE_RESULTS_EXISTS is not set,
|
|
||||||
then remember that it should be cleared
|
|
||||||
*/
|
|
||||||
bits_to_be_cleared= (~thd->server_status &
|
|
||||||
SERVER_MORE_RESULTS_EXISTS);
|
|
||||||
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
If SERVER_MORE_RESULTS_EXISTS is not set,
|
||||||
|
then remember that it should be cleared
|
||||||
|
*/
|
||||||
|
bits_to_be_cleared= (~thd->server_status &
|
||||||
|
SERVER_MORE_RESULTS_EXISTS);
|
||||||
|
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
|
||||||
|
|
||||||
if (check_routine_access(thd, EXECUTE_ACL,
|
if (check_routine_access(thd, EXECUTE_ACL,
|
||||||
sp->m_db.str, sp->m_name.str, TRUE, FALSE))
|
sp->m_db.str, sp->m_name.str, TRUE, FALSE))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user