BUG: before-insert trigger gets ignored while bulk-insert / import

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
michabbb
Posts: 217
Joined: Mon 21 Nov 2011 02:35
Location: DE
Contact:

BUG: before-insert trigger gets ignored while bulk-insert / import

Post by michabbb » Tue 27 Nov 2012 10:46

dear support,

today i noticed a "little" bug: i tried to insert a CSV file into a table with a date-field
that was declared as "NOT NULL" but a trigger exists (before insert: set field = NOW()).
a normal insert of course works, because the before-insert-trigger catches the call and sets the "not null field" to NOW().

the bulk insert via the import-funktion of dbforge forces me to enter a default-value
and even if i insert one, the import function still gets me an error that "no" default is set, even i set one, that´s confusing.

if a before insert trigger exists for a "not null field", it would be perfect to check this so the import function do not force me to insert a not needed value.

regards,
micha

alexa

Re: BUG: before-insert trigger gets ignored while bulk-insert / import

Post by alexa » Tue 27 Nov 2012 16:06

Could you please provide us the following information:

1. CREATE TABLE statement (right-click the object in Database Explorer and select 'Generate Script As -> CREATE' from the popup menu).

2. Sample .csv file to reproduce the issue.

3. CREATE TRIGGER statement (right-click the object in Database Explorer and select 'Generate Script As -> CREATE' from the popup menu).
a normal insert of course works,
We were not able to reproduce this. Could you please provide us such query?
the bulk insert via the import-funktion of dbforge forces me to enter a default-value and even if i insert one, the import function still gets me an error that "no" default is set, even i set one, that´s confusing.
Could you please clarify where you are entering a default value?

michabbb
Posts: 217
Joined: Mon 21 Nov 2011 02:35
Location: DE
Contact:

Re: BUG: before-insert trigger gets ignored while bulk-insert / import

Post by michabbb » Tue 04 Dec 2012 12:11

i will, sorry for late answer... takes me some time to get all the stuff, next i will send it to you with my post, sorry

Post Reply