Skip to content

Commit

Permalink
test(cubestore): Test quote character escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Oct 31, 2024
1 parent a52eeed commit e926dba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rust/cubestore/cubestore-sql-tests/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1350,9 +1350,9 @@ async fn column_escaping(service: Box<dyn SqlClient>) {

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

let result = service.exec_query(
"SELECT date_trunc('day', `timestamp`.t) `day`, sum(CASE WHEN `timestamp`.t > to_timestamp('2020-01-02T00:01:00.000Z') THEN `timestamp`.amount END) \
FROM foo.timestamps `timestamp` \
WHERE `timestamp`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1"
"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) \
FROM foo.timestamps `timestamp_``_quote` \
WHERE `timestamp_``_quote`.t >= to_timestamp('2020-01-02T00:00:00.000Z') GROUP BY 1"
).await.unwrap();

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

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

0 comments on commit e926dba

Please sign in to comment.