Skip to content

Commit

Permalink
system variables cannot have nil defaults (#8590)
Browse files Browse the repository at this point in the history
  • Loading branch information
jycor authored Nov 22, 2024
1 parent b9ad822 commit bb53838
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions go/libraries/doltcore/sqle/system_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -164,23 +164,23 @@ var DoltSystemVariables = []sql.SystemVariable{
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsFile),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.AwsCredsProfile,
Scope: sql.GetMysqlScope(sql.SystemVariableScope_Session),
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsProfile),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.AwsCredsRegion,
Scope: sql.GetMysqlScope(sql.SystemVariableScope_Session),
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsRegion),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.ShowBranchDatabases,
Expand Down Expand Up @@ -351,7 +351,7 @@ func AddDoltSystemVariables() {
Dynamic: true,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.DoltCommitOnTransactionCommitMessage),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.TransactionsDisabledSysVar,
Expand Down Expand Up @@ -391,23 +391,23 @@ func AddDoltSystemVariables() {
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsFile),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.AwsCredsProfile,
Scope: sql.GetMysqlScope(sql.SystemVariableScope_Session),
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsProfile),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.AwsCredsRegion,
Scope: sql.GetMysqlScope(sql.SystemVariableScope_Session),
Dynamic: false,
SetVarHintApplies: false,
Type: types.NewSystemStringType(dsess.AwsCredsRegion),
Default: nil,
Default: "",
},
&sql.MysqlSystemVariable{
Name: dsess.ShowBranchDatabases,
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/bats/sql-server.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb53838

Please sign in to comment.