From cdd7938a54c5944778349f9a58ca3fee6ddc17c3 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 16 Dec 2024 11:49:34 +0100 Subject: [PATCH 1/2] Fix Cockroach NQ problem --- crates/configuration/src/version4/native_operations.rs | 6 +++--- crates/configuration/src/version5/native_operations.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/configuration/src/version4/native_operations.rs b/crates/configuration/src/version4/native_operations.rs index 8db81e734..3079df2bc 100644 --- a/crates/configuration/src/version4/native_operations.rs +++ b/crates/configuration/src/version4/native_operations.rs @@ -207,9 +207,9 @@ const OID_QUERY: &str = " SELECT typnamespace::regnamespace::text as schema_name, typname as type_name, - oid::integer + oid::INT8 FROM pg_type -WHERE oid in (SELECT unnest($1)) +WHERE oid::INT8 in (SELECT unnest($1::INT8[])) "; /// Representation of a result row returned from the oid lookup query. @@ -217,5 +217,5 @@ WHERE oid in (SELECT unnest($1)) struct OidQueryRow { schema_name: String, type_name: String, - oid: i32, + oid: i64, } diff --git a/crates/configuration/src/version5/native_operations.rs b/crates/configuration/src/version5/native_operations.rs index 01f7be99c..90c8f4575 100644 --- a/crates/configuration/src/version5/native_operations.rs +++ b/crates/configuration/src/version5/native_operations.rs @@ -212,9 +212,9 @@ const OID_QUERY: &str = " SELECT typnamespace::regnamespace::text as schema_name, typname as type_name, - oid::integer + oid::INT8 FROM pg_type -WHERE oid in (SELECT unnest($1)) +WHERE oid::INT8 in (SELECT unnest($1::INT8[])) "; /// Representation of a result row returned from the oid lookup query. @@ -222,5 +222,5 @@ WHERE oid in (SELECT unnest($1)) struct OidQueryRow { schema_name: String, type_name: String, - oid: i32, + oid: i64, } From 490a1a2119bf98e68c21c1ca6a7b722ce16aeb38 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 16 Dec 2024 12:00:11 +0100 Subject: [PATCH 2/2] Linting --- crates/configuration/src/version4/native_operations.rs | 2 +- crates/configuration/src/version5/native_operations.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/configuration/src/version4/native_operations.rs b/crates/configuration/src/version4/native_operations.rs index 3079df2bc..9a4a551ca 100644 --- a/crates/configuration/src/version4/native_operations.rs +++ b/crates/configuration/src/version4/native_operations.rs @@ -173,7 +173,7 @@ pub async fn oids_to_typenames( for row in rows { let schema_name: String = row.schema_name; let type_name: String = row.type_name; - let oid: i64 = row.oid.into(); + let oid: i64 = row.oid; let mut found = false; for (scalar_type_name, info) in &configuration.metadata.scalar_types.0 { diff --git a/crates/configuration/src/version5/native_operations.rs b/crates/configuration/src/version5/native_operations.rs index 90c8f4575..a9a7c0e35 100644 --- a/crates/configuration/src/version5/native_operations.rs +++ b/crates/configuration/src/version5/native_operations.rs @@ -178,7 +178,7 @@ pub async fn oids_to_typenames( for row in rows { let schema_name: String = row.schema_name; let type_name: String = row.type_name; - let oid: i64 = row.oid.into(); + let oid: i64 = row.oid; let mut found = false; for (scalar_type_name, info) in &configuration.metadata.types.scalar.0 {