diff options
Diffstat (limited to 'mysql-test/main/get_diagnostics.test')
-rw-r--r-- | mysql-test/main/get_diagnostics.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/main/get_diagnostics.test b/mysql-test/main/get_diagnostics.test index eb8d2a23a45..54ea377aead 100644 --- a/mysql-test/main/get_diagnostics.test +++ b/mysql-test/main/get_diagnostics.test @@ -1481,3 +1481,27 @@ SELECT @num, @msg; DROP PROCEDURE sp; DROP TABLE t1; + +--echo # +--echo # MDEV-26684: Unexpected ERROR_INDEX in a condition raised by a diagnostics statement +--echo # + +CREATE TABLE t1 (a INT); + +INSERT INTO t1 VALUES (1),(2); + +GET DIAGNOSTICS CONDITION 5 @msg = MESSAGE_TEXT; +SHOW WARNINGS; + +GET DIAGNOSTICS CONDITION 1 @ind = ERROR_INDEX, @msg = MESSAGE_TEXT; +SELECT @ind, @msg; + +INSERT INTO t1 VALUES (3),(4); + +GET DIAGNOSTICS CONDITION 1 @ind = ERROR_INDEX, @msg = MESSAGE_TEXT; +SELECT @ind, @msg; + +GET DIAGNOSTICS CONDITION 5 @ind = ERROR_INDEX, @msg = MESSAGE_TEXT; +SELECT @ind, @msg; + +DROP TABLE t1; |