Skip to content

Commit 00c9e2a

Browse files
committed
confirm support for CockroachDB 24.3
1 parent 2f19aa6 commit 00c9e2a

File tree

4 files changed

+39
-10
lines changed

4 files changed

+39
-10
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
use_psycopg2: psycopg2
5050
- crdb-version: v24.2.3
5151
use_server_side_binding: server_side_binding
52+
- crdb-version: v24.3.2
53+
- crdb-version: v24.3.2
54+
use_psycopg2: psycopg2
55+
- crdb-version: v24.3.2
56+
use_server_side_binding: server_side_binding
5257
# Uncomment to enable testing of CockroachDB nightly.
5358
#- crdb-version: LATEST
5459
#- crdb-version: LATEST

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## 5.1.1 - Unreleased
44

5-
- Confirmed support for CockroachDB 24.2.x (no code changes required).
5+
- Confirmed support for CockroachDB 24.2.x and 24.3.x (no code changes
6+
required).
67

78
## 5.1 - 2024-08-13
89

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ By default, CockroachDB sends the version of django-cockroachdb that you're
9292
using back to Cockroach Labs. To disable this, set
9393
`DISABLE_COCKROACHDB_TELEMETRY = True` in your Django settings.
9494

95-
## Known issues and limitations in CockroachDB 24.2.x and earlier
95+
## Known issues and limitations in CockroachDB 24.3.x and earlier
9696

9797
- CockroachDB [can't disable constraint checking](https://github.com/cockroachdb/cockroach/issues/19444),
9898
which means certain things in Django like forward references in fixtures

django_cockroachdb/features.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def is_cockroachdb_23_2(self):
8383
def is_cockroachdb_24_1(self):
8484
return self.connection.cockroachdb_version >= (24, 1)
8585

86+
@cached_property
87+
def is_cockroachdb_24_3(self):
88+
return self.connection.cockroachdb_version >= (24, 3)
89+
8690
@cached_property
8791
def django_test_expected_failures(self):
8892
expected_failures = super().django_test_expected_failures
@@ -136,15 +140,11 @@ def django_test_expected_failures(self):
136140
'migrations.test_operations.OperationTests.test_alter_field_pk_fk',
137141
'migrations.test_operations.OperationTests.test_alter_field_pk_fk_char_to_int',
138142
'migrations.test_operations.OperationTests.test_alter_field_pk_fk_db_collation',
139-
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_target_changes',
140143
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_fk_with_to_field_related_name_target_type_change', # noqa
141-
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_changes', # noqa
142144
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_type_change', # noqa
143-
'migrations.test_operations.OperationTests.test_rename_field_reloads_state_on_fk_target_changes',
144145
'schema.tests.SchemaTests.test_alter_auto_field_to_char_field',
145146
'schema.tests.SchemaTests.test_alter_autofield_pk_to_smallautofield_pk',
146147
'schema.tests.SchemaTests.test_alter_primary_key_db_collation',
147-
'schema.tests.SchemaTests.test_alter_primary_key_the_same_name',
148148
'schema.tests.SchemaTests.test_char_field_pk_to_auto_field',
149149
'schema.tests.SchemaTests.test_char_field_with_db_index_to_fk',
150150
'schema.tests.SchemaTests.test_text_field_with_db_index_to_fk',
@@ -182,11 +182,21 @@ def django_test_expected_failures(self):
182182
'aggregation.tests.AggregateTestCase.test_aggregation_default_expression',
183183
# ProgrammingError: VALUES types int and float cannot be matched
184184
'field_defaults.tests.DefaultTests.test_bulk_create_mixed_db_defaults_function',
185-
# concat(): unknown signature: concat(string, int2) (desired <string>)
186-
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
187-
# unknown signature: concat(varchar, int) (returning <string>)
188-
'migrations.test_operations.OperationTests.test_add_generate_field',
189185
})
186+
if not self.is_cockroachdb_24_3:
187+
expected_failures.update({
188+
# ALTER COLUMN TYPE requiring rewrite of on-disk data is currently
189+
# not supported for columns that are part of an index.
190+
# https://go.crdb.dev/issue/47636
191+
'schema.tests.SchemaTests.test_alter_primary_key_the_same_name',
192+
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_target_changes',
193+
'migrations.test_operations.OperationTests.test_alter_field_reloads_state_on_fk_with_to_field_target_changes', # noqa
194+
'migrations.test_operations.OperationTests.test_rename_field_reloads_state_on_fk_target_changes',
195+
# unknown signature: concat(varchar, int) (returning <string>)
196+
'migrations.test_operations.OperationTests.test_add_generate_field',
197+
# concat(): unknown signature: concat(string, int2) (desired <string>)
198+
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
199+
})
190200
if not self.is_cockroachdb_23_2:
191201
expected_failures.update({
192202
# cannot index a json element:
@@ -258,6 +268,10 @@ def django_test_expected_failures(self):
258268
'queries.test_bulk_update.BulkUpdateTests.test_updated_rows_when_passing_duplicates',
259269
'queries.test_q.QCheckTests.test_expression',
260270
'queries.test_qs_combinators.QuerySetSetOperationTests.test_union_multiple_models_with_values_list_and_annotations', # noqa
271+
# error in argument for $2: could not parse ":" as type int2:
272+
# strconv.ParseInt: parsing ":": invalid syntax
273+
# https://github.com/cockroachdb/cockroach/issues/136295
274+
'db_functions.text.test_concat.ConcatTests.test_concat_non_str',
261275
# unsupported binary operator: <interval> / <decimal>
262276
'expressions.tests.FTimeDeltaTests.test_durationfield_multiply_divide',
263277
# InvalidParameterValue: unsupported binary operator: <int4> / <float>
@@ -268,6 +282,15 @@ def django_test_expected_failures(self):
268282
# operator: <decimal> / <float> (desired <decimal>)
269283
'aggregation.tests.AggregateTestCase.test_aggregation_default_passed_another_aggregate',
270284
})
285+
if self.is_cockroachdb_24_3:
286+
expected_failures.update({
287+
# psycopg.errors.IndeterminateDatatype: replace():
288+
# replace(): replace(): concat(): could not determine data
289+
# type of placeholder $3. This worked until v24.3 added
290+
# support for non-string data to concat():
291+
# https://github.com/cockroachdb/cockroach/pull/127098#issuecomment-2492652084
292+
"model_fields.test_uuid.TestQuerying.test_filter_with_expr",
293+
})
271294
else:
272295
expected_failures.update({
273296
# Unsupported query: unsupported binary operator: <int> / <int>:

0 commit comments

Comments
 (0)