message: Rollback data pointer conversion and removed unneeded function (IsNumeric).
diff: #include "duckdb/main/prepared_statement_data.hpp"
  #include "duckdb/common/types/decimal.hpp"
  +#include <string.h>
  +
  using duckdb::Decimal;
  using duckdb::hugeint_t;
  using duckdb::idx_t;
  @@ -12,28 +14,6 @@ using duckdb::Load;
  using duckdb::LogicalType;
  using duckdb::Value;
  -bool IsNumeric(SQLSMALLINT value_type) {
  - switch (value_type) {
  - case SQL_C_TINYINT:
  - case SQL_C_STINYINT:
  - case SQL_C_UTINYINT:
  - case SQL_C_SHORT:
  - case SQL_C_SSHORT:
  - case SQL_C_USHORT:
  - case SQL_C_SLONG:
  - case SQL_C_LONG:
  - case SQL_C_ULONG:
  - case SQL_C_SBIGINT:
  - case SQL_C_UBIGINT:
  - case SQL_C_FLOAT:
  - case SQL_C_DOUBLE:
  - case SQL_NUMERIC:
  - return true;
  - default:
  - return false;
  - }
  -}
  -
  SQLRETURN ValidateNumeric(int precision, int scale) {
  if (precision < 1 || precision > Decimal::MAX_WIDTH_DECIMAL || scale < 0 || scale > Decimal::MAX_WIDTH_DECIMAL ||
  scale > precision) {
  @@ -57,14 +37,7 @@ SQLRETURN SQLBindParameter(SQLHSTMT statement_handle, SQLUSMALLINT parameter_num
  // it would appear that the parameter_type does not matter that much
  // we cast it anyway and if the cast fails we will hear about it during execution
  duckdb::Value res;
  - duckdb::const_data_ptr_t dataptr;
  - // cast properly to numeric type
  - if (IsNumeric(value_type)) {
  - auto numeric = (SQL_NUMERIC_STRUCT *)parameter_value_ptr;
  - dataptr = numeric->val;
  - } else {
  - dataptr = (duckdb::const_data_ptr_t)parameter_value_ptr;
  - }
  + duckdb::const_data_ptr_t dataptr = (duckdb::const_data_ptr_t)parameter_value_ptr;
  switch (value_type) {
  case SQL_C_CHAR:
  @@ -104,6 +77,9 @@ SQLRETURN SQLBindParameter(SQLHSTMT statement_handle, SQLUSMALLINT parameter_num
  res = Value::DOUBLE(Load<double>(dataptr));
  break;
  case SQL_NUMERIC: {
  + auto numeric = (SQL_NUMERIC_STRUCT *)parameter_value_ptr;
  + dataptr = numeric->val;
  +
  auto precision = column_size;
  if (ValidateNumeric(precision, decimal_digits) == SQL_ERROR) {
  return SQL_ERROR;
  