I am trying to log updates from one table by inserting records into a log table after an update is triggered from the initial table using MySQL.
I can not seem to get the code below to cause an insert to happen.
What do I need to do resolve the problem?
Trigger code
CREATE TRIGGER `issueaim_update` AFTER UPDATE ON `issues`
FOR EACH ROW INSERT INTO issuehistory
SELECT 'update', (select max(revision)+1 from issuehistory where issueid = i.issueid), NOW(), '', IssueID, ProjectID, IssueTitle, Criticality, AssignorID, OwnerID, AltOwnerID, ApproverID, AssignedDate, CompletionDate, DueDate, ECD, ClosedDate, IssueStatement, ClosureCriteria, ClosureStatement, RootCause, CorrectiveAction, IssueResolutionVerification, RejectionJustification, NEW.Category1, Category2, Category3, Category4
FROM ProjectAIM.issues AS i WHERE IssueID = NEW.IssueID and ProjectID = NEW.ProjectID
Error Log - Most Recent Logged Error
2016-06-12 21:55:39 10e0 InnoDB: Error: Tablespace for table "mysql"."innodb_table_stats" is missing.
2016-06-12 21:55:39 10e0 InnoDB: Error: Fetch of persistent statistics requested for table "projectaim"."issues" but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.