Skip to content

Commit

Permalink
Merge #109098
Browse files Browse the repository at this point in the history
109098: sql: fix a leftover bug r=stevendanna a=knz

This (hidden) bug was left over from #108902.
There is no visible negative effect to this bug being present until setting aliases are effectively introduced, which hasn't happened yet.

No tests included here -- this is exercised by #109077 and #109074 and the CI in those PRs readily fail without this fix.

 Epic: CRDB-27642

Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
craig[bot] and knz committed Aug 20, 2023
2 parents 31fe139 + 96bc4c1 commit 23fdad3
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 23fdad3

Please sign in to comment.