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

CREATE PROCEDURE panics on different queries that mysql allows #3241

Closed
jennifersp opened this issue Apr 15, 2022 · 1 comment
Closed

CREATE PROCEDURE panics on different queries that mysql allows #3241

jennifersp opened this issue Apr 15, 2022 · 1 comment
Assignees
Labels
dumps Deals with dumping to and from mysql

Comments

@jennifersp
Copy link
Contributor

create procedure statement panic on multiple situations (valid and invalid procedure queries) where mysql allows but gives error when calling invalid procedures.
This is valid query:

complex> CREATE PROCEDURE `film_in_stock2` (IN p_store_id INT) SELECT COUNT(*) FROM inventory  WHERE store_id = p_store_id;
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1d451dc]

goroutine 1 [running]:
github.com/dolthub/go-mysql-server/sql/expression.(*ProcedureParamReference).Get(0x0, {0xc000ac2420?, 0xc00054ff40?})
	/Users/jenniferpurevsuren/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.11.1-0.20220414185653-a3dbb75c3de8/sql/expression/procedureparam.go:54 +0x3c
github.com/dolthub/go-mysql-server/sql/expression.(*ProcedureParam).Eval(0x2c0d478?, 0xc00054ff40?, {0x4b00501?, 0xc000134f00?, 0xc0006f8488?})

invalid but allowed on mysql:

complex> CREATE PROCEDURE `film_in_stock`(OUT p_film_count INT) READS SQL DATA  SELECT COUNT(*) FROM inventory WHERE film_id = p_film_id AND store_id = p_store_id AND inventory_in_stock(inventory_id); 
panic: unresolved function is a placeholder node, but Type was called

goroutine 1 [running]:
github.com/dolthub/go-mysql-server/sql/expression.(*UnresolvedFunction).Type(0xc000066500)
	/Users/jenniferpurevsuren/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.11.1-0.20220414185653-a3dbb75c3de8/sql/expression/unresolved.go:260 +0x27
github.com/dolthub/go-mysql-server/sql/analyzer.fds({0x2c0d6a8?, 0xc0000b7580?})
	/Users/jenniferpurevsuren/go/pkg/mod/github.com/dolthub/go-mysql-server@v0.11.1-0.20220414185653-a3dbb75c3de8/sql/analyzer/validation_rules.go:846 +0x52
github.com/dolthub/go-mysql-server/sql/analyzer.logicalSem({{0x2c0cb18?, 0xc000c00280?}, {0x2c0d6a8?, 0xc0000b7580?}})
@jennifersp jennifersp added the dumps Deals with dumping to and from mysql label Apr 15, 2022
@jennifersp jennifersp self-assigned this Apr 25, 2022
@jennifersp
Copy link
Contributor Author

Panics are fixed in dolthub/go-mysql-server#981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dumps Deals with dumping to and from mysql
Projects
None yet
Development

No branches or pull requests

1 participant