aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/PreparedStatement.h
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-19 15:25:50 +0200
committerMachiavelli <none@none>2010-09-19 15:25:50 +0200
commit22571e9443ca3d1211f1f9888c67156481916d8b (patch)
treeda772e3f7dd6c8c4381adf1bad8fc7879440818d /src/server/shared/Database/PreparedStatement.h
parentb50c931d6eddb9493c494bc09900c79893b0bf1a (diff)
Core/DBLayer:
- Allow storing floats in prepared statements explicitly (previously would be casted to double) - Add GetBool ¨wrapper/hack¨ to PreparedResultset class. --HG-- branch : trunk
Diffstat (limited to 'src/server/shared/Database/PreparedStatement.h')
-rw-r--r--src/server/shared/Database/PreparedStatement.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/shared/Database/PreparedStatement.h b/src/server/shared/Database/PreparedStatement.h
index ad95789102b..00e7ad89018 100644
--- a/src/server/shared/Database/PreparedStatement.h
+++ b/src/server/shared/Database/PreparedStatement.h
@@ -33,7 +33,8 @@ union PreparedStatementDataUnion
int32 i32;
uint64 ui64;
int64 i64;
- double f; // TODO: Maybe split it up in double and float types
+ float f;
+ double d;
};
//- This enum helps us differ data held in above union
@@ -49,6 +50,7 @@ enum PreparedStatementValueType
TYPE_I32,
TYPE_I64,
TYPE_FLOAT,
+ TYPE_DOUBLE,
TYPE_STRING
};
@@ -82,6 +84,7 @@ class PreparedStatement
void setInt16(const uint8 index, const int16 value);
void setInt32(const uint8 index, const int32 value);
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 std::string& value);
@@ -115,6 +118,7 @@ class MySQLPreparedStatement
void setInt16(const uint8 index, const int16 value);
void setInt32(const uint8 index, const int32 value);
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);