From e355b8346570854d5499adee65c512952df0acfa Mon Sep 17 00:00:00 2001 From: James Cor Date: Fri, 22 Nov 2024 12:59:18 -0800 Subject: [PATCH 1/2] system variables cannot have nil defaults --- go/libraries/doltcore/sqle/system_variables.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/go/libraries/doltcore/sqle/system_variables.go b/go/libraries/doltcore/sqle/system_variables.go index 4d78960e298..afc7a5dd943 100644 --- a/go/libraries/doltcore/sqle/system_variables.go +++ b/go/libraries/doltcore/sqle/system_variables.go @@ -124,7 +124,7 @@ var DoltSystemVariables = []sql.SystemVariable{ Dynamic: true, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.DoltCommitOnTransactionCommitMessage), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.TransactionsDisabledSysVar, @@ -164,7 +164,7 @@ var DoltSystemVariables = []sql.SystemVariable{ Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsFile), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.AwsCredsProfile, @@ -172,7 +172,7 @@ var DoltSystemVariables = []sql.SystemVariable{ Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsProfile), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.AwsCredsRegion, @@ -180,7 +180,7 @@ var DoltSystemVariables = []sql.SystemVariable{ Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsRegion), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.ShowBranchDatabases, @@ -351,7 +351,7 @@ func AddDoltSystemVariables() { Dynamic: true, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.DoltCommitOnTransactionCommitMessage), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.TransactionsDisabledSysVar, @@ -391,7 +391,7 @@ func AddDoltSystemVariables() { Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsFile), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.AwsCredsProfile, @@ -399,7 +399,7 @@ func AddDoltSystemVariables() { Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsProfile), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.AwsCredsRegion, @@ -407,7 +407,7 @@ func AddDoltSystemVariables() { Dynamic: false, SetVarHintApplies: false, Type: types.NewSystemStringType(dsess.AwsCredsRegion), - Default: nil, + Default: "", }, &sql.MysqlSystemVariable{ Name: dsess.ShowBranchDatabases, From 8bc92fb52a7eda4139f228c5d320455e0ce92ab5 Mon Sep 17 00:00:00 2001 From: James Cor Date: Fri, 22 Nov 2024 13:09:24 -0800 Subject: [PATCH 2/2] check for spaces --- integration-tests/bats/sql-server.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/bats/sql-server.bats b/integration-tests/bats/sql-server.bats index 24387ef973e..e1508c89266 100644 --- a/integration-tests/bats/sql-server.bats +++ b/integration-tests/bats/sql-server.bats @@ -209,7 +209,7 @@ user_session_vars: [[ "$output" =~ /Users/user1/.aws/config.*lddev ]] || false run dolt --host=127.0.0.1 --port=$PORT --no-tls --user=user2 --password=pass2 sql -q "SELECT @@aws_credentials_file, @@aws_credentials_profile;" - [[ "$output" =~ NULL.*NULL ]] || false + [[ "$output" =~ " " ]] || false run dolt --host=127.0.0.1 --port=$PORT --no-tls --user=user2 --password=pass2 sql -q "SET @@aws_credentials_file='/Users/should_fail';" [[ "$output" =~ "Variable 'aws_credentials_file' is a read only variable" ]] || false