1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-26836: ROW_NUMBER differs from the number in the error message upon

ER_WARN_DATA_OUT_OF_RANGE

Analysis: value for row_number is hard coded into push_warning_printf() to 1.
Fix: make push_warning_printf() use m_current_row_for_warning instead of 1.
This commit is contained in:
Rucha Deodhar
2021-10-15 15:52:16 +05:30
parent a6cf8b34a8
commit 9ab0d07e10
8 changed files with 45 additions and 13 deletions

View File

@ -1552,3 +1552,16 @@ GET DIAGNOSTICS CONDITION 2 @rnum = ROW_NUMBER, @msg = MESSAGE_TEXT, @err = MYSQ
SELECT @rnum, @msg, @err;
DROP TABLE t1;
--echo #
--echo # ROW_NUMBER differs from the number in the error message upon
--echo # ER_WARN_DATA_OUT_OF_RANGE
--echo #
CREATE TABLE t (a INT);
INSERT INTO t VALUES (1),(2);
SELECT CAST(a AS DECIMAL(2,2)) AS f FROM t;
GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER, @m = MESSAGE_TEXT;
SELECT @n, @m;
DROP TABLE t;