diff --git a/.gitignore b/.gitignore index 7b6e769a10..cbc323f96f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ CMakeFiles tags TAGS TAGS_sorted_by_file +build # googletest files source_downloads diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index f3bb83f88e..1226231963 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -70,3 +70,6 @@ loose-performance-schema-consumer-thread-instrumentation=ON # log file. The note messages will contain important information and # will be useful while debugging an issue as well. log-error-verbosity=3 + +default-storage-engine=tianmu +tianmu_insert_delayed=0 diff --git a/mysql-test/include/have_tianmu.inc b/mysql-test/include/have_tianmu.inc new file mode 100644 index 0000000000..93d6948788 --- /dev/null +++ b/mysql-test/include/have_tianmu.inc @@ -0,0 +1,4 @@ +if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'tianmu' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) +{ + --skip Test requires Tianmu. +} diff --git a/mysql-test/suite/tianmu/r/add_column.result b/mysql-test/suite/tianmu/r/add_column.result index 3dc081ed55..bbaa2ea337 100644 --- a/mysql-test/suite/tianmu/r/add_column.result +++ b/mysql-test/suite/tianmu/r/add_column.result @@ -1,9 +1,9 @@ CREATE TABLE `column_type_test` ( -`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint', -`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint', -`c_mediumint` mediumint(9) DEFAULT NULL COMMENT 'mediumint', -`c_int` int(11) DEFAULT NULL COMMENT 'int', -`c_bigint` bigint(20) DEFAULT NULL COMMENT 'bigint', +`c_tinyint` tinyint DEFAULT NULL COMMENT 'tinyint', +`c_smallint` smallint DEFAULT NULL COMMENT 'smallint', +`c_mediumint` mediumint DEFAULT NULL COMMENT 'mediumint', +`c_int` int DEFAULT NULL COMMENT 'int', +`c_bigint` bigint DEFAULT NULL COMMENT 'bigint', `c_float` float DEFAULT NULL COMMENT 'float', `c_double` double DEFAULT NULL COMMENT 'double', `c_decimal` decimal(10,5) DEFAULT NULL COMMENT 'decimal', @@ -25,11 +25,11 @@ alter table column_type_test add column ex_column int; show create table column_type_test; Table Create Table column_type_test CREATE TABLE `column_type_test` ( - `c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint', - `c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint', - `c_mediumint` mediumint(9) DEFAULT NULL COMMENT 'mediumint', - `c_int` int(11) DEFAULT NULL COMMENT 'int', - `c_bigint` bigint(20) DEFAULT NULL COMMENT 'bigint', + `c_tinyint` tinyint DEFAULT NULL COMMENT 'tinyint', + `c_smallint` smallint DEFAULT NULL COMMENT 'smallint', + `c_mediumint` mediumint DEFAULT NULL COMMENT 'mediumint', + `c_int` int DEFAULT NULL COMMENT 'int', + `c_bigint` bigint DEFAULT NULL COMMENT 'bigint', `c_float` float DEFAULT NULL COMMENT 'float', `c_double` double DEFAULT NULL COMMENT 'double', `c_decimal` decimal(10,5) DEFAULT NULL COMMENT 'decimal', @@ -42,8 +42,8 @@ column_type_test CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob', - `ex_column` int(11) DEFAULT NULL -) ENGINE=TIANMU DEFAULT CHARSET=latin1 + `ex_column` int DEFAULT NULL +) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text,ex_column) values(105,105,105,105,105,5.2,10.88,105.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn',105); select count(*) from column_type_test; diff --git a/mysql-test/suite/tianmu/r/alter_table.result b/mysql-test/suite/tianmu/r/alter_table.result index 9b67ed6d12..c8c5f99190 100644 --- a/mysql-test/suite/tianmu/r/alter_table.result +++ b/mysql-test/suite/tianmu/r/alter_table.result @@ -1,47 +1,47 @@ DROP TABLE IF EXISTS t_test; CREATE TABLE `t_test` ( -`id` int(11) NOT NULL AUTO_INCREMENT, +`id` int NOT NULL AUTO_INCREMENT, `first_name` varchar(10), `last_name` varchar(10), `sex` varchar(5), -`score` int(11), -`copy_id` int(11), +`score` int, +`copy_id` int, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8; alter table t_test modify sex char(5); show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` varchar(10) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, `sex` char(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 alter table t_test modify first_name varchar(20); show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` varchar(20) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, `sex` char(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 alter table t_test modify first_name varchar(5); show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` varchar(5) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, `sex` char(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 set sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"; @@ -49,35 +49,35 @@ alter table t_test modify first_name char(20); show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` char(20) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, `sex` char(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 alter table t_test modify first_name char(5); show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` char(5) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, `sex` char(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 -alter table t_test modify sex smallint(5); +alter table t_test modify sex smallint; show create table t_test; Table Create Table t_test CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` char(5) DEFAULT NULL, `last_name` varchar(10) DEFAULT NULL, - `sex` smallint(5) DEFAULT NULL, - `score` int(11) DEFAULT NULL, - `copy_id` int(11) DEFAULT NULL, + `sex` smallint DEFAULT NULL, + `score` int DEFAULT NULL, + `copy_id` int DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8 diff --git a/mysql-test/suite/tianmu/r/concat.result b/mysql-test/suite/tianmu/r/concat.result index 0943436e4b..40a7d024df 100644 --- a/mysql-test/suite/tianmu/r/concat.result +++ b/mysql-test/suite/tianmu/r/concat.result @@ -1,13 +1,14 @@ use test; CREATE TABLE `test_case` ( -`id` int(11) DEFAULT NULL, +`id` int DEFAULT NULL, `name` text ) ENGINE=TIANMU; -Warnings: -Warning 1681 Integer display width is deprecated and will be removed in a future release. insert into test_case values(1,'test'); insert into test_case (name) values('test2'); insert into test_case values(3,'test3'); select concat(id,name) from test_case; concat(id,name) +1test +NULL +3test3 drop table test_case; diff --git a/mysql-test/suite/tianmu/t/add_column.testbak b/mysql-test/suite/tianmu/t/add_column.test similarity index 81% rename from mysql-test/suite/tianmu/t/add_column.testbak rename to mysql-test/suite/tianmu/t/add_column.test index 3e1a33a606..6f75166c64 100644 --- a/mysql-test/suite/tianmu/t/add_column.testbak +++ b/mysql-test/suite/tianmu/t/add_column.test @@ -1,10 +1,10 @@ CREATE TABLE `column_type_test` ( - `c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint', - `c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint', - `c_mediumint` mediumint(9) DEFAULT NULL COMMENT 'mediumint', - `c_int` int(11) DEFAULT NULL COMMENT 'int', - `c_bigint` bigint(20) DEFAULT NULL COMMENT 'bigint', + `c_tinyint` tinyint DEFAULT NULL COMMENT 'tinyint', + `c_smallint` smallint DEFAULT NULL COMMENT 'smallint', + `c_mediumint` mediumint DEFAULT NULL COMMENT 'mediumint', + `c_int` int DEFAULT NULL COMMENT 'int', + `c_bigint` bigint DEFAULT NULL COMMENT 'bigint', `c_float` float DEFAULT NULL COMMENT 'float', `c_double` double DEFAULT NULL COMMENT 'double', `c_decimal` decimal(10,5) DEFAULT NULL COMMENT 'decimal', diff --git a/mysql-test/suite/tianmu/t/alter_table.testbak b/mysql-test/suite/tianmu/t/alter_table.testbak index fefe4147bf..40b7844bb2 100644 --- a/mysql-test/suite/tianmu/t/alter_table.testbak +++ b/mysql-test/suite/tianmu/t/alter_table.testbak @@ -8,12 +8,12 @@ DROP TABLE IF EXISTS t_test; --enable_warnings CREATE TABLE `t_test` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `first_name` varchar(10), `last_name` varchar(10), `sex` varchar(5), - `score` int(11), - `copy_id` int(11), + `score` int, + `copy_id` int, PRIMARY KEY (`id`) ) ENGINE=TIANMU DEFAULT CHARSET=utf8; @@ -51,6 +51,6 @@ alter table t_test modify first_name char(5); show create table t_test; -alter table t_test modify sex smallint(5); +alter table t_test modify sex smallint; show create table t_test; diff --git a/mysql-test/suite/tianmu/t/concat.test b/mysql-test/suite/tianmu/t/concat.test index 9d222a0f19..4cee75518f 100644 --- a/mysql-test/suite/tianmu/t/concat.test +++ b/mysql-test/suite/tianmu/t/concat.test @@ -1,6 +1,6 @@ use test; CREATE TABLE `test_case` ( - `id` int(11) DEFAULT NULL, + `id` int DEFAULT NULL, `name` text ) ENGINE=TIANMU; insert into test_case values(1,'test');