activerecord-cockroachdb-adapter 7.2.2 → 7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/active_record/connection_adapters/cockroachdb_adapter.rb +18 -13
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c264b125195bc158e58aa652d8ef439fbdc0143906e89b36f4dde335b0d01a62
|
|
4
|
+
data.tar.gz: 30edfe2dcfd8c22c9e85e90a4b473321537f3f2c7360aa532e0a4828e5c51697
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c16131d979e0786fe578d33f3f39e402c8dbe86c7b8c2d9a505ed6e54cdfc0de47b7a36913ae6fb5d626bd834083ce9f12a03c4656bf51e6e7088f63924944ec
|
|
7
|
+
data.tar.gz: ad0ebb869bd80919de447aab0ca459f7a40f87ca0a682f2939b4f17cbc98572fe2b542e214391acb2e592bcb1fe814cdd06e22678766d645a84585402072ae76
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 7.2.4 - 2026-08-19
|
|
4
|
+
|
|
5
|
+
- Detect cached plan failures by error message instead of source function, so recovery keeps working after CockroachDB moved where the error is raised ([#403](https://github.com/cockroachdb/activerecord-cockroachdb-adapter/pull/403))
|
|
6
|
+
|
|
7
|
+
## 7.2.3 - 2026-01-30
|
|
8
|
+
|
|
9
|
+
- Disallow usage of ROLLBACK AND CHAIN syntax, which is not yet supported in CockroachDB ([#397](https://github.com/cockroachdb/activerecord-cockroachdb-adapter/pull/397))
|
|
10
|
+
|
|
3
11
|
## 7.2.2 - 2025-08-20
|
|
4
12
|
|
|
5
13
|
- Fixed the handling of column comments that end in a single quote ([#384](https://github.com/cockroachdb/activerecord-cockroachdb-adapter/pull/384))
|
|
@@ -208,6 +208,11 @@ module ActiveRecord
|
|
|
208
208
|
false
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
+
def supports_restart_db_transaction?
|
|
212
|
+
# Restart -> PG's ROLLBACK AND CHAIN
|
|
213
|
+
false
|
|
214
|
+
end
|
|
215
|
+
|
|
211
216
|
def supports_deferrable_constraints?
|
|
212
217
|
# https://go.crdb.dev/issue-v/31632/v23.1
|
|
213
218
|
false
|
|
@@ -444,24 +449,24 @@ module ActiveRecord
|
|
|
444
449
|
end
|
|
445
450
|
|
|
446
451
|
# override
|
|
447
|
-
#
|
|
448
|
-
#
|
|
449
|
-
# be an ActiveRecord::PreparedStatementCacheExpired
|
|
450
|
-
# error.
|
|
451
|
-
#
|
|
452
|
-
# ActiveRecord handles this by checking that the sql state matches the
|
|
453
|
-
# FEATURE_NOT_SUPPORTED code and that the source function
|
|
454
|
-
# is "RevalidateCachedQuery" since that is the only function
|
|
455
|
-
# in postgres that will create this error.
|
|
452
|
+
# Classifies a FEATURE_NOT_SUPPORTED error from the PG gem as an
|
|
453
|
+
# ActiveRecord::PreparedStatementCacheExpired.
|
|
456
454
|
#
|
|
457
|
-
#
|
|
458
|
-
#
|
|
459
|
-
#
|
|
455
|
+
# Upstream matches PG_DIAG_SOURCE_FUNCTION == "RevalidateCachedQuery",
|
|
456
|
+
# the one PostgreSQL C function that raises this error. CockroachDB's
|
|
457
|
+
# raising function is an internal detail that has already moved
|
|
458
|
+
# (runExecBuilder before cockroachdb/cockroach#164406, execBind after),
|
|
459
|
+
# so match the message instead. The message is not formally guaranteed,
|
|
460
|
+
# but it has been unchanged in PostgreSQL since 8.3 and drivers such as
|
|
461
|
+
# pgx assert the exact string. Upstream avoids message matching because
|
|
462
|
+
# PostgreSQL localizes messages via lc_messages (rails/rails@d507ae2a74);
|
|
463
|
+
# CockroachDB does not localize, so that concern does not apply.
|
|
464
|
+
CACHED_PLAN_HEURISTIC = "cached plan must not change result type"
|
|
460
465
|
def is_cached_plan_failure?(e)
|
|
461
466
|
pgerror = e.cause
|
|
462
467
|
|
|
463
468
|
pgerror.result.result_error_field(PG::PG_DIAG_SQLSTATE) == FEATURE_NOT_SUPPORTED &&
|
|
464
|
-
pgerror.result.result_error_field(PG::
|
|
469
|
+
pgerror.result.result_error_field(PG::PG_DIAG_MESSAGE_PRIMARY).include?(CACHED_PLAN_HEURISTIC)
|
|
465
470
|
rescue
|
|
466
471
|
false
|
|
467
472
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-cockroachdb-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.2.
|
|
4
|
+
version: 7.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cockroach Labs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-08-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|