2011-12-13, 04:29
Ryoga79 Wrote:I'm having a similar problem, and at least from what i can glean from the log, it looks like it may not be a databse problem, but a SQL problem. My log is very similar to his, in that i get repeated references to the files "not being in the database yet", but i also get repeated lines like this snippet below:
I get a copy of that line from every video file that was imported in the previous step. I checked my sources, and it looks like the files are getting imported into the library just fine, it's just that the query is failing when it goes back to check for the files the second time, so the files never get renamed. I'm trying to do the same import as above, with 10 "popular" tv shows and movies from bluecop's hulu plugin (of which i'm also using the latest version).Code:12/12/2011 08:10:08 PM ERROR DBUpdate:TV Show Failed to check if file exists in XBMC's database using: SELECT idFile FROM files WHERE idPath IN(SELECT idPath FROM path WHERE LOWER(strPath) = 'y:\streaming\drop\tv shows\once.upon.a.time\season.1\') AND lower(strFileName) = 's01e06 - the shepherd.mpg'
12/12/2011 08:10:08 PM ERROR DBUpdate:TV Show Could not execute query: SELECT idFile FROM files WHERE idPath IN(SELECT idPath FROM path WHERE LOWER(strPath) = 'y:\streaming\drop\tv shows\once.upon.a.time\season.1\') AND lower(strFileName) = 's01e03 - snow falls.mpg'
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's01e03 - snow falls.mpg'' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2571)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1451)
at utilities.Database.getSingleInt(Database.java:205)
at utilities.XBMCInterface.updateFilePointers(XBMCInterface.java:555)
at mylibrary.importer.updateDatabase(importer.java:1561)
at mylibrary.importer.importVideos(importer.java:357)
at mylibrary.importer.main(importer.java:25)
Config.xml pastebin here: http://pastebin.com/KYPxRPCK
Full Log pastebin here: http://pastebin.com/C8Pzt3kE
Can anyone enlighten me on what i might have done wrong that the second database query is failing?
Thanks!
It looks like MySQL is failing at executing that query. What version of MySQL are you using? Can you try and execute the query manually (if you know how)
Code:
SELECT idFile FROM files WHERE idPath IN(SELECT idPath FROM path WHERE LOWER(strPath) = 'y:\streaming\drop\tv shows\once.upon.a.time\season.1\') AND lower(strFileName) = 's01e06 - the shepherd.mpg'
EDIT-Actually, after a closer look, this is a problem with my code. It looks like i didn't properly handle the '\' character in SQL queries. I thought i had it automatically escaped, but maybe it broke with some of the recent changes.
All my sources are smb://, and they only use forward slashes, so I don't get the same problem. In the meantime, you could try that, but I'll look into it.