Skip to content

Commit

Permalink
Invert flag, use dolt_optimize_json with default of 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktobey committed Jan 8, 2025
1 parent e21bd65 commit 480150c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions go/libraries/doltcore/sqle/system_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ var DoltSystemVariables = []sql.SystemVariable{
Default: int8(0),
},
&sql.MysqlSystemVariable{
Name: "dolt_dont_optimize_json",
Name: "dolt_optimize_json",
Dynamic: true,
Scope: sql.GetMysqlScope(sql.SystemVariableScope_Both),
Type: types.NewSystemBoolType("dolt_dont_optimize_json"),
Default: int8(0),
Type: types.NewSystemBoolType("dolt_optimize_json"),
Default: int8(1),
},
&sql.MysqlSystemVariable{
Name: dsess.DoltStatsAutoRefreshEnabled,
Expand Down
4 changes: 2 additions & 2 deletions go/store/prolly/tree/prolly_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ func getJSONAddrHash(ctx context.Context, ns NodeStore, v interface{}) (hash.Has
}
sqlCtx, isSqlCtx := ctx.(*sql.Context)
if isSqlCtx {
dontOptimizeJson, err := sqlCtx.Session.GetSessionVariable(sqlCtx, "dolt_dont_optimize_json")
dontOptimizeJson, err := sqlCtx.Session.GetSessionVariable(sqlCtx, "dolt_optimize_json")
if err != nil {
return hash.Hash{}, err
}
if dontOptimizeJson != 0 {
if dontOptimizeJson == uint8(0) {
buf, err := types.MarshallJson(j)
if err != nil {
return hash.Hash{}, err
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/bats/json.bats
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ SQL
# We expect that the document gets stored as a blob.
@test "json: Test dolt_dont_optimize_json system variable" {
run dolt sql <<SQL
set @@dolt_dont_optimize_json = 1;
set @@dolt_optimize_json = 0;
CREATE TABLE js (
pk int PRIMARY KEY,
js json
Expand Down

0 comments on commit 480150c

Please sign in to comment.