This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new fa16a3aae fix(c/validation): allow configuring the secondary database 
schema (#4793)
fa16a3aae is described below

commit fa16a3aae4c537cf5985c0c8e221e9da09386f95
Author: Fredrik Fornwall <[email protected]>
AuthorDate: Fri Sep 18 03:15:42 2026 +0200

    fix(c/validation): allow configuring the secondary database schema (#4793)
    
    Allow configuring the secondary database schema through a
    `secondary_db_schema()` quirk, mirroring how the primary schema is
    configurable through the `db_schema()`.
    
    Useful to match an existing environment and to allow concurrent runs.
    
    Signed-off-by: Fredrik Fornwall <[email protected]>
---
 c/validation/adbc_validation.h             |  3 +++
 c/validation/adbc_validation_connection.cc | 12 ++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/c/validation/adbc_validation.h b/c/validation/adbc_validation.h
index 2226704f3..e8d4a9bf3 100644
--- a/c/validation/adbc_validation.h
+++ b/c/validation/adbc_validation.h
@@ -263,6 +263,9 @@ class DriverQuirks {
 
   /// \brief Default database schema to use for tests
   virtual std::string db_schema() const { return ""; }
+
+  /// \brief Secondary database schema to use for tests
+  virtual std::string secondary_db_schema() const { return "otherschema"; }
 };
 
 class DatabaseTest {
diff --git a/c/validation/adbc_validation_connection.cc 
b/c/validation/adbc_validation_connection.cc
index d7e61b918..7e1e8217d 100644
--- a/c/validation/adbc_validation_connection.cc
+++ b/c/validation/adbc_validation_connection.cc
@@ -313,22 +313,22 @@ void ConnectionTest::TestMetadataGetTableSchemaDbSchema() 
{
   ASSERT_THAT(AdbcConnectionNew(&connection, &error), IsOkStatus(&error));
   ASSERT_THAT(AdbcConnectionInit(&connection, &database, &error), 
IsOkStatus(&error));
 
-  auto status = quirks()->EnsureDbSchema(&connection, "otherschema", &error);
+  const std::string db_schema = quirks()->secondary_db_schema();
+  auto status = quirks()->EnsureDbSchema(&connection, db_schema, &error);
   if (status == ADBC_STATUS_NOT_IMPLEMENTED) {
     GTEST_SKIP() << "Schema not supported";
     return;
   }
   ASSERT_THAT(status, IsOkStatus(&error));
 
-  ASSERT_THAT(quirks()->DropTable(&connection, "bulk_ingest", "otherschema", 
&error),
+  ASSERT_THAT(quirks()->DropTable(&connection, "bulk_ingest", db_schema, 
&error),
+              IsOkStatus(&error));
+  ASSERT_THAT(quirks()->CreateSampleTable(&connection, "bulk_ingest", 
db_schema, &error),
               IsOkStatus(&error));
-  ASSERT_THAT(
-      quirks()->CreateSampleTable(&connection, "bulk_ingest", "otherschema", 
&error),
-      IsOkStatus(&error));
 
   Handle<ArrowSchema> schema;
   ASSERT_THAT(AdbcConnectionGetTableSchema(&connection, /*catalog=*/nullptr,
-                                           /*db_schema=*/"otherschema", 
"bulk_ingest",
+                                           /*db_schema=*/db_schema.c_str(), 
"bulk_ingest",
                                            &schema.value, &error),
               IsOkStatus(&error));
 

Reply via email to