SQLite max query parameters are different on Snow Leopard?

This is a secondary question, but I'm a bit puzzled.

sqlite has a strict limit on the number of query parameters, equal to 999. This is specified in headers that are not part of the public header file, and the runtime gives you the opportunity to lower the limit, but does not exceed the hard limit. However, the Python sqlite3 module on Snow Leopard (and Lion also, apparently) allows more parameters than this, and I cannot figure out how much this is possible.

I considered the possibility that the Python shell itself performs parameter substitution and passes complete instructions to sqlite3; but, as far as I can tell from the source code, this does not happen. I also considered the possibility that the sqlite3 implementation on Snow Leopard was made up of slightly different source code; but it turns out that Apple publishes its open source versions (see http://opensource.apple.com/source/SQLite/SQLite-74.11/ ), and the parameter limit in their source is identical by default.

If someone has an idea of ​​how this can happen (and I'm sure this is happening, I created statements with parameters 2000, and they work fine), please call back. For what it's worth, I came across this oddity because identical code crashes on Windows due to a parameter limitation.

+5
source share
1 answer

When building complete SQLite (C) sources, the preprocessor defines

SQLITE_MAX_VARIABLE_NUMBER

controls the maximum number of "operator variables", the default value is 999.

Further information can be found here: https://sqlite.org/limits.html

I would suggest that the python binding uses a custom SQLite assembly with a large number.


( 999 , , - - ). mroe.)

+1

All Articles