Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.7(EOL)
-
None
Description
It appears that when a diagnostics statement raises a condition, it inherits the counter value from the previous statement (regardless whether it had conditions of its own or not) and uses it for ERROR_INDEX.
create table t1 (a int); |
insert into t1 values (1),(2); |
get diagnostics condition 5 @msg = message_text;
|
show warnings;
|
get diagnostics condition 1 @ind = error_index, @msg = message_text;
|
select @ind, @msg; |
|
# Cleanup
|
drop table t1; |
10.7 d552e092 |
MariaDB [test]> get diagnostics condition 5 @msg = message_text;
|
Query OK, 0 rows affected, 1 warning (0.000 sec) |
|
MariaDB [test]> show warnings;
|
+-------+------+--------------------------+ |
| Level | Code | Message | |
+-------+------+--------------------------+ |
| Error | 1758 | Invalid condition number |
|
+-------+------+--------------------------+ |
1 row in set (0.000 sec) |
|
MariaDB [test]> get diagnostics condition 1 @ind = error_index, @msg = message_text;
|
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> select @ind, @msg; |
+------+--------------------------+ |
| @ind | @msg |
|
+------+--------------------------+ |
| 3 | Invalid condition number |
|
+------+--------------------------+ |
1 row in set (0.000 sec) |
Attachments
Issue Links
- is caused by
-
MDEV-10075 Provide index of error causing error in array INSERT
- Closed