Skip to content

Commit

Permalink
sql: fix a leftover bug
Browse files Browse the repository at this point in the history
This (hidden) bug was left over from cockroachdb#108902.
There is no visible negative effect to this bug being present until
setting aliases are effectively introduced, which hasn't happened yet.

Release note: None
  • Loading branch information
knz committed Aug 20, 2023
1 parent a4a7758 commit 96bc4c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/tenant_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (n *alterTenantSetClusterSettingNode) startExec(params runParams) error {
if _, err := params.p.InternalSQLTxn().ExecEx(
params.ctx, "reset-tenant-setting", params.p.Txn(),
sessiondata.RootUserSessionDataOverride,
"DELETE FROM system.tenant_settings WHERE tenant_id = $1 AND name = $2", tenantID, n.name,
"DELETE FROM system.tenant_settings WHERE tenant_id = $1 AND name = $2", tenantID, n.setting.InternalKey(),
); err != nil {
return err
}
Expand All @@ -139,7 +139,7 @@ func (n *alterTenantSetClusterSettingNode) startExec(params runParams) error {
params.ctx, "update-tenant-setting", params.p.Txn(),
sessiondata.RootUserSessionDataOverride,
`UPSERT INTO system.tenant_settings (tenant_id, name, value, last_updated, value_type) VALUES ($1, $2, $3, now(), $4)`,
tenantID, n.name, encoded, n.setting.Typ(),
tenantID, n.setting.InternalKey(), encoded, n.setting.Typ(),
); err != nil {
return err
}
Expand Down

0 comments on commit 96bc4c1

Please sign in to comment.