22#include <config_lgpl.h>
24#include <com/sun/star/uno/XInterface.hpp>
25#include <com/sun/star/sdbc/SQLException.hpp>
27#include <osl/diagnose.h>
31#pragma GCC diagnostic push
32#pragma GCC diagnostic ignored "-Wdeprecated"
36#pragma GCC diagnostic pop
42void resetSqlVar(
void** target, T* pValue, enum_field_types
type, sal_Int32 nSize = 0)
49 constexpr auto nUnitSize =
sizeof(T);
52 case MYSQL_TYPE_INT24:
54 case MYSQL_TYPE_NEWDATE:
56 case MYSQL_TYPE_GEOMETRY:
58 case MYSQL_TYPE_SHORT:
60 case MYSQL_TYPE_LONGLONG:
61 case MYSQL_TYPE_FLOAT:
62 case MYSQL_TYPE_DOUBLE:
65 case MYSQL_TYPE_DATETIME:
66 case MYSQL_TYPE_TIMESTAMP:
67 *target = malloc(nUnitSize);
68 memcpy(*target, pValue, nUnitSize);
70 case MYSQL_TYPE_STRING:
72 case MYSQL_TYPE_DECIMAL:
73 case MYSQL_TYPE_VARCHAR:
74 case MYSQL_TYPE_NEWDECIMAL:
77 case MYSQL_TYPE_VAR_STRING:
78 case MYSQL_TYPE_TINY_BLOB:
79 case MYSQL_TYPE_MEDIUM_BLOB:
80 case MYSQL_TYPE_LONG_BLOB:
81 *target = malloc(nUnitSize * nSize);
82 memcpy(*target, pValue, nUnitSize * nSize);
88 OSL_FAIL(
"resetSqlVar: unknown enum_field_type");
92void allocateSqlVar(
void** mem, enum_field_types eType,
unsigned nSize = 0);
95 const char* _pAsciiFeatureName,
const css::uno::Reference<css::uno::XInterface>& _rxContext);
98 const css::uno::Reference<css::uno::XInterface>& _rxContext);
101 const css::uno::Reference<css::uno::XInterface>& _context,
102 const rtl_TextEncoding encoding);
105 const css::uno::Reference<css::uno::XInterface>& _context);
109OUString
mysqlTypeToStr(
unsigned mysql_type,
unsigned mysql_flags);
113OUString
convert(const ::std::string& _string,
const rtl_TextEncoding encoding);
OUString convert(const ::std::string &_string, const rtl_TextEncoding encoding)
sal_Int32 mysqlStrToOOOType(std::u16string_view sType)
void throwInvalidArgumentException(const char *_pAsciiFeatureName, const css::uno::Reference< XInterface > &_rxContext)
void allocateSqlVar(void **mem, enum_field_types eType, unsigned nSize)
void resetSqlVar(void **target, T *pValue, enum_field_types type, sal_Int32 nSize=0)
sal_Int32 mysqlToOOOType(int eType, int charsetnr) noexcept
void throwSQLExceptionWithMsg(const char *msg, const char *SQLSTATE, unsigned int errorNum, const css::uno::Reference< css::uno::XInterface > &_context, const rtl_TextEncoding encoding)
OUString mysqlTypeToStr(unsigned type, unsigned flags)
void throwFeatureNotImplementedException(const char *_pAsciiFeatureName, const css::uno::Reference< XInterface > &_rxContext)