[MDEV-15231] Invalid use of group by in after insert trigger Created: 2018-02-07  Updated: 2018-03-07  Resolved: 2018-03-07

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.1.31
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Habib Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

Linux Centos 6.8



 Description   

On a table that has an after insert trigger where you need to call a view that uses a group by the insert fails with Invalid use of group function

however adding in a limit allows the query to run

the trigger is defined as follows

BEGIN

drop temporary table if exists fsstoredcalcs;

Create temporary table ttp1 as select * from myupdate_vw where fID = NEW.fID;

//updates to tables based on ttp1

END

Changing this to the below works.

BEGIN

drop temporary table if exists fsstoredcalcs;

Create temporary table ttp1 as select * from myupdate_vw where fID = NEW.fID limit 1000;

//updates to tables based on ttp1

END



 Comments   
Comment by Habib [ 2018-02-07 ]

Even when adding the limit the error is intermittent.

Comment by Elena Stepanova [ 2018-02-07 ]

Please paste the output of

SHOW CREATE TABLE <trigger table>;
SHOW CREATE TRIGGER <trigger name>;
SHOW CREATE VIEW myupdate_vw;

and SHOW CREATE for all objects that the view uses.

Generated at Thu Feb 08 08:19:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.