diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/get_diagnostics.result | 18 | ||||
-rw-r--r-- | mysql-test/main/get_diagnostics.test | 21 |
2 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result index d394d96eaff..6b01cbd78e0 100644 --- a/mysql-test/main/get_diagnostics.result +++ b/mysql-test/main/get_diagnostics.result @@ -1747,3 +1747,21 @@ SELECT @n, @m; @n @m 2 Data truncated for column 'a' at row 2 DROP TABLE t1; +# +# MDEV-26841: ROW_NUMBER is not set and differs from the message upon +# ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1,2),(3); +ERROR 21S01: Column count doesn't match value count at row 1 +GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT; +SELECT @n, @m; +@n @m +1 Column count doesn't match value count at row 1 +INSERT INTO t1(a) VALUES(1,2), (3); +ERROR 21S01: Column count doesn't match value count at row 1 +GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT; +SELECT @n, @m; +@n @m +1 Column count doesn't match value count at row 1 +DROP TABLE t1; diff --git a/mysql-test/main/get_diagnostics.test b/mysql-test/main/get_diagnostics.test index f4495059f9c..623d9a9a686 100644 --- a/mysql-test/main/get_diagnostics.test +++ b/mysql-test/main/get_diagnostics.test @@ -1632,3 +1632,24 @@ GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT; SELECT @n, @m; DROP TABLE t1; + +--echo # +--echo # MDEV-26841: ROW_NUMBER is not set and differs from the message upon +--echo # ER_WRONG_VALUE_COUNT_ON_ROW for the 1st row +--echo # + +CREATE TABLE t1 (a INT); + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1 VALUES (1,2),(3); + +GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT; +SELECT @n, @m; + +--error ER_WRONG_VALUE_COUNT_ON_ROW +INSERT INTO t1(a) VALUES(1,2), (3); + +GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER, @m= MESSAGE_TEXT; +SELECT @n, @m; + +DROP TABLE t1; |