Skip to content
Permalink
Browse files
MDEV-27691: make working view-protocol
Update tests for version 10.4
  • Loading branch information
mariadb-lenastartseva committed Sep 23, 2022
1 parent 78dcf71 commit 184e659
Show file tree
Hide file tree
Showing 36 changed files with 148 additions and 23 deletions.
@@ -8,6 +8,7 @@
# As non transactional engine we use Aria with TRANSACTIONAL = 0
--source include/have_aria.inc

--disable_service_connection
# Following connections are used in a few of the following tests
connect (con1,localhost,root,,);

@@ -61,6 +62,7 @@ INSERT INTO t_permanent_aria SET col1 = 1;
CREATE TABLE throw_away (col1 INT) ENGINE = Aria TRANSACTIONAL = 0;
--error ER_BACKUP_LOCK_IS_ACTIVE
RENAME TABLE t_permanent_aria To throw_away;
--disable_view_protocol
--echo # - DDL creating a temporary table is allowed.
CREATE TEMPORARY TABLE t_temporary_aria (col1 INT) ENGINE = Aria TRANSACTIONAL = 0;
--echo # - DML modifying that temporary table is allowed.
@@ -107,6 +109,7 @@ ALTER TABLE t_temporary_aria ADD KEY idx(col2);
BACKUP STAGE END;

DROP TABLE t_permanent_aria;
--enable_view_protocol

--echo #-----------------------------------------------------------------------
--echo # Show that non transactional tables locks with BACKUP STAGE FLUSH
@@ -155,3 +158,4 @@ drop table t1;
--echo #

disconnect con1;
--enable_service_connection
@@ -50,6 +50,7 @@ unlock tables;
--echo #
--echo # Check lock tables under BACKUP STAGE
--echo #
--disable_service_connection
backup stage start;
unlock tables;
select lock_mode from information_schema.metadata_lock_info;
@@ -61,7 +62,7 @@ lock table t1 read;
unlock tables;
backup stage end;
drop table t1;

--enable_service_connection

--echo #
--echo # Check setting readonly under BACKUP STAGE
@@ -118,6 +119,7 @@ drop table t1;
--echo #
--echo # BACKUP STAGE performs implicit commits
--echo #
--disable_view_protocol
create table t1(a int) engine=InnoDB;
begin;
insert into t1 values(1);
@@ -128,12 +130,13 @@ backup stage block_commit;
commit;
backup stage end;
drop table t1;
--enable_view_protocol

--echo # Ensure that BACKUP STAGE ... does AUTOCOMMIT like most DDL.
--echo # Sideeffect:
--echo # Show the impact of not yet committed INSERT before sequence start
--echo # and ROLLBACK sliding through the sequence.

--disable_service_connection
CREATE TABLE t1 (col1 INT) ENGINE = InnoDB;
SET AUTOCOMMIT = 0;
INSERT INTO t1 SET col1 = 1;
@@ -217,7 +220,7 @@ drop table t1;
--echo # CHECK: RO transaction under BACKUP STAGE is a potential deadlock
--echo # OTOH we most probably allow them under FTWRL as well
--echo #

--disable_view_protocol
CREATE TABLE t1 (col1 INT) ENGINE = InnoDB;
insert into t1 values (1);
backup stage start;
@@ -228,6 +231,7 @@ select lock_mode from information_schema.metadata_lock_info;
backup stage end;
select lock_mode from information_schema.metadata_lock_info;
drop table t1;
--enable_view_protocol

--echo #
--echo # Check that handler are closed by backup stage block_ddl
@@ -347,6 +351,7 @@ SET SESSION sql_log_bin = 1;
SET SESSION sql_log_bin = 0;
BACKUP STAGE END;
SET SESSION sql_log_bin = 1;
--enable_service_connection

--echo #-----------------------------------------------------------------------
--echo # BACKUP STAGE statements are not allowed in stored routines
@@ -446,7 +451,7 @@ DROP TABLE t1_myisam;
--echo #
--echo # Creating and modifying TEMPORARY TABLES are allowed
--echo #

--disable_view_protocol
BACKUP STAGE START;
BACKUP STAGE BLOCK_DDL;
CREATE TEMPORARY TABLE tmp (col1 INT);
@@ -501,6 +506,7 @@ TRUNCATE t_temporary_innodb;
ALTER TABLE t_temporary_innodb ADD COLUMN col2 INT;
ALTER TABLE t_temporary_innodb ADD KEY idx(col2);
BACKUP STAGE END;
--enable_view_protocol

#
# MDEV-18067, MDEV-18068 and MDEV-18069
@@ -5,6 +5,8 @@
--source include/have_innodb.inc
--source include/have_metadata_lock_info.inc
--source include/not_embedded.inc
--source include/no_view_protocol.inc


