Conversation
c255959 to
f9e7324
Compare
f9e7324 to
7839a25
Compare
| conn, SQL_BEST_ROWID, kDatasetName, kCatalogDatasetTableWithPK); | ||
|
|
||
| // existing driver returns an empty result set for SQL_BEST_ROWID. | ||
| EXPECT_TRUE(special_columns.empty()); |
There was a problem hiding this comment.
why is it empty for every test case?
There was a problem hiding this comment.
found out :
What the ODBC spec asks for
SQL_BEST_ROWID: "the optimal column or set of columns that, by retrieving values from the column or columns, allows any row in the specified table to be uniquely identified" — used by applications for positioned updates/deletes and re-fetching a row.
SQL_ROWVER: columns "automatically updated by the data source when any value in the row is updated by a transaction" (SQL Server rowversion, Oracle ORA_ROWSCN, etc.).
The spec explicitly allows an empty result set when the data source has no such columns; it does not require the driver to invent one.
Why BigQuery legitimately has none
There is no ROWID/OID pseudo-column and no auto-updated row-version column, so SQL_ROWVER has nothing to return.
Primary keys in BigQuery are NOT ENFORCED . BigQuery does not guarantee uniqueness, so PK columns do not satisfy "allows any row to be uniquely identified". Advertising them as BEST_ROWID would be misleading: an app that then does UPDATE … WHERE StringField=? AND IntField=? could hit multiple rows.
BigQuery has no positioned-update/scrollable-cursor model anyway, which is the main consumer of BEST_ROWID.
So Simba's choice — return a well-formed 8-column result set with zero rows, and SQL_SUCCESS even for a nonexistent table (same as its SQLPrimaryKeys behaviour) — is the conservative, defensible implementation. A driver for an RDBMS with enforced PKs would typically derive BEST_ROWID from the PK or a unique index; that reasoning simply doesn't transfer here which is the same for our driver
7839a25 to
45fdcdc
Compare
Description
This PR establishes the integration testing baseline for the
SQLSpecialColumnsAPI against the existing driver, in preparation for its implementation in the new BQ driver.Key Changes:
Catalog::GetSpecialColumnshelper to fetch and map special column metadata.catalog_test.ccto verify the existing driver's behavior forSQL_BEST_ROWID(with and without primary keys) andSQL_ROWVER.StatementTest.SQLSpecialColumns_VerifyMetadatato strictly ensure the returned schema matches the 8 standard columns defined by the ODBC 3.8 specification.pipeline: link