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
When inserting into a table that has a before-insert trigger with a DECLARE variable in its body the dolt server crashes.
My trigger:
CREATETRIGGERfoo BEFORE INSERT ON PartNumber
BEGIN
DECLARE newmax VARCHAR(255);
SELECT CONCAT('A', MAX(CAST(SUBSTRING(UniqueID, 2) AS UNSIGNED)) +1) INTO newmax FROM PartNumber;
SETNEW.UniqueId= newmax;
END;
A simpler version that produces the same crash:
CREATETRIGGERfoo BEFORE INSERT ON PartNumber
BEGIN
DECLARE newmax VARCHAR(255);
SET newmax ='FOO';
SETNEW.UniqueID= newmax;
END;
Hey @0x4261756D, the fix for this has been merged to dolt main.
DECLAREs should work just fine in triggers.
While fixing this issue, we discovered #7737 .
So, just don't call external stored procedures in your triggers, and it should be fine.
When inserting into a table that has a before-insert trigger with a
DECLARE
variable in its body the dolt server crashes.My trigger:
A simpler version that produces the same crash:
Crashlog:
The text was updated successfully, but these errors were encountered: