Skip to content

Commit

Permalink
fix: add_comlumn test failed stoneatom#648
Browse files Browse the repository at this point in the history
[summary]
1. rm `Deprecate integer display` warnings as --nowarnings does not take effect in 8.0.
For more details, see: https://dev.mysql.com/worklog/task/?id=13127
2. port missing std_data and files in mysql-test from stonedb-5.7-dev.
3. fix uncorrect result of concat test.
  • Loading branch information
hustjieke committed Oct 8, 2022
1 parent 52a721e commit b6f1ba4
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 48 deletions.
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.
}
24 changes: 12 additions & 12 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 @@ -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',
Expand All @@ -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;
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 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

0 comments on commit b6f1ba4

Please sign in to comment.