Description:
Situation 1:
passing last insert id value to udf using trigger fails. No value passed.
Situation 2:
i have also some weird problem with long arguments using udf with the same situation (using trigger and call udf with dozen of arguments) some of the argument are empty or populated with some binary. This problem happened only on my 9th argument (args->args[8]).
I have 11 args all together :
args->args[0] until args->[7] have correct values
args->args[8] empty value
args->args[9] until args->[10] have correct values
How to repeat:
delimiter ||
create trigger dbsync_trigger AFTER INSERT ON data_table
FOR EACH ROW
BEGIN
SET @LASTID = LAST_INSERT_ID();
INSERT INTO dbsync_journal SET dbsync_id='', username=NEW.username,
dbsync_status=dbsyncinsert(@LASTID, NEW.username, NEW.data1, NEW.data2, NEW.data3, NEW.data4, NEW.data5, NEW.data6, NEW.data8, NEW.data9, NEW.data10);
END
||
delimiter ;
@LASTID dont have any value
Suggested fix:
temporary fix:
this will fix the the last insert id problem (inside my trigger):
and the problem with my 9th argument
BEGIN
...
dbsync_status=dbsyncinsert(substring(@LASTID,1), NEW.username, NEW.data1, NEW.data2, NEW.data3, NEW.data4, NEW.data5, NEW.data6, substring(NEW.data8,1), NEW.data9, NEW.data10);
---
END
however i end up putting substrings in all arguments just for preacaution...