added amb1377 - binary sql functions

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401918
This commit is contained in:
David Anderson
2008-03-02 18:01:49 +00:00
parent b3c7d4803f
commit 31a745422d
7 changed files with 142 additions and 9 deletions
+31
View File
@@ -226,6 +226,37 @@ IQuery *MyDatabase::DoQuery(const char *query)
return new MyQuery(this, res);
}
bool MyDatabase::DoSimpleQueryEx(const char *query, size_t len)
{
IQuery *pQuery = DoQueryEx(query, len);
if (!pQuery)
{
return false;
}
pQuery->Destroy();
return true;
}
IQuery *MyDatabase::DoQueryEx(const char *query, size_t len)
{
if (mysql_real_query(m_mysql, query, len) != 0)
{
return NULL;
}
MYSQL_RES *res = NULL;
if (mysql_field_count(m_mysql))
{
res = mysql_store_result(m_mysql);
if (!res)
{
return NULL;
}
}
return new MyQuery(this, res);
}
IPreparedQuery *MyDatabase::PrepareQuery(const char *query, char *error, size_t maxlength, int *errCode)
{
MYSQL_STMT *stmt = mysql_stmt_init(m_mysql);
+2
View File
@@ -58,6 +58,8 @@ public: //IDatabase
void UnlockFromFullAtomicOperation();
void IncReferenceCount();
IDBDriver *GetDriver();
bool DoSimpleQueryEx(const char *query, size_t len);
IQuery *DoQueryEx(const char *query, size_t len);
public:
const DatabaseInfo &GetInfo();
private: