fix: set current database

This commit is contained in:
Kirill Shvakov 2017-06-21 23:10:43 +03:00
parent e86f4a201c
commit 8cd9761d29
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ func (ch *ClickHouse) Open(dsn string) (database.Driver, error) {
func (ch *ClickHouse) init() error { func (ch *ClickHouse) init() error {
if len(ch.config.DatabaseName) == 0 { if len(ch.config.DatabaseName) == 0 {
if err := ch.conn.QueryRow("SELECT currentDatabase()").Scan(ch.config.DatabaseName); err != nil { if err := ch.conn.QueryRow("SELECT currentDatabase()").Scan(&ch.config.DatabaseName); err != nil {
return err return err
} }
} }