impl(bq_driver): Implements DefaultStringColumnLength truncation logic#1356
impl(bq_driver): Implements DefaultStringColumnLength truncation logic#1356Anshu6250 wants to merge 17 commits into
Conversation
|
|
||
| if (type_status_record.GetValue() == SQL_VARCHAR || | ||
| type_status_record.GetValue() == SQL_VARBINARY) { | ||
| if (type_status_record.GetValue() == SQL_VARCHAR) { |
There was a problem hiding this comment.
why is this changed?
There was a problem hiding this comment.
changes are reverted
| dest_data.buflen, src_len, | ||
| dest_data.buflen, dest_data.result_len); | ||
| } | ||
| if (dest_type == SQL_C_BINARY) { |
There was a problem hiding this comment.
why is this needed?
There was a problem hiding this comment.
We need this code so SQLGetData(..., SQL_C_BINARY) works for string columns; it copies raw bytes, reports correct length, and only truncates when the buffer is too small—not because of DefaultStringColumnLength.
| using google::cloud::odbc_internal::StatusRecord; | ||
|
|
||
| StatusRecord WriteToApplicationBuffer(DSValue const& ds_val, | ||
| StatusRecord WriteToApplicationBuffer(StatementHandle& stmt_handle, |
There was a problem hiding this comment.
pass it as const
|
|
||
| StatusRecord WriteDSRow(DSRow const& ds_row, RowSchema const& schema, | ||
| DescriptorHandle& ard, int row_num) { | ||
| StatusRecord WriteDSRow(StatementHandle& stmt_handle, DSRow const& ds_row, |
There was a problem hiding this comment.
pass stmt_handle as const and everywhere else
|
|
||
| EXPECT_EQ(Disconnect(conn), SQL_SUCCESS); | ||
| } | ||
| #ifdef BQ_DRIVER_INTEGRATION_TESTS |
There was a problem hiding this comment.
instead of connection test , put them under data translation test or statement test file
db1bf1f to
a56608c
Compare
| HandleType kType = HandleType::kStmtHandle; | ||
|
|
||
| inline ConnectionHandle* GetConnectionHandle() { return conn_handle_; }; | ||
| inline ConnectionHandle const* GetConnectionHandle() const { |
There was a problem hiding this comment.
why do you need this, this seems redundant , we already have GetConnectionHandle() above
b854479 to
358f4e0
Compare
358f4e0 to
388fd20
Compare
This PR implements the DefaultStringColumnLength configuration option to truncate STRING columns to a user-specified maximum length, addressing customer issue b/406545117 (tracked by b/391855319)
gha: macOS & Windows pipeline: link