All -

I posted this query on stackoverflow, but I'm probably more likely to get an answer here.

http://stackoverflow.com/questions/10332668/sqlite-max-query-parameters-differs-on-snow-leopard

An overgeneralization in some code I'm writing revealed some differing behavior between the Python sqlite bindings on Windows and on MacOS X Snow Leopard. The issue relates to the maximum permitted number of query parameters.

sqlite has a hard limit on the number of query parameters, of 999. This is set in headers which are not part of the public header file, and the runtime gives you the ability to lower the limit, but not exceed the hard limit. The maximum value in the Python sqlite3 module on Snow Leopard (and Lion as well, apparently) is not 999, but 500,000, and I can't figure out for the life of me how this is possible.

I considered the possibility that the Python wrapper is doing the parameter substitution itself and passing full statements to sqlite3; but as far as I can tell from the source code, that's not happening. I also considered the possibility that the implementation of sqlite3 on Snow Leopard was compiled from slightly different source code; but it turns out that Apple publishes its open-source modifications (see http://opensource.apple.com/source/SQLite/SQLite-74.11/) and the parameter limit in their source is identical to the default.

Does anyone have any ideas about how this might be happening? As an added bonus, if any of the sqlite developers are listening, it would be excellent if these max limits were programmatically inspectable (e.g., sqlite3_get_hard_parameter_limit() or something like that).

Thanks in advance -
Sam Bayer
The MITRE Corporation
s...@mitre.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to