395 Commits

Author SHA1 Message Date
Skyiesac
c3c9f1908e Fixed #36812 -- Dropped support for MariaDB < 10.11. 2026-01-25 09:19:43 +01:00
Mariusz Felisiak
6cff020787 Applied Black's 2026 stable style.
https://github.com/psf/black/releases/tag/26.1.0
2026-01-18 21:26:56 +01:00
JaeHyuck Sa
211b631427 Fixed #36822 -- Added parameter limit for PostgreSQL with server-side binding. 2026-01-16 09:15:53 -05:00
JaeHyuck Sa
b98075dc62 Refs #36822 -- Hoisted bulk_batch_size() implementations to base backend. 2026-01-16 09:15:53 -05:00
Jacob Walls
6a596373d4 Fixed #35402 -- Fixed crash in DatabaseFeatures.django_test_skips when running a subset of tests.
Thanks Tim Graham for the report and the review.
2026-01-14 08:25:37 -05:00
Tim Graham
3201a895cb Added DatabaseCreation.destroy_test_db_connection_close_method hook. 2026-01-03 19:42:02 +01:00
Simon Charette
d6ae2ed868 Refs #33647 -- Fixed silent data truncation in bulk_create on Postgres.
Regression in a16eedcf9c.

The UNNEST strategy is affected by the same problem bulk_update has wrt/
to silent data truncation due to its usage of db_type which always returns
a parametrized subtype.
2025-12-31 10:41:55 -05:00
VIZZARD-X
da19b3897d Fixed #36112 -- Added fallback in last_executed_query() on Oracle and PostgreSQL. 2025-12-26 21:59:10 +01:00
guro-Ishiguro
84bae9c22a Fixed #36818 -- Ensured SQLite connection before accessing max_query_params.
Regression in 358fd21c47.
2025-12-22 20:33:13 -05:00
Clifford Gama
55888655a2 Fixed #36722 -- Moved AutoFieldMixin validate_autopk_value() check to get_db_prep_save.
The validation in validate_autopk_value is specific to saving. Having it in
get_db_prep_value caused Value(0, AutoField()) to fail unexpectedly when used
in a filter on MySQL.

Thanks Jacob Walls for the review.
2025-12-05 09:35:15 -05:00
Mariusz Felisiak
35f86b641a Refs #24928 -- Added introspection support for PostgreSQL HStoreField. 2025-11-14 13:36:15 +01:00
myoungjinGo
c4e07f94eb Fixed #36420 -- Used actual SQLite limits in last_executed_query() quoting. 2025-11-07 16:41:57 -05:00
Mariusz Felisiak
c87daabbf3 Fixed #36624 -- Dropped support for MySQL < 8.4. 2025-10-27 15:05:23 +01:00
Mariusz Felisiak
d506e4a528 Fixed #36671 -- Dropped support for SQLite < 3.37. 2025-10-18 21:04:11 +02:00
Mariusz Felisiak
5bd775703c Fixed #36623 -- Dropped support for PostgreSQL 14 and PostGIS 3.1. 2025-10-03 17:12:57 -04:00
Jacob Walls
a2ce4900a6 Fixed #36430 -- Removed artificially low limit on single field bulk operations on SQLite. 2025-08-21 16:47:41 +02:00
Mariusz Felisiak
d55979334d Fixed #36531 -- Added forkserver support to parallel test runner. 2025-07-29 14:11:22 -03:00
django-bot
69a93a88ed Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
2025-07-23 20:17:55 -03:00
Jacob Walls
43c68042c9 Skipped test_no_logs_without_debug test when the runner is invoked with --debug-sql. 2025-07-13 18:29:34 +02:00
Simon Charette
0fe218842e Fixed #36502 -- Restored UNNEST strategy for foreign key bulk inserts on PostgreSQL.
Regression in 764af7a3d6.
2025-07-10 18:33:00 +02:00
Natalia
d6e0c71017 Refs #36380 -- Replaced mocked logging assertions in tests/backends/tests.py. 2025-06-16 17:41:24 -03:00
Natalia
1a03a984ab Fixed #36380 -- Deferred SQL formatting when running tests with --debug-sql.
Thanks to Jacob Walls for the report and previous iterations of this
fix, to Simon Charette for the logging formatter idea, and to Tim Graham
for testing and ensuring that 3rd party backends remain compatible.

This partially reverts d8f093908c.

Refs #36112, #35448.

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2025-06-16 17:41:24 -03:00
Sage Abdullah
358fd21c47 Fixed #36143 -- Made max_query_params respect SQLITE_LIMIT_VARIABLE_NUMBER.
Co-authored-by: Xavier Frankline <xf.xavierfrank@gmail.com>
2025-05-08 11:37:11 +01:00
fowczrek
6a9db1e626 Fixed #34865 -- Released memory earlier than garbage collection on database wrapping layers.
Thank you Florian Apolloner, Jake Howard and Patryk Zawadzki for
the clarifying comments and reviews.
2025-03-17 18:28:20 -03:00
Mariusz Felisiak
1823a80113 Fixed #33537 -- Made test database cloning on MySQL reraise unexpected errors.
Thanks Faakhir Zahid and Stephen Finucane for the initial patch.

