You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEitems (
id INTPRIMARY KEY AUTO_INCREMENT,
item TEXTNOT NULL
);
CREATE PROCEDURE add_item (IN txt TEXT) MODIFIES SQL DATA
INSERT INTO items (item) VALUES (txt);
CALL add_item('A test item');
Dolt throws an error:
error on line 6 for query
CREATE PROCEDURE add_item (IN txt TEXT) MODIFIES SQL DATA
INSERT INTO items (item) VALUES (txt): column "txt" could not be found in any table in scope
Error processing batch
I didn't get to test this on MySQL, but the documentation examples does not have any special syntax for accessing procedure parameters.
Did I miss something or is this a dolt bug?
The text was updated successfully, but these errors were encountered:
cipharius
changed the title
Can not user stored procedure with arguments
Can not use stored procedure with arguments
Mar 30, 2021
This is definitely a Dolt bug! We do parameter name resolution for stored procedures in an analysis step that's independent from column name resolution. It looks like we're accidentally not looking into the VALUES of INSERT and REPLACE during the param name resolution. I'll get it fixed by the next release!
Given the example setup:
Dolt throws an error:
I didn't get to test this on MySQL, but the documentation examples does not have any special syntax for accessing procedure parameters.
Did I miss something or is this a dolt bug?
The text was updated successfully, but these errors were encountered: