-
Notifications
You must be signed in to change notification settings - Fork 966
Closed
Labels
Description
Version
Other
What happened?
A previously filed bug. Was found again while attempting to perform an implicit JOIN with mysql.
Using version v1.13.0
Relevant log output
panic: expected range var
goroutine 1 [running]:
github.com/kyleconroy/sqlc/internal/engine/dolphin.(*cc).convertUpdateStmt(0x10?, 0xc0001ecc60)
github.com/kyleconroy/sqlc/internal/engine/dolphin/convert.go:551 +0x5ad
github.com/kyleconroy/sqlc/internal/engine/dolphin.(*cc).convert(0xc000418600?, {0x5051910?, 0xc0001ecc60?})
github.com/kyleconroy/sqlc/internal/engine/dolphin/convert.go:1722 +0xb73
github.com/kyleconroy/sqlc/internal/engine/dolphin.(*Parser).Parse(0xc00019a820, {0x5046aa0?, 0xc00003dca0?})
github.com/kyleconroy/sqlc/internal/engine/dolphin/parse.go:63 +0x19d
github.com/kyleconroy/sqlc/internal/compiler.(*Compiler).parseQueries(0xc0004cc000, {0x50?, {0x50?, 0xe7?, {0x0?, 0x1?}}})
github.com/kyleconroy/sqlc/internal/compiler/compile.go:102 +0x3ad
github.com/kyleconroy/sqlc/internal/compiler.(*Compiler).ParseQueries(...)
github.com/kyleconroy/sqlc/internal/compiler/engine.go:49
github.com/kyleconroy/sqlc/internal/cmd.parse({_, _}, {_, _}, {_, _}, {_, _}, {{0xc0002934b6, 0x5}, ...}, ...)
github.com/kyleconroy/sqlc/internal/cmd/generate.go:262 +0x253
github.com/kyleconroy/sqlc/internal/cmd.Generate({0x504baa0, 0xc00019e008}, {0xc0?, 0x6b?}, {0xc000040004, 0x21}, {0x0?, 0x4c01500?}, {0x50469c0, 0xc00019a010})
github.com/kyleconroy/sqlc/internal/cmd/generate.go:183 +0x7b4
github.com/kyleconroy/sqlc/internal/cmd.glob..func3(0x5e32000, {0x4d52b07?, 0x0?, 0x0?})
github.com/kyleconroy/sqlc/internal/cmd/cmd.go:144 +0x194
github.com/spf13/cobra.(*Command).execute(0x5e32000, {0x5ea5678, 0x0, 0x0})
github.com/spf13/[email protected]/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc000370a00)
github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
github.com/spf13/[email protected]/command.go:895
github.com/kyleconroy/sqlc/internal/cmd.Do({0xc0001a8010, 0x1, 0x1}, {0x5046980?, 0xc00019a000}, {0x50469c0?, 0xc00019a008}, {0x50469c0?, 0xc00019a010})
github.com/kyleconroy/sqlc/internal/cmd/cmd.go:47 +0x4ba
main.main()
github.com/kyleconroy/sqlc/cmd/sqlc/main.go:10 +0x7aDatabase schema
CREATE TABLE authors (
name text NOT NULL,
deleted_at datetime NOT NULL,
created_at datetime NOT NULL,
updated_at datetime NOT NULL
);
CREATE TABLE books (
is_amazing tinyint(1) NOT NULL,
deleted_at datetime NOT NULL,
created_at datetime NOT NULL,
updated_at datetime NOT NULL
);SQL queries
-- name: DeleteAuthor :exec
UPDATE authors, books
SET
authors.deleted_at = now(),
authors.updated_at = now()
WHERE books.is_amazing = 1
AND authors.name = sqlc.arg(name);Configuration
{
"version": "1",
"packages": [
{
"path": "db",
"engine": "mysql",
"schema": "query.sql",
"queries": "query.sql"
}
]
}Playground URL
https://play.sqlc.dev/p/9fc9f9695357e74d7f9f4050bda23c51999cd7bb07380ff3615b69b6a4f8428c
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
blampe