Skip to content

Commit e926dba

Browse files
committed
test(cubestore): Test quote character escaping
1 parent a52eeed commit e926dba

File tree

1 file changed

+9
-9
lines changed
  • rust/cubestore/cubestore-sql-tests/src

1 file changed

+9
-9
lines changed

rust/cubestore/cubestore-sql-tests/src/tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,9 @@ async fn column_escaping(service: Box<dyn SqlClient>) {
13501350

13511351
let result = service
13521352
.exec_query(
1353-
"SELECT date_trunc('day', `timestamp`.t) `day`, sum(`timestamp`.amount) \
1354-
FROM foo.timestamps `timestamp` \
1355-
WHERE `timestamp`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1",
1353+
"SELECT date_trunc('day', `timestamp_``_quote`.t) `day_``_quote`, sum(`timestamp_``_quote`.amount) \
1354+
FROM foo.timestamps `timestamp_``_quote` \
1355+
WHERE `timestamp_``_quote`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1",
13561356
)
13571357
.await
13581358
.unwrap();
@@ -1447,9 +1447,9 @@ async fn case_column_escaping(service: Box<dyn SqlClient>) {
14471447
.unwrap();
14481448

14491449
let result = service.exec_query(
1450-
"SELECT date_trunc('day', `timestamp`.t) `day`, sum(CASE WHEN `timestamp`.t > to_timestamp('2020-01-02T00:01:00.000Z') THEN `timestamp`.amount END) \
1451-
FROM foo.timestamps `timestamp` \
1452-
WHERE `timestamp`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1"
1450+
"SELECT date_trunc('day', `timestamp_``_quote`.t) `day_``_quote`, sum(CASE WHEN `timestamp_``_quote`.t > to_timestamp('2020-01-02T00:01:00.000Z') THEN `timestamp_``_quote`.amount END) \
1451+
FROM foo.timestamps `timestamp_``_quote` \
1452+
WHERE `timestamp_``_quote`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1"
14531453
).await.unwrap();
14541454

14551455
assert_eq!(
@@ -1481,9 +1481,9 @@ async fn inner_column_escaping(service: Box<dyn SqlClient>) {
14811481

14821482
let result = service
14831483
.exec_query(
1484-
"SELECT date_trunc('day', `t`) `day`, sum(`amount`) \
1485-
FROM foo.timestamps `timestamp` \
1486-
WHERE `t` >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1",
1484+
"SELECT date_trunc('day', `t_``_quote`) `day_``_quote`, sum(`amount_``_quote`) \
1485+
FROM foo.timestamps `timestamp_``_quote` \
1486+
WHERE `t_``_quote` >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1",
14871487
)
14881488
.await
14891489
.unwrap();

0 commit comments

Comments
 (0)