Commit Graph

303 Commits

Author SHA1 Message Date
Erlend Egeberg Aasland 797745e749
[3.10] gh-94321: Document sqlite3.PrepareProtocol (GH-94620) (#94671)
(cherry picked from commit fb6dccae34)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-08 01:44:09 +02:00
Erlend Egeberg Aasland deb4d0457f
[3.10] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) (#94273)
Also add adapters and converter recipes.

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com.
(cherry picked from commit bd3c1c187e)
2022-06-25 22:55:38 +02:00
Erlend Egeberg Aasland c4440e6bc0
[3.10] gh-93925: Improve clarity of sqlite3 commit/rollback, and close docs (GH-93926) (#94011)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit 6446592c89)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-06-19 21:43:03 +02:00
Erlend Egeberg Aasland 2229d34a6e
[3.10] gh-79579: Improve DML query detection in sqlite3 (GH-93623) (#93801)
The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.

pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.

(cherry picked from commit 46740073ef)
2022-06-14 15:05:36 +02:00
Erlend Egeberg Aasland 9cc0afcb87
[3.10] gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (GH-93526) (GH-93599)
(cherry picked from commit 875de61)
2022-06-08 13:31:14 +02:00
Erlend Egeberg Aasland 2a2421e538
[3.10] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters (#92274)
* [3.10] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters (#29054)

(cherry picked from commit f629dcfe83)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Fix ref leak in pysqlite_cursor_iternext
2022-05-05 12:46:21 -07:00
Erlend Egeberg Aasland 178d79ae67
[3.10] gh-89301: Fix regression with bound values in traced SQLite statements (#92147)
(cherry picked from commit 721aa96540)
2022-05-02 10:21:13 -06:00
Jelle Zijlstra d8ba5c102c
[3.10] sqlite3: normalise pre-acronym determiners (GH-31772) (GH-31806)
For consistency, replace "a SQL" with "an SQL"..
(cherry picked from commit 2d5835a019)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-03-11 17:10:55 -08:00
Jelle Zijlstra 5dfe981791
[3.10] Docstring: replace pysqlite with sqlite3 (GH-31758) (GH-31777)
Replace two instances of "pysqlite" with "sqlite3" in sqlite3
docstrings. Also reword "is a no-op" to "does nothing" for clarity..
(cherry picked from commit b33a1ae703)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-03-09 10:19:27 -08:00
Erlend Egeberg Aasland f3d3b2d5c5
[3.10] bpo-46878: Purge 'non-standard' from sqlite3 docstrings (GH-31612) (GH-31753)
(cherry picked from commit 4d95fa1ac5)
2022-03-08 07:30:14 -08:00
Erlend Egeberg Aasland ba457fe6f8
[3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030)
* [3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642).
(cherry picked from commit 3eb3b4f270)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

* Fix test_func_return_too_large_int

GH-27613 (bpo 44839) was not backported, so exceptions differ between
main (3.11) and older versions.
2022-02-20 16:13:04 -08:00
Erlend Egeberg Aasland ed91f959b0
[3.10] bpo-45634: Don't combine error checks when adding `sqlite3` int constants (GH-29251). (GH-29343) 2021-10-31 20:22:22 +09:00
Łukasz Langa 7e2c0a18b4
[3.10] bpo-45581: Raise `MemoryError` in `sqlite3.connect` if SQLite signals memory error (GH-29171) (GH-29323)
(cherry picked from commit e2e62b3808)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-10-29 22:54:07 +02:00
Erlend Egeberg Aasland aa6dd54d43
[3.10] bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231). (GH-28298) 2021-09-13 12:16:01 +09:00
Erlend Egeberg Aasland 2a80893e5c
[3.10] bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) (GH-27943) 2021-08-28 19:26:00 +01:00
Miss Islington (bot) 2b1e713f87
bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588)
(cherry picked from commit 8f010dc920)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-08-06 10:59:51 -07:00
Erlend Egeberg Aasland 0cb470e622
[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431). (GH-27472)
(cherry picked from commit 7e311e496b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-07-30 14:01:22 +02:00
Erlend Egeberg Aasland 02e4c0cad3
[3.10] Fix docstring typo in sqlite3.Connection.executescript/sqlite3.Cursor.executescript (GH-27147) (GH-27151)
Both `executescript` methods contain the same docstring typo:
_"Executes a multiple SQL statements at once."_ => _"Executes multiple SQL statements at once."_

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-07-15 00:02:01 +01:00
Erlend Egeberg Aasland ccc95c7b47
[3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) (GH-26816)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-20 22:07:31 +01:00
Miss Islington (bot) 7297d74251
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351) (GH-26766)
* Make functools types immutable

* Multibyte codec types are now immutable

* pyexpat.xmlparser is now immutable

* array.arrayiterator is now immutable

* _thread types are now immutable

* _csv types are now immutable

* _queue.SimpleQueue is now immutable

* mmap.mmap is now immutable

* unicodedata.UCD is now immutable

* sqlite3 types are now immutable

* _lsprof.Profiler is now immutable

* _overlapped.Overlapped is now immutable

* _operator types are now immutable

* winapi__overlapped.Overlapped is now immutable

* _lzma types are now immutable

* _bz2 types are now immutable

* _dbm.dbm and _gdbm.gdbm are now immutable
(cherry picked from commit 00710e6346)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-17 11:19:44 +01:00
Miss Islington (bot) 317e9ed436
bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL held (GH-26551) (GH_26552)
(cherry picked from commit 6e3b7cf3af)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-06 00:13:27 +01:00
Miss Islington (bot) ad2f3b74b5
bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement objects (GH-26545)
(cherry picked from commit fa106a685c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-04 20:09:40 -07:00
Miss Islington (bot) 067d6d4657
bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
(cherry picked from commit 006fd869e4)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-04 11:54:39 -07:00
Erlend Egeberg Aasland 84d80f5f30
[3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) (GH-26515)
Allocate and track statement objects in pysqlite_statement_create.

By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().

Co-authored-by: Victor Stinner <vstinner@python.org>.
(cherry picked from commit fffa0f92ad)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-03 18:38:09 +02:00
Miss Islington (bot) ff359d735f
bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) (GH-26461)
(cherry picked from commit d1124b09e8)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-31 11:12:27 +02:00
Miss Islington (bot) e8d9df0089
bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104)
(cherry picked from commit d3c277a59c)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-25 11:08:39 -07:00
Erlend Egeberg Aasland cbb7b9ed4a
bpo-43434: Clean up sqlite3.connect() after GH-25818 (GH-25823) 2021-05-02 23:10:51 +01:00
Erlend Egeberg Aasland c96cc089f6
bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818) 2021-05-02 22:25:17 +01:00
Erlend Egeberg Aasland 7244c0060d
bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246) 2021-04-27 00:16:46 +01:00
Erlend Egeberg Aasland e9194ea6ea
bpo-43852: Improve tuple creation in sqlite3 (GH-25421) 2021-04-23 14:21:08 +03:00
Erlend Egeberg Aasland 5cb601f956
bpo-43296: Handle sqlite3_value_blob() errors (GH-24674) 2021-04-15 00:09:11 +03:00
Erlend Egeberg Aasland def919342f
bpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404) 2021-04-14 17:50:16 +03:00
Erlend Egeberg Aasland c1ae741997
bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586) 2021-04-14 14:45:49 +03:00
Erlend Egeberg Aasland 6f1e8ccffa
bpo-43752: Fix sqlite3 regression for zero-sized blobs with converters (GH-25228) 2021-04-14 14:18:49 +03:00
Erlend Egeberg Aasland 2256a2876b
bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801) 2021-03-13 17:33:39 +02:00
Erlend Egeberg Aasland e161ec5dd7
bpo-43369: sqlite3_column_{text,blob} failures now raise MemoryError (GH-24723) 2021-03-04 11:50:25 +02:00
Mariusz Felisiak 3b4b2cf418
bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706)
Regression introduced in 47feb1feb2.
2021-03-03 16:16:24 +02:00
Alex Henrie 25e244c925
bpo-39523: Use do-while loop pysqlite_cursor_executescript() (GH-18305) 2021-03-02 09:40:34 +02:00
Erlend Egeberg Aasland 2183d06bc8
bpo-43251: sqlite3_column_name() failures now raise MemoryError (GH-24609) 2021-02-28 19:01:06 +02:00
Erlend Egeberg Aasland 5e48e83688
bpo-43294: Remove unused variables in pysqlite_connection_*() (GH-24658) 2021-02-26 16:30:22 +02:00
Erlend Egeberg Aasland 3150754f91
bpo-43314: Remove SQLITE_OPEN_URI ifdef (GH-24637)
SQLite 3.7.15 is required as by GH-24106. SQLITE_OPEN_URI was added in
SQLite 3.7.7.
2021-02-26 02:48:19 +02:00
Erlend Egeberg Aasland 91ea37c84a
bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
From the SQLite 3.5.3 changelog:

