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

@ -1671,3 +1671,21 @@ SELECT @rnum, @msg, @err;
@rnum @msg @err
3 Data truncated for column 'a' at row 3 1265
DROP TABLE t1;
#
# ROW_NUMBER differs from the number in the error message upon
# ER_WARN_DATA_OUT_OF_RANGE
#
CREATE TABLE t (a INT);
INSERT INTO t VALUES (1),(2);
SELECT CAST(a AS DECIMAL(2,2)) AS f FROM t;
f
0.99
0.99
Warnings:
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'f' at row 2
GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER, @m = MESSAGE_TEXT;
SELECT @n, @m;
@n @m
2 Out of range value for column 'f' at row 2
DROP TABLE t;