MySQL Forums
Forum List  »  Stored Procedures

Re: ROW_COUNT() results in NULL from stored procedure
Posted by: Rick James
Date: June 01, 2016 11:49AM

MAX(evID)+1 -- Will this Sproc be run by multiple connections at the 'same' time? If so, you probably have a bug in computing that id. Or maybe you have a BEGIN...COMMIT around the call to the sproc? Even so, you would need FOR UPDATE.

Better yet, use AUTO_INCREMENT instead of simulating it.

Another bug... SET @sql = CONCAT(@sql, "'",...,"',"); fails to escape the parameters. If any has "'" in it, you will get syntax errors. Also it is an open invitation to hackers to mess with your system.

The whole sproc is a lot of work to replace a single simple INSERT with AUTO_INCREMENT. Get rid of the Stored Procedure.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: ROW_COUNT() results in NULL from stored procedure
918
June 01, 2016 11:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.