From 55aca3690a7667a8519bf2fac31b9d95ad8f47ae Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Tue, 2 Jun 2026 13:50:32 -0700 Subject: [PATCH] Add new test for dolt_patch() used with JSONB values --- testing/go/dolt_functions_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/testing/go/dolt_functions_test.go b/testing/go/dolt_functions_test.go index 77093f9b5c..2e3de6c56b 100755 --- a/testing/go/dolt_functions_test.go +++ b/testing/go/dolt_functions_test.go @@ -3045,6 +3045,28 @@ func TestDoltFunctionSmokeTests(t *testing.T) { }, }, }, + { + Name: "dolt_patch works with JSONB columns", + SetUpScript: []string{ + "CREATE TABLE repro (pk int primary key, data jsonb);", + "INSERT INTO repro VALUES (1, '{\"text\": \"hello\"}');", + }, + Assertions: []ScriptTestAssertion{ + { + Query: "SELECT statement_order, table_name, diff_type, statement FROM dolt_patch('HEAD', 'WORKING', 'repro')", + Expected: []sql.Row{ + {Numeric("1"), "public.repro", "schema", "CREATE TABLE \"repro\" (\n \"pk\" integer NOT NULL,\n \"data\" jsonb,\n PRIMARY KEY (\"pk\")\n);"}, + {Numeric("2"), "public.repro", "data", "INSERT INTO \"repro\" (\"pk\",\"data\") VALUES (1,'{\\\"text\\\": \\\"hello\\\"}');"}, + }, + }, + { + Query: "SELECT diff_type, from_pk, to_pk FROM dolt_diff('HEAD', 'WORKING', 'repro')", + Expected: []sql.Row{ + {"added", nil, 1}, + }, + }, + }, + }, { Name: "DOLT_PREVIEW_MERGE_CONFLICTS basic functionality", SetUpScript: []string{