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

MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon

ER_TRUNCATED_WRONG_VALUE

Part 1: Fix for DELETE without ORDER BY

Analysis: m_current_row_for_warning doesn't increment and assumes default
value which is then used by ROW_NUMBER.
Fix: Increment m_current_row_for_warning for each processed row.
This commit is contained in:
Rucha Deodhar
2021-10-18 20:30:04 +05:30
committed by Sergei Golubchik
parent e13dc7d0d0
commit 92f7d008ab
3 changed files with 51 additions and 0 deletions

View File

@ -1667,3 +1667,23 @@ GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER;
SELECT @n;
DROP TABLE t1;
--echo #
--echo # MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon
--echo # ER_TRUNCATED_WRONG_VALUE
--echo #
--echo # without ORDER BY
CREATE TABLE t (a VARCHAR(8));
INSERT INTO t VALUES ('val1'),('val2'),('100'),('val4');
SELECT * FROM t;
DELETE FROM t WHERE a = 100;
SHOW WARNINGS;
GET DIAGNOSTICS CONDITION 3 @n = ROW_NUMBER;
SELECT @n;
DROP TABLE t;