Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
cf24037
[no-release-notes] .github/workflows/test.yml: Prepare for go-icu-reg…
reltuk Sep 2, 2025
db9a8e1
Refactorings to support index scans for pg catalog tables
zachmu Sep 2, 2025
1ef73a8
Moved ExtendedType into the sql package
zachmu Sep 3, 2025
84e24eb
Bug fixes
zachmu Sep 4, 2025
b2ba67c
Added key type to other index builder interfaces
zachmu Sep 4, 2025
4bfc225
Support for NOT
zachmu Sep 4, 2025
e806822
Merge main
zachmu Sep 4, 2025
561fd82
add unwrapany calls for dolt textstorage
elianddb Sep 5, 2025
7f6dddf
Bug fix for type conversion in index building
zachmu Sep 5, 2025
0883bbc
type conversion for in set
zachmu Sep 5, 2025
3298c59
[ga-format-pr] Run ./format_repo.sh to fix formatting
zachmu Sep 5, 2025
d9d27fb
fixed test
zachmu Sep 5, 2025
015f572
[ga-format-pr] Run ./format_repo.sh to fix formatting
zachmu Sep 5, 2025
08d813d
Add added column to CreateConstraint scope
angelamayxie Sep 5, 2025
1ed44af
add more tests
angelamayxie Sep 5, 2025
c24cf80
update comment
angelamayxie Sep 5, 2025
b618447
add other funcs
elianddb Sep 5, 2025
85527db
Merge pull request #3199 from dolthub/angela/alter_table
angelamayxie Sep 5, 2025
58e535d
mv unwrap to funcs
elianddb Sep 5, 2025
a1bcdb1
add miss for trim
elianddb Sep 6, 2025
2385722
add miss unwraps
elianddb Sep 6, 2025
56d48aa
do not push down filters for full outer joins
angelamayxie Sep 5, 2025
c0a961f
add dialect
elianddb Sep 6, 2025
e787e8e
Merge pull request #3197 from dolthub/elian/9794
elianddb Sep 6, 2025
447dc8f
add fix for 9807
elianddb Sep 8, 2025
3f18f52
add simple tests
elianddb Sep 8, 2025
1c0d9a7
[ga-format-pr] Run ./format_repo.sh to fix formatting
elianddb Sep 8, 2025
5d96f23
mv tests to join_op_tests
elianddb Sep 8, 2025
db805db
Merge pull request #3201 from dolthub/elian/9807
elianddb Sep 8, 2025
6f24802
PR feedback
zachmu Sep 8, 2025
311f976
Merge branch 'zachmu/index-scans-pgcatalog' of github.com:dolthub/go-…
zachmu Sep 8, 2025
7db5799
Merge pull request #3190 from dolthub/zachmu/index-scans-pgcatalog
zachmu Sep 8, 2025
c8d2027
implement double truncation and find correct hash comparison type (#3…
jycor Sep 9, 2025
cacc220
allow caching subqueries
nicktobey Sep 9, 2025
521c5d9
Update plan tests.
nicktobey Sep 9, 2025
a17d15a
fix equality check in buildSingleLookupPlan
Sep 9, 2025
b624244
Simplify logic for `cacheSubqueryAliasesInJoins`. This seems to resul…
nicktobey Sep 9, 2025
ded0f64
fix check
Sep 9, 2025
0a15664
fix check
Sep 9, 2025
23a6eb7
Revert
Sep 9, 2025
dbb6a69
Merge pull request #3206 from dolthub/james/join
nicktobey Sep 9, 2025
5fb8788
Merge pull request #3205 from dolthub/nicktobey/join_2
nicktobey Sep 9, 2025
2b90e9b
fix ret type
elianddb Sep 10, 2025
dd14069
amend query plans
elianddb Sep 10, 2025
4fa6628
[ga-format-pr] Run ./format_repo.sh to fix formatting
elianddb Sep 10, 2025
991ec5f
add tests
angelamayxie Sep 10, 2025
61ec6b4
convert arg to string before calculating bit_length
angelamayxie Sep 10, 2025
95d7b97
update tests
angelamayxie Sep 10, 2025
d93cc8b
Merge pull request #3208 from dolthub/elian/9817
elianddb Sep 10, 2025
de207f5
rename left and right to primary and secondary
angelamayxie Sep 10, 2025
f994321
copy parent row when building row
angelamayxie Sep 10, 2025
a77c705
Merge pull request #3209 from dolthub/angela/bitlength
angelamayxie Sep 10, 2025
9fdcaeb
add test
angelamayxie Sep 10, 2025
731c9da
fix typo
angelamayxie Sep 10, 2025
248b1e8
Merge pull request #3210 from dolthub/angela/lateraljoin
angelamayxie Sep 10, 2025
1839a3e
update exists iter
angelamayxie Sep 11, 2025
34391f4
Merge pull request #3185 from dolthub/aaron/prepare-icu-dependency
reltuk Sep 11, 2025
ffc890c
add test
angelamayxie Sep 11, 2025
8720cc4
add tests
angelamayxie Sep 11, 2025
133fc3d
Merge pull request #3211 from dolthub/angela/exists_iter
angelamayxie Sep 11, 2025
20923af
Wrap right side in distinct when converting semijoins to inner joins
angelamayxie Sep 11, 2025
f0850da
rename buildDistinctWrapper to wrapInDistinct
angelamayxie Sep 11, 2025
c3a64fe
Merge pull request #3212 from dolthub/angela/semi_merge
angelamayxie Sep 11, 2025
9388f03
Copy parent row in fullJoinIter
angelamayxie Sep 12, 2025
6164474
add test
angelamayxie Sep 12, 2025
0ca241f
Merge pull request #3213 from dolthub/angela/fullouterjoin
angelamayxie Sep 12, 2025
b763e43
add test w warn and cast fix
elianddb Sep 9, 2025
576a3a7
add warning tests for dolthub/dolt#9834
elianddb Sep 12, 2025
17c53ae
add 9733 and 9812 tests
elianddb Sep 12, 2025
e27a016
rm warning count
elianddb Sep 12, 2025
ca5ff6f
trim string before converting to bool
angelamayxie Sep 12, 2025
38d8d4f
add tests for warnings and order pk
elianddb Sep 12, 2025
9fc0d7e
amend tests
elianddb Sep 12, 2025
99f6fd3
vitess bump
angelamayxie Sep 12, 2025
24af042
Revert "vitess bump"
angelamayxie Sep 12, 2025
64bd0a1
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Sep 12, 2025
1031166
fix table name in test
elianddb Sep 12, 2025
8efd2f7
[ga-format-pr] Run ./format_repo.sh to fix formatting
elianddb Sep 12, 2025
1b9f80d
Merge pull request #3204 from dolthub/elian/9812
elianddb Sep 12, 2025
dce5acf
remove cyclical dependency
angelamayxie Sep 15, 2025
9b34677
fix conflict
angelamayxie Sep 15, 2025
7e8c61a
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Sep 15, 2025
823e0b1
fix package for NumericCutSet
angelamayxie Sep 15, 2025
0f2bd97
remove duplicate function
angelamayxie Sep 15, 2025
bd69509
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Sep 15, 2025
d7b30c2
Merge branch 'main' of https://github.com/dolthub/go-mysql-server int…
angelamayxie Sep 15, 2025
f63503c
test for warnings
angelamayxie Sep 15, 2025
798a488
merge conflict
angelamayxie Sep 15, 2025
44cf13c
[ga-format-pr] Run ./format_repo.sh to fix formatting
angelamayxie Sep 15, 2025
3583a81
add mysql dialect tag
angelamayxie Sep 15, 2025
fbc08af
updated TODOs
angelamayxie Sep 15, 2025
03b6054
Merge pull request #3215 from dolthub/angela/casting
angelamayxie Sep 15, 2025
63a1648
[ga-bump-dep] Bump dependency in GMS by angelamayxie
angelamayxie Sep 15, 2025
545a703
Merge branch 'angela/pipes_as_concat' into angelamayxie-753c4480
angelamayxie Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,31 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install ICU4C (MacOS)
if: ${{ matrix.platform == 'macos-latest' }}
run: |
dir=$(brew --cellar icu4c)
dir="$dir"/$(ls "$dir")
echo CGO_CPPFLAGS=-I$dir/include >> $GITHUB_ENV
echo CGO_LDFLAGS=-L$dir/lib >> $GITHUB_ENV
- name: Install ICU4C (Windows)
if: ${{ matrix.platform == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
path-type: inherit
msystem: UCRT64
pacboy: icu:p toolchain:p pkg-config:p
- name: Test
if: ${{ matrix.platform != 'ubuntu-latest' }}
if: ${{ matrix.platform == 'macos-latest' }}
run: go test ./...
env:
CI_TEST: "true"
- name: Test
if: ${{ matrix.platform == 'windows-latest' }}
shell: msys2 {0}
run: go.exe test ./...
env:
CI_TEST: "true"
- name: Test
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: go test -race ./...
Expand Down
97 changes: 96 additions & 1 deletion enginetest/join_op_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,61 @@ var EngineOnlyJoinOpTests = []joinOpTest{
}

var DefaultJoinOpTests = []joinOpTest{
{
// https://github.com/dolthub/dolt/issues/9807
name: "FULL OUTER JOIN fails with empty subquery",
setup: [][]string{
{
"CREATE TABLE t(c BOOLEAN);",
"INSERT INTO t VALUES (FALSE);",
},
},
tests: []JoinOpTests{
{
Query: "SELECT * FROM ( SELECT c FROM t WHERE c ) sub1 FULL OUTER JOIN ( SELECT 1 AS c ) sub2 ON 1=1;",
Expected: []sql.Row{
{nil, 1},
},
},
},
},
{
// https://github.com/dolthub/dolt/issues/9807
name: "FULL OUTER JOIN with empty tables",
setup: [][]string{
{
"CREATE TABLE t1 (i INT);",
"CREATE TABLE t2 (j INT);",
"INSERT INTO t2 VALUES (1);",
},
},
tests: []JoinOpTests{
{
Query: "SELECT i, j FROM t1 FULL OUTER JOIN t2 ON 1=1;",
Expected: []sql.Row{
{nil, 1},
},
},
{
Query: "SELECT j, i FROM t2 FULL OUTER JOIN t1 ON 1=1;",
Expected: []sql.Row{
{1, nil},
},
},
{
Query: "SELECT i, j FROM t1 FULL OUTER JOIN t2 ON 1=0;",
Expected: []sql.Row{
{nil, 1},
},
},
{
Query: "SELECT j, i FROM t2 FULL OUTER JOIN t1 ON 1=0;",
Expected: []sql.Row{
{1, nil},
},
},
},
},
{
name: "bug where transitive join edge drops filters",
setup: [][]string{
Expand Down Expand Up @@ -1922,15 +1977,55 @@ SELECT SUM(x) FROM xy WHERE x IN (
},
},
{
name: "where not exists",
name: "where exists and where not exists",
setup: [][]string{
setup.XyData[0],
{
"create table t(c varchar(500))",
"insert into t values ('a'),('a')",
"create table u(c0 int, c1 int, primary key(c0, c1))",
"insert into u values (1, 1),(2,2),(2,3)",
},
},
tests: []JoinOpTests{
{
Query: `select * from xy_hasnull x where not exists(select 1 from ab_hasnull a where a.b = x.y)`,
Expected: []sql.Row{{1, 0}, {3, nil}},
},
{
Query: "select x from xy where exists (select 1 from ab where ab.b = -1)",
Expected: []sql.Row{},
},
{
Query: "select x from xy where exists (select 1 from ab where ab.b = xy.y)",
Expected: []sql.Row{{0}, {2}},
},
{
Query: "select x from xy where not exists (select 1 from ab where ab.b = xy.y)",
Expected: []sql.Row{{1}, {3}},
},
{
Query: "select x from xy_hasnull where not exists(select 1 from ab_hasnull where ab_hasnull.b <> xy_hasnull.y)",
Expected: []sql.Row{{3}},
},
{
Query: "select x from xy_hasnull_idx where exists(select 1 from rs where rs.s = xy_hasnull_idx.y)",
Expected: []sql.Row{{1}},
},
{
Query: "select x from xy_hasnull_idx where not exists(select 1 from rs where rs.s = xy_hasnull_idx.y)",
Expected: []sql.Row{{2}, {0}, {3}},
},
{
// https://github.com/dolthub/dolt/issues/9828
Query: "with v as (select 'a' as c where false) select null from t where not exists (select 1 from v where v.c <> t.c);",
Expected: []sql.Row{{nil}, {nil}},
},
{
// https://github.com/dolthub/dolt/issues/9797
Query: "select * from u where exists (select 1 from u as x where x.c0 = u.c0)",
Expected: []sql.Row{{1, 1}, {2, 2}, {2, 3}},
},
},
},
{
Expand Down
60 changes: 46 additions & 14 deletions enginetest/join_planning_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,34 @@ join uv d on d.u = c.x`,
},
},
},
{
name: "single look up plan does not drop complex equality filters",
setup: []string{
"create table t1 (i int primary key);",
"create table t2 (j int);",
"create table t3 (k int);",
"insert into t1 values (1), (2);",
"insert into t2 values (1), (2);",
"insert into t3 values (3);",
},
tests: []JoinPlanTest{
{
q: "select * from t1 cross join t2 join (select * from t3) v3 on v3.k = t2.j;",
types: []plan.JoinType{plan.JoinTypeHash, plan.JoinTypeCross},
exp: []sql.Row{},
},
{
q: "select * from t1 cross join t2 join (select * from t3) v3 on v3.k >= t2.j order by i, j, k;",
types: []plan.JoinType{plan.JoinTypeInner, plan.JoinTypeCross},
exp: []sql.Row{
{1, 1, 3},
{1, 2, 3},
{2, 1, 3},
{2, 2, 3},
},
},
},
},
}

func TestJoinPlanning(t *testing.T, harness Harness) {
Expand Down Expand Up @@ -1915,24 +1943,28 @@ func evalIndexTest(t *testing.T, harness Harness, e QueryEngine, q string, index
})
}

func evalJoinCorrectness(t *testing.T, harness Harness, e QueryEngine, name, q string, exp []sql.Row, skipOld bool) {
t.Run(name, func(t *testing.T) {
ctx := NewContext(harness)
ctx = ctx.WithQuery(q)
func evalJoinCorrectness(t *testing.T, harness Harness, e QueryEngine, name, q string, exp []sql.Row, skip bool) {
if skip {
t.Skip()
} else {
t.Run(name, func(t *testing.T) {
ctx := NewContext(harness)
ctx = ctx.WithQuery(q)

sch, iter, _, err := e.QueryWithBindings(ctx, q, nil, nil, nil)
require.NoError(t, err, "Unexpected error for query %s: %s", q, err)
sch, iter, _, err := e.QueryWithBindings(ctx, q, nil, nil, nil)
require.NoError(t, err, "Unexpected error for query %s: %s", q, err)

rows, err := sql.RowIterToRows(ctx, iter)
require.NoError(t, err, "Unexpected error for query %s: %s", q, err)
rows, err := sql.RowIterToRows(ctx, iter)
require.NoError(t, err, "Unexpected error for query %s: %s", q, err)

if exp != nil {
CheckResults(ctx, t, harness, exp, nil, sch, rows, q, e)
}
if exp != nil {
CheckResults(ctx, t, harness, exp, nil, sch, rows, q, e)
}

require.Equal(t, 0, ctx.Memory.NumCaches())
validateEngine(t, ctx, harness, e)
})
require.Equal(t, 0, ctx.Memory.NumCaches())
validateEngine(t, ctx, harness, e)
})
}
}

func collectJoinTypes(n sql.Node) []plan.JoinType {
Expand Down
22 changes: 22 additions & 0 deletions enginetest/queries/alter_table_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,28 @@ var AddColumnScripts = []ScriptTest{
},
},
},
{
Name: "add column with check constraint",
SetUpScript: []string{
"create table t (i int primary key, j int)",
"insert into t values (1, 2)",
},
Assertions: []ScriptTestAssertion{
{
Query: "alter table t add column k int check (k > 0)",
// TODO: this should be 1 rowsAffected https://github.com/dolthub/dolt/issues/9606
Expected: []sql.Row{{types.NewOkResult(0)}},
},
{
Query: "alter table t add column l int check (l is not null)",
ExpectedErr: sql.ErrCheckConstraintViolated,
},
{
Query: "alter table t add column m int default 0 check (m != 0)",
ExpectedErr: sql.ErrCheckConstraintViolated,
},
},
},
{
Name: "error cases",
Assertions: []ScriptTestAssertion{
Expand Down
19 changes: 18 additions & 1 deletion enginetest/queries/function_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,26 @@ var FunctionQueryTests = []QueryTest{
{
Query: "SELECT BIT_LENGTH(i) from mytable order by i limit 1",
Expected: []sql.Row{
{64},
{8},
},
},
{
// https://github.com/dolthub/dolt/issues/9818
Query: "select bit_length(10)",
Expected: []sql.Row{{16}},
},
{
Query: "select bit_length(now())",
Expected: []sql.Row{{152}},
},
{
Query: "select bit_length(-10)",
Expected: []sql.Row{{24}},
},
{
Query: "select bit_length(true)",
Expected: []sql.Row{{8}},
},
{
Query: "select date_format(datetime_col, '%D') from datetime_table order by 1",
Expected: []sql.Row{
Expand Down
Loading
Loading