From 85d2e11a2841b636a47f4d5551612cc1389d00a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Mon, 27 Nov 2023 19:03:12 -0500 Subject: [PATCH] fix double escaping of password on create clickhouse user --- db/dialect_clickhouse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dialect_clickhouse.go b/db/dialect_clickhouse.go index 218d998..4d40bca 100644 --- a/db/dialect_clickhouse.go +++ b/db/dialect_clickhouse.go @@ -134,7 +134,7 @@ func (d clickhouseDialect) OnlyInserts() bool { func (d clickhouseDialect) CreateUser(tx Tx, ctx context.Context, l *Loader, username string, password string, _database string, readOnly bool) error { user, pass := EscapeIdentifier(username), EscapeIdentifier(password) - createUserQ := fmt.Sprintf("CREATE USER IF NOT EXISTS %s IDENTIFIED WITH plaintext_password BY '%s';", user, pass) + createUserQ := fmt.Sprintf("CREATE USER IF NOT EXISTS %s IDENTIFIED WITH plaintext_password BY %s;", user, pass) _, err := tx.ExecContext(ctx, createUserQ) if err != nil { return fmt.Errorf("executing query %q: %w", createUserQ, err)