Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(cubestore): Test quote character escaping #8891

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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
Loading