-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathodbc_stmt_handle.cc
More file actions
563 lines (504 loc) · 22.1 KB
/
Copy pathodbc_stmt_handle.cc
File metadata and controls
563 lines (504 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "google/cloud/odbc/bq_driver/internal/odbc_stmt_handle.h"
#include "google/cloud/odbc/bq_client_interface/odbc_bq_client.h"
#include "google/cloud/odbc/bq_client_interface/utils.h"
#include "google/cloud/odbc/bq_driver/internal/odbc_conn_handle.h"
#include "google/cloud/odbc/bq_driver/internal/odbc_desc_attr.h"
#include "google/cloud/odbc/bq_driver/internal/odbc_desc_handle.h"
#include "google/cloud/odbc/bq_driver/internal/odbc_sql_type_info.h"
#include "google/cloud/odbc/bq_driver/internal/odbc_transactions.h"
#include "google/cloud/odbc/bq_driver/internal/trace_utils.h"
#include "google/cloud/odbc/internal/status_record_or.h"
namespace google::cloud::odbc_bq_driver_internal {
using google::cloud::Options;
using google::cloud::bigquery_v2_minimal_internal::Job;
using google::cloud::bigquery_v2_minimal_internal::JobStatistics;
using google::cloud::bigquery_v2_minimal_internal::TableSchema;
using google::cloud::odbc_bigquery_client_interface::MaxRetriesOption;
using google::cloud::odbc_bq_driver_internal::BeginTransactionIfNeeded;
using google::cloud::odbc_internal::SQLStates;
using google::cloud::odbc_internal::StatusRecord;
using google::cloud::odbc_internal::StatusRecordOr;
DescriptorHandle& StatementHandle::GetDescriptorHandle(
DescriptorType type) const {
switch (type) {
// DescriptorType::kApplication should not be used as input argument
case DescriptorType::kApplication:
case DescriptorType::kARD:
return descriptors_.ard_expl_ != nullptr ? *descriptors_.ard_expl_
: *descriptors_.ard_;
case DescriptorType::kAPD:
return descriptors_.apd_expl_ != nullptr ? *descriptors_.apd_expl_
: *descriptors_.apd_;
case DescriptorType::kIRD:
return *descriptors_.ird_;
case DescriptorType::kIPD:
return *descriptors_.ipd_;
}
}
StatementHandle ::StatementHandle(StatementHandle const& statementHandle)
: Handle(statementHandle) {
kType = statementHandle.kType;
stmt_state_ = statementHandle.stmt_state_;
result_set_ = statementHandle.result_set_;
query_str_ = statementHandle.query_str_;
descriptors_ = statementHandle.descriptors_;
query_ = statementHandle.query_;
attributes_ = statementHandle.attributes_;
// TODO(b/349757194): Convert shallow copy to deep copy
conn_handle_ = statementHandle.conn_handle_;
query_parameters_ = statementHandle.query_parameters_;
};
StatementHandle& StatementHandle::operator=(
StatementHandle const& statementHandle) {
if (this != &statementHandle) {
kType = statementHandle.kType;
stmt_state_ = statementHandle.stmt_state_;
result_set_ = statementHandle.result_set_;
query_str_ = statementHandle.query_str_;
descriptors_ = statementHandle.descriptors_;
query_ = statementHandle.query_;
attributes_ = statementHandle.attributes_;
// TODO(b/349757194): Convert shallow copy to deep copy
conn_handle_ = statementHandle.conn_handle_;
query_parameters_ = statementHandle.query_parameters_;
}
return *this;
}
StatementHandle::StatementHandle(StatementHandle&& statementHandle) noexcept {
kType = std::move(statementHandle.kType);
stmt_state_ = std::move(statementHandle.stmt_state_);
result_set_ = std::move(statementHandle.result_set_);
query_str_ = std::move(statementHandle.query_str_);
descriptors_ = std::move(statementHandle.descriptors_);
query_ = std::move(statementHandle.query_);
attributes_ = std::move(statementHandle.attributes_);
conn_handle_ = std::move(statementHandle.conn_handle_);
query_parameters_ = std::move(statementHandle.query_parameters_);
}
StatementHandle& StatementHandle::operator=(
StatementHandle&& statementHandle) noexcept {
kType = std::move(statementHandle.kType);
stmt_state_ = std::move(statementHandle.stmt_state_);
result_set_ = std::move(statementHandle.result_set_);
query_str_ = std::move(statementHandle.query_str_);
descriptors_ = std::move(statementHandle.descriptors_);
query_ = std::move(statementHandle.query_);
attributes_ = std::move(statementHandle.attributes_);
conn_handle_ = std::move(statementHandle.conn_handle_);
query_parameters_ = std::move(statementHandle.query_parameters_);
return *this;
}
void DissociateDescriptorHandle(DescriptorHandle* descriptor_handle,
DescriptorType type, StatementHandle* handle) {
if (descriptor_handle) {
descriptor_handle->GetAssociatedStatementHandles().erase({handle, type});
}
}
void AssociateDescriptorHandle(DescriptorHandle* descriptor_handle,
DescriptorType type, StatementHandle* handle) {
if (descriptor_handle) {
descriptor_handle->GetAssociatedStatementHandles().emplace(handle, type);
}
}
StatusRecord StatementHandle::SetDescriptorHandle(
DescriptorType type, DescriptorHandle* descriptor_handle) {
switch (type) {
case DescriptorType::kARD:
DissociateDescriptorHandle(descriptors_.ard_expl_, type, this);
descriptors_.ard_expl_ = descriptor_handle;
break;
case DescriptorType::kAPD:
DissociateDescriptorHandle(descriptors_.apd_expl_, type, this);
descriptors_.apd_expl_ = descriptor_handle;
break;
default:
LOG(ERROR) << "StatementHandle::SetDescriptorHandle:: Invalid attempt to "
"set an implementation descriptor.";
return StatusRecord{SQLStates::k_HY017(),
"Invalid try to set implementation descriptor"};
}
AssociateDescriptorHandle(descriptor_handle, type, this);
return StatusRecord::Ok();
}
StatusRecord StatementHandle::SetAttribute(int attribute, SQLULEN value) {
StatusRecord status_record =
ValidateStatementAttributeToSet(attribute, value);
if (!status_record.ok()) {
LOG(ERROR)
<< "StatementHandle::SetAttribute::ValidateStatementAttributeToSet:: "
<< status_record.message;
return status_record;
}
attributes_[attribute] = value;
return StatusRecord::Ok();
}
StatusRecord StatementHandle::PopulateResultSet(TableSchema const& schema) {
for (int i = 0; i < schema.fields.size(); ++i) {
auto const& field = schema.fields[i];
ColumnSchema column;
column.col_index = i;
StatusRecordOr<BQDataType> type_status_record = ConvertDSType(field.type);
if (!type_status_record.Ok()) {
LOG(ERROR) << "StatementHandle::PopulateResultSet::ConvertDSType:: "
<< type_status_record.GetStatusRecord().message;
return type_status_record.GetStatusRecord();
}
column.col_type = *type_status_record;
result_set_.row_schema.emplace_back(column);
}
return StatusRecord::Ok();
}
std::string GetLeadingKeyword(std::string const& q) {
std::string s = q;
s.erase(0, s.find_first_not_of(" \t\n\r")); // trim leading whitespace
// Extract first word
auto end = s.find_first_of(" \t\n\r;");
std::string keyword = s.substr(0, end);
// Convert to lowercase
std::transform(keyword.begin(), keyword.end(), keyword.begin(),
[](unsigned char c) { return std::tolower(c); });
return keyword;
}
bool IsInsertQuery(std::string const& q) {
return GetLeadingKeyword(q) == "insert";
}
bool IsSelectQuery(std::string const& q) {
return GetLeadingKeyword(q) == "select";
}
// TODO(b/342044533) Sanitize query text to avoid potential SQL Injection
// risk.
StatusRecord StatementHandle::PrepareQuery(std::string const& query) {
StatusRecord transaction_status = BeginTransactionIfNeeded(*conn_handle_);
if (!transaction_status.ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::BeginTransactionIfNeeded:: "
<< transaction_status.message;
return transaction_status;
}
ConnectionHandle& conn_handle = *GetConnectionHandle();
Job req;
req.configuration.query.query = query;
req.configuration.query.use_query_cache = conn_handle.GetDsn().is_query_cache;
req.configuration.dry_run = true;
req.configuration.query.use_legacy_sql =
conn_handle.GetDsn().is_bq_legacy_sql;
// Add default dataset from the config
std::string catalog_name = conn_handle.GetDsn().catalog;
std::string default_dataset = conn_handle.GetDsn().default_dataset;
if (!default_dataset.empty()) {
req.configuration.query.default_dataset.project_id = catalog_name;
req.configuration.query.default_dataset.dataset_id = default_dataset;
}
// We are setting it only for validation. We couldn't find any issues with the
// behaviour if we don't set it. 'OPTIONS ( kms_key_name = ... )' is supposed
// to be used during table creation. Subsequent operations on the table will
// automatically use the KMS key without the application sending it.
std::string kms_key_name = conn_handle.GetDsn().kms_key_name;
if (IsInsertQuery(query) || IsSelectQuery(query)) {
if (!kms_key_name.empty()) {
req.configuration.query.destination_encryption_configuration
.kms_key_name = kms_key_name;
}
}
if (!conn_handle.GetDsn().is_bq_legacy_sql) {
// Detect POSITIONAL (`?`) and NAMED (`[:@]\w+`) parameter markers using
// RE2 instead of a manual character scan.
bool has_positional = re2::RE2::PartialMatch(query, R"(\?)");
bool has_named = re2::RE2::PartialMatch(query, R"([:@]\w+)");
if (has_positional) {
req.configuration.query.parameter_mode = "POSITIONAL";
}
// Check for named parameters
if (has_named) {
req.configuration.query.parameter_mode = "NAMED";
}
}
std::vector<ConnectionProperty> combined_properties =
conn_handle.GetDsn().connection_properties;
// If session started, add session_id
if (conn_handle.IsSessionStarted()) {
combined_properties.push_back({"session_id", conn_handle.GetSessionId()});
} else if (conn_handle.GetDsn().sessions_enabled) {
req.configuration.query.create_session = true;
req.job_reference.location = conn_handle.GetDsn().session_location;
}
req.configuration.query.connection_properties = combined_properties;
Options opt;
opt.set<MaxRetriesOption>(conn_handle.GetDsn().max_retries);
auto response = conn_handle.GetClient()->InsertJob(
conn_handle.GetDsn().catalog, req, opt);
if (!response.Ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::InsertJob:: "
<< response.GetStatusRecord().message;
return response.GetStatusRecord();
}
auto& schema = response.GetValue().statistics.job_query_stats.schema;
auto pop_response = PopulateResultSet(schema);
if (!pop_response.ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::PopulateResultSet:: "
<< pop_response.message;
return pop_response;
}
SetQueryParameters(
response.GetValue()
.statistics.job_query_stats.undeclared_query_parameters);
if (!pop_response.ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::PopulateResultSet:: "
<< pop_response.message;
return pop_response;
}
TableReference table_fields;
auto table_ref =
response.GetValue().statistics.job_query_stats.referenced_tables;
if (!table_ref.empty()) {
auto* table_ref_ptr = table_ref.data();
table_fields = *table_ref_ptr;
} else {
table_fields = response.GetValue().configuration.query.destination_table;
}
DescriptorHandle& desc_handle =
this->GetDescriptorHandle(DescriptorType::kIRD);
desc_handle.SetConnectionHandle(&conn_handle);
desc_handle.ClearDescriptorRecordsMap();
StatusRecord ird_response = PopulateIrd(desc_handle, schema, table_fields);
if (!ird_response.ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::PopulateIrd:: "
<< ird_response.message;
return ird_response;
}
DescriptorHandle& ipd_desc_handle =
this->GetDescriptorHandle(DescriptorType::kIPD);
ipd_desc_handle.ClearDescriptorRecordsMap();
auto job_statistics = (*response).statistics;
StatusRecord ipd_response = PopulateIpd(ipd_desc_handle, job_statistics);
if (!ipd_response.ok()) {
LOG(ERROR) << "StatementHandle::PrepareQuery::PopulateIpd:: "
<< ipd_response.message;
return ipd_response;
}
if (!conn_handle.IsSessionStarted() &&
!response->statistics.session_info.session_id.empty()) {
conn_handle.SetSessionId(response->statistics.session_info.session_id);
}
query_str_ = query;
prepared_job_ = *response;
return StatusRecord::Ok();
}
StatusRecord StatementHandle::PopulateIrd(DescriptorHandle& descriptor_handle,
TableSchema const& schema,
TableReference const& table_fields,
bool is_metadata) {
if (&descriptor_handle == nullptr ||
descriptor_handle.GetType() != DescriptorType::kIRD) {
LOG(ERROR) << "StatementHandle::PopulateIrd::Invalid descriptor handle.";
return StatusRecord{SQLStates::k_HY024(),
"Invalid attribute value (invalid descriptor handle)"};
}
std::string const nullable = "NULLABLE";
std::string const nullable_required = "REQUIRED";
std::string const array_field = "REPEATED";
ConnectionHandle& conn_handle = *(descriptor_handle.GetConnectionHandle());
for (int i = 0; i < schema.fields.size(); ++i) {
auto const& res = schema.fields[i];
DescriptorRecord descriptor_record;
descriptor_record.SetName(res.name, res.name.length());
descriptor_record.length = res.max_length;
StatusRecordOr<SQLSMALLINT> type_status_record =
GetSQLDataType(res.type, (res.mode == array_field));
if (!type_status_record.Ok()) {
LOG(ERROR) << "StatementHandle::PopulateIrd::GetSQLDataType:: "
<< type_status_record.GetStatusRecord().message;
return type_status_record.GetStatusRecord();
}
StatusRecord status_record = descriptor_record.SetConciseType(
*type_status_record, DescriptorType::kIRD);
if (!status_record.ok()) {
LOG(ERROR) << "StatementHandle::PopulateIrd::SetConciseType:: "
<< status_record.message;
return status_record;
}
TypeInfoRow type_info;
GetTypeInfoFromBQType(type_status_record.GetValue(), res.type,
res.mode == array_field, type_info);
if (type_status_record.GetValue() == SQL_VARCHAR ||
type_status_record.GetValue() == SQL_VARBINARY) {
type_info.col_size = conn_handle.GetDsn().default_string_column_length;
}
descriptor_record.base_column_name = res.name;
descriptor_record.base_table_name = table_fields.table_id;
descriptor_record.catalog_name = table_fields.project_id;
descriptor_record.schema_name = table_fields.dataset_id;
descriptor_record.table_name = table_fields.table_id;
descriptor_record.label = res.name;
descriptor_record.local_type_name =
type_info.local_type_name
? std::string(reinterpret_cast<char*>(type_info.local_type_name))
: "";
descriptor_record.type_name =
type_info.type_name
? std::string(reinterpret_cast<char*>(type_info.type_name))
: "";
descriptor_record.case_sensitive = type_info.case_sensitive;
if (descriptor_record.local_type_name == "BIGNUMERIC" ||
descriptor_record.local_type_name == "INT64" ||
descriptor_record.local_type_name == "NUMERIC") {
descriptor_record.SetNumPrecRadix(kNumPrecRadixForExactNumeric);
descriptor_record.sql_desc_unsigned =
(type_info.unsigned_attribute) ? SQL_TRUE : SQL_FALSE;
} else if (descriptor_record.local_type_name == "FLOAT64") {
descriptor_record.sql_desc_unsigned =
(type_info.unsigned_attribute) ? SQL_TRUE : SQL_FALSE;
descriptor_record.SetNumPrecRadix(kNumPrecRadixForApproximateNumeric);
} else {
descriptor_record.sql_desc_unsigned =
(type_info.unsigned_attribute) ? SQL_FALSE : SQL_TRUE;
descriptor_record.SetNumPrecRadix(kDefaultIntervalPrecision);
}
if (res.type == "TIME" || res.type == "DATETIME" ||
res.type == "TIMESTAMP") {
descriptor_record.precision = 6;
descriptor_record.scale = 6;
} else if (res.type == "DATE") {
descriptor_record.precision = 0;
descriptor_record.scale = 0;
} else {
descriptor_record.precision = type_info.interval_precision == 0
? type_info.col_size
: type_info.interval_precision;
descriptor_record.scale = type_info.maximum_scale;
}
if (res.type == "DATETIME") {
// hard-coding to 16 to have the same behaviour as existing driver
descriptor_record.octet_length = 16;
} else {
descriptor_record.SetOctetLength(type_status_record.GetValue(),
type_info.col_size,
descriptor_record.precision);
}
if (res.type == "INTERVAL" || res.type == "JSON") {
descriptor_record.case_sensitive = 1;
}
if (type_status_record.GetValue() == SQL_DOUBLE) {
// hard-coding to 15 to have the same behaviour as existing driver
descriptor_record.length = 15;
} else {
descriptor_record.length = type_info.col_size;
}
descriptor_record.nullable = (res.mode == nullable) ? SQL_NULLABLE
: (res.mode == nullable_required)
? SQL_NULLABLE
: SQL_NO_NULLS;
// hard-coding to have the same behaviour as existing driver
if (descriptor_record.local_type_name == "BIGNUMERIC" ||
descriptor_record.local_type_name == "FLOAT64" ||
descriptor_record.local_type_name == "NUMERIC") {
descriptor_record.literal_prefix = "";
descriptor_record.literal_suffix = "";
} else if (descriptor_record.local_type_name == "BYTES") {
descriptor_record.literal_prefix = "0x";
descriptor_record.literal_suffix = "";
} else if (descriptor_record.local_type_name == "DATE" ||
descriptor_record.local_type_name == "TIME" ||
descriptor_record.local_type_name == "TIMESTAMP") {
descriptor_record.literal_prefix = "'";
descriptor_record.literal_suffix = "'";
} else {
descriptor_record.literal_prefix =
type_info.literal_prefix == nullptr
? ""
: std::string(reinterpret_cast<char*>(type_info.literal_prefix));
descriptor_record.literal_suffix =
type_info.literal_suffix == nullptr
? ""
: std::string(reinterpret_cast<char*>(type_info.literal_suffix));
}
descriptor_record.SetDisplaySize(type_status_record.GetValue(),
type_info.col_size,
descriptor_record.precision);
if (is_metadata) {
descriptor_record.ApplyMetadataIrdOverrides(res.name);
}
descriptor_handle.BindNewDescriptorRecord(i + 1, descriptor_record);
}
return StatusRecord::Ok();
}
StatusRecordOr<SQLULEN> StatementHandle::GetAttribute(int attribute) {
if (!IsStatementAttributeValid(attribute)) {
LOG(ERROR) << "StatementHandle::GetAttribute::Invalid attribute: "
<< attribute;
return StatusRecord{SQLStates::k_HY092(), "Invalid attribute"};
}
return attributes_[attribute];
}
StatusRecord StatementHandle::PopulateIpd(DescriptorHandle& handle,
JobStatistics const& job_statistics) {
if (handle.GetType() != DescriptorType::kIPD) {
LOG(ERROR) << "StatementHandle::PopulateIpd::Invalid descriptor handle.";
return StatusRecord(
{SQLStates::k_HY024(),
"Invalid attribute value (invalid descriptor handle)"});
}
DescriptorRecord descriptor_record;
auto stmt_params = job_statistics.job_query_stats.undeclared_query_parameters;
if (stmt_params.empty()) {
return StatusRecord::Ok();
}
for (int i = 0; i < stmt_params.size(); i++) {
bool is_array = stmt_params[i].parameter_type.type == "ARRAY";
StatusRecordOr<SQLSMALLINT> record_type =
GetSQLDataType(stmt_params[i].parameter_type.type, is_array);
descriptor_record.SetConciseType(*record_type, DescriptorType::kIPD);
descriptor_record.SetName(stmt_params[i].name, stmt_params[i].name.size());
descriptor_record.type_name = stmt_params[i].parameter_type.type;
TypeInfoRow type_info;
GetTypeInfoFromBQType(record_type.GetValue(),
stmt_params[i].parameter_type.type, is_array,
type_info);
if (stmt_params[i].parameter_type.type == "TIME" ||
stmt_params[i].parameter_type.type == "DATETIME" ||
stmt_params[i].parameter_type.type == "TIMESTAMP") {
descriptor_record.precision = 6;
descriptor_record.scale = 6;
} else if (stmt_params[i].parameter_type.type == "DATE") {
descriptor_record.precision = 0;
descriptor_record.scale = 0;
} else {
descriptor_record.precision = type_info.interval_precision == 0
? type_info.col_size
: type_info.interval_precision;
descriptor_record.scale = (stmt_params[i].parameter_type.type == "RANGE")
? 0
: type_info.maximum_scale;
}
if (record_type.GetValue() == SQL_DOUBLE) {
// hard-coding to 15 to have the same behaviour as internal driver
descriptor_record.length = 15;
} else {
descriptor_record.length = type_info.col_size;
}
handle.BindNewDescriptorRecord(i + 1, descriptor_record);
}
return StatusRecord::Ok();
}
void StatementHandle::CloseCursor() {
ResultSet result_set;
result_set_ = result_set;
if (StatementPrepared()) {
SetStmtState(StmtStates::kStatementPrepared);
} else {
SetStmtState(StmtStates::kStatementNotPrepared);
}
}
} // namespace google::cloud::odbc_bq_driver_internal