Skip to content

Nil pointer dereference for create user 'foo'@'%' identified by '' #4085

@fulghum

Description

@fulghum

When specifying an empty string for a user password, Dolt panics with a nil pointer dereference:

2022-08-15T12:20:32-07:00 ERROR [conn %!d(<nil>)] mysql_server caught panic:
runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:260 (0x102779e57)
runtime/signal_unix.go:835 (0x102792c97)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/plan/create_user.go:74 (0x103564d40)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/resolve_variables.go:35 (0x10377834b)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/transform/node.go:304 (0x1034a02c3)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/resolve_variables.go:34 (0x103778267)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/batch.go:119 (0x10372d417)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/batch.go:65 (0x10372cee7)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/batch.go:56 (0x103721eff)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/analyzer.go:524 (0x103721cd0)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/sql/analyzer/analyzer.go:379 (0x103796777)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/engine.go:329 (0x103796720)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/engine.go:191 (0x103795b73)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/server/handler.go:343 (0x1038103f3)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/server/handler.go:607 (0x103812627)
github.com/dolthub/go-mysql-server@v0.12.1-0.20220811192639-c0b3f448ca13/server/handler.go:161 (0x10380e95b)
github.com/dolthub/vitess@v0.0.0-20220811180048-dec9dd483049/go/mysql/conn.go:1286 (0x102ece19f)
github.com/dolthub/vitess@v0.0.0-20220811180048-dec9dd483049/go/mysql/conn.go:930 (0x102ecb7df)
github.com/dolthub/vitess@v0.0.0-20220811180048-dec9dd483049/go/mysql/server.go:481 (0x102ee1b63)
runtime/asm_arm64.s:1165 (0x1027af993)

MySQL handles this gracefully and creates the user.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions