fix a bug about sync mysqltest
This commit is contained in:
parent
f229486631
commit
168e025811
@ -1,71 +0,0 @@
|
||||
# 如何执行MySQLtest
|
||||
|
||||
## 名词解释
|
||||
- OBD:[OceanBase Deploy](https://github.com/oceanbase/obdeploy)的简称。
|
||||
- case:执行MySQLtest的最小单位,一个case至少包含一个test文件和一个result文件
|
||||
- suite:一组case的集合,称为suite
|
||||
|
||||
|
||||
## 启动测试
|
||||
|
||||
#### __启动测试前,你需要先使用OBD启动一个集群。[使用OBD快速启动OceanBase数据库](https://github.com/oceanbase/obdeploy#%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8-oceanbase-%E6%95%B0%E6%8D%AE%E5%BA%93)__
|
||||
|
||||
### 全量测试
|
||||
|
||||
执行mysql_test/test_suite下全部的测试,可以使用以下命令:
|
||||
|
||||
```shell
|
||||
obd test mysqltest <deploy name> --all --auto-retry
|
||||
# 如果执行obd命令时不处于当前目录请使用 --suite-dir 选项
|
||||
# 一些case中包含是相当路径,不在当前目录执行可能会导致失败
|
||||
```
|
||||
|
||||
#### 参数与选项解释
|
||||
参数 `deploy name` 为部署配置名称,可以理解为配置文件名称。
|
||||
|
||||
选项 `--suite-dir` 为 suite 所在目录,默认为 ./mysql_test/test_suite
|
||||
|
||||
选项 `--all` 为执行 `--suite-dir` 下全部suite。
|
||||
|
||||
选项 `--auto-retry` 开启后,当case第一次执行失败时会自动重部署集群进行重试。
|
||||
|
||||
### 单suite测试
|
||||
|
||||
对mysql_test/test_suite下指定suite执行测试,可以使用以下命令:
|
||||
|
||||
```shell
|
||||
obd test mysqltest <deploy name> --suite <suite_name> --auto-retry
|
||||
# 如果执行obd命令时不处于当前目录请使用 --suite-dir 选项
|
||||
# 一些case中包含是相当路径,不在当前目录执行可能会导致失败
|
||||
```
|
||||
|
||||
#### 参数与选项解释
|
||||
参数 `deploy name` 为部署配置名称,可以理解为配置文件名称。
|
||||
|
||||
选项 `--suite-dir` 为 suite 所在目录,默认为 ./mysql_test/test_suite
|
||||
|
||||
选项 `--suite` 为要执行suite的集合,多个suite之间使用英文逗号`,`间隔
|
||||
|
||||
选项 `--auto-retry` 开启后,当case第一次执行失败时会自动重部署集群进行重试。
|
||||
|
||||
### 单case测试
|
||||
|
||||
对特定case进行测试,比如对mysql_test/test_suite/alter/t/alter_log_archive_option.test进行测试,可以使用以下命令:
|
||||
```shell
|
||||
obd test mysqltest <deploy name> --test-dir ./mysql_test/test_suite/alter/t --result-dir ./mysql_test/test_suite/alter/r --test-set alter_log_archive_option --auto-retry
|
||||
# 如果执行obd命令时不处于当前目录请调整 --test-dir 和 --result-dir
|
||||
# 一些case中包含是相当路径,不在当前目录执行可能会导致失败
|
||||
```
|
||||
|
||||
#### 参数与选项解释
|
||||
参数 `deploy name` 为部署配置名称,可以理解为配置文件名称。
|
||||
|
||||
选项 `--test-dir` 为 test文件 所在目录,默认为 ./t
|
||||
|
||||
选项 `--result-dir` 为 result文件 所在目录,默认为 ./r
|
||||
|
||||
选项 `--test-set` 为要执行case的集合,多个case之间使用英文逗号`,`间隔
|
||||
|
||||
选项 `--auto-retry` 开启后,当case第一次执行失败时会自动重部署集群进行重试。
|
||||
|
||||
|
31
tools/deploy/mysql_test/include/check_all_idx_ok.inc
Normal file
31
tools/deploy/mysql_test/include/check_all_idx_ok.inc
Normal file
@ -0,0 +1,31 @@
|
||||
#--disable_query_log
|
||||
#--disable_result_log
|
||||
#
|
||||
#let $index_status_expect = 2;
|
||||
#let $result = 2;
|
||||
#
|
||||
#connect (obsys_caio,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
#connection obsys_caio;
|
||||
#let $i=210;
|
||||
#while($i>0)
|
||||
#{
|
||||
# sleep 1;
|
||||
# #--echo $index_name
|
||||
# ## let $result = query_get_value(select count(*) from oceanbase.__all_virtual_table where table_name like '__idx_%' and index_status!=2,count(*),1);
|
||||
# let $result = query_get_value(select count(*) from oceanbase.__all_virtual_table as t join oceanbase.__all_virtual_database as d where t.tenant_id = d.tenant_id and t.database_id = d.database_id and d.in_recyclebin = false and d.database_name != "__recyclebin" and t.table_name like '__idx_%' and t.index_status!=2,count(*),1);
|
||||
# if($result == 0)
|
||||
# {
|
||||
# let $i = -4;
|
||||
# }
|
||||
# dec $i;
|
||||
#}
|
||||
#sleep 2;
|
||||
#if($i != -5)
|
||||
#{
|
||||
# let $table_id = query_get_value(select table_id from oceanbase.__all_virtual_table as t join oceanbase.__all_virtual_database as d where t.tenant_id = d.tenant_id and t.database_id = d.database_id and d.in_recyclebin = false and d.database_name != "__recyclebin" and t.table_name like '__idx_%' and t.index_status!=2 limit 1,table_id,1);
|
||||
# --echo $result idx is build failed, first table id is $table_id
|
||||
#}
|
||||
#disconnect obsys_caio;
|
||||
#connection default;
|
||||
#--enable_query_log
|
||||
#--enable_result_log
|
9
tools/deploy/mysql_test/include/check_ob_or_mysql.inc
Normal file
9
tools/deploy/mysql_test/include/check_ob_or_mysql.inc
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
let $cluster_is_ob = 1;
|
||||
let $cluster_is_mysql = 0;
|
||||
let $collation_count = query_get_value(select count(1) as cnt from information_schema.COLLATIONS, cnt, 1);
|
||||
if ($collation_count > 100) {
|
||||
let $cluster_is_ob = 0;
|
||||
let $cluster_is_mysql = 1;
|
||||
}
|
||||
|
22
tools/deploy/mysql_test/include/check_schema_sync.inc
Normal file
22
tools/deploy/mysql_test/include/check_schema_sync.inc
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
connect (ob_sys_check_schema,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection ob_sys_check_schema;
|
||||
|
||||
let $i = 10;
|
||||
while($i > 0)
|
||||
{
|
||||
sleep 1;
|
||||
let $cnt = query_get_value(select count(*) as cnt from oceanbase.__all_virtual_server_schema_info as a join oceanbase.__all_virtual_server_schema_info as b on a.tenant_id = b.tenant_id where a.refreshed_schema_version != b.refreshed_schema_version, cnt, 1);
|
||||
dec $i;
|
||||
if ($cnt == 0)
|
||||
{
|
||||
let $i = -4;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i != -4)
|
||||
{
|
||||
--echo check schema sync timeout
|
||||
eval select * from oceanbase.__all_virtual_server_schema_info;
|
||||
}
|
||||
disconnect ob_sys_check_schema;
|
25
tools/deploy/mysql_test/include/check_stat.inc
Normal file
25
tools/deploy/mysql_test/include/check_stat.inc
Normal file
@ -0,0 +1,25 @@
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
connection default;
|
||||
let $tenant_id = query_get_value(select effective_tenant_id() as ID from dual, ID, 1);
|
||||
connect (obsys_ydm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_ydm;
|
||||
let $__i__= 100;
|
||||
while($__i__ > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $__i__;
|
||||
|
||||
## 检查有没有分区的列级统计信息还没有汇报上来
|
||||
let $__num__ = query_get_value(select count(*) as num from oceanbase.__all_virtual_meta_table a where a.tenant_id = $tenant_id and not exists (select 1 from oceanbase.__all_virtual_column_statistic b where a.table_id = b.table_id and a.partition_id = b.partition_id and b.tenant_id = $tenant_id), num, 1);
|
||||
if($__num__ == 0)
|
||||
{
|
||||
let $__i__ = -5;
|
||||
}
|
||||
}
|
||||
|
||||
connection default;
|
||||
disconnect obsys_ydm;
|
||||
|
||||
--enable_query_log
|
||||
--enable_result_log
|
24
tools/deploy/mysql_test/include/check_tenant_sync.inc
Normal file
24
tools/deploy/mysql_test/include/check_tenant_sync.inc
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
let $server_cnt = query_get_value(select count(*) as cnt from oceanbase.__all_server, cnt, 1);
|
||||
|
||||
let $schema_version = query_get_value(select max(schema_version) as max_schema_version from oceanbase.__all_tenant_history, max_schema_version, 1);
|
||||
|
||||
let $sync_cnt = 0;
|
||||
|
||||
let $i = 10;
|
||||
while($i > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $i;
|
||||
let $sync_cnt = query_get_value(select count(*) as cnt from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version >= $schema_version and tenant_id = 1, cnt, 1);
|
||||
if ($sync_cnt == $server_cnt)
|
||||
{
|
||||
let $i = -4;
|
||||
}
|
||||
}
|
||||
|
||||
if ($i != -4)
|
||||
{
|
||||
--echo check tenant sync timeout, sync_cnt:$sync_cnt, server_cnt:$server_cnt
|
||||
eval select * from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version >= $schema_version and tenant_id = 1;
|
||||
}
|
32
tools/deploy/mysql_test/include/get_tenant_server.inc
Normal file
32
tools/deploy/mysql_test/include/get_tenant_server.inc
Normal file
@ -0,0 +1,32 @@
|
||||
## 功能: 获取指定租户的ip&port
|
||||
# 1.最好使用前sleep下,否则tenant_schema有可能还未刷到server上导致连接不上
|
||||
# 2.如果分布于多个server,取unit_id最小的
|
||||
## 用法:
|
||||
# 1.设置待连接的tenant_name
|
||||
# 2.source本文件
|
||||
# 3.connect
|
||||
## 模板:
|
||||
# sleep 3;
|
||||
# let $__tenant_name__ = 'tt1';
|
||||
# --source mysql_test/include/get_tenant_server.inc
|
||||
# connect (conn1,$TE_SERVER_IP,root@tt1,,*NO-ONE*,$TE_SERVER_PORT);
|
||||
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
connect (obsys,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys;
|
||||
let $__tenant_id__ = `select tenant_id from oceanbase.__all_tenant where tenant_name = $__tenant_name__ limit 1`;
|
||||
let $__resource_pool_id__ = `select resource_pool_id from oceanbase.__all_resource_pool where tenant_id = $__tenant_id__ limit 1`;
|
||||
|
||||
let $__svr_ip__ = `select svr_ip from oceanbase.__all_unit where resource_pool_id = $__resource_pool_id__ limit 1`;
|
||||
let $__svr_port__ = `select svr_port from oceanbase.__all_unit where resource_pool_id = $__resource_pool_id__ limit 1`;
|
||||
|
||||
let $__inner_port__ = `select inner_port from oceanbase.__all_server where svr_ip = '$__svr_ip__' and svr_port = $__svr_port__ limit 1`;
|
||||
|
||||
let $TE_SERVER_IP = $__svr_ip__;
|
||||
let $TE_SERVER_PORT = $__inner_port__;
|
||||
disconnect obsys;
|
||||
connection default;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
6
tools/deploy/mysql_test/include/index_quick_major.inc
Normal file
6
tools/deploy/mysql_test/include/index_quick_major.inc
Normal file
@ -0,0 +1,6 @@
|
||||
connect (obsys_idm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_idm;
|
||||
set ob_enable_index_direct_select=1;
|
||||
alter system set merger_check_interval = '10s';
|
||||
disconnect obsys_idm;
|
||||
connection default;
|
5
tools/deploy/mysql_test/include/majorfreeze.inc
Normal file
5
tools/deploy/mysql_test/include/majorfreeze.inc
Normal file
@ -0,0 +1,5 @@
|
||||
connect (obsys,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys;
|
||||
alter system major freeze;
|
||||
disconnect obsys;
|
||||
connection default;
|
5
tools/deploy/mysql_test/include/not_embedded.inc
Normal file
5
tools/deploy/mysql_test/include/not_embedded.inc
Normal file
@ -0,0 +1,5 @@
|
||||
-- require mysql_test/r/not_embedded.require
|
||||
disable_query_log;
|
||||
select version() like '%embedded%' as 'have_embedded';
|
||||
enable_query_log;
|
||||
|
9
tools/deploy/mysql_test/include/proxy_route_to_c.inc
Normal file
9
tools/deploy/mysql_test/include/proxy_route_to_c.inc
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
connection default;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
select * from proxy_mock_table_for_pc;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
|
@ -0,0 +1 @@
|
||||
--replace_regex /REPLICA_NUM = [0-9]*/REPLICA_NUM = 1/g /ROW_FORMAT = (DYNAMIC|COMPRESSED|COMPACT|REDUNDANT)[ ]*//g /(NOCOMPRESS|COMPRESS) (FOR)*[ ]*(BASIC|OLTP|QUERY|ARCHIVE)*[ ]*//g /zstd_1\.3\.8/lz4_1.0/g /OBFK_[0-9]*/OBFK_1234/g /OBPK_[0-9]*/OBPK_1234/g /OBUNIQUE_[0-9]*/OBUNIQUE_1234/g /RECYCLE_\$_[0-9]*_[0-9]*_OBCHECK_[0-9]*/RECYCLE_$_1_2_OBCHECK_3/g /PCTFREE = [0-9]*/PCTFREE = 10/g
|
@ -0,0 +1 @@
|
||||
--replace_regex /REPLICA_NUM = [0-9]*/REPLICA_NUM = NUM/g /ROW_FORMAT = (DYNAMIC|COMPRESSED|COMPACT|REDUNDANT|CONDENSED)[ ]*//g /(NOCOMPRESS|COMPRESS) (FOR)*[ ]*(BASIC|OLTP|QUERY|ARCHIVE)*[ ]*//g /zstd_1\.3\.8/lz4_1.0/g /OBFK_[0-9]*/OBFK_1234/g /OBIDX_[0-9]*/OBIDX_1234/g /OBCHECK_[0-9]*/OBCHECK_1234/g /OBPK_[0-9]*/OBPK_1234/g /OBUNIQUE_[0-9]*/OBUNIQUE_1234/g /zone1;zone2/zone1/g /BLOCK_SIZE = [0-9]*/BLOCK_SIZE = SIZE/g /TABLET_SIZE = [0-9]*/TABLET_SIZE = SIZE/g /ZONE_LIST = \(.*\)/ZONE_LIST = (test)/g /PRIMARY_ZONE = .*/PRIMARY_ZONE = /g /PCTFREE = [0-9]*/PCTFREE = 10/g
|
45
tools/deploy/mysql_test/include/wait_daily_merge.inc
Normal file
45
tools/deploy/mysql_test/include/wait_daily_merge.inc
Normal file
@ -0,0 +1,45 @@
|
||||
#--disable_query_log
|
||||
#--disable_result_log
|
||||
connect (obsys_ydm,$OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection obsys_ydm;
|
||||
let $__i__= 600;
|
||||
while($__i__ > 0)
|
||||
{
|
||||
sleep 1;
|
||||
dec $__i__;
|
||||
let $__forzen_version__ = query_get_value(select value from oceanbase.__all_zone where name = 'frozen_version', value, 1);
|
||||
let $__merged_version__ = query_get_value(select value from oceanbase.__all_zone where name = 'last_merged_version' and zone = '', value, 1);
|
||||
if($__forzen_version__ == $__merged_version__)
|
||||
{
|
||||
let $__i__ = -5;
|
||||
}
|
||||
}
|
||||
|
||||
###判断集群状态,先注释掉
|
||||
#let $__j__= 180;
|
||||
#while($__j__ > 0)
|
||||
#{
|
||||
# sleep 1;
|
||||
# dec $__j__;
|
||||
# let $__global_stat__ = query_get_value(select comment from oceanbase.__all_cluster_stat where name='global_stat',comment, 1);
|
||||
# if($__global_stat__ == NORMAL)
|
||||
# {
|
||||
# let $__j__ = -5;
|
||||
# }
|
||||
#}
|
||||
|
||||
#if($__j__ != -5)
|
||||
#{
|
||||
# --echo major freeze failed
|
||||
#}
|
||||
|
||||
if($__i__ != -5)
|
||||
{
|
||||
--echo major freeze failed
|
||||
}
|
||||
sleep 2;
|
||||
|
||||
disconnect obsys_ydm;
|
||||
connection default;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
2
tools/deploy/mysql_test/r/not_embedded.require
Normal file
2
tools/deploy/mysql_test/r/not_embedded.require
Normal file
@ -0,0 +1,2 @@
|
||||
have_embedded
|
||||
0
|
@ -0,0 +1,37 @@
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t_h3_01_20;
|
||||
drop table if exists t_h3_05_24;
|
||||
drop table if exists t_h3_09_28;
|
||||
drop table if exists t_h5_01_20;
|
||||
drop table if exists t_h5_05_24;
|
||||
drop table if exists t_h5_09_28;
|
||||
drop table if exists t_r4_01_20;
|
||||
drop table if exists t_r4_05_24;
|
||||
drop table if exists t_r4_09_28;
|
||||
drop table if exists t_r5_01_20;
|
||||
drop table if exists t_r5_05_24;
|
||||
drop table if exists t_r5_09_28;
|
||||
drop table if exists t_h3_r4_01_20;
|
||||
drop table if exists t_h3_r5_09_28;
|
||||
drop table if exists t_h5_r4_01_20;
|
||||
drop table if exists t_h5_r5_09_28;
|
||||
|
||||
drop table if exists t_refered;
|
||||
drop table if exists t_h5_int;
|
||||
drop table if exists t_r4_int;
|
||||
drop table if exists t_r4_date;
|
||||
drop table if exists t_r4_datetime;
|
||||
drop table if exists t_r4_timestamp;
|
||||
drop table if exists t_h5_r4_int_int;
|
||||
drop table if exists t_h5_r4_int_int_datetime;
|
||||
|
||||
|
||||
drop table if exists t_r4_h2_date_int;
|
||||
drop table if exists t_r4_h3_date_int;
|
||||
drop table if exists t_r4_h3_date_bigint;
|
||||
drop table if exists tt;
|
||||
|
||||
drop table if exists t_many_range_part;
|
||||
|
||||
--enable_warnings
|
@ -0,0 +1,355 @@
|
||||
|
||||
--source mysql_test/include/check_ob_or_mysql.inc
|
||||
|
||||
create table t_h3_01_20(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 3;
|
||||
create table t_h3_05_24(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 3;
|
||||
create table t_h3_09_28(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 3;
|
||||
create table t_h5_01_20(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 5;
|
||||
create table t_h5_05_24(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 5;
|
||||
create table t_h5_09_28(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 5;
|
||||
create table t_r4_01_20(a int, b int, c datetime, primary key (a,b))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p6 values less than (6),
|
||||
partition p11 values less than (11),
|
||||
partition p16 values less than (16),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
create table t_r4_05_24(a int, b int, c datetime, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p10 values less than (10),
|
||||
partition p15 values less than (15),
|
||||
partition p20 values less than (20),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
create table t_r4_09_28(a int, b int, c datetime, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p14 values less than (14),
|
||||
partition p19 values less than (19),
|
||||
partition p24 values less than (24),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
create table t_r5_01_20(a int, b int, c datetime, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p5 values less than (5),
|
||||
partition p9 values less than (9),
|
||||
partition p13 values less than (13),
|
||||
partition p17 values less than (17),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
create table t_r5_05_24(a int, b int, c datetime, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p9 values less than (9),
|
||||
partition p13 values less than (13),
|
||||
partition p17 values less than (17),
|
||||
partition p21 values less than (21),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
create table t_r5_09_28(a int, b int, c datetime, primary key (a,b))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p13 values less than (13),
|
||||
partition p17 values less than (17),
|
||||
partition p21 values less than (21),
|
||||
partition p25 values less than (25),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
#--disable_query_log
|
||||
if ($cluster_is_ob == 1) {
|
||||
create table t_h3_r4_01_20(a int, b int, c int, d int, e datetime, primary key (a, b, c))
|
||||
partition by hash(a)
|
||||
subpartition by range(b)
|
||||
subpartition template (
|
||||
subpartition p6 values less than (6),
|
||||
subpartition p11 values less than (11),
|
||||
subpartition p16 values less than (16),
|
||||
subpartition pm values less than (MAXVALUE)
|
||||
)
|
||||
partitions 3;
|
||||
create table t_h3_r5_09_28(a int, b int, c int, d int, e datetime, primary key (a, b))
|
||||
partition by hash(a)
|
||||
subpartition by range(b)
|
||||
subpartition template (
|
||||
subpartition p13 values less than (13),
|
||||
subpartition p17 values less than (17),
|
||||
subpartition p21 values less than (21),
|
||||
subpartition p25 values less than (25),
|
||||
subpartition pm values less than (MAXVALUE)
|
||||
)
|
||||
partitions 3;
|
||||
create table t_h5_r4_01_20(a int, b int, c int, d int, e datetime, primary key (a, b))
|
||||
partition by hash(a)
|
||||
subpartition by range(b)
|
||||
subpartition template (
|
||||
subpartition p6 values less than (6),
|
||||
subpartition p11 values less than (11),
|
||||
subpartition p16 values less than (16),
|
||||
subpartition pm values less than (MAXVALUE)
|
||||
)
|
||||
partitions 5;
|
||||
create table t_h5_r5_09_28(a int, b int, c int, d int, e datetime, primary key (a, b, c))
|
||||
partition by hash(a)
|
||||
subpartition by range(b)
|
||||
subpartition template (
|
||||
subpartition p13 values less than (13),
|
||||
subpartition p17 values less than (17),
|
||||
subpartition p21 values less than (21),
|
||||
subpartition p25 values less than (25),
|
||||
subpartition pm values less than (MAXVALUE)
|
||||
)
|
||||
partitions 5;
|
||||
}
|
||||
if ($cluster_is_mysql == 1) {
|
||||
create table t_h3_r4_01_20(a int, b int, c int, d int, e datetime, primary key (a, b, c));
|
||||
create table t_h3_r5_09_28(a int, b int, c int, d int, e datetime, primary key (a, b));
|
||||
create table t_h5_r4_01_20(a int, b int, c int, d int, e datetime, primary key (a, b));
|
||||
create table t_h5_r5_09_28(a int, b int, c int, d int, e datetime, primary key (a, b, c));
|
||||
}
|
||||
|
||||
create table t_refered(a int, aa bigint, b int unsigned, bb bigint unsigned, c datetime, d date, e timestamp, primary key (a)) partition by hash(a) partitions 3;
|
||||
|
||||
create table t_h5_int(a int, b int, c datetime, primary key (a)) partition by hash(a) partitions 5;
|
||||
|
||||
create table t_r4_int(a int, b int, c date, primary key (a,b))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p6 values less than (6),
|
||||
partition p11 values less than (11),
|
||||
partition p16 values less than (16),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_date(a int, b int, c date, primary key (b,c))
|
||||
partition by range columns(c)
|
||||
(
|
||||
partition p11 values less than ("20161101"),
|
||||
partition p12 values less than ("20161201"),
|
||||
partition p171 values less than ("20170101"),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_datetime(a int, b int, c datetime, primary key (b,c))
|
||||
partition by range columns(c)
|
||||
(
|
||||
partition p11 values less than ("20161101"),
|
||||
partition p12 values less than ("20161201"),
|
||||
partition p171 values less than ("20170101"),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_timestamp(a int, b int, c timestamp, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p11 values less than (10),
|
||||
partition p12 values less than (100),
|
||||
partition p171 values less than (1000),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_h5_r4_int_int(a int, b int, c datetime, primary key (a, b))
|
||||
partition by hash(a)
|
||||
subpartition by range columns(b)
|
||||
subpartition template (
|
||||
subpartition p6 values less than (6),
|
||||
subpartition p11 values less than (11),
|
||||
subpartition p16 values less than (16),
|
||||
subpartition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_h3_date_int(a date, b int, c int, primary key (a, b))
|
||||
partition by range columns(a) subpartition by hash(b) subpartitions 3
|
||||
(
|
||||
partition p11 values less than ("20161101"),
|
||||
partition p12 values less than ("20161201"),
|
||||
partition p171 values less than ("20170101"),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_h2_date_int(a date, b int, c int, primary key (a, b))
|
||||
partition by range columns(a) subpartition by hash(b) subpartitions 2
|
||||
(
|
||||
partition p11 values less than ("20161101"),
|
||||
partition p12 values less than ("20161201"),
|
||||
partition p171 values less than ("20170101"),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
create table t_r4_h3_date_bigint(a date, b bigint, c int, primary key (a, b))
|
||||
partition by range columns(a) subpartition by hash(b) subpartitions 3
|
||||
(
|
||||
partition p11 values less than ("20161101"),
|
||||
partition p12 values less than ("20161201"),
|
||||
partition p171 values less than ("20170101"),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
|
||||
|
||||
create table t_h5_r4_int_int_datetime(a int, b int, c datetime, primary key (a, b, c))
|
||||
partition by hash(a)
|
||||
subpartition by range columns(b, c)
|
||||
subpartition template (
|
||||
subpartition p6 values less than (6, "20170510"),
|
||||
subpartition p11 values less than (11, "20170510"),
|
||||
subpartition p16 values less than (16, "20170510"),
|
||||
subpartition pm values less than (MAXVALUE, MAXVALUE)
|
||||
);
|
||||
|
||||
create table tt (a int, b int, c date, primary key(a, b));
|
||||
|
||||
|
||||
|
||||
#--enable_query_log
|
||||
|
||||
insert into t_h3_01_20 values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104),
|
||||
( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120);
|
||||
insert into t_h3_05_24 values ( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124);
|
||||
insert into t_h3_09_28 values ( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124),
|
||||
(25, 25, 20161125), (26, 26, 20161126), (27, 27, 20161127), (28, 28, 20161128);
|
||||
insert into t_h5_01_20 values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104),
|
||||
( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120);
|
||||
insert into t_h5_05_24 values ( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124);
|
||||
insert into t_h5_09_28 values ( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124),
|
||||
(25, 25, 20161125), (26, 26, 20161126), (27, 27, 20161127), (28, 28, 20161128);
|
||||
insert into t_r4_01_20 values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104),
|
||||
( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120);
|
||||
insert into t_r4_05_24 values ( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124);
|
||||
insert into t_r4_09_28 values ( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124),
|
||||
(25, 25, 20161125), (26, 26, 20161126), (27, 27, 20161127), (28, 28, 20161128);
|
||||
insert into t_r5_01_20 values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104),
|
||||
( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120);
|
||||
insert into t_r5_05_24 values ( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124);
|
||||
insert into t_r5_09_28 values ( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124),
|
||||
(25, 25, 20161125), (26, 26, 20161126), (27, 27, 20161127), (28, 28, 20161128);
|
||||
insert into t_h3_r4_01_20 values ( 1, 1, 1, 1, 20161101), ( 2, 2, 2, 2, 20161102), ( 3, 3, 3, 3, 20161103), ( 4, 4, 4, 4, 20161104),
|
||||
( 5, 5, 5, 5, 20161105), ( 6, 6, 6, 6, 20161106), ( 7, 7, 7, 7, 20161107), ( 8, 8, 8, 8, 20161108),
|
||||
( 9, 9, 9, 9, 20161109), (10, 10, 10, 10, 20161110), (11, 11, 11, 11, 20161111), (12, 12, 12, 12, 20161112),
|
||||
(13, 13, 13, 13, 20161113), (14, 14, 14, 14, 20161114), (15, 15, 15, 15, 20161115), (16, 16, 16, 16, 20161116),
|
||||
(17, 17, 17, 17, 20161117), (18, 18, 18, 18, 20161118), (19, 19, 19, 19, 20161119), (20, 20, 20, 20, 20161120);
|
||||
insert into t_h3_r5_09_28 values ( 9, 9, 9, 9, 20161109), (10, 10, 10, 10, 20161110), (11, 11, 11, 11, 20161111), (12, 12, 12, 12, 20161112),
|
||||
(13, 13, 13, 13, 20161113), (14, 14, 14, 14, 20161114), (15, 15, 15, 15, 20161115), (16, 16, 16, 16, 20161116),
|
||||
(17, 17, 17, 17, 20161117), (18, 18, 18, 18, 20161118), (19, 19, 19, 19, 20161119), (20, 20, 20, 20, 20161120),
|
||||
(21, 21, 21, 21, 20161121), (22, 22, 22, 22, 20161122), (23, 23, 23, 23, 20161123), (24, 24, 24, 24, 20161124),
|
||||
(25, 25, 25, 25, 20161125), (26, 26, 26, 26, 20161126), (27, 27, 27, 27, 20161127), (28, 28, 28, 28, 20161128);
|
||||
insert into t_h5_r4_01_20 values ( 1, 1, 1, 1, 20161101), ( 2, 2, 2, 2, 20161102), ( 3, 3, 3, 3, 20161103), ( 4, 4, 4, 4, 20161104),
|
||||
( 5, 5, 5, 5, 20161105), ( 6, 6, 6, 6, 20161106), ( 7, 7, 7, 7, 20161107), ( 8, 8, 8, 8, 20161108),
|
||||
( 9, 9, 9, 9, 20161109), (10, 10, 10, 10, 20161110), (11, 11, 11, 11, 20161111), (12, 12, 12, 12, 20161112),
|
||||
(13, 13, 13, 13, 20161113), (14, 14, 14, 14, 20161114), (15, 15, 15, 15, 20161115), (16, 16, 16, 16, 20161116),
|
||||
(17, 17, 17, 17, 20161117), (18, 18, 18, 18, 20161118), (19, 19, 19, 19, 20161119), (20, 20, 20, 20, 20161120);
|
||||
insert into t_h5_r5_09_28 values ( 9, 9, 9, 9, 20161109), (10, 10, 10, 10, 20161110), (11, 11, 11, 11, 20161111), (12, 12, 12, 12, 20161112),
|
||||
(13, 13, 13, 13, 20161113), (14, 14, 14, 14, 20161114), (15, 15, 15, 15, 20161115), (16, 16, 16, 16, 20161116),
|
||||
(17, 17, 17, 17, 20161117), (18, 18, 18, 18, 20161118), (19, 19, 19, 19, 20161119), (20, 20, 20, 20, 20161120),
|
||||
(21, 21, 21, 21, 20161121), (22, 22, 22, 22, 20161122), (23, 23, 23, 23, 20161123), (24, 24, 24, 24, 20161124),
|
||||
(25, 25, 25, 25, 20161125), (26, 26, 26, 26, 20161126), (27, 27, 27, 27, 20161127), (28, 28, 28, 28, 20161128);
|
||||
|
||||
insert into t_refered values ( 1, 1, 1, 1, 20161101, 20161101, 20161101), ( 2, 2, 2, 2, 20161101, 20161102, 20161102), ( 3, 3, 3, 3, 20161103, 20161101, 20161103), ( 4, 4, 4, 4, 20161104, 20161101, 20161104);
|
||||
insert into t_h5_int values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104), ( 5, 5, 20161105);
|
||||
insert into t_r4_int values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104), ( 5, 5, 20161105);
|
||||
insert into t_r4_date values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104);
|
||||
insert into t_r4_datetime values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104);
|
||||
insert into t_r4_timestamp values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104);
|
||||
insert into t_h5_r4_int_int values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104);
|
||||
insert into t_h5_r4_int_int_datetime values ( 1, 1, 20161101), ( 2, 2, 20161102), ( 3, 3, 20161103), ( 4, 4, 20161104);
|
||||
|
||||
insert into tt values ( 5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124),
|
||||
(5, 6, 20161105), ( 6, 7, 20161106), ( 7, 8, 20161107), ( 8, 9, 20161108),
|
||||
(9, 10, 20161109), (10, 11, 20161110), (11, 12, 20161111), (12, 13, 20161112),
|
||||
(13, 14, 20161113), (14, 15, 20161114), (15, 16, 20161115), (16, 17, 20161116),
|
||||
(17, 18, 20161117), (18, 19, 20161118), (19, 20, 20161119), (20, 21, 20161120),
|
||||
(21, 22, 20161121), (22, 23, 20161122), (23, 24, 20161123), (24, 25, 20161124);
|
||||
|
||||
insert into t_r4_h2_date_int(b, c, a) values (5, 5, 20161105), ( 6, 6, 20161106), ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123), (24, 24, 20161124);
|
||||
|
||||
insert into t_r4_h3_date_int(b, c, a) values ( 7, 7, 20161107), ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122), (23, 23, 20161123);
|
||||
|
||||
insert into t_r4_h3_date_bigint(b, c, a) values ( 8, 8, 20161108),
|
||||
( 9, 9, 20161109), (10, 10, 20161110), (11, 11, 20161111), (12, 12, 20161112),
|
||||
(13, 13, 20161113), (14, 14, 20161114), (15, 15, 20161115), (16, 16, 20161116),
|
||||
(17, 17, 20161117), (18, 18, 20161118), (19, 19, 20161119), (20, 20, 20161120),
|
||||
(21, 21, 20161121), (22, 22, 20161122);
|
||||
|
||||
create table t_many_range_part(a int, b int, primary key (a))
|
||||
partition by range columns(a)
|
||||
(
|
||||
partition p05 values less than (5),
|
||||
partition p10 values less than (10),
|
||||
partition p15 values less than (15),
|
||||
partition p20 values less than (20),
|
||||
partition p25 values less than (25),
|
||||
partition p30 values less than (30),
|
||||
partition p35 values less than (35),
|
||||
partition p40 values less than (40),
|
||||
partition p45 values less than (45),
|
||||
partition p50 values less than (50),
|
||||
partition p55 values less than (55),
|
||||
partition p60 values less than (60),
|
||||
partition p65 values less than (65),
|
||||
partition p70 values less than (70),
|
||||
partition p75 values less than (75),
|
||||
partition p80 values less than (80),
|
||||
partition p85 values less than (85),
|
||||
partition pm values less than (MAXVALUE)
|
||||
);
|
||||
insert into t_many_range_part values (01, 01), (02, 02), (03, 03), (04, 04), (05, 05), (06, 06), (07, 07), (08, 08), (09, 09), (10, 10),
|
||||
(11, 11), (12, 12), (13, 13), (14, 14), (15, 15), (16, 16), (17, 17), (18, 18), (19, 19), (20, 20),
|
||||
(21, 21), (22, 22), (23, 23), (24, 24), (25, 25), (26, 26), (27, 27), (28, 28), (29, 29), (30, 30),
|
||||
(31, 31), (32, 32), (33, 33), (34, 34), (35, 35), (36, 36), (37, 37), (38, 38), (39, 39), (40, 40),
|
||||
(41, 41), (42, 42), (43, 43), (44, 44), (45, 45), (46, 46), (47, 47), (48, 48), (49, 49), (50, 50);
|
||||
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
|
||||
#--echo
|
||||
#--echo ########### import time zone info ###########
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
|
||||
connect (conn_admin_tz, $OBMYSQL_MS0,admin,$OBMYSQL_PWD,test,$OBMYSQL_PORT);
|
||||
connection conn_admin_tz;
|
||||
select count(*) c1 from oceanbase.__all_tenant_time_zone;
|
||||
select count(*) c1 from oceanbase.__all_tenant_time_zone_name;
|
||||
select count(*) c1 from oceanbase.__all_tenant_time_zone_transition;
|
||||
select count(*) c1 from oceanbase.__all_tenant_time_zone_transition_type;
|
||||
delete from oceanbase.__all_tenant_time_zone;
|
||||
delete from oceanbase.__all_tenant_time_zone_name;
|
||||
delete from oceanbase.__all_tenant_time_zone_transition;
|
||||
delete from oceanbase.__all_tenant_time_zone_transition_type;
|
||||
alter system change tenant mysql ;
|
||||
sleep 2;
|
||||
|
||||
--source mysql_test/test_suite/time_zone/t/time_zone_info.sql
|
||||
|
||||
sleep 10;
|
||||
disconnect conn_admin_tz;
|
||||
connection default;
|
||||
|
||||
--enable_query_log
|
||||
--enable_result_log
|
||||
--enable_warnings
|
106
tools/deploy/mysql_test/test_suite/px/include/exam_data.inc
Executable file
106
tools/deploy/mysql_test/test_suite/px/include/exam_data.inc
Executable file
@ -0,0 +1,106 @@
|
||||
set ob_query_timeout=1000000000;
|
||||
--disable_warnings
|
||||
drop database if exists px_test;
|
||||
--enable_warnings
|
||||
create database px_test;
|
||||
use px_test;
|
||||
|
||||
# 场景:一个年级 6 个班,修了2门课,英语和数学
|
||||
|
||||
create table stu (
|
||||
sid int,
|
||||
name varchar(32),
|
||||
cls int,
|
||||
primary key (cls, sid)
|
||||
) partition by hash(sid) partitions 6;
|
||||
|
||||
create table teacher (
|
||||
tid int,
|
||||
name varchar(32),
|
||||
subject varchar(4),
|
||||
primary key (tid)
|
||||
) partition by hash(tid) partitions 8;
|
||||
|
||||
create table score (
|
||||
sid int,
|
||||
subject varchar(4),
|
||||
score int,
|
||||
primary key (sid, subject)
|
||||
) partition by hash(sid) partitions 6;
|
||||
|
||||
insert into stu values
|
||||
(11, 'a1', 1),
|
||||
(12, 'b1', 1),
|
||||
(13, 'c1', 1),
|
||||
|
||||
(21, 'a2', 2),
|
||||
(22, 'b2', 2),
|
||||
|
||||
(31, 'a3', 3),
|
||||
|
||||
(41, 'a4', 4),
|
||||
(42, 'b4', 4),
|
||||
|
||||
(51, 'a5', 5),
|
||||
(52, 'b5', 5),
|
||||
|
||||
(61, 'a6', 6),
|
||||
(62, 'b6', 6),
|
||||
(63, 'c6', 6),
|
||||
(64, 'd6', 6);
|
||||
|
||||
insert into teacher values
|
||||
(1, 'Miss Zhang', 'EN'),
|
||||
(2, 'Mr Wang', 'MA');
|
||||
|
||||
|
||||
insert into score values
|
||||
(11, 'EN', 60),
|
||||
(12, 'EN', 70),
|
||||
(13, 'EN', 80),
|
||||
|
||||
(21, 'EN', 58),
|
||||
(22, 'EN', 90),
|
||||
|
||||
(31, 'EN', 80),
|
||||
|
||||
(41, 'EN', 80),
|
||||
(42, 'EN', 90),
|
||||
|
||||
(51, 'EN', 89),
|
||||
(52, 'EN', 99),
|
||||
|
||||
(61, 'EN', 100),
|
||||
(62, 'EN', 90),
|
||||
(63, 'EN', 99),
|
||||
(64, 'EN', 87);
|
||||
|
||||
|
||||
insert into score values
|
||||
(11, 'MA', 60),
|
||||
(12, 'MA', 70),
|
||||
(13, 'MA', 80),
|
||||
|
||||
(21, 'MA', 58),
|
||||
(22, 'MA', 90),
|
||||
|
||||
(31, 'MA', 80),
|
||||
|
||||
(41, 'MA', 80),
|
||||
(42, 'MA', 90),
|
||||
|
||||
(51, 'MA', 89),
|
||||
(52, 'MA', 99),
|
||||
|
||||
(61, 'MA', 100),
|
||||
(62, 'MA', 90),
|
||||
(63, 'MA', 99),
|
||||
(64, 'MA', 87);
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
select * from stu;
|
||||
select * from teacher;
|
||||
select * from score;
|
||||
--enable_query_log
|
||||
--enable_result_log
|
43961
tools/deploy/mysql_test/test_suite/time_zone/t/time_zone_info.sql
Normal file
43961
tools/deploy/mysql_test/test_suite/time_zone/t/time_zone_info.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user