sqlite3_step() returns SQLITE_MISUSE instead of crashing when called
with a NULL parameter.

The workaround no longer needed because we no longer support
SQLite releases older than 3.7.15.
2021-02-26 01:39:34 +02:00
Erlend Egeberg Aasland 38b6c2acd4
bpo-43269: Remove redundant extern keywords (GH-24605) 2021-02-21 12:07:49 +02:00
Erlend Egeberg Aasland bf838a6e7e
bpo-43269: Clean up sqlite3 file scope (GH-24578) 2021-02-21 02:29:19 +02:00
Erlend Egeberg Aasland 2bb0bf4dd8
bpo-43258: Make sqlite3 callback functions static (GH-24574) 2021-02-19 13:59:24 +02:00
Erlend Egeberg Aasland 979b23cbe4
bpo-43258: Don't allocate sqlite3 aggregate context for empty queries (GH-24569) 2021-02-19 13:20:32 +02:00
Erlend Egeberg Aasland cc96231f0a
bpo-43249: Improve scoping in _pysqlite_fetch_one_row() (GH-24565) 2021-02-18 19:13:14 +02:00
Erlend Egeberg Aasland 47feb1feb2
bpo-43249: sqlite3_column_bytes() must follow sqlite_column_blob() (GH-24562) 2021-02-18 17:44:43 +02:00
Erlend Egeberg Aasland ea46579067
bpo-40956: Fix segfault when Connection.backup is called without target (GH-24503) 2021-02-11 01:04:02 +02:00
Serhiy Storchaka 9073180db5
bpo-43083: Fix error handling in _sqlite3 (GH-24395) 2021-01-31 17:42:38 +02:00