Kodi Community Forum

Full Version: Undefined MySQL error: code (1366)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When trying to scan my video library, if there are any episodes/movies with non-standard characters in the names I get the following errors in my logs and the episodes do not add.

12:15:15 T:2750411872 ERROR: SQL: Undefined MySQL error: Code (1366)
Query: insert into files (idFile, idPath, strFileName) values(NULL, 738, 'The Big Bang Theory - S02E07 - The Panty Piñata Polarization.mkv')
12:15:15 T:2750411872 ERROR: AddFile unable to addfile ()
12:15:15 T:2750411872 ERROR: SQL: Undefined MySQL error: Code (1366)
Query: insert into files (idFile, idPath, strFileName) values(NULL, 738, 'The Big Bang Theory - S02E07 - The Panty Piñata Polarization.mkv')
12:15:15 T:2750411872 ERROR: AddFile unable to addfile ()
12:15:15 T:2750411872 ERROR: SQL: Undefined MySQL error: Code (1366)
Query: insert into files (idFile, idPath, strFileName) values(NULL, 738, 'The Big Bang Theory - S02E07 - The Panty Piñata Polarization.mkv')
12:15:15 T:2750411872 ERROR: AddFile unable to addfile ()


If I copy and paste the statement it's trying to run into mysql manually, it executes with no problems.

Am I missing something in my setup or is this a known bug?
I have started getting this issue too, here is a snippet from my log file for 1 episode.

20:44:34 T:3180 DEBUG: Mysql execute: insert into files (idFile, idPath, strFileName) values(NULL, 495, 'Helix - 02x02 - R�union.mkv')
20:44:34 T:3180 ERROR: SQL: Undefined MySQL error: Code (1366)
Query: insert into files (idFile, idPath, strFileName) values(NULL, 495, 'Helix - 02x02 - R�union.mkv')
20:44:34 T:3180 ERROR: CVideoDatabase::AddFile unable to addfile ()

This is happening with all episodes of Helix, and The walking dead. Now looking at the above the name of the file is obviously Helix - 02x02 - Reunion.mkv so where is this special character coming from that is stopping my shows from scraping.
Log snippets are totally useless as they tell nothing.
Read Debug Log
I had to trim it a little to get it to fit pastebin.

http://pastebin.com/Pjf21KyS
I just ran into this issue too. I believe the problem lies with MySQL of course. It seems to have issues with special characters, error 1366 is apparently "Incorrect string value", and has to do with the character set used in the database like UTF-8. I have only experienced it when it was pulling from an NFO. The accented N in Piñata. An accented E in Reunion. For me it was left and right double quotes(“ ”) in my Formula 1 NFO's. Once I replaced them with the regular unidirectional double quote(") everything went fine. I had added two new TV shows that were not showing up in Kodi. I found that these errors were stopping the TV show scan dead in it's tracks and so not scraping any new content past them.

Maybe the error isn't something the Kodi team can fix but maybe getting it to continue the scan through the error would be nice.
I looked on trac.kodi.tv and didn't see anything related. Is a bug fix request in order?
What version of MySQL.

Currently 5.7 offered modes, such as strict, traditional, or ANSI. IF in strict, then it will throw that code possibly, where traditional may make it a warning. But traditional means 5.6 and below, I believe.

V5.6 and below I found this post interesting about resetting the variables to the current code page of Windows: http://stackoverflow.com/questions/32950...ysql-utf-8

Code page
https://www.microsoft.com/resources/docu...x?mfr=true
I am running MySQL 5.6.
For the two times I've had this issue it was just easier for me to modify the NFO's.

I haven't looked but I have to imagine I have some cast member names with accented letters in their name.
I wonder, does this issue not come up with any data that was scraped from the internet?
Would it be in a different format? Maybe I will check that tonight.
I have personally never ran into the issue. All movie/tv names I update with filebot, but prior, scraped data never came in with the special characters. takeing some peesksies around the inner truth, it looks like a lot of programs can and will replace nonascii with its ascii equivalent