diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-12-02 12:46:15 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-12-02 12:46:15 +0300 |
commit | 1d46923a0f6508d52d7ce679a7dd8e7e0e957ae4 (patch) | |
tree | e49b51394ca259fb5e54be41df8fb382f49fa420 /mysql-test/suite | |
parent | a3b63b8da36b5896dc0093fdbceb2851e0a04214 (diff) | |
download | mariadb-git-1d46923a0f6508d52d7ce679a7dd8e7e0e957ae4.tar.gz |
MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED (10.4)
Don't do skip_setup_conds() unless all errors are checked.
Fixes following errors:
ER_PERIOD_NOT_FOUND
ER_VERS_QUERY_IN_PARTITION
ER_VERS_ENGINE_UNSUPPORTED
ER_VERS_NOT_VERSIONED
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/period/r/delete.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/period/t/delete.test | 14 | ||||
-rw-r--r-- | mysql-test/suite/versioning/r/partition.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/versioning/r/select.result | 15 | ||||
-rw-r--r-- | mysql-test/suite/versioning/r/view.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/partition.test | 8 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/select.test | 15 |
7 files changed, 73 insertions, 1 deletions
diff --git a/mysql-test/suite/period/r/delete.result b/mysql-test/suite/period/r/delete.result index 428200a4564..451017e5340 100644 --- a/mysql-test/suite/period/r/delete.result +++ b/mysql-test/suite/period/r/delete.result @@ -353,6 +353,18 @@ id s e datediff(e, s) 1 1999-01-01 1999-01-03 2 1 2018-12-10 2018-12-12 2 2 1999-01-01 1999-01-03 2 +# +# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +# +create or replace table t1 (id int, s date, e date, period for apptime(s,e)); +create or replace procedure sp() +delete from t1 for portion of othertime from '2000-01-01' to '2018-01-01'; +call sp; +ERROR HY000: Period `othertime` is not found in table +call sp; +ERROR HY000: Period `othertime` is not found in table +drop table t1; +drop procedure sp; drop table t,t2,t3,log_tbl; drop view v; drop procedure log; diff --git a/mysql-test/suite/period/t/delete.test b/mysql-test/suite/period/t/delete.test index 00bc314160f..738d77d2c19 100644 --- a/mysql-test/suite/period/t/delete.test +++ b/mysql-test/suite/period/t/delete.test @@ -181,6 +181,20 @@ delete from t for portion of apptime from '1999-01-03' to '2018-12-10'; --sorted_result select *, datediff(e, s) from t; +--echo # +--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +--echo # +create or replace table t1 (id int, s date, e date, period for apptime(s,e)); +create or replace procedure sp() +delete from t1 for portion of othertime from '2000-01-01' to '2018-01-01'; +--error ER_PERIOD_NOT_FOUND +call sp; +--error ER_PERIOD_NOT_FOUND +call sp; +drop table t1; +drop procedure sp; + + drop table t,t2,t3,log_tbl; drop view v; drop procedure log; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index 76268af9c3c..474f529bb8c 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -512,6 +512,14 @@ delete from t1 where a is not null; create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current); select * from t1 partition (p0) for system_time all; ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query +# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +create or replace procedure sp() +select * from t1 partition (p0) for system_time all; +call sp; +ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query +call sp; +ERROR HY000: SYSTEM_TIME partitions in table `t1` does not support historical query +drop procedure sp; # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE create or replace table t1 (pk int primary key) engine=myisam diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result index 3569268ce1d..b63e6222581 100644 --- a/mysql-test/suite/versioning/r/select.result +++ b/mysql-test/suite/versioning/r/select.result @@ -356,6 +356,21 @@ ERROR HY000: Table `t` is not system-versioned create or replace table t1 (x int) with system versioning engine myisam; select * from t1 for system_time as of transaction 1; ERROR HY000: Transaction-precise system versioning for `t1` is not supported +# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +create or replace procedure sp() +select * from t1 for system_time as of transaction 1; +call sp; +ERROR HY000: Transaction-precise system versioning for `t1` is not supported +call sp; +ERROR HY000: Transaction-precise system versioning for `t1` is not supported +create or replace table t1 (a int); +create or replace procedure sp() +select * from t1 for system_time all; +call sp; +ERROR HY000: Table `t1` is not system-versioned +call sp; +ERROR HY000: Table `t1` is not system-versioned +drop procedure sp; create or replace table t1 ( x int, sys_trx_start bigint unsigned as row start invisible, diff --git a/mysql-test/suite/versioning/r/view.result b/mysql-test/suite/versioning/r/view.result index 8b23e87d6a4..b33602f7336 100644 --- a/mysql-test/suite/versioning/r/view.result +++ b/mysql-test/suite/versioning/r/view.result @@ -146,7 +146,7 @@ i create or replace view v1 as select * from t1 for system_time as of date_sub(now(), interval 6 second); show create view v1; View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` FOR SYSTEM_TIME AS OF current_timestamp() - interval 6 second latin1 latin1_swedish_ci +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp() - interval 6 second latin1 latin1_swedish_ci drop view v1, vt1, vt12; drop tables t1, t3; # diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index bf6dd18118e..88f6a45b301 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -446,6 +446,14 @@ delete from t1 where a is not null; create or replace table t1 (i int) with system versioning partition by system_time limit 10 (partition p0 history, partition pn current); --error ER_VERS_QUERY_IN_PARTITION select * from t1 partition (p0) for system_time all; +--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +create or replace procedure sp() +select * from t1 partition (p0) for system_time all; +--error ER_VERS_QUERY_IN_PARTITION +call sp; +--error ER_VERS_QUERY_IN_PARTITION +call sp; +drop procedure sp; --echo # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE create or replace table t1 (pk int primary key) diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test index c4c1d703ce5..5771b9652f5 100644 --- a/mysql-test/suite/versioning/t/select.test +++ b/mysql-test/suite/versioning/t/select.test @@ -228,6 +228,21 @@ for system_time all as t; create or replace table t1 (x int) with system versioning engine myisam; --error ER_VERS_ENGINE_UNSUPPORTED select * from t1 for system_time as of transaction 1; +--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +create or replace procedure sp() +select * from t1 for system_time as of transaction 1; +--error ER_VERS_ENGINE_UNSUPPORTED +call sp; +--error ER_VERS_ENGINE_UNSUPPORTED +call sp; +create or replace table t1 (a int); +create or replace procedure sp() +select * from t1 for system_time all; +--error ER_VERS_NOT_VERSIONED +call sp; +--error ER_VERS_NOT_VERSIONED +call sp; +drop procedure sp; create or replace table t1 ( x int, |