Skip to content

Commit 1743fe1

Browse files
committed
merge main
2 parents be31db9 + cebe501 commit 1743fe1

7 files changed

Lines changed: 75 additions & 8 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ require (
66
github.com/PuerkitoBio/goquery v1.8.1
77
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
88
github.com/cockroachdb/errors v1.7.5
9-
github.com/dolthub/dolt/go v0.40.5-0.20260108002554-92cfa3fd0834
9+
github.com/dolthub/dolt/go v0.40.5-0.20260106173753-e3c81824fc90
1010
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca
1111
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
12-
github.com/dolthub/go-mysql-server v0.20.1-0.20260108001605-ff0a497ea62f
12+
github.com/dolthub/go-mysql-server v0.20.1-0.20260106170317-759307e19edd
1313
github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1
1414
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216
1515
github.com/dolthub/vitess v0.0.0-20251210200925-1d33d416d162

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 h1:I
228228
github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12/go.mod h1:rN7X8BHwkjPcfMQQ2QTAq/xM3leUSGLfb+1Js7Y6TVo=
229229
github.com/dolthub/dolt-mcp v0.2.2 h1:bpROmam74n95uU4EA3BpOIVlTDT0pzeFMBwe/YRq2mI=
230230
github.com/dolthub/dolt-mcp v0.2.2/go.mod h1:S++DJ4QWTAXq+0TNzFa7Oq3IhoT456DJHwAINFAHgDQ=
231-
github.com/dolthub/dolt/go v0.40.5-0.20260108002554-92cfa3fd0834 h1:Aqz8MMcNNpc2HJ+4xBlwjUTJed8vrd3iw6p5leFBGcc=
232-
github.com/dolthub/dolt/go v0.40.5-0.20260108002554-92cfa3fd0834/go.mod h1:Bxj60f481X6n2uyujnIbQdSV0xhkl6pnGUQUIHug7IM=
231+
github.com/dolthub/dolt/go v0.40.5-0.20260106173753-e3c81824fc90 h1:lWOjwImXbtzaL34XjFYVCcnniJUt/jjGx9omvu4y5NU=
232+
github.com/dolthub/dolt/go v0.40.5-0.20260106173753-e3c81824fc90/go.mod h1:RrRSqn/03/yMFx3nxUyL1H8YkC60tJwhqq2UyuvIGNA=
233233
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca h1:BGFz/0OlKIuC6qHIZQbvPapFvdAJkeEyGXWVgL5clmE=
234234
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca/go.mod h1:CoDLfgPqHyBtth0Cp+fi/CmC4R81zJNX4wPjShdZ+Bw=
235235
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
@@ -238,8 +238,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
238238
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
239239
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790 h1:zxMsH7RLiG+dlZ/y0LgJHTV26XoiSJcuWq+em6t6VVc=
240240
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790/go.mod h1:F3cnm+vMRK1HaU6+rNqQrOCyR03HHhR1GWG2gnPOqaE=
241-
github.com/dolthub/go-mysql-server v0.20.1-0.20260108001605-ff0a497ea62f h1:pKwWXc4w96VvPKQ81S8uVBXRJxsxRInvKZIS/hpoCg4=
242-
github.com/dolthub/go-mysql-server v0.20.1-0.20260108001605-ff0a497ea62f/go.mod h1:T+oVXfQAETbWm9R55daMqg0HE7W7Fz7bzh+pGiQgaPI=
241+
github.com/dolthub/go-mysql-server v0.20.1-0.20260106170317-759307e19edd h1:AgpawshAhriZokzNFNTEeeojRDXX96t9Z/Vu6px8F+g=
242+
github.com/dolthub/go-mysql-server v0.20.1-0.20260106170317-759307e19edd/go.mod h1:NjewWKoa5bVSLdKwL7fg7eAfrcIxDybWUKoWEHWRTw4=
243243
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
244244
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
245245
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=

postgres/parser/parser/sql.y

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ func (u *sqlSymUnion) vacuumTableAndColsList() tree.VacuumTableAndColsList {
717717
%token <str> BOOLEAN BOTH BOX2D BUFFER_USAGE_LIMIT BUNDLE BY BYPASSRLS
718718

719719
%token <str> CACHE CHAIN CALL CALLED CANCEL CANCELQUERY CANONICAL CASCADE CASCADED CASE CAST CATEGORY CBRT
720-
%token <str> CHANGEFEED CHAR CHARACTER CHARACTERISTICS CHECK CHECK_OPTION CLASS CLOSE
720+
%token <str> CHANGEFEED BPCHAR CHAR CHARACTER CHARACTERISTICS CHECK CHECK_OPTION CLASS CLOSE
721721
%token <str> CLUSTER COALESCE COLLATABLE COLLATE COLLATION COLLATION_VERSION COLUMN COLUMNS COMBINEFUNC COMMENT COMMENTS
722722
%token <str> BLOCK_COMMENT HINT
723723
%token <str> COMMIT COMMITTED COMPACT COMPLETE COMPRESSION CONCAT CONCURRENTLY CONFIGURATION CONFIGURATIONS CONFIGURE
@@ -12047,6 +12047,11 @@ character_base:
1204712047
{
1204812048
$$.val = types.String
1204912049
}
12050+
| BPCHAR
12051+
{
12052+
$$.val = types.MakeChar(0)
12053+
}
12054+
1205012055

1205112056
char_aliases:
1205212057
CHAR
@@ -15115,6 +15120,7 @@ col_name_keyword:
1511515120
| BIT
1511615121
| BOOLEAN
1511715122
| BOX2D
15123+
| BPCHAR
1511815124
| CHAR
1511915125
| CHARACTER
1512015126
| CHARACTERISTICS

testing/go/alter_table_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,27 @@ func TestAlterTable(t *testing.T) {
327327
},
328328
},
329329
},
330+
{
331+
Name: "Add column with inline check constraint to table with existing data",
332+
SetUpScript: []string{
333+
"CREATE TABLE test1 (a INT, b INT);",
334+
"INSERT INTO test1 VALUES (1, 1);",
335+
},
336+
Assertions: []ScriptTestAssertion{
337+
{
338+
Query: "ALTER TABLE test1 ADD COLUMN c INT NOT NULL DEFAULT 42 CONSTRAINT chk1 CHECK (c > 0);",
339+
Expected: []sql.Row{},
340+
},
341+
{
342+
Query: "INSERT INTO test1 VALUES (2, 2, -2);",
343+
ExpectedErr: `Check constraint "chk1" violated`,
344+
},
345+
{
346+
Query: "ALTER TABLE test1 ADD COLUMN c2 INT CONSTRAINT chk2 CHECK (c2 IS NOT NULL);",
347+
ExpectedErr: `Check constraint "chk2" violated`,
348+
},
349+
},
350+
},
330351
{
331352
Name: "Drop Column",
332353
SetUpScript: []string{

testing/go/enginetest/doltgres_harness_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ func columns(rows pgx.Rows) (sql.Schema, []interface{}, error) {
865865
colVal := gosql.NullBool{}
866866
columnVals = append(columnVals, &colVal)
867867
schema = append(schema, &sql.Column{Name: field.Name, Type: gmstypes.Int8, Nullable: true})
868-
case uint32(oid.T_text), uint32(oid.T_varchar), uint32(oid.T_name), uint32(oid.T__text):
868+
case uint32(oid.T_text), uint32(oid.T_varchar), uint32(oid.T_name), uint32(oid.T__text), uint32(oid.T_bpchar):
869869
colVal := gosql.NullString{}
870870
columnVals = append(columnVals, &colVal)
871871
schema = append(schema, &sql.Column{Name: field.Name, Type: gmstypes.LongText, Nullable: true})

testing/go/show_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ func TestShowTables(t *testing.T) {
159159
{
160160
Name: "show tables in single schema",
161161
SetUpScript: []string{
162+
// Create a sequence to ensure it isn't included
163+
`CREATE SEQUENCE seq1;`,
162164
`CREATE TABLE t1 (a INT PRIMARY KEY, name TEXT)`,
163165
`CREATE TABLE t2 (b INT PRIMARY KEY, name TEXT)`,
164166
`create schema schema2`,

testing/go/types_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,44 @@ var typesTests = []ScriptTest{
398398
},
399399
},
400400
},
401+
{
402+
// https://github.com/dolthub/doltgresql/issues/2145
403+
Name: "bpchar type",
404+
Assertions: []ScriptTestAssertion{
405+
{
406+
Query: "create table bptest1 (pk int primary key, c1 bpchar, c2 bpchar(12));",
407+
Expected: nil,
408+
},
409+
{
410+
Query: "insert into bptest1 values (1, '1', '1');",
411+
Expected: nil,
412+
},
413+
{
414+
Query: "select * from bptest1;",
415+
Expected: []sql.Row{
416+
{1, "1", "1 "},
417+
},
418+
},
419+
{
420+
Query: "SELECT '!'::bpchar;",
421+
Expected: []sql.Row{
422+
{"!"},
423+
},
424+
},
425+
{
426+
Query: "SELECT '!'::bpchar(1);",
427+
Expected: []sql.Row{
428+
{"!"},
429+
},
430+
},
431+
{
432+
Query: "SELECT '!'::bpchar(2);",
433+
Expected: []sql.Row{
434+
{"! "},
435+
},
436+
},
437+
},
438+
},
401439
{
402440
Name: "Character type",
403441
SetUpScript: []string{

0 commit comments

Comments
 (0)