diff --git a/go/libraries/doltcore/sqle/system_variables.go b/go/libraries/doltcore/sqle/system_variables.go index 61c406cf9a6..99e6c2f5a9b 100644 --- a/go/libraries/doltcore/sqle/system_variables.go +++ b/go/libraries/doltcore/sqle/system_variables.go @@ -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, diff --git a/go/store/prolly/tree/prolly_fields.go b/go/store/prolly/tree/prolly_fields.go index e5932398764..4e00c434b27 100644 --- a/go/store/prolly/tree/prolly_fields.go +++ b/go/store/prolly/tree/prolly_fields.go @@ -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 diff --git a/integration-tests/bats/json.bats b/integration-tests/bats/json.bats index f5800166901..a9ed1a5a4f9 100644 --- a/integration-tests/bats/json.bats +++ b/integration-tests/bats/json.bats @@ -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 <