Replace vector<uchar> with octets type alias
This commit is contained in:
parent
b6284cdb15
commit
fb61dfbd7f
@ -86,6 +86,7 @@ inline int64_t portable_integer(const uint8_t* p, short length)
|
|||||||
|
|
||||||
inline std::string type_name(unsigned int type)
|
inline std::string type_name(unsigned int type)
|
||||||
{
|
{
|
||||||
|
// 0-bit means nullability, clear before switch
|
||||||
switch (type & ~1u)
|
switch (type & ~1u)
|
||||||
{
|
{
|
||||||
case SQL_ARRAY:
|
case SQL_ARRAY:
|
||||||
@ -363,7 +364,7 @@ struct parameter
|
|||||||
int subtype;
|
int subtype;
|
||||||
int scale;
|
int scale;
|
||||||
std::string str_value;
|
std::string str_value;
|
||||||
std::vector<uint8_t> octets_value;
|
octets octets_value;
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
@ -582,7 +583,7 @@ public:
|
|||||||
m_parameters.at(i) = std::move(p);
|
m_parameters.at(i) = std::move(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(unsigned int i, const std::vector<uint8_t>& value)
|
void set(unsigned int i, const octets& value)
|
||||||
{
|
{
|
||||||
parameter p{};
|
parameter p{};
|
||||||
p.type = MY_SQL_OCTETS;
|
p.type = MY_SQL_OCTETS;
|
||||||
@ -980,13 +981,13 @@ inline std::string result_set::as<std::string>(unsigned i) const
|
|||||||
/// <param name="i"></param>
|
/// <param name="i"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
template <>
|
template <>
|
||||||
inline std::vector<uint8_t> result_set::as<std::vector<uint8_t>>(unsigned i) const
|
inline octets result_set::as<octets>(unsigned i) const
|
||||||
{
|
{
|
||||||
assert(i >= 1);
|
assert(i >= 1);
|
||||||
auto const& f = m_fields.at(i - 1);
|
auto const& f = m_fields.at(i - 1);
|
||||||
check_field_null(f.name, f.null_offset);
|
check_field_null(f.name, f.null_offset);
|
||||||
auto start = m_buffer.data() + f.offset;
|
auto start = m_buffer.data() + f.offset;
|
||||||
return std::vector<uint8_t>(start, start + f.length);
|
return octets(start, start + f.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1177,7 +1178,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
statement& set(unsigned i, const std::vector<uint8_t>& value)
|
statement& set(unsigned i, const octets& value)
|
||||||
{
|
{
|
||||||
debug("statement: ", this, ", set #", i, " -> octets");
|
debug("statement: ", this, ", set #", i, " -> octets");
|
||||||
get_input_parameters()->set(i - 1, value);
|
get_input_parameters()->set(i - 1, value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user