[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-10 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset c1323d4b8cb010a06c11bace6e681bea7f895851 by Erlend Egeberg Aasland in branch 'main': bpo-45754: Use correct SQLite limit when checking statement length (GH-29489)

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I believe it is best to go with alternative 1. The error strings produced by SQLite may change from release to release, so for example a buildbot update may suddenly break the CI. -- ___ Python tracker

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Also, SQLITE_LIMIT_LENGTH and SQLITE_LIMIT_SQL_LENGTH is inclusive in SQLite. We should treat them likewise. -- ___ Python tracker ___

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-09 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27740 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29489 ___ Python tracker

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > > What happens if set SQLITE_LIMIT_SQL_LENGTH to 0 [...] In this case, the limit is actually zero: >>> cx.setlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH, 0) 1024 >>> cx.execute("select 1") Traceback (most recent call last): File "", line

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'm leaning towards alt 1. It is also easy to test all paths with that option. But I also think alt 3 is ok. It makes for easier code to maintain. Alt 2 is, as you say, the weakest alternative. > What happens if set SQLITE_LIMIT_SQL_LENGTH to 0 or

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In alternative 1 we control the type and the message of exception. In alternative 3 we left this to the SQLite3 engine. It is difficult to keep consistency in alternative 2, errors raised for sizes less and larger than INT_MAX can be different. I think

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-08 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : In Modules/_sqlite/statement.c pysqlite_statement_create() and Modules/_sqlite/cursor.c pysqlite_cursor_executescript_impl(), we incorrectly use SQLITE_LIMIT_LENGTH to check statement length. However, the correct limit is *SQLITE_LIMIT_SQL_LENGTH*.

[issue45754] [sqlite3] SQLITE_LIMIT_LENGTH is incorrectly used to check statement length

2021-11-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: BTW, this only affects the code in main. -- components: +Extension Modules type: -> behavior versions: +Python 3.11 ___ Python tracker