Kodi Community Forum

Full Version: MySQL Error removing Tags from Movies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! When trying to remove Tags from the Movies library, the log shows "ERROR: SQL: Undefined MySQL error: Code (1442)". The complete log file is at http://xbmclogs.com/show.php?id=32519 . As you can see in the log file, this error is on Frodo, Pi, with MySQL.

ERROR: SQL: Undefined MySQL error: Code (1442)
Query: DELETE FROM taglinks WHERE idTag = 2 AND idMedia = 92 AND media_type='movie'
ERROR: RemoveFromLinkTable failed
ERROR: SQL: Undefined MySQL error: Code (1442)
Query: DELETE FROM taglinks WHERE idTag = 2 AND media_type = 'movie'
ERROR: DeleteTag (2) failed

MySQL docs tell us code 1442 is "Can't update table '%s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." http://dev.mysql.com/doc/refman/5.1/en/e..._sf_or_trg

This error occurs consistently after:
- "Remove from library" on any selected tag
- "Remove Movies" on any selected tag
- "Remove from library" on any selected Movie with a tag
- "Refresh" on any selected Movie with an updated NFO to remove tag
The error prevents removing tagged movies from the library and stops the trakt.tv add-on from completing a sync of movies.

I have searched the forums and haven't found an existing thread about this issue. I appreciate any help. Thanks!
Maybe try a more recent XBMC build - you're on XBMC 12.0 dating back to February, the latest XBMC is 12.2.

What version of MySQL are you using, and for future reference debug log (wiki)'s are more useful.