Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mysql-test): add_comlumn test failed #648 #651

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CMakeFiles
tags
TAGS
TAGS_sorted_by_file
build

# googletest files
source_downloads
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/default_mysqld.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions mysql-test/include/have_tianmu.inc
Original file line number Diff line number Diff line change
@@ -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.
}
100,000 changes: 100,000 additions & 0 deletions mysql-test/std_data/tianmu/bigdata4load

Large diffs are not rendered by default.

Binary file added mysql-test/std_data/tianmu/column_type_test.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions mysql-test/std_data/tianmu/loadfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
100|100|100|100|100|5.2|10.88|100.08300|2016-02-25|2016-02-25 10:20:01|2007-04-23 08:12:49|10:20:01|stoneatom|hello||bcdefghijklmn|
101|101|101|101|101|5.2|10.88|101.08300|2016-02-25|2016-02-25 10:20:01|1985-08-11 09:10:25|10:20:01|stoneatom|hello||bcdefghijklmn|
102|102|102|102|102|5.2|10.88|102.08300|2016-02-25|2016-02-25 10:20:01|2076-08-10 18:33:37|10:20:01|stoneatom|hello||bcdefghijklmn|
103|103|103|103|103|5.2|10.88|103.08300|2016-02-25|2016-02-25 10:20:01|2041-08-07 23:55:45|10:20:01|stoneatom|hello||bcdefghijklmn|
104|104|104|104|104|5.2|10.88|104.08300|2016-02-25|2016-02-25 10:20:01|2046-08-22 11:24:49|10:20:01|stoneatom|hello||bcdefghijklmn|
32 changes: 16 additions & 16 deletions mysql-test/suite/tianmu/r/add_column.result
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -16,7 +16,7 @@ CREATE TABLE `column_type_test` (
`c_blob` blob COMMENT 'blob',
`c_text` text COMMENT 'text',
`c_longblob` longblob COMMENT 'longblob'
) ENGINE=TIANMU;
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|';
select count(*) from column_type_test;
count(*)
Expand All @@ -25,25 +25,25 @@ 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',
`c_date` date DEFAULT NULL COMMENT 'date',
`c_datetime` datetime DEFAULT NULL COMMENT 'datetime',
`c_timestamp` timestamp NULL DEFAULT NULL COMMENT 'timestamp',
`c_time` time DEFAULT NULL COMMENT 'time',
`c_char` char(10) DEFAULT NULL COMMENT 'char',
`c_varchar` varchar(10) DEFAULT NULL COMMENT 'varchar',
`c_char` char(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'char',
`c_varchar` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'varchar',
`c_blob` blob COMMENT 'blob',
`c_text` text COMMENT 'text',
`c_text` text COLLATE utf8mb4_unicode_ci 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_unicode_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;
Expand Down
46 changes: 23 additions & 23 deletions mysql-test/suite/tianmu/r/alter_table.result
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
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";
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
7 changes: 4 additions & 3 deletions mysql-test/suite/tianmu/r/concat.result
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` (
`c_blob` blob COMMENT 'blob',
`c_text` text COMMENT 'text',
`c_longblob` longblob COMMENT 'longblob'
) ENGINE=TIANMU;
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|';
select count(*) from column_type_test;
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/suite/tianmu/t/alter_table.testbak
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
2 changes: 1 addition & 1 deletion mysql-test/suite/tianmu/t/concat.test
Original file line number Diff line number Diff line change
@@ -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');
Expand Down