From c00e3d4d702d5d5b15917e7a49169ae513354667 Mon Sep 17 00:00:00 2001 From: Alex Kwiatkowski Date: Wed, 19 Jul 2023 13:45:08 -0700 Subject: [PATCH] use row_array_size member from OdbcStatementOptions --- src/include/odbc.hpp | 17 +++++++---------- src/odbc_scan.cpp | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/include/odbc.hpp b/src/include/odbc.hpp index 1b025f9..eab1924 100644 --- a/src/include/odbc.hpp +++ b/src/include/odbc.hpp @@ -72,15 +72,6 @@ struct OdbcEnvironment { SQLHENV Handle() const { return handle; } }; -struct OdbcStatementOptions { - OdbcStatementOptions(SQLINTEGER _row_array_size) : row_array_size(_row_array_size) {} - - SQLINTEGER row_array_size; - -public: - SQLULEN RowArraySize() { return row_array_size; } -}; - #define MAXCOLS 1024 struct OdbcColumnDescription { @@ -344,6 +335,12 @@ struct OdbcConnection { SQLHSTMT HandleConn() { return handle_conn; } }; +struct OdbcStatementOptions { + OdbcStatementOptions(SQLULEN _row_array_size) : row_array_size(_row_array_size) {} + + SQLULEN row_array_size; +}; + struct OdbcStatement { OdbcStatement(shared_ptr _conn) : conn(_conn), handle(SQL_NULL_HSTMT), prepared(false), executing(false) {} @@ -573,7 +570,7 @@ struct OdbcStatement { } SetAttribute(SQL_ATTR_ROW_BIND_TYPE, SQL_BIND_BY_COLUMN); - SetAttribute(SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)opts->RowArraySize()); + SetAttribute(SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)opts->row_array_size); auto execute_sql_return = SQLExecute(handle); if (execute_sql_return == SQL_SUCCESS || execute_sql_return == SQL_SUCCESS_WITH_INFO) { diff --git a/src/odbc_scan.cpp b/src/odbc_scan.cpp index 55a7317..e807039 100644 --- a/src/odbc_scan.cpp +++ b/src/odbc_scan.cpp @@ -257,7 +257,7 @@ static unique_ptr OdbcScanInitLocalState(ExecutionContext &context, TableFunctionInitInput &input, GlobalTableFunctionState *global_state) { auto &bind_data = input.bind_data->Cast(); - auto row_array_size = bind_data.statement_opts->RowArraySize(); + auto row_array_size = bind_data.statement_opts->row_array_size; auto local_state = make_uniq(row_array_size); bind_data.statement->SetAttribute(SQL_ATTR_ROW_STATUS_PTR,