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

Some GLORP tests are failing for some SQLite library versions #24

Open
gcotelli opened this issue Jul 23, 2020 · 1 comment
Open

Some GLORP tests are failing for some SQLite library versions #24

gcotelli opened this issue Jul 23, 2020 · 1 comment

Comments

@gcotelli
Copy link
Member

GlorpBlobTest>>testBlob and GlorpBooleanTest>>#testBoolean are failing on the SQLite versions installed in the CI machines, but they work with version 3.32.3.

PR #23 marks them as expectedFailures if the library version is less than 3.32.2, but wold be good to understand why, because not all the Linux distributions comes with the last version of the library.

@tblanchard
Copy link
Contributor

I found that SQLite has a limit on the size of an argument to like or glob.

See https://sqlite.org/limits.html

"The pattern matching algorithm used in the default LIKE and GLOB implementation of SQLite can exhibit O(N²) performance (where N is the number of characters in the pattern) for certain pathological cases. To avoid denial-of-service attacks from miscreants who are able to specify their own LIKE or GLOB patterns, the length of the LIKE or GLOB pattern is limited to SQLITE_MAX_LIKE_PATTERN_LENGTH bytes. The default value of this limit is 50000. A modern workstation can evaluate even a pathological LIKE or GLOB pattern of 50000 bytes relatively quickly. The denial of service problem only comes into play when the pattern length gets into millions of bytes. Nevertheless, since most useful LIKE or GLOB patterns are at most a few dozen bytes in length, paranoid application developers may want to reduce this parameter to something in the range of a few hundred if they know that external users are able to generate arbitrary patterns."

Unfortunately the fix is in the glorp SQLite3Platform in the glorp project.
See pharo-rdbms/glorp#34

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

2 participants