Skip to content

Commit

Permalink
fix CreateUser: again, wrong escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Nov 28, 2023
1 parent be809cb commit a4c2bc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/dialect_clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,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)
user, pass := EscapeIdentifier(username), escapeStringValue(password)

createUserQ := fmt.Sprintf("CREATE USER IF NOT EXISTS %s IDENTIFIED WITH plaintext_password BY %s;", user, pass)
_, err := tx.ExecContext(ctx, createUserQ)
Expand Down

0 comments on commit a4c2bc4

Please sign in to comment.