Skip to content
Open
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
6 changes: 6 additions & 0 deletions test/distributed/cases/load_data/load_data_parquet.result
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,10 @@ load data infile {'filepath'='$resources/parquet/Iris.parquet', 'format'='parque
select count(*) from parquet_01;
➤ count(*)[-5,64,0] 𝄀
150
drop table if exists parquet_06;
create table parquet_06(PassengerId bigint,Survived bigint, Pclass bigint,Name varchar(50),Sex varchar(50),Age double,SibSp bigint,Parch bigint,Ticket varchar(50),Fare double,Cabin varchar(50),Embarked varchar(50));
load data infile {'filepath'='$resources/parquet/Titanic.parquet','format'='parquet'} into table parquet_06;
select count(*) from parquet_06;
➤ count(*)[-5,64,0] 𝄀
891
drop database parq;
4 changes: 4 additions & 0 deletions test/distributed/cases/load_data/load_data_parquet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ CREATE TABLE `parquet_01` (
load data infile {'filepath'='$resources/parquet/Iris.parquet', 'format'='parquet'} into table parquet_01;
select count(*) from parquet_01;

drop table if exists parquet_06;
create table parquet_06(PassengerId bigint,Survived bigint, Pclass bigint,Name varchar(50),Sex varchar(50),Age double,SibSp bigint,Parch bigint,Ticket varchar(50),Fare double,Cabin varchar(50),Embarked varchar(50));
load data infile {'filepath'='$resources/parquet/Titanic.parquet','format'='parquet'} into table parquet_06;
select count(*) from parquet_06;

-- post
drop database parq;
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,33 @@ insert into src values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy ca
(10, NULL, NULL);
create table src2 (id1 varchar, id2 bigint, body char(128), title text, primary key (id1, id2), FULLTEXT ftidx(body, title) ASYNC);
insert into src2 values ('id0', 0, 'red', 't1'), ('id1', 1, 'yellow', 't2'), ('id2', 2, 'blue', 't3'), ('id3', 3, 'blue red', 't4'), ('id4', 4, 'bright red null', NULL);
select sleep(20);
sleep(20)
0
select * from src where match(body, title) against('red');
id body title
0 color is red t1
3 blue is not red colorful
➤ id[-5,64,0] ¦ body[12,-1,0] ¦ title[12,0,0] 𝄀
0 ¦ color is red ¦ t1 𝄀
3 ¦ blue is not red ¦ colorful
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `body` varchar(65535) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `ftidx`(`body`,`title`) ASYNC\n)
➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀
src ¦ CREATE TABLE `src` (
`id` bigint NOT NULL,
`body` varchar(65535) DEFAULT NULL,
`title` text DEFAULT NULL,
PRIMARY KEY (`id`),
FULLTEXT `ftidx`(`body`,`title`) ASYNC
)
alter table src rename to src1;
select * from src2 where match(body, title) against('red');
id1 id2 body title
id0 0 red t1
id3 3 blue red t4
id1[12,-1,0] ¦ id2[-5,64,0] ¦ body[1,128,0] ¦ title[12,0,0] 𝄀
id0 ¦ 0 ¦ red ¦ t1 𝄀
id3 ¦ 3 ¦ blue red ¦ t4
show create table src2;
Table Create Table
src2 CREATE TABLE `src2` (\n `id1` varchar(65535) NOT NULL,\n `id2` bigint NOT NULL,\n `body` char(128) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id1`,`id2`),\n FULLTEXT `ftidx`(`body`,`title`) ASYNC\n)
➤ Table[12,-1,0] ¦ Create Table[12,-1,0] 𝄀
src2 ¦ CREATE TABLE `src2` (
`id1` varchar(65535) NOT NULL,
`id2` bigint NOT NULL,
`body` char(128) DEFAULT NULL,
`title` text DEFAULT NULL,
PRIMARY KEY (`id1`,`id2`),
FULLTEXT `ftidx`(`body`,`title`) ASYNC
)
drop table src1;
drop table src2;
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ create table src2 (id1 varchar, id2 bigint, body char(128), title text, primary

insert into src2 values ('id0', 0, 'red', 't1'), ('id1', 1, 'yellow', 't2'), ('id2', 2, 'blue', 't3'), ('id3', 3, 'blue red', 't4'), ('id4', 4, 'bright red null', NULL);

-- sleep and wait for src and src2 finish
select sleep(20);

-- select src
-- @wait_expect(1,10)
select * from src where match(body, title) against('red');
show create table src;
alter table src rename to src1;
Expand Down
124 changes: 59 additions & 65 deletions test/distributed/cases/pessimistic_transaction/isolation_2.result
Original file line number Diff line number Diff line change
Expand Up @@ -281,25 +281,25 @@ vvv 2000-09-08 00:00:00
aaaa 2000-09-02 00:00:00
oppo 1009-11-11 00:00:00
insert into dis_table_02(b,c) values ('','1999-06-04');
drop database if exists temp_db;
create database temp_db;
use temp_db;
create temporary table dis_temp_01(a int,b varchar(100),primary key(a));

begin ;

insert into dis_temp_01 values (233,'uuuu');

use temp_db;
select * from dis_temp_01;
SQL parser error: table "dis_temp_01" does not exist
select * from dis_temp_01;
a b
233 uuuu
➤ a[4,32,0] ¦ b[12,-1,0] 𝄀
233 ¦ uuuu
use temp_db;
truncate table dis_temp_01;
no such table isolation_2.dis_temp_01
no such table temp_db.dis_temp_01
rollback ;

select * from dis_temp_01;
a b
➤ a[4,32,0] ¦ b[12,-1,0]
drop table dis_temp_01;

start transaction;

load data infile '$resources/external_table_file/isolation_01.csv' into table dis_table_02 fields terminated by ',';
Expand Down Expand Up @@ -507,28 +507,21 @@ a b c
6666 kkkk 2010-11-25 00:00:00
879 uuyyy 2011-11-26 00:00:00
begin ;

use isolation_2;

create temporary table dis_table_05(a int,b varchar(25) not null,c datetime,primary key(a),unique key bstr (b),key cdate (c));

load data infile 'fff.csv' to dis_table_05 fields terminated by ',';
SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 29 near " to dis_table_05;";
SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 29 near " to dis_table_05 fields terminated by ',';";
use isolation_2;

select * from dis_table_05;
SQL parser error: table "dis_table_05" does not exist
insert into dis_table_05 values (8900,'kkkk77','1772-04-20');

commit;

select * from dis_table_05;
a b c
8900 kkkk77 1772-04-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[93,64,0] 𝄀
8900 ¦ kkkk77 ¦ 1772-04-20 00:00:00
select * from dis_table_05;
SQL parser error: table "dis_table_05" does not exist
drop table dis_table_05;

use isolation_2;
create table dis_table_06(a int auto_increment primary key,b varchar(25),c double default 0.0);
insert into dis_table_06(a,b) values(2,'moon');
Expand All @@ -538,47 +531,47 @@ use isolation_2;
insert into dis_table_06(a,b) values (3,'llllp');
Duplicate entry '3' for key 'a'
select * from dis_table_06;
a b c
2 moon 0.0
3 sun 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0
use isolation_2;
insert into dis_table_06 values (3,'uuubbb',12.02);
Duplicate entry '3' for key 'a'
select * from dis_table_06;
a b c
2 moon 0.0
3 sun 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0
insert into dis_table_06(a,b) values (4,'cookie');
commit;
select * from dis_table_06;
a b c
2 moon 0.0
3 sun 0.0
4 cookie 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0 𝄀
4 ¦ cookie ¦ 0.0
begin;
use isolation_2;
insert into dis_table_06(a,b) values (5,'leetio');
select * from dis_table_06;
a b c
5 leetio 0.0
2 moon 0.0
3 sun 0.0
4 cookie 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
5 ¦ leetio ¦ 0.0 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0 𝄀
4 ¦ cookie ¦ 0.0
update dis_table_06 set a=5 where b='sun';
Duplicate entry '5' for key 'a'
select * from dis_table_06;
a b c
2 moon 0.0
3 sun 0.0
4 cookie 0.0
5 leetio 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0 𝄀
4 ¦ cookie ¦ 0.0 𝄀
5 ¦ leetio ¦ 0.0
commit;
select * from dis_table_06;
a b c
2 moon 0.0
3 sun 0.0
4 cookie 0.0
5 leetio 0.0
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] 𝄀
2 ¦ moon ¦ 0.0 𝄀
3 ¦ sun ¦ 0.0 𝄀
4 ¦ cookie ¦ 0.0 𝄀
5 ¦ leetio ¦ 0.0
drop table dis_table_06;
create table dis_table_07(a int,b varchar(25),c double,d datetime,primary key(a,b,d));
insert into dis_table_07 values (1,'yellow',20.09,'2020-09-27');
Expand All @@ -588,36 +581,37 @@ use isolation_2;
insert into dis_table_07 values (2,'blue',11.00,'2021-01-20');
Duplicate entry '(2,blue,2021-01-20 00:00:00)' for key '(a,b,d)'
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00
commit;
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00
insert into dis_table_07 values (2,'blue',12.00,'2024-01-20');
begin;
update dis_table_07 set d='2024-01-20' where a=2 and b='blue';
Duplicate entry '(2,blue,2024-01-20 00:00:00)' for key '(a,b,d)'
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
2 blue 12.0 2024-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00 𝄀
2 ¦ blue ¦ 12.0 ¦ 2024-01-20 00:00:00
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
2 blue 12.0 2024-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00 𝄀
2 ¦ blue ¦ 12.0 ¦ 2024-01-20 00:00:00
commit;
select * from dis_table_07;
a b c d
1 yellow 20.09 2020-09-27 00:00:00
2 blue 10.0 2021-01-20 00:00:00
2 blue 12.0 2024-01-20 00:00:00
➤ a[4,32,0] ¦ b[12,-1,0] ¦ c[8,54,0] ¦ d[93,64,0] 𝄀
1 ¦ yellow ¦ 20.09 ¦ 2020-09-27 00:00:00 𝄀
2 ¦ blue ¦ 10.0 ¦ 2021-01-20 00:00:00 𝄀
2 ¦ blue ¦ 12.0 ¦ 2024-01-20 00:00:00
drop table dis_table_07;
drop database temp_db;
10 changes: 6 additions & 4 deletions test/distributed/cases/pessimistic_transaction/isolation_2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,24 @@ use dis_db_02;
select b,c from dis_table_02;
insert into dis_table_02(b,c) values ('','1999-06-04');
------------------------------
-- @bvt:issue#9124
drop database if exists temp_db;
create database temp_db;
use temp_db;
create temporary table dis_temp_01(a int,b varchar(100),primary key(a));
begin ;
insert into dis_temp_01 values (233,'uuuu');
-- @session:id=1{
use temp_db;
select * from dis_temp_01;
-- @session}
select * from dis_temp_01;
-- @session:id=1{
use temp_db;
truncate table dis_temp_01;
-- @session}
rollback ;
select * from dis_temp_01;
drop table dis_temp_01;
-- @bvt:issue

-- @bvt:issue#10585
start transaction;
Expand Down Expand Up @@ -311,7 +314,6 @@ select * from dis_table_04;
-- @session}
-- @bvt:issue
----------------------------
-- @bvt:issue#9124
begin ;
use isolation_2;
create temporary table dis_table_05(a int,b varchar(25) not null,c datetime,primary key(a),unique key bstr (b),key cdate (c));
Expand All @@ -327,7 +329,6 @@ select * from dis_table_05;
select * from dis_table_05;
-- @session}
drop table dis_table_05;
-- @bvt:issue

-- auto_increment 主键冲突
use isolation_2;
Expand Down Expand Up @@ -387,3 +388,4 @@ select * from dis_table_07;
commit;
select * from dis_table_07;
drop table dis_table_07;
drop database temp_db;
Loading
Loading