Thanks Simon Charette for the review.
2025-03-17 15:45:08 +01:00
Mariusz Felisiak
ff3aaf036f Applied Black's 2025 stable style.
https://github.com/psf/black/releases/tag/25.1.0
2025-03-01 19:41:37 +01:00
Simon Charette
2d34ebe49a Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).
Given there are no longer any internal usages of serialize=True and it
poses a risk to non-test databases integrity it seems appropriate to
deprecate it.
2025-02-16 08:43:42 +01:00
Mariusz Felisiak
17160819f3 Fixed #36105 -- Dropped support for MariaDB 10.5. 2025-02-09 12:57:40 +01:00
Simon Charette
4608d34b34 Fixed #36088 -- Avoided unnecessary DEFAULT usage on bulk_create().
When all values of a field with a db_default are DatabaseDefault, which
is the case most of the time, there is no point in specifying explicit
DEFAULT for all INSERT VALUES as that's what the database will do anyway
if not specified.

In the case of PostgreSQL doing so can even be harmful as it prevents
the usage of the UNNEST strategy and in the case of Oracle, which
doesn't support the usage of the DEFAULT keyword, it unnecessarily
requires providing literal db defaults.

Thanks Lily Foote for the review.
2025-02-01 18:43:10 +01:00
Sarah Boyce
5a2c1bc07d Fixed #36118 -- Accounted for multiple primary keys in bulk_update max_batch_size.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-01-29 09:11:54 +00:00
Jacob Walls
330d89d4fe Fixed #36111 -- Fixed test --debug-sql crash on Oracle when no prior query has executed. 2025-01-25 18:06:11 +01:00
Mariusz Felisiak
ec8cbea91e Refs #35448 -- Fixed BackendTestCase.test_queries_logger() on Oracle < 23c. 2025-01-20 07:53:45 +01:00
Tim Graham
d8f093908c Fixed #35448 -- Fixed formatting of test --debug-sql output.
Also adds DatabaseOperations.format_debug_sql() hook for backends
(e.g. NoSQL) to customize formatting.
2025-01-18 07:04:57 +01:00
Sarah Boyce
b4bc393b23 Refs #33817 -- Removed support for cx_Oracle per deprecation timeline. 2025-01-15 22:28:37 +01:00
Sarah Boyce
6b271ef21d Refs #34547 -- Removed DatabaseOperations.field_cast_sql() per deprecation timeline. 2025-01-15 22:28:37 +01:00
suraj
0d9872fc9a Fixed #7732 -- Added support for connection pools on Oracle. 2024-12-17 11:26:32 +01:00
Tim Graham
94436dee57 Refs #29850 -- Removed obsolete test_window_frame_raise_not_supported_error.
This NotSupportedError was removed in 6375cee490
because it will never be reached due to the same exception raised by
Window.as_sql().
2024-12-16 13:42:21 +01:00
Simon Charette
a16eedcf9c Fixed #35936 -- Used unnest for bulk inserts on Postgres when possible.
This should make bulk_create significantly faster on Postgres when provided
only literal values.

Thanks James Sewell for writing about this technique, Tom Forbes for
validating the performance benefits, David Sanders and Mariusz Felisiak
for the review.
2024-12-11 13:56:18 +01:00
Sarah Boyce
7380ac5734 Fixed #35688 -- Restored timezone and role setters to be PostgreSQL DatabaseWrapper methods.
Following the addition of PostgreSQL connection pool support in
Refs #33497, the methods for configuring the database role and timezone
were moved to module-level functions. This change prevented subclasses
of DatabaseWrapper from overriding these methods as needed, for example,
when creating wrappers for other PostgreSQL-based backends.

Thank you Christian Hardenberg for the report and to
Florian Apolloner and Natalia Bidart for the review.

Regression in fad334e1a9.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-08-28 19:25:07 -03:00
Simon Charette
a69f895d7d Refs #34547 -- Adjusted deprecation warning stacklevel in DatabaseOperations.field_cast_sql(). 2024-08-28 11:44:05 -03:00
Simon Charette
5e81a4e790 Refs #12581 -- Adjusted warning stacklevel in queries ring buffer. 2024-08-28 11:44:05 -03:00
Tim Graham
bc9b6251e0 Added supports_sequence_reset skip in backends tests. 2024-08-26 12:53:08 -03:00
Jacob Walls
99f23eaabd Fixed #35469 -- Removed deferred SQL to create index removed by AlterField operation. 2024-05-28 12:44:07 +02:00
Mariusz Felisiak
b049bec7cf Fixed #35479 -- Dropped support for PostgreSQL 13 and PostGIS 3.0. 2024-05-27 09:49:25 +02:00
Mariusz Felisiak
85c154da2f Fixed #35412 -- Dropped support for SQLite < 3.31. 2024-04-29 11:07:54 +02:00
Sarah Boyce
f973a70bfc Made postgresql.tests.Tests.test_connect_pool less flaky by increasing timeout value. 2024-04-10 14:09:52 -03:00
Mariusz Felisiak
921670c694 Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.
On SQLite, close() doesn't explicitly close in-memory connections.

Follow up to dd45d5223b.
2024-03-19 10:03:12 +01:00
Michail Chatzis
4426b1a72d Fixed #35021 -- Fixed capturing queries when using client-side parameters binding with psycopg 3+. 2024-03-06 11:24:58 +01:00
Sarah Boyce
fad334e1a9 Refs #33497 -- Added connection pool support for PostgreSQL.
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Ran Benita <ran@unusedvar.com>
2024-03-01 09:01:18 +01:00
AlexCLeduc
a084c5d35a Fixed #35238 -- Fixed database serialization crash when base managers use prefetch_related().
Regression in 1391356276
following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
2024-02-20 22:14:17 +01:00