Bug #121393 Trigger prevents GEOMETRY NOT NULL guard from working
Submitted: 29 Sep 8:03 Modified: 30 Sep 7:10
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:8.0.46, 8.4.11, 9.7.2, 26.07 OS:Any
Assigned to: CPU Architecture:Any

[29 Sep 8:03] Laurynas Biveinis
Description:
MTR:

CREATE TABLE t1 (id INT PRIMARY KEY, g GEOMETRY NOT NULL);
CREATE TRIGGER t1_insert BEFORE INSERT ON t1 FOR EACH ROW SET @x = 1;

# Succeeds even though should fail
INSERT IGNORE INTO t1 VALUES (1, NULL);
SELECT id, LENGTH(g) FROM t1;

DROP TRIGGER t1_insert;
TRUNCATE TABLE t1;

# Without the trigger, fails correctly 
--error ER_BAD_NULL_ERROR_NOT_IGNORED
INSERT IGNORE INTO t1 VALUES (1, NULL);

DROP TABLE t1;

How to repeat:
See above
[30 Sep 7:10] Chaithra Marsur Gopala Reddy
Hi Laurynas Biveinis,

Thank you for the test case. Verifies as described.