Skip to content

Commit 95600c0

Browse files
authored
test(p3): add new test cases (#536)
* Add tests for update and index scan Signed-off-by: Yuchen Liang <[email protected]> * Change project3 tests Signed-off-by: Yuchen Liang <[email protected]> --------- Signed-off-by: Yuchen Liang <[email protected]>
1 parent 1da0016 commit 95600c0

18 files changed

+579
-156
lines changed

test/sql/p3.03-update.slt

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Create a table
2+
statement ok
3+
create table t1(v1 int, v2 varchar(128), v3 int);
4+
5+
# Insert once
6+
query
7+
insert into t1 values (0, '🥰', 10), (1, '🥰🥰', 11), (2, '🥰🥰🥰', 12), (3, '🥰🥰🥰🥰', 13), (4, '🥰🥰🥰🥰🥰', 14);
8+
----
9+
5
10+
11+
query
12+
select * from t1;
13+
----
14+
0 🥰 10
15+
1 🥰🥰 11
16+
2 🥰🥰🥰 12
17+
3 🥰🥰🥰🥰 13
18+
4 🥰🥰🥰🥰🥰 14
19+
20+
# Update in table
21+
query
22+
update t1 set v3 = 445 where v1 >= 3;
23+
----
24+
2
25+
26+
query
27+
select * from t1;
28+
----
29+
0 🥰 10
30+
1 🥰🥰 11
31+
2 🥰🥰🥰 12
32+
3 🥰🥰🥰🥰 445
33+
4 🥰🥰🥰🥰🥰 445
34+
35+
36+
# Insert more
37+
query
38+
insert into t1 values (0, '🥰', 10), (1, '🥰🥰', 11), (2, '🥰🥰🥰', 12), (3, '🥰🥰🥰🥰', 13), (4, '🥰🥰🥰🥰🥰', 14);
39+
----
40+
5
41+
42+
43+
query
44+
select * from t1;
45+
----
46+
0 🥰 10
47+
1 🥰🥰 11
48+
2 🥰🥰🥰 12
49+
3 🥰🥰🥰🥰 445
50+
4 🥰🥰🥰🥰🥰 445
51+
0 🥰 10
52+
1 🥰🥰 11
53+
2 🥰🥰🥰 12
54+
3 🥰🥰🥰🥰 13
55+
4 🥰🥰🥰🥰🥰 14
56+
57+
# Update in table
58+
query
59+
update t1 set v3 = 645 where v1 >= 3;
60+
----
61+
4
62+
63+
query
64+
select * from t1;
65+
----
66+
0 🥰 10
67+
1 🥰🥰 11
68+
2 🥰🥰🥰 12
69+
3 🥰🥰🥰🥰 645
70+
4 🥰🥰🥰🥰🥰 645
71+
0 🥰 10
72+
1 🥰🥰 11
73+
2 🥰🥰🥰 12
74+
3 🥰🥰🥰🥰 645
75+
4 🥰🥰🥰🥰🥰 645
76+
77+
# Update nothing
78+
query
79+
update t1 set v3 = 645 where v1 >= 5;
80+
----
81+
0
82+
83+
query
84+
select * from t1;
85+
----
86+
0 🥰 10
87+
1 🥰🥰 11
88+
2 🥰🥰🥰 12
89+
3 🥰🥰🥰🥰 645
90+
4 🥰🥰🥰🥰🥰 645
91+
0 🥰 10
92+
1 🥰🥰 11
93+
2 🥰🥰🥰 12
94+
3 🥰🥰🥰🥰 645
95+
4 🥰🥰🥰🥰🥰 645
96+
97+
query
98+
update t1 set v3 = v3 + v1;
99+
----
100+
10
101+
102+
query
103+
select * from t1;
104+
----
105+
0 🥰 10
106+
1 🥰🥰 12
107+
2 🥰🥰🥰 14
108+
3 🥰🥰🥰🥰 648
109+
4 🥰🥰🥰🥰🥰 649
110+
0 🥰 10
111+
1 🥰🥰 12
112+
2 🥰🥰🥰 14
113+
3 🥰🥰🥰🥰 648
114+
4 🥰🥰🥰🥰🥰 649
File renamed without changes.

test/sql/p3.04-index-scan.slt

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)