[MDEV-26836] ROW_NUMBER differs from the number in the error message upon ER_WARN_DATA_OUT_OF_RANGE Created: 2021-10-14  Updated: 2021-10-17  Resolved: 2021-10-17

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: N/A
Fix Version/s: 10.7.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-10075 Provide index of error causing error ... Closed

 Description   

CREATE OR REPLACE 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;

bb-10.7-row_number cb9002bee

+------+--------------------------------------------+
| @n   | @m                                         |
+------+--------------------------------------------+
|    2 | Out of range value for column 'f' at row 1 |
+------+--------------------------------------------+
1 row in set (0.000 sec)
 
MariaDB [test]> show warnings;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'f' at row 1 |
| Warning | 1264 | Out of range value for column 'f' at row 1 |
+---------+------+--------------------------------------------+
2 rows in set (0.000 sec)

So, ROW_NUMBER looks correct and the error messages don't, but there was a requirement that the error message and the value of ROW_NUMBER must correlate, so probably the message should be fixed. Also, it is suspicious that it differs, if the same counter is supposed to be used.



 Comments   
Comment by Elena Stepanova [ 2021-10-14 ]

On the other hand, there was also a discussion that SELECT is out of scope. I'm not sure which one takes precedence – the requirement that the values should be the same, or the agreement that SELECT is not a mandatory part of the scope. Please feel free to demote/remove from 10.7 "must do" list.

Comment by Rucha Deodhar [ 2021-10-15 ]

Patch: https://github.com/MariaDB/server/commit/9ab0d07e10fdec9b9db59b3ac493045c5be253b0

Comment by Sergei Golubchik [ 2021-10-16 ]

ok to push!

Generated at Thu Feb 08 09:48:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.