Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Duplicate
-
10.11.11
-
None
-
Debian 12
Description
INSERT SELECT not working with triggers.
To recreate the problem:
create table a (id bigint not null primary key, name varchar(30)) |
insert into parasql_pk_counters values ('a','id',5000) -- our way of managing simple counter - code unchanged for years |
|
insert into a (id, name)
|
select parasql_next_val('a'), 'dog' |
from Customers -- just a table with some records
|
limit 10 |
|
select * from a
|
The above code works as expected when table a does not have a BEFORE insert nor BEFORE update trigger. Adding either trigger (even if it does nothing) results in:
ERROR: (conn=50) Column 'id' cannot be null
Prior to v10.11.11 everything worked as expected for years.
After updating from 10.11.10 to v10.11.11 the problem is as follows:
If table a has no triggers - works as expected
Adding empty triggers (with just a comment):
BEFORE insert = ERROR: (conn=50) Column 'id' cannot be null
BEFORE update = ERROR: (conn=80) Column 'id' cannot be null
AFTER insert = works as expected
AFTER update = works as expected
This seems similar to MDEV-36026 - Problem with INSERT SELECT on NOT NULL columns, but I am not sure so submitting as new bug as both BEFORE insert and update cause the problem.
Attachments
Issue Links
- duplicates
-
MDEV-36026 Problem with INSERT SELECT on NOT NULL columns while having BEFORE UPDATE trigger
-
- Closed
-
Thanks for the report. Yes, it is the same issue.