1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-4674 Fix ColumnStore to run MTR tests in a build directory

This commit is contained in:
Alexander Barkov
2021-04-13 11:25:25 +04:00
parent d8b473329f
commit 75e3bbc31e
1874 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source default_storage_engine_by_combination.inc
SET NAMES utf8;
--echo #
--echo # MCOL-4539 WHERE short_char_column='literal' ignores the collation on a huge table
--echo #
--disable_warnings
DROP DATABASE IF EXISTS mcs_ctype_cmp_char4_latin1_bin;
--enable_warnings
CREATE DATABASE mcs_ctype_cmp_char4_latin1_bin;
USE mcs_ctype_cmp_char4_latin1_bin;
CREATE TABLE t1 (id INT, c CHAR(4) CHARACTER SET latin1 COLLATE latin1_bin);
INSERT INTO t1 VALUES (0,'aaaa');
INSERT INTO t1 VALUES (0,'bbbb');
INSERT INTO t1 VALUES (0,'AAAA');
INSERT INTO t1 VALUES (0,'BBBB');
INSERT INTO t1 VALUES (0,'aaaa');
INSERT INTO t1 VALUES (0,'bbbb');
INSERT INTO t1 VALUES (0,'AAAA');
INSERT INTO t1 VALUES (0,'BBBB');
CREATE TABLE t2 (c CHAR(4) CHARACTER SET latin1 COLLATE latin1_bin);
INSERT INTO t2 SELECT t1_5.c FROM
t1 t1_0
JOIN t1 t1_1 USING (id)
JOIN t1 t1_2 USING (id)
JOIN t1 t1_3 USING (id)
JOIN t1 t1_4 USING (id)
JOIN t1 t1_5 USING (id)
;
SELECT COUNT(*) FROM t2;
SELECT DISTINCT c FROM t2 WHERE c='aaaa';
SELECT DISTINCT c FROM t2 WHERE c='AAAA';
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT * FROM t2 WHERE c='aaaa';
SELECT c, MIN(c), MAX(c), COUNT(*) FROM t3 GROUP BY c;
DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
DROP DATABASE mcs_ctype_cmp_char4_latin1_bin;

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='CHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci';
CREATE TABLE t1 (c1 CHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4, @datatype);
CALL test04_like(4, @datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='CHAR(5) CHARACTER SET latin1 COLLATE latin1_swedish_ci';
CREATE TABLE t1 (c1 CHAR(5) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,5);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(5, @datatype);
CALL test04_like(5, @datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,5 @@
[myisam]
default_storage_engine=myisam
[columnstore]
default_storage_engine=columnstore

View File

@@ -0,0 +1 @@
# This file is needed just to force tests using ctype_cmp.combinations

View File

@@ -0,0 +1,229 @@
--source default_storage_engine_by_combination.inc
--disable_query_log
--eval SET @mysqltest_file='$MYSQLTEST_FILE';
SET @mysqltest_file=regexp_replace(@mysqltest_file, '^(.*)/([a-z0-9_]*)([.]test$)','\\2');
--enable_query_log
SELECT @mysqltest_file;
SET @database=CONCAT('mcs_', @mysqltest_file);
--disable_warnings
EXECUTE IMMEDIATE CONCAT('DROP DATABASE IF EXISTS ', @database);
--enable_warnings
EXECUTE IMMEDIATE CONCAT('CREATE DATABASE ', @database);
--let database=`SELECT @database`
--disable_query_log
--eval USE $database
--enable_query_log
DELIMITER $$;
CREATE PROCEDURE exec(query TEXT)
BEGIN
SELECT query AS '';
EXECUTE IMMEDIATE query;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test01_execval(op VARCHAR(3) CHARACTER SET utf8,
val VARCHAR(64) CHARACTER SET utf8)
BEGIN
DECLARE query TEXT DEFAULT 'SELECT HEX(c1), QUOTE(c1) FROM t1 WHERE c1=''VAL''';
SET query=REPLACE(query,'=',op);
SET query=REPLACE(query,'VAL', val);
CALL exec(query);
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test01_populate(len1 INT, len2 INT)
BEGIN
-- Make sure the table is handled by a proper ENGINE
SELECT (SELECT engine FROM information_schema.tables WHERE (table_schema,table_name)=(@database,'t1')) =
@@default_storage_engine;
FOR i IN len1..len2
DO
INSERT INTO t1 VALUES (RPAD('a',i)),(RPAD('A',i));
-- LATIN SMALL LETTER A WITH TILDE
-- LATIN CAPITAL LETTER A WITH TILDE
INSERT INTO t1 VALUES (RPAD(_latin1 0xE3,i)),(RPAD(_latin1 0xC3,i));
INSERT INTO t1 VALUES (RPAD('b',i)),(RPAD('B',i));
END FOR;
-- MCOL-4454 "ORDER BY BINARY a" is not like in InnoDB
CALL exec('SELECT QUOTE(c1) FROM t1 ORDER BY c1, BINARY(c1) ASC');
CALL exec('SELECT QUOTE(c1) FROM t1 ORDER BY c1, BINARY(c1) DESC');
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test01_field_literal_op(len1 INT,
len2 INT,
op VARCHAR(3) CHARACTER SET utf8)
BEGIN
FOR i IN len1..len2
DO
CALL test01_execval(op,RPAD('a',i));
CALL test01_execval(op,RPAD('A',i));
CALL test01_execval(op,RPAD(_latin1 0xE3,i)); -- LATIN SMALL LETTER A WITH TILDE
CALL test01_execval(op,RPAD(_latin1 0xC3,i)); -- LATIN CAPITAL LETTER A WITH TILDE
END FOR;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test01_field_literal(len1 INT,
len2 INT)
BEGIN
CALL test01_field_literal_op(len1, len2, '=');
CALL test01_field_literal_op(len1, len2, '<=');
CALL test01_field_literal_op(len1, len2, '<');
CALL test01_field_literal_op(len1, len2, '>');
CALL test01_field_literal_op(len1, len2, '>=');
CALL test01_field_literal_op(len1, len2, '<>');
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test01_field_field()
BEGIN
SELECT QUOTE(t1.c1), QUOTE(t2.c1) FROM t1, t1 t2 WHERE t1.c1=t2.c1 ORDER BY HEX(t1.c1), HEX(t2.c1);
END;
$$
DELIMITER ;$$
# This query:
# SELECT DISTINCT c1 FROM t1;
# is not deterministic, because we don't know which exactly distinct value
# will get to the result set, e.g.: 'A' or 'a' or 'A ' or 'a '.
# So here we create a table t2 with distinct values of t1 and make sure
# that every record in t1 has only one matching record in t2.
#
DELIMITER $$;
CREATE PROCEDURE test01_distinct()
BEGIN
DECLARE vrecno INT DEFAULT 1;
CALL exec('SELECT GROUP_CONCAT(CONCAT(''['',c1,'']'') ORDER BY BINARY(c1) SEPARATOR '''') FROM t1 GROUP BY c1 ORDER BY c1');
CALL exec('SELECT COUNT(DISTINCT c1) FROM t1');
CREATE TABLE t2 AS SELECT DISTINCT c1 FROM t1;
CALL exec('SELECT COUNT(*) FROM t2');
CREATE TABLE t3 AS SELECT t1.c1, CAST(0 AS UNSIGNED) AS distinct_count FROM t1 LIMIT 0;
FOR rec IN (SELECT c1 FROM t1)
DO
INSERT INTO t3 SELECT rec.c1, COUNT(*) FROM t2 WHERE t2.c1=rec.c1;
END FOR;
CALL exec('SELECT distinct_count, QUOTE(c1) FROM t3 ORDER BY c1, BINARY(c1)');
DROP TABLE t3;
CREATE TABLE t4 AS SELECT t1.c1, CAST(0 AS UNSIGNED) AS distinct_recno FROM t1 LIMIT 0;
FOR rec IN (SELECT c1 FROM t2 ORDER BY c1)
DO
INSERT INTO t4 SELECT t1.c1, vrecno FROM t1 WHERE t1.c1=rec.c1 ORDER BY BINARY t1.c1;
SET vrecno= vrecno+1;
END FOR;
CALL exec('SELECT distinct_recno, QUOTE(c1) FROM t4 ORDER BY c1, BINARY(c1)');
DROP TABLE t4;
DROP TABLE t2;
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test02_same_table_create_table(dtype VARCHAR(128))
BEGIN
DECLARE tbl TEXT DEFAULT 'CREATE TABLE t1 (c1 TYPE, c2 TYPE)';
SET tbl=REPLACE(tbl,'TYPE',dtype);
CALL exec(tbl);
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test02_same_table_populate()
BEGIN
INSERT INTO t1 VALUES ('a', 'A');
INSERT INTO t1 VALUES ('a', 'A ');
INSERT INTO t1 VALUES ('a ', 'A');
INSERT INTO t1 VALUES ('a ', 'A ');
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test02_same_table_cmp_field_field_op(op VARCHAR(2))
BEGIN
DECLARE query TEXT DEFAULT 'SELECT QUOTE(c1), QUOTE(c2) FROM t1 '
'WHERE c1=c2 ORDER BY HEX(c1), HEX(c2)';
SET query=REPLACE(query,'=',op);
CALL exec(query);
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test02_same_table_cmp_field_field()
BEGIN
CALL test02_same_table_cmp_field_field_op('=');
CALL test02_same_table_cmp_field_field_op('<=');
CALL test02_same_table_cmp_field_field_op('<');
CALL test02_same_table_cmp_field_field_op('>');
CALL test02_same_table_cmp_field_field_op('>=');
CALL test02_same_table_cmp_field_field_op('<>');
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test03(len INT, datatype TEXT)
BEGIN
CALL exec(REPLACE('CREATE TABLE t1 (c1 DATATYPE, c2 DATATYPE)', 'DATATYPE', datatype));
CALL exec(REPLACE('INSERT INTO t1 VALUES (LEFT(''Hellooooooooooooooooooo'',LEN),LEFT(''hellooooooooooooooooooo'',LEN))', 'LEN', len));
CALL exec(REPLACE('CREATE TABLE t2 (c1 DATATYPE, c2 DATATYPE)', 'DATATYPE', datatype));
CALL exec(REPLACE('INSERT INTO t2 VALUES (LEFT(''Hellooooooooooooooooooo'',LEN),LEFT(''hellooooooooooooooooooo'',LEN))', 'LEN', len));
CALL exec(REPLACE('SELECT * FROM t1 WHERE c1=''VAL''', 'VAL', LEFT('Hellooooooooooooooooooo', len)));
CALL exec(REPLACE('SELECT * FROM t1 WHERE c1=''VAL''', 'VAL', LEFT('hellooooooooooooooooooo', len)));
CALL exec('SELECT * FROM t1 WHERE c1=c2');
CALL exec('SELECT * FROM t1, t2 WHERE t1.c1=t2.c1');
CALL exec('SELECT * FROM t1, t2 WHERE t1.c1=t2.c2');
CALL exec('SELECT * FROM t1, t2 WHERE t1.c2=t2.c1');
CALL exec('SELECT * FROM t1, t2 WHERE t1.c2=t2.c2');
CALL exec('DROP TABLE t1');
END;
$$
DELIMITER ;$$
DELIMITER $$;
CREATE PROCEDURE test04_like(len INT, datatype TEXT)
BEGIN
CALL exec(REPLACE('CREATE TABLE t1 (c1 DATATYPE)', 'DATATYPE', datatype));
CALL exec(REPLACE('INSERT INTO t1 VALUES (REPEAT(''a'',LEN))','LEN',len));
CALL exec(REPLACE('INSERT INTO t1 VALUES (REPEAT(''A'',LEN))','LEN',len));
CALL exec('SELECT * FROM t1 WHERE c1 LIKE ''a%'' ORDER BY BINARY c1');
CALL exec('SELECT * FROM t1 WHERE c1 LIKE ''A%'' ORDER BY BINARY c1');
CALL exec(REPLACE('SELECT * FROM t1 WHERE c1 LIKE ''VAL%'' ORDER BY BINARY c1','VAL',REPEAT('a',len)));
CALL exec(REPLACE('SELECT * FROM t1 WHERE c1 LIKE ''VAL%'' ORDER BY BINARY c1','VAL',REPEAT('A',len)));
CALL exec('DROP TABLE t1');
END;
$$
DELIMITER ;$$

View File

@@ -0,0 +1,16 @@
DROP PROCEDURE exec;
DROP PROCEDURE test01_execval;
DROP PROCEDURE test01_populate;
DROP PROCEDURE test01_field_literal_op;
DROP PROCEDURE test01_field_literal;
DROP PROCEDURE test01_field_field;
DROP PROCEDURE test01_distinct;
DROP PROCEDURE test02_same_table_create_table;
DROP PROCEDURE test02_same_table_populate;
DROP PROCEDURE test02_same_table_cmp_field_field_op;
DROP PROCEDURE test02_same_table_cmp_field_field;
DROP PROCEDURE test03;
DROP PROCEDURE test04_like;
EXECUTE IMMEDIATE CONCAT('DROP DATABASE ', @database);
USE test;
SET @@default_storage_engine=DEFAULT;

View File

@@ -0,0 +1,27 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
#CALL test01_field_literal(28,35);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_nopad_bin';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_nopad_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_nopad_ci);
CALL test01_populate(1,3);
#CALL test01_field_literal(1,4);
CALL test01_field_literal(1,3);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_nopad_bin';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_nopad_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci);
CALL test01_populate(1,3);
#CALL test01_field_literal(1,4);
CALL test01_field_literal(1,3);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(32,@datatype);
CALL test04_like(32,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_bin';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_nopad_bin';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_nopad_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_bin';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_general_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_general_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_general_nopad_ci);
CALL test01_populate(1,3);
#CALL test01_field_literal(1,4);
CALL test01_field_literal(1,3);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_nopad_bin';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_nopad_bin);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,25 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_ci);
CALL test01_populate(1,3);
CALL test01_field_literal(1,4);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,26 @@
--source ../include/have_columnstore.inc
--source ctype_cmp_combinations.inc
--source ctype_cmp_create.inc
SET NAMES utf8;
SET @datatype='VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci';
CREATE TABLE t1 (c1 VARCHAR(4) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci);
CALL test01_populate(1,3);
#CALL test01_field_literal(1,4);
CALL test01_field_literal(1,3);
CALL test01_field_field();
CALL test01_distinct();
DROP TABLE t1;
CALL test02_same_table_create_table(@datatype);
CALL test02_same_table_populate();
CALL test02_same_table_cmp_field_field();
DROP TABLE t1;
CALL test03(4,@datatype);
CALL test04_like(4,@datatype);
--source ctype_cmp_drop.inc

View File

@@ -0,0 +1,17 @@
--disable_query_log
SET @combination=NULL;
if ($MTR_COMBINATION_MYISAM)
{
SET @combination="MYISAM";
}
if ($MTR_COMBINATION_COLUMNSTORE)
{
SET @combination="COLUMNSTORE";
}
#
# If we're running without combinations, e.g. with --extern,
# then set default_storage_engine to ColumnStore.
# Otherwise (when running without --extern) it's set by the *.combinations file.
#
SET @@default_storage_engine=COALESCE(@combination,'ColumnStore');
--enable_query_log

View File

@@ -0,0 +1,152 @@
--source ../include/have_columnstore.inc
--source ../include/combinations.myisam-columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS func_bit;
--enable_warnings
CREATE DATABASE func_bit;
USE func_bit;
#
# DECIMAL(30,1) input
#
CREATE TABLE t1 (a DECIMAL(30,1) NOT NULL);
INSERT INTO t1 VALUES (99999999999999999999999999999.9);
INSERT INTO t1 VALUES (28446744073709551615);
INSERT INTO t1 VALUES (2.9);
INSERT INTO t1 VALUES (-2.9);
INSERT INTO t1 VALUES (-28446744073709551615);
INSERT INTO t1 VALUES (-99999999999999999999999999999.9);
--disable_warnings
SELECT a, a & a, a | a, a^0, a<<2, a>>2, bit_count(a) FROM t1;
--enable_warnings
DROP TABLE t1;
#
# DECIMAL(20,0) input
#
CREATE TABLE t1 (a DECIMAL(20,0) NOT NULL);
INSERT INTO t1 VALUES (99999999999999999999);
INSERT INTO t1 VALUES (28446744073709551615);
INSERT INTO t1 VALUES (-28446744073709551615);
INSERT INTO t1 VALUES (-99999999999999999999);
--disable_warnings
SELECT a, a & a, a | a, a^0, a<<2, a<<0, a>>1, bit_count(a) FROM t1;
--enable_warnings
DROP TABLE t1;
#
# DECIMAL(10,1) input
#
CREATE TABLE t1 (a DECIMAL(10,1) NOT NULL);
INSERT INTO t1 VALUES (999999999.9);
INSERT INTO t1 VALUES (3.5);
INSERT INTO t1 VALUES (3.4);
INSERT INTO t1 VALUES (2.9);
INSERT INTO t1 VALUES (-2.9);
INSERT INTO t1 VALUES (-3.4);
INSERT INTO t1 VALUES (-3.5);
INSERT INTO t1 VALUES (-999999999.9);
--disable_warnings
SELECT a, a & a, a | a, a^0, a<<2, a>>2, bit_count(a) FROM t1;
--enable_warnings
DROP TABLE t1;
#
# DECIMAL(10,0) input
#
CREATE TABLE t1 (a DECIMAL(10,0) NOT NULL);
INSERT INTO t1 VALUES (9999999999);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (-3);
INSERT INTO t1 VALUES (-9999999999);
--disable_warnings
SELECT a, a & a, a | a, a^0, a<<2, a<<0, a>>1, bit_count(a) FROM t1;
--enable_warnings
DROP TABLE t1;
#
# VARCHAR input
#
CREATE TABLE t1 (a VARCHAR(30) NOT NULL);
INSERT INTO t1 VALUES ('2.9');
INSERT INTO t1 VALUES ('18446744073709551610');
SELECT a, a & a, a | a, a^0, a<<1, a<<0, a>>1, bit_count(a) FROM t1;
DROP TABLE t1;
#
# Double input
#
CREATE TABLE t1 (a DOUBLE NOT NULL);
INSERT INTO t1 VALUES (2.9);
INSERT INTO t1 VALUES (10e30);
--disable_warnings
SELECT a, a & a, a | a, a^0, a<<2, a<<0, a>>1, bit_count(a) FROM t1;
--enable_warnings
DROP TABLE t1;
#
# Time input
#
CREATE TABLE t1 (a TIME(1) NOT NULL);
INSERT INTO t1 VALUES ('00:00:02.9');
INSERT INTO t1 VALUES ('800:00:02.9');
INSERT INTO t1 VALUES ('-800:00:02.9');
SELECT a, a & a, a | a, a^0, a<<1, a<<0, a>>1, bit_count(a) FROM t1;
DROP TABLE t1;
#
# Datetime input
#
CREATE TABLE t1 (a DATETIME(1) NOT NULL);
INSERT INTO t1 VALUES ('2001-01-01 00:00:02.9');
INSERT INTO t1 VALUES ('2001-01-01 23:59:59.9');
INSERT INTO t1 VALUES ('9999-12-31 23:59:59.9');
SELECT a, a & a, a | a, a^0, a<<1, a<<0, a>>1, bit_count(a) FROM t1;
DROP TABLE t1;
#
# Bit shift for more than 63 bits
#
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (63),(64),(65);
SELECT a, 1<<a,1>>a FROM t1;
DROP TABLE t1;
--echo #
--echo # MCOL-4666 Empty set when using BIT OR and BIT AND functions in WHERE
--echo #
CREATE TABLE t1 (a DECIMAL(18,2));
INSERT INTO t1 VALUES (3.4);
SELECT a, a|4, a&4 FROM t1;
SELECT * FROM t1 WHERE (a|4) <> a;
SELECT * FROM t1 WHERE (a&4) <> a;
DROP TABLE t1;
#
# Clean up
#
DROP DATABASE func_bit;
USE test;

View File

@@ -0,0 +1,30 @@
--source ../include/have_columnstore.inc
SET default_storage_engine=ColumnStore;
--disable_warnings
DROP DATABASE IF EXISTS func_bit_mcs;
--enable_warnings
CREATE DATABASE func_bit_mcs;
USE func_bit_mcs;
--echo #
--echo # MCOL-4666 Empty set when using BIT OR and BIT AND functions in WHERE
--echo #
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES ('1');
--error ER_INTERNAL_ERROR
SELECT a|1 FROM t1;
DROP TABLE t1;
#
# Clean up
#
DROP DATABASE func_bit_mcs;
USE test;

View File

@@ -0,0 +1,28 @@
--source ../include/have_columnstore.inc
--source ../include/combinations.myisam-columnstore.inc
--echo #
--echo # MCOL-4631 CAST(double AS SIGNED) returns 0 or NULL
--echo #
CREATE TABLE t1 (d1 DOUBLE, d2 DOUBLE NOT NULL);
INSERT INTO t1 VALUES (9.2233720368547758e+18, 9.2233720368547758e+18);
INSERT INTO t1 VALUES (18446744073709551614,18446744073709551614);
--disable_warnings
SELECT d1, CAST(d1 AS SIGNED), CAST(d2 AS SIGNED) FROM t1;
--enable_warnings
DROP TABLE t1;
--echo #
--echo # MCOL-4649 MCOL-4631 CAST(double AS UNSIGNED) returns 0
--echo #
CREATE TABLE t1 (d1 DOUBLE, d2 DOUBLE NOT NULL);
INSERT INTO t1 VALUES (18446744073709551614,18446744073709551614);
--disable_warnings
--replace_result 18446744073709551613 18446744073709551615
SELECT d1, CAST(d1 AS UNSIGNED), CAST(d2 AS UNSIGNED) FROM t1;
--enable_warnings
DROP TABLE t1;

View File

@@ -0,0 +1,43 @@
--source ../include/have_columnstore.inc
--source ../include/combinations.myisam-columnstore.inc
--echo #
--echo # MCOL-4668 PERIOD_DIFF(dec_or_double1,dec_or_double2) is not as in InnoDB
--echo #
--echo # Narrow decimal rounding
CREATE TABLE t1 (a DECIMAL(18,1));
INSERT INTO t1 VALUES (200101.9);
SELECT PERIOD_DIFF(a, 200101) FROM t1;
DROP TABLE t1;
--echo # Wide decimal rounding
CREATE TABLE t1 (a DECIMAL(30,1));
INSERT INTO t1 VALUES (200101.9);
SELECT PERIOD_DIFF(a, 200101) FROM t1;
DROP TABLE t1;
--echo # Huge narrow decimal
CREATE TABLE t1 (a DECIMAL(18,0));
INSERT INTO t1 VALUES (999999999999999999);
SELECT a, PERIOD_DIFF(200101,a) FROM t1;
DROP TABLE t1;
--echo # Huge wide decimal
CREATE TABLE t1 (a DECIMAL(30,0));
INSERT INTO t1 VALUES (9223372036854775807);
SELECT a, PERIOD_DIFF(200101,a) FROM t1;
DROP TABLE t1;
--echo # Huge double
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (9223372036854775807.0-1000);
INSERT INTO t1 VALUES (9223372036854775807.0+1000);
SELECT a, PERIOD_DIFF(200101,a) FROM t1 ORDER BY 2;
DROP TABLE t1;

View File

@@ -0,0 +1,14 @@
--source ../include/have_columnstore.inc
--source ../include/combinations.myisam-columnstore.inc
--echo #
--echo # MCOL-4647 SEC_TO_TIME(double_or_float) returns a wrong result
--echo #
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (0.000025e-35);
INSERT INTO t1 VALUES (-1),(1);
INSERT INTO t1 VALUES (-900),(900);
INSERT INTO t1 VALUES (-1000000),(1000000);
SELECT a, SEC_TO_TIME(a) FROM t1 ORDER BY 1;
DROP TABLE t1;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates that extend range to new min value.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=33 where x=44; # range must be 33..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

Some files were not shown because too many files have changed in this diff Show More