--echo #
--echo # Testing which locks we get from all stages
@@ -5,6 +5,7 @@
--source include/have_innodb.inc
--source include/have_metadata_lock_info.inc
--source include/not_embedded.inc
--source include/no_view_protocol.inc

--echo #
--echo # Test lock taken
@@ -5,6 +5,7 @@
--echo #
--echo # Test privileges for BACKUP STAGES
--echo #
--disable_service_connection

set sql_mode="";

@@ -50,3 +51,5 @@ DROP USER user1@localhost, user2@localhost;
--error ER_SP_BADSTATEMENT
create procedure foo42()
BACKUP STAGE START;

--enable_service_connection
@@ -2246,6 +2246,8 @@ drop view v1;

--echo 10.2. view as tailed simple select

#enable after fix MDEV-29554
--disable_view_protocol
create view v1 as
select * from t1 order by a;
show create view v1;
@@ -2257,6 +2259,7 @@ create view v1 as
show create view v1;
select * from v1;
drop view v1;
--enable_view_protocol

--echo 10.3. view as union

@@ -1,6 +1,7 @@
#
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
--disable_service_connection
set names utf8;

create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
@@ -25,6 +26,7 @@ from имя_таблицы_в_кодировке_утф8_длиной_больш
# database, table, field, key, view
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;

--disable_view_protocol
--sorted_result
select TABLE_NAME from information_schema.tables where
table_schema='test';
@@ -37,6 +39,7 @@ table_schema='test';

select TABLE_NAME from information_schema.views where
table_schema='test';
--enable_view_protocol

show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
show create view имя_вью_кодировке_утф8_длиной_больше_чем_42;
@@ -78,3 +81,4 @@ return 0;
drop view имя_вью_кодировке_утф8_длиной_больше_чем_42;
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
set names default;
--enable_service_connection
@@ -425,6 +425,7 @@ drop table t1;
--echo # Bug#52117 Pending FLUSH TALBES <list> aborts
--echo # transactions unnecessarily.
--echo #
--disable_view_protocol
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -500,7 +501,7 @@ disconnect con2;
--source include/wait_until_disconnected.inc
connection default;
drop table t1;

--enable_view_protocol

--echo #
--echo # Test for bug #55273 "FLUSH TABLE tm WITH READ LOCK for Merge table
@@ -538,6 +539,7 @@ drop tables tm, t1, t2;
--echo # Test for bug #57006 "Deadlock between HANDLER and
--echo # FLUSH TABLES WITH READ LOCK".
--echo #
--disable_view_protocol
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
@@ -580,7 +582,7 @@ disconnect con2;
--source include/wait_until_disconnected.inc
connection default;
drop tables t1, t2;

--enable_view_protocol

