Skip to content

Commit

Permalink
Quote in drop as well
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-nardelli committed Nov 30, 2022
1 parent 90273fe commit 9fe7383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database/clickhouse/clickhouse.go
Expand Up @@ -259,7 +259,7 @@ func (ch *ClickHouse) ensureVersionTable() (err error) {
}

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

if err != nil {
Expand All @@ -277,7 +277,7 @@ func (ch *ClickHouse) Drop() (err error) {
return err
}

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

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

0 comments on commit 9fe7383

Please sign in to comment.