Skip to content

impl(bq_driver): add sql_wvarchar impl#1487

Draft
NeerajDwivedii wants to merge 2 commits into
mainfrom
add_sql_wvarchar_varchar_ui_impl
Draft

impl(bq_driver): add sql_wvarchar impl#1487
NeerajDwivedii wants to merge 2 commits into
mainfrom
add_sql_wvarchar_varchar_ui_impl

Conversation

@NeerajDwivedii
Copy link
Copy Markdown
Collaborator

@NeerajDwivedii NeerajDwivedii commented Apr 6, 2026

This PR implements the UI feature and internal support for UseWVarChar as described in the ticket. The UseWVarChar option can be configured through the driver UI, odbc.ini, and the connection string.

windows gha checks: https://github.com/googleapis/cpp-bigquery-odbc/actions/runs/24066772452

Installer: https://drive.google.com/file/d/1Qb0qeLx_WmqIXMXw-G0Ac2fRPkB2ytJi/view?usp=drive_link

Here are Screenshot for same:
image

Note: I verified the current PR implementation of SQLGetData and SQLFetch with UseWVarChar both enabled and disabled. In both cases, the existing driver and the BQ driver behave the same—data is returned as wchar even when UseWVarChar is disabled. Screenshots are attached for reference.

Screenshot 2026-04-27 142116 Screenshot 2026-04-27 150532

@NeerajDwivedii NeerajDwivedii changed the title Add sql wvarchar varchar UI impl add sql wvarchar varchar UI impl Apr 6, 2026
@NeerajDwivedii NeerajDwivedii changed the title add sql wvarchar varchar UI impl add sql_wvarchar impl Apr 6, 2026
@NeerajDwivedii NeerajDwivedii changed the title add sql_wvarchar impl impl(bq_driver): add sql_wvarchar impl Apr 6, 2026
@NeerajDwivedii NeerajDwivedii changed the base branch from main to add_max_retries April 6, 2026 11:27
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch from 6aafd68 to cf1be14 Compare April 6, 2026 12:03

TEST(StatementTest, UseWVarcharInsteadOfVarchar) {
auto conn = std::make_shared<ODBCHandles>();
std::string const conn_str = kDefaultConnectionString + ";UseWVarChar=1";
Copy link
Copy Markdown
Collaborator

@shivamd-gpartner shivamd-gpartner Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test case makes sense, even if you don't use the 'UseWVarChar' param, it will still pass, please check this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't utilize UseWVarChar then test case will fail. It's verified.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please verify separately as SQLGetData and SQLBindCol test parts looks generic

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It's passing. Removed now

case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE_TO_SECOND:
IntValueToOutputBufferResponse<SQLSMALLINT, SQLSMALLINT>(

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, Done

octet_length = value * sizeof(SQLWCHAR);
break;
case SQL_WVARCHAR:
octet_length = value * 4;

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value 8 is wrong. The size of SQLWCHAR is 2 on Windows and 4 on Linux. But after the latest existing driver update, it uses 4 for both systems

@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch 3 times, most recently from eea86eb to 86bf350 Compare April 7, 2026 05:56
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch 2 times, most recently from 5b0276b to c0d9b8d Compare April 7, 2026 06:38
Base automatically changed from add_max_retries to main April 8, 2026 12:51
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch 2 times, most recently from db6011c to 3f17dff Compare April 13, 2026 05:21
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch 2 times, most recently from af17c2b to de70384 Compare April 27, 2026 09:36
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch from 0fa1ca9 to db2ac3b Compare April 29, 2026 13:17
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch from db2ac3b to 6db07a9 Compare April 30, 2026 07:38
@NeerajDwivedii NeerajDwivedii force-pushed the add_sql_wvarchar_varchar_ui_impl branch from 6db07a9 to 041a6a2 Compare April 30, 2026 07:44
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.

2 participants