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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <algorithm>
#include <cstdint>
#include <cstring>
#include "arrow/array.h"

namespace driver {
Expand All @@ -44,7 +45,7 @@ inline RowStatus MoveSingleCellToBinaryBuffer(ColumnBinding* binding, BinaryArra

auto* byte_buffer =
static_cast<unsigned char*>(binding->buffer) + i * binding->buffer_length;
memcpy(byte_buffer, ((char*)value) + value_offset, value_length);
std::memcpy(byte_buffer, ((char*)value) + value_offset, value_length);

if (remaining_length > binding->buffer_length) {
result = odbcabstraction::RowStatus_SUCCESS_WITH_INFO;
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/arrow/flight/sql/odbc/flight_sql/accessors/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <algorithm>
#include <cstdint>
#include <cstring>
#include "arrow/array.h"
#include "arrow/flight/sql/odbc/flight_sql/accessors/types.h"
#include "arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/diagnostics.h"
Expand All @@ -43,7 +44,7 @@ inline size_t CopyFromArrayValuesToBinding(ARRAY_TYPE* array, ColumnBinding* bin
}
}
} else {
// Duplicate this loop to avoid null checks within the loop.
// Duplicate above for-loop to exit early when null value is found
for (int64_t i = starting_row; i < starting_row + cells; ++i) {
if (array->IsNull(i)) {
throw odbcabstraction::NullWithoutIndicatorException();
Expand All @@ -55,7 +56,7 @@ inline size_t CopyFromArrayValuesToBinding(ARRAY_TYPE* array, ColumnBinding* bin
// Note that the array should already have been sliced down to the same number
// of elements in the ODBC data array by the point in which this function is called.
const auto* values = array->raw_values();
memcpy(binding->buffer, &values[starting_row], element_size * cells);
std::memcpy(binding->buffer, &values[starting_row], element_size * cells);

return cells;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "arrow/flight/sql/odbc/flight_sql/accessors/string_array_accessor.h"

#include <boost/locale.hpp>
#include <cstring>
#include "arrow/array.h"
#include "arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h"

Expand Down Expand Up @@ -88,7 +89,7 @@ inline RowStatus MoveSingleCellToCharBuffer(std::vector<uint8_t>& buffer,

auto* byte_buffer = static_cast<char*>(binding->buffer) + i * binding->buffer_length;
auto* char_buffer = (CHAR_TYPE*)byte_buffer;
memcpy(char_buffer, ((char*)value) + value_offset, value_length);
std::memcpy(char_buffer, ((char*)value) + value_offset, value_length);

// Write a NUL terminator
if (binding->buffer_length >= remaining_length + sizeof(CHAR_TYPE)) {
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/arrow/flight/sql/odbc/flight_sql/get_info_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -954,21 +954,21 @@ bool GetInfoCache::LoadInfoFromServer() {
break;
}
case SqlInfoOptions::SQL_SUPPORTED_RESULT_SET_TYPES:
// Ignored. Warpdrive supports forward-only only.
// Ignored. Arrow ODBC supports forward-only only.
break;
case SqlInfoOptions::SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_UNSPECIFIED:
// Ignored. Warpdrive supports forward-only only.
// Ignored. Arrow ODBC supports forward-only only.
break;
case SqlInfoOptions::SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_FORWARD_ONLY:
// Ignored. Warpdrive supports forward-only only.
// Ignored. Arrow ODBC supports forward-only only.
break;
case SqlInfoOptions::
SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_SENSITIVE:
// Ignored. Warpdrive supports forward-only only.
// Ignored. Arrow ODBC supports forward-only only.
break;
case SqlInfoOptions::
SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_INSENSITIVE:
// Ignored. Warpdrive supports forward-only only.
// Ignored. Arrow ODBC supports forward-only only.
break;

// List<string> properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ inline SQLRETURN GetAttributeUTF8(const std::string_view& attribute_value,
if (output) {
size_t output_len_before_null =
std::min(static_cast<O>(attribute_value.size()), static_cast<O>(output_size - 1));
memcpy(output, attribute_value.data(), output_len_before_null);
std::memcpy(output, attribute_value.data(), output_len_before_null);
reinterpret_cast<char*>(output)[output_len_before_null] = '\0';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ inline size_t ConvertToSqlWChar(const std::string_view& str, SQLWCHAR* buffer,
SQLLEN value_length_in_bytes = wstr.size();

if (buffer) {
memcpy(buffer, wstr.data(),
std::min(static_cast<SQLLEN>(wstr.size()), buffer_size_in_bytes));
std::memcpy(buffer, wstr.data(),
std::min(static_cast<SQLLEN>(wstr.size()), buffer_size_in_bytes));

// Write a NUL terminator
if (buffer_size_in_bytes >=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void ODBCStatement::CopyAttributesFromConnection(ODBCConnection& connection) {
ODBCStatement& tracking_statement = connection.GetTrackingStatement();

// Get abstraction attributes and copy to this spi_statement_.
// Possible ODBC attributes are below, but many of these are not supported by warpdrive
// Possible ODBC attributes are below, but many of these are not supported by Arrow ODBC
// or ODBCAbstaction:
// SQL_ATTR_ASYNC_ENABLE:
// SQL_ATTR_METADATA_ID:
Expand Down
Loading