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
dolt init
dolt sql -q "create table t (pk int primary key, col1 int);"
dolt sql-server
Separately:
mysql> DELIMITER //
-> create procedure test_proc()
-> begin
-> select col1 from t;
-> end //
Query OK, 0 rows affected (0.02 sec)
mysql> call dolt_commit('-Am', 'add a procedure');
+----------------------------------+
| hash |
+----------------------------------+
| kv143gr8danmjq38889e6p28v7dpml41 |
+----------------------------------+
1 row in set (0.01 sec)
mysql> alter table t drop col1;
Query OK, 0 rows affected (0.01 sec)
mysql> call dolt_checkout('-b', 'new', 'head^');
ERROR 1105 (HY000): column "col1" could not be found in any table in scope
Dropping the procedure resolves the issue:
mysql> drop procedure test_proc;
Query OK, 0 rows affected (0.01 sec)
mysql> call dolt_checkout('-b', 'new', 'head^');
+--------+
| status |
+--------+
| 0 |
+--------+
1 row in set (0.01 sec)
The text was updated successfully, but these errors were encountered:
@PavelSafronov – this could be a good next issue to pick up.
The loadStoredProcedures function in stored_procedures.go has the code involved here. Currently, if we hit any error while loading stored procedures, then we give up and don't load any. Instead, we could log any errors to the server log and/or add a warning in the session's context and just load whatever stored procedures we can. Alternatively, if we can load a stored procedure, but not fully validate it, that could be a better experience. That way, customers could still see their (broken) stored procedure and when they try to call it, they'd get the appropriate error.
dolt init dolt sql -q "create table t (pk int primary key, col1 int);" dolt sql-server
Separately:
Dropping the procedure resolves the issue:
The text was updated successfully, but these errors were encountered: