diff options
| author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-10-18 13:27:36 +0530 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2021-10-26 17:29:40 +0200 |
| commit | e13dc7d0d0820973684753cdb5cf674c4595f47b (patch) | |
| tree | 49f954f49a39bd2a331cf4b719e7b4b9a131d53a /mysql-test/main/get_diagnostics.result | |
| parent | 797bd73cfa09e002819e847bd1aa9fea79dc5d9f (diff) | |
| download | mariadb-git-e13dc7d0d0820973684753cdb5cf674c4595f47b.tar.gz | |
MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with
CHECK violation
Analysis: When there is constraint fail we return non-zero value for
view_check_option(). So we continue the loop which doesn't increment the
counter because it increments at the end of the loop.
Fix: Increment m_current_row_for_warning() at the beginning of loop. This
will also fix similar bugs if any, about counter not incrementing
correctly because of continue.
Diffstat (limited to 'mysql-test/main/get_diagnostics.result')
| -rw-r--r-- | mysql-test/main/get_diagnostics.result | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result index 6b01cbd78e0..a884ebe3fe0 100644 --- a/mysql-test/main/get_diagnostics.result +++ b/mysql-test/main/get_diagnostics.result @@ -1765,3 +1765,21 @@ SELECT @n, @m; @n @m 1 Column count doesn't match value count at row 1 DROP TABLE t1; +# +# MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with +# CHECK violation +# +CREATE TABLE t1 (a INT, CHECK(a>0)); +INSERT IGNORE INTO t1 VALUES (1),(0),(2),(0); +Warnings: +Warning 4025 CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` +Warning 4025 CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` +GET DIAGNOSTICS CONDITION 1 @n= ROW_NUMBER; +SELECT @n; +@n +2 +GET DIAGNOSTICS CONDITION 2 @n= ROW_NUMBER; +SELECT @n; +@n +4 +DROP TABLE t1; |
