From 96bc4c1b3d6a7aa26a3dfa7434f14f27e0e7a8de Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Sun, 20 Aug 2023 10:56:19 +0200 Subject: [PATCH] sql: fix a leftover bug 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. Release note: None --- pkg/sql/tenant_settings.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sql/tenant_settings.go b/pkg/sql/tenant_settings.go index ce33108c57b3..a7957bc3fe6f 100644 --- a/pkg/sql/tenant_settings.go +++ b/pkg/sql/tenant_settings.go @@ -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 } @@ -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 }