Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash by Function DAYNAME #7039

Closed
suyZhong opened this issue Nov 22, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2158
Closed

Crash by Function DAYNAME #7039

suyZhong opened this issue Nov 22, 2023 · 0 comments · Fixed by dolthub/go-mysql-server#2158
Labels
bug Something isn't working customer issue panic

Comments

@suyZhong
Copy link

The following test case crashed go-mysql-server.

CREATE TABLE t0(c2 INT, c3 INT, PRIMARY KEY(c2));
INSERT INTO t0(c2) VALUES (1);
INSERT INTO t0(c2) VALUES (2);

SELECT c2 FROM t0 WHERE c2 ORDER BY DAYNAME(c3) ASC;

Here's my error trace:

panic: interface conversion: interface {} is nil, not time.Time

goroutine 611 [running]:
github.com/dolthub/go-mysql-server/sql/expression/function.(*DayName).Eval(0x0?, 0x0?, {0xc0017aebe0?, 0xc000d52e88?, 0xc000baf800?})
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/expression/function/time.go:1198 +0x1e5
github.com/dolthub/go-mysql-server/sql/expression.(*Sorter).Less(0xc000fff810, 0x18?, 0x0?)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/expression/sort.go:48 +0x17e
sort.insertionSort({0x30362e0, 0xc000fff810}, 0x0, 0x2)
        /home/suyang/go/src/sort/zsortinterface.go:12 +0xa7
sort.stable({0x30362e0, 0xc000fff810}, 0x2)
        /home/suyang/go/src/sort/zsortinterface.go:343 +0x6a
sort.Stable({0x30362e0, 0xc000fff810})
        /home/suyang/go/src/sort/sort.go:229 +0x34
github.com/dolthub/go-mysql-server/sql/rowexec.(*sortIter).computeSortedRows(0xc000fff680, 0xc000df0d20)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/rowexec/rel_iters.go:1007 +0x248
github.com/dolthub/go-mysql-server/sql/rowexec.(*sortIter).Next(0xc000fff680, 0x58?)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/rowexec/rel_iters.go:961 +0x25
github.com/dolthub/go-mysql-server/sql/rowexec.(*projectIter).Next(0xc000d34120, 0x1?)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/rowexec/rel_iters.go:512 +0x29
github.com/dolthub/go-mysql-server/sql/rowexec.transactionCommittingIter.Next(...)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/rowexec/transaction_iters.go:78
github.com/dolthub/go-mysql-server/sql/plan.(*trackedRowIter).Next(0xc000bc75c0, 0x100000000?)
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/sql/plan/process.go:347 +0x24
github.com/dolthub/go-mysql-server/server.(*Handler).doQuery.func2()
        /home/suyang/go/pkg/mod/github.com/dolthub/[email protected]/server/handler.go:286 +0x125
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/suyang/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 554
        /home/suyang/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x96

I originally find this by building dolt from source version f400a12. It could also be reproduced in 1.26.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer issue panic
Projects
None yet
3 participants