Skip to content

Commit 5dd007a

Browse files
fix: add backticks to table names
1 parent 7db6a8f commit 5dd007a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/slo/database/sql/storage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
const (
2222
createTemplate = `
23-
CREATE TABLE %s (
23+
CREATE TABLE ` + "`%s`" + ` (
2424
hash Uint64,
2525
id Uint64,
2626
payload_str Utf8,
@@ -39,17 +39,17 @@ CREATE TABLE %s (
3939
AUTO_PARTITIONING_MAX_PARTITIONS_COUNT = %d,
4040
UNIFORM_PARTITIONS = %d
4141
);`
42-
dropTemplate = `DROP TABLE %s;`
42+
dropTemplate = `DROP TABLE ` + "`%s`" + `;`
4343
upsertTemplate = `
44-
UPSERT INTO %s (
44+
UPSERT INTO ` + "`%s`" + ` (
4545
id, hash, payload_str, payload_double, payload_timestamp
4646
) VALUES (
4747
$id, Digest::NumericHash($id), $payload_str, $payload_double, $payload_timestamp
4848
);
4949
`
5050
selectTemplate = `
5151
SELECT id, payload_str, payload_double, payload_timestamp, payload_hash
52-
FROM %s WHERE id = $id AND hash = Digest::NumericHash($id);
52+
FROM ` + "`%s`" + ` WHERE id = $id AND hash = Digest::NumericHash($id);
5353
`
5454
)
5555

tests/slo/native/storage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DECLARE $payload_str AS Utf8;
2929
DECLARE $payload_double AS Double;
3030
DECLARE $payload_timestamp AS Timestamp;
3131
32-
UPSERT INTO %s (
32+
UPSERT INTO ` + "`%s`" + ` (
3333
id, hash, payload_str, payload_double, payload_timestamp
3434
) VALUES (
3535
$id, Digest::NumericHash($id), $payload_str, $payload_double, $payload_timestamp
@@ -40,7 +40,7 @@ PRAGMA TablePathPrefix("%s");
4040
4141
DECLARE $id AS Uint64;
4242
SELECT id, payload_str, payload_double, payload_timestamp, payload_hash
43-
FROM %s WHERE id = $id AND hash = Digest::NumericHash($id);
43+
FROM ` + "`%s`" + ` WHERE id = $id AND hash = Digest::NumericHash($id);
4444
`
4545
)
4646

0 commit comments

Comments
 (0)