Skip to content

Commit 9fe7383

Browse files
committedNov 30, 2022
Quote in drop as well
1 parent 90273fe commit 9fe7383

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎database/clickhouse/clickhouse.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (ch *ClickHouse) ensureVersionTable() (err error) {
259259
}
260260

261261
func (ch *ClickHouse) Drop() (err error) {
262-
query := "SHOW TABLES FROM " + ch.config.DatabaseName
262+
query := "SHOW TABLES FROM \"" + ch.config.DatabaseName + "\""
263263
tables, err := ch.conn.Query(query)
264264

265265
if err != nil {
@@ -277,7 +277,7 @@ func (ch *ClickHouse) Drop() (err error) {
277277
return err
278278
}
279279

280-
query = "DROP TABLE IF EXISTS " + ch.config.DatabaseName + "." + table
280+
query = "DROP TABLE IF EXISTS \"" + ch.config.DatabaseName + "\"." + table
281281

282282
if _, err := ch.conn.Exec(query); err != nil {
283283
return &database.Error{OrigErr: err, Query: []byte(query)}

0 commit comments

Comments
 (0)