0

I've finally put my finger on an intermittent error we receive when processing data. The error shows when we execute a stored procedure & reports "Column A cannot be null" but when we track down the record and run the procedure manually it works fine. I'm able to repeat this error using the following.

  1. Run the procedure using valid values, it succeeds
  2. Run the same procedure using an invalid value, it fails with "column A cannot be null"
  3. Re-run the same procedure using the same valid values from step 1, it fails with the same error
  4. open a new tab/session & re-run the same procedure from step 1, it now succeeds again.

I'm really scratching my head on this one & cant seem to find the correct documentation to help. We are using MySQL 5.7 on AWS RDS. It seems like the session is cashing the error and anytime the procedure is called it simply pulls the error from cash.

BilliD
  • 577
  • 2
  • 7
  • 17
  • It is *extremely* likely that the error is in your code. Unfortunately, we cannot see it, so you may want to share it. Making a blind guess: uninitialized variables (that keep a value from the previous run, but get resettet in a new session. That especially includes the use of `into`). – Solarflare Jan 23 '21 at 21:16
  • I agree we're making blind guesses since you haven't shown the code. My guess is that you're using a user-defined variable (the kind with the `@` sigil) where you should be using a local variable (the kind you `DECLARE`). In MySQL, these are different, and you should not mix them. – Bill Karwin Jan 24 '21 at 05:06

0 Answers0