I’ve got a simple stored procedure called SPName, SPName has 1 input (FullName) and 2 outputs (FirstName and LastName), its job is just to split a name up into first and last name using the space as a delimiter. Until last week it worked fine but now all it does no matter what input is, is to output the last successful output from last week.
E.g. I used to get (and still do on my testDB)
call SPName(@FirstName, @LastName, ‘Barry White’);
Query OK, 1 row affected (0.02ms)
Select @FirstName, @LastName;
+————|———–+
| @FirstName | @LastName |
+————|———–+
| Barry | White |
+————|———–+
Now if I try a different name I still get Barry White and SPName returns 0 rows rather than 1 in the output.
call SPName(@FirstName, @LastName, ‘Michael Jackson’);
Query OK, 0 rows affected (0.02ms)
Select @FirstName, @LastName;
+————|———–+
| @FirstName | @LastName |
+————|———–+
| Barry | White |
+————|———–+
Where are the input/output variables stored (MySQL 5.6)? I’m convinced that wherever MySQL stores them is locked somehow so that no matter what I put in the input it can’t update them. Or what else can cause a stored procedure from failing to update the output variable (outside of the stored procedure itself as the same stored procedure works perfectly fine in my test DB and worked perfectly fine on live until last week so I know it’s not the stored proc itself).
I expect that whatever I input into the Fullname variable to be split into 2 variables, as I say the stored proc is fine, the DB itself I think is doing something funky to stop the output variable from changing.
MySQL is wrong is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.