Skip to content

Commit 7e9edfa

Browse files
committed
Merge branch 'nicktobey-0159e964' into nicktobey/vector2
2 parents 02dbcd3 + c6cc061 commit 7e9edfa

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

enginetest/queries/script_queries.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11687,6 +11687,33 @@ select * from t1 except (
1168711687
},
1168811688
},
1168911689
},
11690+
{
11691+
Name: "aggregate function with match",
11692+
Dialect: "mysql",
11693+
SetUpScript: []string{
11694+
"CREATE TABLE test (pk INT PRIMARY KEY, doc TEXT, FULLTEXT idx (doc));",
11695+
"INSERT INTO test VALUES (2, 'g hhhh aaaab ooooo aaaa'), (1, 'bbbb ff cccc ddd eee'), (4, 'AAAA aaaa aaaac aaaa Aaaa aaaa'), (3, 'aaaA ff j kkkk llllllll');",
11696+
},
11697+
Assertions: []ScriptTestAssertion{
11698+
{
11699+
// https://github.com/dolthub/dolt/issues/9761
11700+
Skip: true,
11701+
Query: "SELECT pk, count(pk), MATCH(doc) AGAINST('aaaa') AS relevancy FROM test ORDER BY relevancy DESC;",
11702+
// TODO: replace with corresponding error once validation for aggregated query without group by
11703+
// has been implemented https://github.com/dolthub/dolt/issues/9761
11704+
ExpectedErr: nil,
11705+
},
11706+
{
11707+
Query: "SET SESSION sql_mode = REPLACE(@@SESSION.sql_mode, 'ONLY_FULL_GROUP_BY', '');",
11708+
Expected: []sql.Row{{types.NewOkResult(0)}},
11709+
},
11710+
11711+
{
11712+
Query: "SELECT pk, count(pk), MATCH(doc) AGAINST('aaaa') AS relevancy FROM test ORDER BY relevancy DESC;",
11713+
Expected: []sql.Row{{1, 4, float64(0)}},
11714+
},
11715+
},
11716+
},
1169011717
}
1169111718

1169211719
var SpatialScriptTests = []ScriptTest{

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require (
66
github.com/dolthub/go-icu-regex v0.0.0-20250820171420-f2b78f56ce9f
77
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
88
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
9-
github.com/dolthub/vitess v0.0.0-20250829222523-5a45c06a7f3e
10-
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
9+
github.com/dolthub/vitess v0.0.0-20250902225707-0159e964d73d
10+
github.com/go-sql-driver/mysql v1.9.3
1111
github.com/gocraft/dbr/v2 v2.7.2
1212
github.com/google/uuid v1.3.0
1313
github.com/hashicorp/golang-lru v0.5.4
@@ -42,4 +42,4 @@ require (
4242
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
4343
)
4444

45-
go 1.24.0
45+
go 1.24.6

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE
1818
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI=
1919
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE=
2020
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
21-
github.com/dolthub/vitess v0.0.0-20250829222523-5a45c06a7f3e h1:foI0Zp8ydVabVyrJm30DbAxmHqjiA2rrQG+ZpahRQeU=
22-
github.com/dolthub/vitess v0.0.0-20250829222523-5a45c06a7f3e/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
21+
github.com/dolthub/vitess v0.0.0-20250902225707-0159e964d73d h1:oTWJxjzRmuHKuICUunCUwNuonubkXwOqPa5hXX3dXBo=
22+
github.com/dolthub/vitess v0.0.0-20250902225707-0159e964d73d/go.mod h1:tV3BrIVyDWVkkYy8dKt2o6hjJ89cHb5opY5FpCyhncQ=
2323
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
2424
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
2525
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
26-
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d h1:QQP1nE4qh5aHTGvI1LgOFxZYVxYoGeMfbNHikogPyoA=
27-
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
26+
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
27+
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
2828
github.com/gocraft/dbr/v2 v2.7.2 h1:ccUxMuz6RdZvD7VPhMRRMSS/ECF3gytPhPtcavjktHk=
2929
github.com/gocraft/dbr/v2 v2.7.2/go.mod h1:5bCqyIXO5fYn3jEp/L06QF4K1siFdhxChMjdNu6YJrg=
3030
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=

sql/planbuilder/scalar.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,6 @@ func (b *Builder) ConvertVal(v *ast.SQLVal) sql.Expression {
10151015
// filter, since we only need to load the tables once. All steps after this
10161016
// one can assume that the expression has been fully resolved and is valid.
10171017
func (b *Builder) buildMatchAgainst(inScope *scope, v *ast.MatchExpr) *expression.MatchAgainst {
1018-
// TODO: implement proper scope support and remove this check
1019-
if (inScope.groupBy != nil && inScope.groupBy.hasAggs()) || inScope.windowFuncs != nil {
1020-
b.handleErr(fmt.Errorf("aggregate and window functions are not yet supported alongside MATCH expressions"))
1021-
}
10221018
rts := getTablesByName(inScope.node)
10231019
var rt *plan.ResolvedTable
10241020
var matchTable string

0 commit comments

Comments
 (0)