--echo #
--echo # Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads
@@ -530,7 +530,10 @@ SELECT * FROM t1 WHERE a BETWEEN 1 AND 1;
SELECT * FROM t1 WHERE a BETWEEN 0 AND 1;
SELECT * FROM t1 WHERE a BETWEEN 0 AND -1;
SELECT * FROM t1 WHERE a BETWEEN -1 AND -1;
#enable after fix MDEV-29524
--disable_view_protocol
SELECT * FROM t1 WHERE a BETWEEN -0000000000000001 AND -1;
--enable_view_protocol
SELECT * FROM t1 WHERE a BETWEEN -1 AND 18446744073709551615;
SELECT * FROM t1 WHERE a BETWEEN -1 AND 18446744073709551616;
SELECT * FROM t1 WHERE a BETWEEN 1e2 AND 100e0;
@@ -62,6 +62,8 @@ SELECT a, b, EXTRACT(SECOND FROM a), EXTRACT(SECOND FROM b) FROM t1 WHERE NOT (E
SELECT a, b, EXTRACT(MICROSECOND FROM a), EXTRACT(MICROSECOND FROM b) FROM t1 WHERE NOT (EXTRACT(MICROSECOND FROM a)<=>EXTRACT(MICROSECOND FROM b));
--enable_warnings

#enable after fix MDEV-29525
--disable_view_protocol
--echo # Detailed results
SELECT
a,
@@ -86,6 +88,7 @@ SELECT
EXTRACT(MICROSECOND FROM b)
FROM t1;
DROP TABLE t1;
--enable_view_protocol

--echo # Special case: DAY + TIME
CREATE TABLE t1 (a VARCHAR(64));
@@ -103,6 +106,8 @@ SELECT a,
FROM t1;
DROP TABLE t1;

#enable after fix MDEV-29525
--disable_view_protocol
--echo # Bad values
CREATE TABLE t1 (a VARCHAR(64));
INSERT INTO t1 VALUES ('');
@@ -119,7 +124,7 @@ SELECT a,
EXTRACT(MICROSECOND FROM a)
FROM t1;
DROP TABLE t1;

--enable_view_protocol

--echo # Backward compatibility

@@ -249,9 +254,12 @@ INSERT INTO t1 VALUES
('01:02:03/'),
('20 10:20:30');

#enable after fix MDEV-29525
--disable_view_protocol
SELECT
EXTRACT(DAY FROM a),
EXTRACT(DAY_SECOND FROM a), a,
CAST(a AS INTERVAL DAY_SECOND(6)) AS cidm
FROM t1;
DROP TABLE t1;
--enable_view_protocol
@@ -769,6 +769,7 @@ DROP TABLE t1;

SET sql_mode='NO_ZERO_DATE,NO_ZERO_IN_DATE';

--disable_view_protocol
--disable_ps_protocol
--enable_metadata
SELECT
@@ -782,6 +783,7 @@ SELECT
LEAST(20010001,TIMESTAMP'2001-01-01 00:00:00') AS i4;
--disable_metadata
--enable_ps_protocol
--enable_view_protocol

SET sql_mode='NO_ZERO_DATE,NO_ZERO_IN_DATE';
CREATE TABLE t1 AS SELECT
@@ -565,8 +565,11 @@ select (1.175494351E-37 div 1.7976931348623157E+308);

select round(999999999, -9);
select round(999999999.0, -9);
#enable after fix MDEV-29526
--disable_view_protocol
select round(999999999999999999, -18);
select round(999999999999999999.0, -18);
--enable_view_protocol

--echo #
--echo # Bug#12537160 ASSERTION FAILED:
@@ -3211,7 +3211,10 @@ SELECT TIME('0001:01:01-'), TIME('0001:01:01--');

SELECT TIME('-xxx'), TIME('-xxxxxxxxxxxxxxxxxxxx');
SELECT TIME('- '), TIME('- ');
#enable after fix MDEV-28535
--disable_view_protocol
SELECT TIME('-'), TIME('-');
--enable_view_protocol
SELECT TIME('1-1-1 1:1:1'), TIME('1-1-1 1:1:1.0');
SELECT TIME('1-1-1 1:2:3'), TIME('1-1-1 1:2:3.0');

@@ -3226,11 +3229,12 @@ SELECT TIME('- 01:00:00'), TIME('- 1 01:00:00');
--echo #
--echo # MDEV-17854 Assertion `decimals <= 6' failed in my_time_fraction_remainder on SELECT with NULLIF and FROM_UNIXTIME on incorrect time
--echo #

#enable after fix MDEV-29534
--disable_view_protocol
SET time_zone='+00:00';
SELECT NULLIF(FROM_UNIXTIME('foo'), '2012-12-12 21:10:14');
SET time_zone=DEFAULT;

--enable_view_protocol

--echo #
--echo # MDEV-18402 Assertion `sec.sec() <= 59' failed in Item_func_maketime::get_date
@@ -126,6 +126,8 @@ SELECT TIME_TO_SEC(a), CAST(a AS TIME(6)), a FROM t1_datetime_in_decimal ORDER B
--echo # Functions with a single TIME interval input, conversion from TIME-interval-in-VARCHAR
--echo #

#enable after fix MDEV-29525
--disable_view_protocol
SELECT
EXTRACT(DAY FROM a),
EXTRACT(HOUR FROM a),
@@ -135,6 +137,7 @@ SELECT
CAST(a AS INTERVAL DAY_SECOND(6)),
a
FROM t1_time_in_varchar ORDER BY id;
--enable_view_protocol

SELECT
TIME_TO_SEC(a),
@@ -146,6 +149,8 @@ FROM t1_time_in_varchar ORDER BY id;
--echo # Functions with a single TIME interval input, conversion from TIME-interval-in-DECIMAL
--echo #

#enable after fix MDEV-29525
--disable_view_protocol
SELECT
EXTRACT(DAY FROM a),
EXTRACT(HOUR FROM a),
@@ -155,6 +160,7 @@ SELECT
CAST(a AS INTERVAL DAY_SECOND(6)),
a
FROM t1_time_in_decimal ORDER BY id;
--enable_view_protocol

SELECT
TIME_TO_SEC(a),
@@ -1447,8 +1447,11 @@ DROP TABLE t1,t2;

CREATE TABLE t1 (i int NOT NULL);
SELECT * FROM t1 GROUP BY i HAVING i IN ( i IS NULL);
#dublicate warning
--disable_view_protocol
SELECT * FROM t1 GROUP BY i HAVING i IN ( i IS NULL AND 'x' = 0);
SELECT * FROM t1 GROUP BY i HAVING i='1' IN ( i IS NULL AND 'x' = 0);
--enable_view_protocol
DROP TABLE t1;

--echo #
@@ -2,6 +2,8 @@
# MDEV-7656 init_file option does not allow changing passwords
#
--source include/not_embedded.inc
#enable view protocol after fix MDEV-29542
--source include/no_view_protocol.inc

create user foo@localhost;

0 comments on commit 184e659

Please sign in to comment.