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
Triggers can bypass column data type validation when updating a row
Expected behavior
Triggers should be restricted by a column's data type when performing updates
Steps to reproduce
Setup:
CREATETABLEIF NOT EXISTS test (
id TEXTPRIMARY KEYNOT NULL,
val INTEGERNOT NULL
);
CREATETRIGGERupdate_on_change AFTER
UPDATE OF val ON test FOR EACH ROW
BEGINUPDATE test
SET
val ='not_an_integer'WHERE
id =NEW.id;
END;
INSERT INTO test (id, val) VALUES ('test', 1);
Trigger the trigger:
UPDATE test SET val=2WHERE id='test'
the val column of the test row (val is defined as an Integer) now contains Text
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered:
Which Cloudflare product(s) does this pertain to?
D1
What version(s) of the tool(s) are you using?
3.53.1 [Wrangler]
What version of Node are you using?
No response
What operating system and version are you using?
Mac Ventura 13.5.2
Describe the Bug
Observed behavior
Triggers can bypass column data type validation when updating a row
Expected behavior
Triggers should be restricted by a column's data type when performing updates
Steps to reproduce
val
column of thetest
row (val
is defined as an Integer) now contains TextPlease provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: