Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 41 additions & 87 deletions google/cloud/odbc/bq_driver/internal/driver_adv_opt_form.cc

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions google/cloud/odbc/bq_driver/internal/driver_adv_opt_form.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ static int const kIdcUseDefaultCheckbox = 128;
static int const kIdcDatasetNameEdit = 129;
static int const kIdcTempExpirationEdit = 130;
static int const kIdcAllowHighThroughputCheckbox = 131;
static int const kIdcActivationThresholdEdit = 132;
static int const kIdcEncryptionKeyEdit = 133;
static int const kIdcRowsPerBlockEdit = 134;
static int const kIdcDefaultStringEdit = 135;
Expand Down Expand Up @@ -86,13 +85,10 @@ class AdvanceOptions {
inline std::string const& GetTempTableExpiration() const {
return temp_expiration_;
}
inline std::string const& GetActivationThreshold() const {
return activation_threshold_;
}
inline std::string const& GetUseWchar() const { return use_wchar_; }
inline std::string const& GetEnableSession() const { return enable_session_; }
inline std::string const& GetActivationThresholdCheckbox() const {
return activation_threshold_checkbox_;
inline std::string const& GetAllowHtapiForLargeResultsCheckbox() const {
return allow_htapi_for_large_results_checkbox_;
}
inline std::string const& GetAllowLargeResults() const {
return allow_large_results_;
Expand Down Expand Up @@ -129,10 +125,9 @@ class AdvanceOptions {
static std::string session_location_;
static std::string additional_projects_;
static std::string query_properties_;
static std::string activation_threshold_;
static std::string use_wchar_;
static std::string enable_session_;
static std::string activation_threshold_checkbox_;
static std::string allow_htapi_for_large_results_checkbox_;
static std::string allow_large_results_;
static std::string use_default_large_results_;
static std::string encryption_type_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ TEST_F(AdvanceOptionsTest, SetValuesValidinput) {
{"SessionLocation", "USA"},
{"AdditionalProjects", "projectA,projectB"},
{"QueryProperties", "property1=value1"},
{"HTAPI_ActivationThreshold", "10000"},
{"MaxThreads", "10"},
{"MaxRetries", "9"}};

Expand All @@ -98,7 +97,6 @@ TEST_F(AdvanceOptionsTest, SetValuesValidinput) {
EXPECT_EQ(options.GetSessionLocation(), "USA");
EXPECT_EQ(options.GetAdditionalProjects(), "projectA,projectB");
EXPECT_EQ(options.GetQueryProperties(), "property1=value1");
EXPECT_EQ(options.GetActivationThreshold(), "10000");
EXPECT_EQ(options.GetMaxThreads(), "10");
EXPECT_EQ(options.GetMaxRetries(), "9");
}
Expand All @@ -121,7 +119,7 @@ TEST_F(AdvanceOptionsTest, SetValuesMissingkeys) {
EXPECT_EQ(options.GetSessionLocation(), "");
EXPECT_EQ(options.GetAdditionalProjects(), "");
EXPECT_EQ(options.GetQueryProperties(), "");
EXPECT_EQ(options.GetActivationThreshold(), "");
EXPECT_EQ(options.GetAllowHtapiForLargeResultsCheckbox(), "");
}

} // namespace google::cloud::odbc_bq_driver_internal
4 changes: 1 addition & 3 deletions google/cloud/odbc/bq_driver/internal/driver_form.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,10 @@ static Section BuildTestConnectionAttributes(
attributes_map["MaxThreads"] = adv_form.GetMaxThreads();
attributes_map["AdditionalProjects"] = adv_form.GetAdditionalProjects();
attributes_map["QueryProperties"] = adv_form.GetQueryProperties();
attributes_map["HTAPI_ActivationThreshold"] =
adv_form.GetActivationThreshold();
attributes_map["UseWVarChar"] = adv_form.GetUseWchar();
attributes_map["EnableSession"] = adv_form.GetEnableSession();
attributes_map["AllowHtapiForLargeResults"] =
adv_form.GetActivationThresholdCheckbox();
adv_form.GetAllowHtapiForLargeResultsCheckbox();
attributes_map["AllowLargeResults"] = adv_form.GetAllowLargeResults();
attributes_map["UseDefaultLargeResultsDataset"] =
adv_form.GetUseDefaultLargeResults();
Expand Down
6 changes: 1 addition & 5 deletions google/cloud/odbc/bq_driver/internal/odbc_conn_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ void ConnectionHandle::SetUp(Section& dsn_section,
}
std::string allow_htapi = dsn_section["ALLOWHTAPIFORLARGERESULTS"];
dsn_.allow_htapi = (allow_htapi == "1");
dsn_.htapi_activation_threshold = dsn_section["HTAPI_ACTIVATIONTHRESHOLD"];
if (dsn_.htapi_activation_threshold.empty()) {
// This is the default value set on the windows configuration screen too.
dsn_.htapi_activation_threshold = "10000";
}

dsn_.large_table_expiration_time =
dsn_section["LARGERESULTSTEMPTABLEEXPIRATIONTIME"];
if (dsn_.large_table_expiration_time.empty()) {
Expand Down
1 change: 0 additions & 1 deletion google/cloud/odbc/bq_driver/internal/odbc_conn_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct Dsn {
bool use_default_large_results_dataset = true;
std::string large_results_dataset_id;
bool allow_htapi = false;
std::string htapi_activation_threshold = "10000";
std::string large_table_expiration_time = kDefaultLargeResultsTableExpiration;

/////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ TEST(ConnectionHandle, DsnSetupHtapiBasic) {
dsn_section["USEDEFAULTLARGERESULTSDATASET"] = "0";
dsn_section["LARGERESULTSDATASETID"] = "large_dataset";
dsn_section["ALLOWHTAPIFORLARGERESULTS"] = "1";
dsn_section["HTAPI_ACTIVATIONTHRESHOLD"] = "4";
dsn_section["LARGERESULTSTEMPTABLEEXPIRATIONTIME"] = "36000";

conn_handle.SetUp(dsn_section, kDsnName);
Expand All @@ -136,7 +135,6 @@ TEST(ConnectionHandle, DsnSetupHtapiBasic) {
EXPECT_FALSE(actual.use_default_large_results_dataset);
EXPECT_EQ(actual.large_results_dataset_id, "large_dataset");
EXPECT_TRUE(actual.allow_htapi);
EXPECT_EQ(actual.htapi_activation_threshold, "4");
EXPECT_EQ(actual.large_table_expiration_time, "36000");
}

Expand Down
15 changes: 5 additions & 10 deletions google/cloud/odbc/bq_driver/odbc_windows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@ bool ConfigDSNInternal(HWND hwnd_parent, WORD f_request, LPCSTR lpsz_driver,
GetValueOrDefault(section, additional_projects_key);
std::string query_properties =
GetValueOrDefault(section, query_properties_key);
std::string activation_threshold =
GetValueOrDefault(section, activation_threshold_key);
// std::string use_wchar = GetValueOrDefault(section, use_wchar_key);
std::string enable_session = GetValueOrDefault(section, enable_session_key);
std::string htapi_activation_threshold_check =
GetValueOrDefault(section, htapi_activation_threshold_check_key);
std::string allow_htapi_for_large_results =
GetValueOrDefault(section, allow_htapi_for_large_results_key);
std::string allow_large_results =
GetValueOrDefault(section, allow_large_results_key);
std::string use_default_large_results_dataset =
Expand Down Expand Up @@ -197,13 +195,11 @@ bool ConfigDSNInternal(HWND hwnd_parent, WORD f_request, LPCSTR lpsz_driver,
{session_location_key, session_location},
{additional_projects_key, additional_projects},
{query_properties_key, query_properties},
{activation_threshold_key, activation_threshold},
// {use_wchar_key, use_wchar},
{enable_session_key, enable_session},
{max_threads_key, max_threads},
{max_retries_key, max_retries},
{htapi_activation_threshold_check_key,
htapi_activation_threshold_check},
{allow_htapi_for_large_results_key, allow_htapi_for_large_results},
{allow_large_results_key, allow_large_results},
{use_default_large_results_dataset_key,
use_default_large_results_dataset},
Expand Down Expand Up @@ -262,13 +258,12 @@ bool ConfigDSNInternal(HWND hwnd_parent, WORD f_request, LPCSTR lpsz_driver,
session_location = advance_form.GetSessionLocation();
additional_projects = advance_form.GetAdditionalProjects();
query_properties = advance_form.GetQueryProperties();
activation_threshold = advance_form.GetActivationThreshold();
// use_wchar = advance_form.GetUseWchar();
enable_session = advance_form.GetEnableSession();
max_threads = advance_form.GetMaxThreads();
max_retries = advance_form.GetMaxRetries();
htapi_activation_threshold_check =
advance_form.GetActivationThresholdCheckbox();
allow_htapi_for_large_results =
advance_form.GetAllowHtapiForLargeResultsCheckbox();
allow_large_results = advance_form.GetAllowLargeResults();
use_default_large_results_dataset =
advance_form.GetUseDefaultLargeResults();
Expand Down
3 changes: 1 addition & 2 deletions google/cloud/odbc/bq_driver/odbc_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ std::string const additional_projects_key = "AdditionalProjects";
std::string const query_properties_key = "QueryProperties";
std::string const max_threads_key = "MaxThreads";
std::string const max_retries_key = "MaxRetries";
std::string const activation_threshold_key = "HTAPI_ActivationThreshold";
std::string const use_wchar_key = "UseWVarChar";
std::string const enable_session_key = "EnableSession";
std::string const htapi_activation_threshold_check_key =
std::string const allow_htapi_for_large_results_key =
"AllowHtapiForLargeResults";
std::string const allow_large_results_key = "AllowLargeResults";
std::string const encryption_type = "EncryptionType";
Expand Down
Loading