Comments - DECLARE HANDLER
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
In the example, I presume '23000' indicates a primary key violation. For good coding practice, it's best to avoid leaving "magic numbers" for readers to figure out on their own. Could you please at least leave a comment, so the example it more readable? DECLARE CONTINUE HANDLER FOR SQLSTATE '23000' --PK violation SET @x2 = 1; --I think this should be @x instead of @x2, no?