[MDEV-26830] Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with CHECK violation Created: 2021-10-14  Updated: 2021-10-26  Resolved: 2021-10-20

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Insert, 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, check(a>0));
insert ignore into t values (1),(0),(2),(0);
get diagnostics condition 1 @n= row_number;
select @n;
get diagnostics condition 2 @n= row_number;
select @n;
 
# Cleanup
drop table t;

bb-10.7-row_number cb9002bee

MariaDB [test]> get diagnostics condition 1 @n= row_number;
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [test]> select @n;
+------+
| @n   |
+------+
|    2 |
+------+
1 row in set (0.000 sec)
 
MariaDB [test]> get diagnostics condition 2 @n= row_number;
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [test]> select @n;
+------+
| @n   |
+------+
|    3 |
+------+
1 row in set (0.000 sec)

The second one is wrong, the expected result is 4.



 Comments   
Comment by Rucha Deodhar [ 2021-10-18 ]

Patch: https://github.com/MariaDB/server/commit/688ad5ed67f6b7e68fc31baf92163b9763a76582

Comment by Rucha Deodhar [ 2021-10-20 ]

pushed to bb-10.7-row_number

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