Hi,

I've been attempting to import the IMDb database into a SQLite database, 
and have found and fixed a couple of problems that were preventing me.

The first, and most serious, is that soundex() appears to have a length 
limit in SQLite (at least in Windows). There are some character entries 
in the "VG EverQuest 2" entry that are extremely long, over 600 
characters. When soundex() was called on them, it crashed python (not a 
python exception, a GPF). By adding the following line of code before 
soundex() is called in name_soundexes(), the crash is avoided:

    name = name[:min(512,len(name))]

title_soundex() probably needs to have something similar added also. I 
experienced this on Windows XP with the ActivePython installation 
(Python 2.5.1.1) and also with Python 2.5.1.2. I used SQLObject 0.9 and 
0.10.0b3, and pysqlite as bundled in Python 2.5.1.1 and also pysqlite 
2.4.1. (I was updating everything I could to newer versions trying to 
solve the problem).

The second is that the CharactersCache class is not allowed for custom 
queries and thus performance in SQLite is _slow_ when flushing the 
characters cache. This is sovled by adding 'AFTER_CHARACTERS_TODB' and 
'BEFORE_CHARACTERS_TODB' to ALLOWED_TIMES, and adding them to 
CUSTOM_QUERIES during option scanning along with the other 
'BEFORE_XXX_TODB' and 'AFTER_XXX_TODB' strings.

Hope this helps anyone else having these problems. Currently waiting for 
indexing.... ;)

Clark Bassett


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Reply via email to