MCPcopy Create free account
hub / github.com/apache/arrow / BindCol

Method BindCol

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_descriptor.cc:537–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535std::vector<DescriptorRecord>& ODBCDescriptor::GetRecords() { return records_; }
536
537void ODBCDescriptor::BindCol(SQLSMALLINT record_number, SQLSMALLINT c_type,
538 SQLPOINTER data_ptr, SQLLEN buffer_length,
539 SQLLEN* indicator_ptr) {
540 assert(is_app_descriptor_);
541 assert(is_writable_);
542
543 // The set of records auto-expands to the supplied record number.
544 if (records_.size() < static_cast<size_t>(record_number)) {
545 records_.resize(record_number);
546 }
547
548 SQLSMALLINT zero_based_record_index = record_number - 1;
549 DescriptorRecord& record = records_[zero_based_record_index];
550
551 record.type = c_type;
552 record.indicator_ptr = indicator_ptr;
553 record.length = buffer_length;
554
555 // Initialize default precision and scale for SQL_C_NUMERIC.
556 if (record.type == SQL_C_NUMERIC) {
557 record.precision = 38;
558 record.scale = 0;
559 }
560 SetDataPtrOnRecord(data_ptr, record_number);
561}
562
563void ODBCDescriptor::SetDataPtrOnRecord(SQLPOINTER data_ptr, SQLSMALLINT record_number) {
564 assert(static_cast<size_t>(record_number) <= records_.size());

Callers 1

SQLBindColFunction · 0.80

Calls 2

resizeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected