Server/Database: Reduce differences between 3.3.5 and 6.x branches

Cherry-pick 1bea52fd46 and 543bea32 to add support to TYPE_BINARY MySQL field type
This commit is contained in:
jackpoz
2016-08-10 16:02:22 +02:00
parent 3755937611
commit abe37e458c
5 changed files with 59 additions and 18 deletions

View File

@@ -56,6 +56,7 @@ enum PreparedStatementValueType
TYPE_FLOAT,
TYPE_DOUBLE,
TYPE_STRING,
TYPE_BINARY,
TYPE_NULL
};
@@ -63,7 +64,7 @@ struct PreparedStatementData
{
PreparedStatementDataUnion data;
PreparedStatementValueType type;
std::string str;
std::vector<uint8> binary;
};
//- Forward declare
@@ -92,6 +93,7 @@ class TC_DATABASE_API PreparedStatement
void setFloat(const uint8 index, const float value);
void setDouble(const uint8 index, const double value);
void setString(const uint8 index, const std::string& value);
void setBinary(const uint8 index, const std::vector<uint8>& value);
void setNull(const uint8 index);
protected:
@@ -129,7 +131,7 @@ class TC_DATABASE_API MySQLPreparedStatement
void setInt64(const uint8 index, const int64 value);
void setFloat(const uint8 index, const float value);
void setDouble(const uint8 index, const double value);
void setString(const uint8 index, const char* value);
void setBinary(const uint8 index, const std::vector<uint8>& value, bool isString);
void setNull(const uint8 index);
protected: