Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dantengsky committed Nov 26, 2024
1 parent efcbac3 commit 9ade1a5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ explain select * from t left join t t1 on t.a = t1.a where t1.a <= 1 or t.a < 1
----
Filter
├── output columns: [t.a (#0), t1.a (#1)]
├── filters: [is_true((t1.a (#1) <= 1 OR t.a (#0) < 1))]
├── filters: [is_true(t1.a (#1) <= 1 OR t.a (#0) < 1)]
├── estimated rows: 3.09
└── HashJoin
├── output columns: [t.a (#0), t1.a (#1)]
Expand Down
23 changes: 12 additions & 11 deletions tests/sqllogictests/suites/mode/standalone/explain/explain.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ create OR REPLACE table t1 as select number as a, number as b from numbers(1)
statement ok
create OR REPLACE table t2 as select number as a, number as b from numbers(5)

statement error 1005
explain explain select t1.a from t1 where a > 0

statement error 1005
explain explain analyze select t1.a from t1 where a > 0

statement error 1005
explain analyze explain select t1.a from t1 where a > 0

statement error 1005
explain analyze explain analyze select t1.a from t1 where a > 0
# commented out, not applicable in v1.2.636-rc5
#statement error 1005
#explain explain select t1.a from t1 where a > 0
#
#statement error 1005
#explain explain analyze select t1.a from t1 where a > 0
#
#statement error 1005
#explain analyze explain select t1.a from t1 where a > 0
#
#statement error 1005
#explain analyze explain analyze select t1.a from t1 where a > 0

query T
explain select t1.a from t1 where a > 0
Expand Down
8 changes: 4 additions & 4 deletions tests/sqllogictests/suites/mode/standalone/explain/join.test
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ HashJoin
├── estimated rows: 0.89
├── Filter(Build)
│ ├── output columns: [b.x (#1), b.y (#2)]
│ ├── filters: [is_true((b.x (#1) > 44 OR b.x (#1) < 43))]
│ ├── filters: [is_true(b.x (#1) > 44 OR b.x (#1) < 43)]
│ ├── estimated rows: 1.33
│ └── TableScan
│ ├── table: default.default.twocolumn
Expand All @@ -290,11 +290,11 @@ HashJoin
│ ├── partitions total: 1
│ ├── partitions scanned: 1
│ ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
│ ├── push downs: [filters: [is_true((twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43))], limit: NONE]
│ ├── push downs: [filters: [is_true(twocolumn.x (#1) > 44 OR twocolumn.x (#1) < 43)], limit: NONE]
│ └── estimated rows: 4.00
└── Filter(Probe)
├── output columns: [a.x (#0)]
├── filters: [is_true((a.x (#0) > 44 OR a.x (#0) < 43))]
├── filters: [is_true(a.x (#0) > 44 OR a.x (#0) < 43)]
├── estimated rows: 1.33
└── TableScan
├── table: default.default.onecolumn
Expand All @@ -304,7 +304,7 @@ HashJoin
├── partitions total: 1
├── partitions scanned: 1
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
├── push downs: [filters: [is_true((onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43))], limit: NONE]
├── push downs: [filters: [is_true(onecolumn.x (#0) > 44 OR onecolumn.x (#0) < 43)], limit: NONE]
└── estimated rows: 4.00

query T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ explain select * from t1 inner join t2 on t1.a = t2.a where t2.a <= 2 or (t1.a >
----
Filter
├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)]
├── filters: [is_true((t2.a (#2) <= 2 OR (t1.a (#0) > 1 AND t2.a (#2) > 1)))]
├── filters: [is_true(t2.a (#2) <= 2 OR t1.a (#0) > 1 AND t2.a (#2) > 1)]
├── estimated rows: 3.56
└── HashJoin
├── output columns: [t1.a (#0), t1.b (#1), t2.b (#3), t2.a (#2)]
Expand All @@ -74,7 +74,7 @@ Filter
├── estimated rows: 3.56
├── Filter(Build)
│ ├── output columns: [t2.a (#2), t2.b (#3)]
│ ├── filters: [is_true((t2.a (#2) <= 2 OR t2.a (#2) > 1))]
│ ├── filters: [is_true(t2.a (#2) <= 2 OR t2.a (#2) > 1)]
│ ├── estimated rows: 3.00
│ └── TableScan
│ ├── table: default.default.t2
Expand All @@ -84,11 +84,11 @@ Filter
│ ├── partitions total: 1
│ ├── partitions scanned: 1
│ ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
│ ├── push downs: [filters: [is_true((t2.a (#2) <= 2 OR t2.a (#2) > 1))], limit: NONE]
│ ├── push downs: [filters: [is_true(t2.a (#2) <= 2 OR t2.a (#2) > 1)], limit: NONE]
│ └── estimated rows: 3.00
└── Filter(Probe)
├── output columns: [t1.a (#0), t1.b (#1)]
├── filters: [is_true((t1.a (#0) <= 2 OR t1.a (#0) > 1))]
├── filters: [is_true(t1.a (#0) <= 2 OR t1.a (#0) > 1)]
├── estimated rows: 3.56
└── TableScan
├── table: default.default.t1
Expand All @@ -98,7 +98,7 @@ Filter
├── partitions total: 1
├── partitions scanned: 1
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
├── push downs: [filters: [is_true((t1.a (#0) <= 2 OR t1.a (#0) > 1))], limit: NONE]
├── push downs: [filters: [is_true(t1.a (#0) <= 2 OR t1.a (#0) > 1)], limit: NONE]
└── estimated rows: 4.00

statement ok
Expand Down
25 changes: 1 addition & 24 deletions tests/suites/0_stateless/18_rbac/18_0007_privilege_access.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,34 @@
>>>> create database db01;
>>>> drop database if exists dbnotexists;
>>>> GRANT SELECT ON db01.tbnotexists TO 'test-user'
Error: APIError: QueryFailed: [1025]Unknown table 'tbnotexists'
<<<<
>>>> GRANT SELECT ON dbnotexists.* TO 'test-user'
Error: APIError: QueryFailed: [1003]Unknown database 'dbnotexists'
<<<<
=== check list user's local stage ===
=== no err ===
information_schema
system
test -- insert
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Insert] is required on 'default'.'default'.'t20_0012' for user 'test-user'@'%' with roles [public]
1
2
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Delete] is required on 'default'.'default'.'t20_0012' for user 'test-user'@'%' with roles [public,test-role1,test-role2]
1
2
test -- update
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Update] is required on 'default'.'default'.'t20_0012' for user 'test-user'@'%' with roles [public,test-role1,test-role2]
2
3
test -- delete
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Delete] is required on 'default'.'default'.'t20_0012' for user 'test-user'@'%' with roles [public,test-role1,test-role2]
true
test -- insert overwrite
2
3
test -- optimize table
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Super] is required on 'default'.'default'.'t20_0012' for user 'test-user'@'%' with roles [public,test-role1,test-role2]
true
test -- select
1
1
1
1
test -- select view
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default2'.'v_t20_0012' for user 'test-user'@'%' with roles [public,test-role1,test-role2]
1
test -- clustering_information
true
Expand All @@ -51,15 +43,12 @@ grant_db
information_schema
system
test -- show tables from system
Error: APIError: QueryFailed: [1063]Permission denied: User 'a'@'%' does not have the required privileges for database 'system'
test -- show tables from grant_db
t
Error: APIError: QueryFailed: [1063]Permission denied: User 'a'@'%' does not have the required privileges for database 'system'
test -- show columns from one from system
dummy TINYINT UNSIGNED NO NULL NULL
c1 INT NO NULL NULL
0
Error: APIError: QueryFailed: [1063]Permission denied: User 'a'@'%' does not have the required privileges for table 'system.tasks'
catalog VARCHAR NO NULL NULL
cluster_by VARCHAR NO NULL NULL
comment VARCHAR NO NULL NULL
Expand All @@ -82,24 +71,12 @@ table_id BIGINT UNSIGNED NO NULL NULL
table_type VARCHAR NO NULL NULL
total_columns BIGINT UNSIGNED NO NULL NULL
updated_on TIMESTAMP NO NULL NULL
Error: APIError: QueryFailed: [1063]Permission denied: User 'a'@'%' does not have the required privileges for database 'nogrant'
1
0
0
0
=== Test: show grants on privilege check ===
Error: APIError: QueryFailed: [1063]Permission denied: privilege USAGE is required on udf root_func for user b.
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage root_stage for user b. Or no need to show the stage privilege
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on database root_db for user b.
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
Error: APIError: QueryFailed: [1063]Permission denied: No privilege on table root_table for user b.
1 1 356
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t1' for user 'b'@'%' with roles [public]
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'b'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t' for user 'b'@'%' with roles [public]
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'b'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'b'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'t1' for user 'b'@'%' with roles [public]
1 1 377
a b/data_UUID_0000_00000000.parquet 1 0 NULL NULL
=== check db/table_id ===
Read s3 USER b GRANT Read ON STAGE s3 TO 'b'@'%'
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
Error: APIError: QueryFailed: [1006]divided by zero while evaluating function `divide(0, 0)` in expr `t.a (#0) / 0`, during run expr: `(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((t.a (#0) > 0 OR t.a (#0) > 1) OR t.a (#0) > 2) OR t.a (#0) > 3) OR t.a (#0) > 4) OR t.a (#0) > 5) OR t.a (#0) > 6) OR t.a (#0) > 7) OR t.a (#0) > 8) OR t.a (#0) > 9) OR t.a (#0) > 10) OR t.a (#0) > 11) OR t.a (#0) > 12) OR t.a (#0) > 13) OR t.a (#0) > 14) OR t.a (#0) > 15) OR t.a (#0) > 16) OR t.a (#0) > 17) OR t.a (#0) > 18) OR t.a (#0) > 19) OR t.a (#0) > 20) OR t.a (#0) > 21) OR t.a (#0) > 22) OR t.a (#0) > 23) OR t.a (#0) > 24) OR t.a (#0) > 25) OR t.a (#0) > 26) OR t.a (#0) > 27) OR t.a (#0) > 28) OR t.a (#0) > 29) OR t.a (#0) > 30) OR t.a (#0) > 31) OR t.a (#0) > 32) OR t.a (#0) > 33) OR t.a (#0) > 34) OR t.a (#0) > 35) OR t.a (#0) > 36) OR t.a (#0) > 37) OR t.a (#0) > 38) OR t.a (#0) > 39) OR t.a (#0) > 40) OR t.a (#0) > 41) OR t.a (#0) > 42) OR t.a (#0) > 43) OR t.a (#0) > 44) OR t.a (#0) > 45) OR t.a (#0) > 46) OR t.a (#0) > 47) OR t.a (#0) > 48) OR t.a (#0) > 49) OR t.a (#0) > 50) OR t.a (#0) > 51) OR t.a (#0) > 52) OR t.a (#0) > 53) OR t.a (#0) > 54) OR t.a (#0) > 55) OR t.a (#0) > 56) OR t.a (#0) > 57) OR t.a (#0) > 58) OR t.a (#0) > 59) OR t.a (#0) > 60) OR t.a (#0) > 61) OR t.a (#0) > 62) OR t.a (#0) > 63) OR t.a (#0) > 64) OR t.a (#0) > 65) OR t.a (#0) > 66) OR t.a (#0) > 67) OR t.a (#0) > 68) OR t.a (#0) > 69) OR t.a (#0) > 70) OR t.a (#0) > 71) OR t.a (#0) > 72) OR t.a (#0) > 73) OR t.a (#0) > 74) OR t.a (#0) > 75) OR t.a (#0) > 76) OR t.a (#0) > 77) OR t.a (#0) > 78) OR t.a (#0) > 79) OR t.a (#0) > 80) OR t.a (#0) > 81) OR t.a (#0) > 82) OR t.a (#0) > 83) OR t.a (#0) > 84) OR t.a (#0) > 85) OR t.a (#0) > 86) OR t.a (#0) > 87) OR t.a (#0) > 88) OR t.a (#0) > 89) OR t.a (#0) > 90) OR t.a (#0) > 91) OR t.a (#0) > 92) OR t.a (#0) > 93) OR t.a (#0) > 94) OR t.a (#0) > 95) OR t.a (#0) > 96) OR t.a (#0) > 97) OR t.a (#0) > 98) OR t.a (#0) > 99) OR t.a (#0) > 100) OR t.a (#0) / 0 > 0)`
20 changes: 2 additions & 18 deletions tests/suites/1_stateful/00_stage/00_0012_stage_priv.result
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
==== check internal stage write priv ===
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s2 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Select] is required on 'default'.'default'.'test_table' for user 'u1'@'%' with roles [public]
20 160 160
1
==== check external stage priv ===
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s1 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
20 160 160
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s1 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
csv/data_UUID_0000_00000000.csv 20 0 NULL NULL
==== check internal stage read priv ===
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s2 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
data_UUID_0000_00000000.csv 20 0 NULL NULL
=== check presign ===
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE presign_stage for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
000
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE presign_stage for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
000
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Write] is required on STAGE s3 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
1 1 356
Error: APIError: QueryFailed: [1063]Permission denied: privilege [Read] is required on STAGE s3 for user 'u1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage.
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
Error: APIError: QueryFailed: [1063]Permission denied: privilege READ is required on stage s3 for user 'u1'@'%'
1 1 377
2
1
1
1
=== check external location ===
1 1
2 2
i0.csv 2 0 NULL NULL
1 1
2 2
=== check access user's local stage ===
000

0 comments on commit 9ade1a5

Please sign in to comment.