Skip to content

Commit

Permalink
feat(tianmu): update MTR test cases,different mtr use different datab…
Browse files Browse the repository at this point in the history
…ase. (stoneatom#497)
  • Loading branch information
lujiashun authored and konghaiya committed Mar 7, 2023
1 parent a4caad2 commit 273b318
Show file tree
Hide file tree
Showing 170 changed files with 1,739 additions and 804 deletions.
4 changes: 4 additions & 0 deletions mysql-test/suite/tianmu/r/add_column.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP DATABASE IF EXISTS add_column_test;
CREATE DATABASE add_column_test;
USE add_column_test;
CREATE TABLE `column_type_test` (
`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -50,3 +53,4 @@ select count(*) from column_type_test;
count(*)
100001
drop table column_type_test;
DROP DATABASE add_column_test;
4 changes: 4 additions & 0 deletions mysql-test/suite/tianmu/r/alter_table.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP DATABASE IF EXISTS alter_table_test;
CREATE DATABASE alter_table_test;
USE alter_table_test;
DROP TABLE IF EXISTS t_test;
CREATE TABLE `t_test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down Expand Up @@ -81,3 +84,4 @@ t_test CREATE TABLE `t_test` (
`copy_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TIANMU DEFAULT CHARSET=utf8
DROP DATABASE alter_table_test;
6 changes: 4 additions & 2 deletions mysql-test/suite/tianmu/r/alter_table_mix_use.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
create database alter_table_mix;
use alter_table_mix;
DROP DATABASE IF EXISTS alter_table_mix_use_test;
CREATE DATABASE alter_table_mix_use_test;
USE alter_table_mix_use_test;
CREATE TABLE `alter_table_mix_test` (
`c_tinyint` tinyint DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint NOT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -174,3 +175,4 @@ alter_table_rename_drop CREATE TABLE `alter_table_rename_drop` (
`c_blob` blob COMMENT 'blob',
`c_text` text COLLATE utf8mb4_unicode_ci COMMENT 'text'
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
DROP DATABASE alter_table_mix_use_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/casewhen.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS casewhen_test;
CREATE DATABASE casewhen_test;
USE casewhen_test;
CREATE TABLE `test_case1` (
`id` int(11) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
Expand All @@ -7,3 +9,4 @@ CREATE TABLE `test_case1` (
select id,case age when 2 then '1' else name end from test_case1;
id case age when 2 then '1' else name end
drop table test_case1;
DROP DATABASE casewhen_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/concat.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS concat_test;
CREATE DATABASE concat_test;
USE concat_test;
CREATE TABLE `test_case` (
`id` int(11) DEFAULT NULL,
`name` text
Expand All @@ -12,3 +14,4 @@ concat(id,name)
NULL
3test3
drop table test_case;
DROP DATABASE concat_test;
4 changes: 4 additions & 0 deletions mysql-test/suite/tianmu/r/create_drop_users.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP DATABASE IF EXISTS create_drop_users_test;
CREATE DATABASE create_drop_users_test;
USE create_drop_users_test;
#
# Test create and drop users
# Author: shiz
Expand Down Expand Up @@ -27,3 +30,4 @@ DROP USER 'user2'@'%';
DROP USER 'user'@'%';
DROP USER 'user'@'localhost';
DROP USER 'user'@'127.0.0.1';
DROP DATABASE create_drop_users_test;
4 changes: 4 additions & 0 deletions mysql-test/suite/tianmu/r/create_index.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
DROP DATABASE IF EXISTS create_index_test;
CREATE DATABASE create_index_test;
USE create_index_test;
create table t1 (f1 binary(5)) engine=innodb;
insert into t1 values ('w'), ('w');
create unique index index_t1 on t1(f1(4));
ERROR 23000: Duplicate entry 'w' for key 'index_t1'
drop table t1;
DROP DATABASE create_index_test;
11 changes: 7 additions & 4 deletions mysql-test/suite/tianmu/r/delete.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
DROP DATABASE IF EXISTS delete_test;
CREATE DATABASE delete_test;
USE delete_test;
#
# DELETE FROM TABLE_NAME WHERE ...
#
use test;
CREATE TABLE `column_type_test` (
`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -257,7 +259,7 @@ insert into t1 values (3, 3), (7, 7);
delete from t1 where a = 3;
check table t1;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
delete_test.t1 check note The storage engine for the table doesn't support check
select * from t1;
a b
7 7
Expand Down Expand Up @@ -338,8 +340,8 @@ drop table t1 , t2;
#
drop table if exists tbIn,t1;
Warnings:
Note 1051 Unknown table 'test.tbIn'
Note 1051 Unknown table 'test.t1'
Note 1051 Unknown table 'delete_test.tbIn'
Note 1051 Unknown table 'delete_test.t1'
create table tbIn(c1 int,c2 varchar(255))engine=InnoDB;
insert into tbIn values(3,'hhhb');
insert into tbIn values(2,'hhhb');
Expand All @@ -350,3 +352,4 @@ insert into t1 values(2,'hhhb');
insert into t1 values(1,'hhhb');
delete tbIn,t1 from tbIn,t1 where tbIn.c1=t1.c1 and tbIn.c1=1;
drop table tbIn,t1;
DROP DATABASE delete_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/delete_all_rows.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
DROP DATABASE IF EXISTS delete_all_rows_test;
CREATE DATABASE delete_all_rows_test;
USE delete_all_rows_test;
#
# DELETE FROM TABLE_NAME
#
use test;
CREATE TABLE `column_type_test` (
`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -169,3 +171,4 @@ SET AUTOCOMMIT=0;
DELETE from t1;
SET AUTOCOMMIT=1;
drop table t1;
DROP DATABASE delete_all_rows_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/drop_column.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS drop_column_test;
CREATE DATABASE drop_column_test;
USE drop_column_test;
CREATE TABLE `column_type_test` (
`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -40,3 +42,4 @@ column_type_test CREATE TABLE `column_type_test` (
`c_longblob` longblob COMMENT 'longblob'
) ENGINE=TIANMU DEFAULT CHARSET=latin1
drop table column_type_test;
DROP DATABASE drop_column_test;
4 changes: 4 additions & 0 deletions mysql-test/suite/tianmu/r/flow_control_function.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP DATABASE IF EXISTS flow_control_function_test;
CREATE DATABASE flow_control_function_test;
USE flow_control_function_test;
#
# Flow control function,Based on the test
#
Expand Down Expand Up @@ -51,3 +54,4 @@ NULLIF (2,1)
SELECT NULLIF (2,2);
NULLIF (2,2)
NULL
DROP DATABASE flow_control_function_test;
14 changes: 9 additions & 5 deletions mysql-test/suite/tianmu/r/func_math.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP DATABASE IF EXISTS func_math_test;
CREATE DATABASE func_math_test;
USE func_math_test;
create table t1
(f1 varchar(32) not null,
f2 smallint(5) unsigned not null,
Expand Down Expand Up @@ -181,17 +184,18 @@ SELECT @a / 0.5 from t1;
ERROR 22003: DECIMAL value is out of range in '((@`a`) / 0.5)'
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 'test.t2'
Note 1051 Unknown table 'func_math_test.t2'
create table t1(a tinyint zerofill, b int) engine=tianmu;
insert into t1 values (11, 22);
select a-b from t1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t1`.`a` - `test`.`t1`.`b`)'
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`func_math_test`.`t1`.`a` - `func_math_test`.`t1`.`b`)'
select cast((a-b) as unsigned) from t1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t1`.`a` - `test`.`t1`.`b`)'
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`func_math_test`.`t1`.`a` - `func_math_test`.`t1`.`b`)'
create table t2(a tinyint unsigned, b int) engine=tianmu;
insert into t2 values (1, 22);
select a-b from t1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t1`.`a` - `test`.`t1`.`b`)'
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`func_math_test`.`t1`.`a` - `func_math_test`.`t1`.`b`)'
select cast((a-b) as unsigned) from t2;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`t2`.`a` - `test`.`t2`.`b`)'
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`func_math_test`.`t2`.`a` - `func_math_test`.`t2`.`b`)'
drop table t1, t2;
DROP DATABASE func_math_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/group_concat.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS group_concat_test;
CREATE DATABASE group_concat_test;
USE group_concat_test;
CREATE TABLE `test_groupconcat_case` (
`id` int(11) DEFAULT NULL,
`name` text
Expand Down Expand Up @@ -35,3 +37,4 @@ id group_concat(distinct name SEPARATOR ":")
2 test:test2
3 test1
drop table test_groupconcat_case;
DROP DATABASE group_concat_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/group_concat2.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS group_concat2_test;
CREATE DATABASE group_concat2_test;
USE group_concat2_test;
CREATE TABLE `test_groupconcat2_case` (
`id` int(11) DEFAULT NULL,
`val` int(11)
Expand All @@ -12,3 +14,4 @@ select id,group_concat(distinct val SEPARATOR ":") from test_groupconcat2_case g
id group_concat(distinct val SEPARATOR ":")
1 22:4
drop table test_groupconcat2_case;
DROP DATABASE group_concat2_test;
24 changes: 12 additions & 12 deletions mysql-test/suite/tianmu/r/insert.result
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
#Insert values for different types of fields
#
DROP DATABASE IF EXISTS insert_db;
CREATE DATABASE insert_db;
USE insert_db;
DROP DATABASE IF EXISTS insert_test;
CREATE DATABASE insert_test;
USE insert_test;
CREATE TABLE `column_type_test` (
`c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint',
`c_smallint` smallint(6) DEFAULT NULL COMMENT 'smallint',
Expand Down Expand Up @@ -120,12 +120,12 @@ drop table t1;
# Test of mysqld crash with fully qualified column names
#
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
create database mysqltest_insert_test;
use mysqltest_insert_test;
create table t1 (c int);
insert into mysqltest.t1 set mysqltest.t1.c = '1';
drop database mysqltest;
use test;
insert into mysqltest_insert_test.t1 set mysqltest_insert_test.t1.c = '1';
drop database mysqltest_insert_test;
use insert_test;
#
# Test of wrong values for float data
#
Expand Down Expand Up @@ -314,15 +314,15 @@ create view v1 as select * from t1, t2 where f1= f3;
insert into t1 values (1,11), (2,22);
insert into t2 values (1,12), (2,24);
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
ERROR HY000: Can not modify more than one base table through a join view 'insert_test.v1'
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
ERROR HY000: Can not modify more than one base table through a join view 'insert_test.v1'
select * from t1;
f1 f2
1 11
2 22
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
ERROR HY000: Can not modify more than one base table through a join view 'insert_test.v1'
select * from t1;
f1 f2
1 11
Expand Down Expand Up @@ -552,4 +552,4 @@ pk
2
DROP VIEW v1, v2;
DROP TABLE t1;
DROP DATABASE insert_db;
DROP DATABASE insert_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/issue1000.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use test;
DROP DATABASE IF EXISTS issue1000_test;
CREATE DATABASE issue1000_test;
USE issue1000_test;
#
# Test of skip lines syntax
#
Expand Down Expand Up @@ -121,3 +123,4 @@ drop table tmp_loaddata3;
drop table tmp_loaddata4;
drop table tmp_loaddata5;
drop table error_log;
DROP DATABASE issue1000_test;
5 changes: 4 additions & 1 deletion mysql-test/suite/tianmu/r/issue1034.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
USE test;
DROP DATABASE IF EXISTS issue1034_test;
CREATE DATABASE issue1034_test;
USE issue1034_test;
set global tianmu_index_search=on;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id int) ENGINE=TIANMU;
Expand Down Expand Up @@ -365,3 +367,4 @@ CREATE TABLE t1 (id VARCHAR(255)) ENGINE=TIANMU;
ALTER TABLE t1 ADD PRIMARY KEY(id) USING HASH, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
DROP TABLE t1;
DROP DATABASE issue1034_test;
Loading

0 comments on commit 273b318

Please sign in to comment.