summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-09-18 09:51:13 +0400
committerAlexander Barkov <bar@mariadb.com>2019-09-18 09:51:13 +0400
commitbf617c36540de99cc3597d339ff80dcf69377ece (patch)
tree69727a3515210281704ab6c8a237dadde5de7a20 /mysql-test/suite/vcol
parentefefafd02f72b3d56f82a29a9fa4a100932d55c0 (diff)
downloadmariadb-git-bf617c36540de99cc3597d339ff80dcf69377ece.tar.gz
MDEV-20423 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/vcol_sql_mode_datetime.result24
-rw-r--r--mysql-test/suite/vcol/r/vcol_sql_mode_time.result24
-rw-r--r--mysql-test/suite/vcol/t/vcol_sql_mode_datetime.test26
-rw-r--r--mysql-test/suite/vcol/t/vcol_sql_mode_time.test27
4 files changed, 101 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/vcol_sql_mode_datetime.result b/mysql-test/suite/vcol/r/vcol_sql_mode_datetime.result
index dab13af5fff..151b95095a8 100644
--- a/mysql-test/suite/vcol/r/vcol_sql_mode_datetime.result
+++ b/mysql-test/suite/vcol/r/vcol_sql_mode_datetime.result
@@ -97,5 +97,29 @@ UPDATE IGNORE t1 SET d = NOW();
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
+# MDEV-20423 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL
+#
+CREATE TABLE t1 (
+a DATETIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (CAST(a AS DATETIME(3))) VIRTUAL,
+KEY (v)
+);
+Warnings:
+Warning 1901 Function or expression 'cast(`a` as datetime(3))' cannot be used in the GENERATED ALWAYS AS clause of `v`
+Warning 1105 Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DATETIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (TRUNCATE(a,3)) VIRTUAL,
+KEY (v)
+);
+DROP TABLE t1;
+CREATE TABLE t1 (
+a DATETIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (ROUND(a,3)) VIRTUAL,
+KEY (v)
+);
+DROP TABLE t1;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/suite/vcol/r/vcol_sql_mode_time.result b/mysql-test/suite/vcol/r/vcol_sql_mode_time.result
index 8f72cd89a08..adf650fff9f 100644
--- a/mysql-test/suite/vcol/r/vcol_sql_mode_time.result
+++ b/mysql-test/suite/vcol/r/vcol_sql_mode_time.result
@@ -97,5 +97,29 @@ UPDATE IGNORE t1 SET d = CURRENT_TIME;
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
+# MDEV-20423 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL
+#
+CREATE TABLE t1 (
+a TIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (CAST(a AS TIME(3))) VIRTUAL,
+KEY (v)
+);
+Warnings:
+Warning 1901 Function or expression 'cast(`a` as time(3))' cannot be used in the GENERATED ALWAYS AS clause of `v`
+Warning 1105 Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL
+DROP TABLE t1;
+CREATE TABLE t1 (
+a TIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (TRUNCATE(a,3)) VIRTUAL,
+KEY (v)
+);
+DROP TABLE t1;
+CREATE TABLE t1 (
+a TIME(6),
+v VARCHAR(30) GENERATED ALWAYS AS (ROUND(a,3)) VIRTUAL,
+KEY (v)
+);
+DROP TABLE t1;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/suite/vcol/t/vcol_sql_mode_datetime.test b/mysql-test/suite/vcol/t/vcol_sql_mode_datetime.test
index 5e0e611949d..bef1e09b719 100644
--- a/mysql-test/suite/vcol/t/vcol_sql_mode_datetime.test
+++ b/mysql-test/suite/vcol/t/vcol_sql_mode_datetime.test
@@ -106,6 +106,32 @@ UPDATE IGNORE t1 SET d = NOW();
DROP TABLE t1;
SET sql_mode=DEFAULT;
+--echo #
+--echo # MDEV-20423 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL
+--echo #
+
+#--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1 (
+ a DATETIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (CAST(a AS DATETIME(3))) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a DATETIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (TRUNCATE(a,3)) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a DATETIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (ROUND(a,3)) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
--echo #
--echo # End of 10.4 tests
diff --git a/mysql-test/suite/vcol/t/vcol_sql_mode_time.test b/mysql-test/suite/vcol/t/vcol_sql_mode_time.test
index f06871b6ebc..05160a43ebb 100644
--- a/mysql-test/suite/vcol/t/vcol_sql_mode_time.test
+++ b/mysql-test/suite/vcol/t/vcol_sql_mode_time.test
@@ -108,5 +108,32 @@ SET sql_mode=DEFAULT;
--echo #
+--echo # MDEV-20423 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL
+--echo #
+
+#--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1 (
+ a TIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (CAST(a AS TIME(3))) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a TIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (TRUNCATE(a,3)) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ a TIME(6),
+ v VARCHAR(30) GENERATED ALWAYS AS (ROUND(a,3)) VIRTUAL,
+ KEY (v)
+);
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.4 tests
--echo #