Skip to content

fix: handling timestamp escape clause - #1662

Open
sachinpro wants to merge 1 commit into
mainfrom
fix_timestamp_escape_clause
Open

sachinpro wants to merge 1 commit into
mainfrom
fix_timestamp_escape_clause

Conversation

@sachinpro

Copy link
Copy Markdown
Collaborator

This PR adds support for ODBC timestamp/date/time and other escape sequences (e.g. {ts '...'}, {d '...'}, {t '...'}, {escape '...'}, {oj ...}, {fn ...}) in queries.

Changes

  • Implemented TranslateOdbcEscapeSequences in google/cloud/odbc/bq_driver/internal/utils.cc to parse and translate ODBC escape clauses into BigQuery SQL syntax while preserving comments, quoted string literals, and BigQuery struct literals.
  • Updated StatementHandle::PrepareQuery to invoke TranslateOdbcEscapeSequences when SQL_ATTR_NOSCAN is not set to SQL_NOSCAN_ON.
  • Added unit tests in google/cloud/odbc/bq_driver/internal/utils_test.cc for datetime literals, escape/outer joins, and preserving strings/comments/structs.
  • Added integration test StatementTest.OdbcEscapeTimestampLiteral in google/cloud/odbc/integration_tests/odbc_driver_tests/statement_test.cc verifying both SQLExecDirect and SQLPrepare/SQLExecute workflows.

@sachinpro
sachinpro requested a review from a team as a code owner September 12, 2026 01:37
@sachinpro
sachinpro force-pushed the fix_timestamp_escape_clause branch from e5e9fde to 9277c03 Compare September 12, 2026 01:40
@sachinpro
sachinpro requested a review from logachev September 12, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant