Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL variable count too low #274

Open
jcavar opened this issue Apr 3, 2017 · 2 comments
Open

SQL variable count too low #274

jcavar opened this issue Apr 3, 2017 · 2 comments

Comments

@jcavar
Copy link
Contributor

jcavar commented Apr 3, 2017

Hi,
We have recently discovered issue with NSFetchRequest failing because of reaching SQL variable count limit. This can happen when using request in format identifier IN %@, array.
Since this library uses sqlcipher, the number is 999:
https://github.com/sqlcipher/sqlcipher/blob/master/src/sqliteLimit.h#L136

It seems that is much lower number then used in actual CoreData sqlite. That number seems to be 500000:
http://sqlite.1065341.n5.nabble.com/SQLITE-MAX-VARIABLE-NUMBER-td43457.html
Yalantis/FastEasyMapping#80

Would it be possible for this library to increase this to some reasonable number (i guess 500000)?
This can be done by recompiling or by using:
sqlite3_limit(database, SQLITE_LIMIT_VARIABLE_NUMBER, 500000);

@jcavar
Copy link
Contributor Author

jcavar commented Apr 4, 2017

It seems that I was wrong about sqlite3_limit. Limit defined in constant is upper bound limit so there are safety checks to make sure that limit is not exceeded.

@jcavar
Copy link
Contributor Author

jcavar commented Apr 4, 2017

So this needs to be added in podspec I think with GCC_PREPROCESSOR_DEFINITIONS which is better anyway I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant