From f6276db4d07b87c8efdcfbad520b15ed25a39163 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 26 Oct 2007 00:10:09 +0000 Subject: [PATCH] fixed amb1067 - SQL_SetAffinity crashed when targeting sqlite --- dlls/sqlite/sqlitepp/ISQLDriver.h | 4 ++++ dlls/sqlite/sqlitepp/SqliteDriver.cpp | 4 ++++ dlls/sqlite/sqlitepp/SqliteDriver.h | 1 + 3 files changed, 9 insertions(+) diff --git a/dlls/sqlite/sqlitepp/ISQLDriver.h b/dlls/sqlite/sqlitepp/ISQLDriver.h index f0cb6a15..78b25dca 100644 --- a/dlls/sqlite/sqlitepp/ISQLDriver.h +++ b/dlls/sqlite/sqlitepp/ISQLDriver.h @@ -141,11 +141,13 @@ namespace SourceMod struct DatabaseInfo { + DatabaseInfo() : max_timeout(0) { }; const char *host; const char *database; const char *user; const char *pass; unsigned int port; + unsigned int max_timeout; }; class ISQLDriver @@ -154,6 +156,8 @@ namespace SourceMod virtual ~ISQLDriver() { }; public: virtual IDatabase *Connect(DatabaseInfo *info, int *errcode, char *error, size_t maxlength) =0; + //Supports the timeout clause + virtual IDatabase *Connect2(DatabaseInfo *info, int *errcode, char *error, size_t maxlength) =0; virtual const char *NameString() =0; virtual bool IsCompatDriver(const char *namestring) =0; }; diff --git a/dlls/sqlite/sqlitepp/SqliteDriver.cpp b/dlls/sqlite/sqlitepp/SqliteDriver.cpp index b49447ba..0ba5088b 100644 --- a/dlls/sqlite/sqlitepp/SqliteDriver.cpp +++ b/dlls/sqlite/sqlitepp/SqliteDriver.cpp @@ -35,6 +35,10 @@ int busy_handler(void *unused1, int unused2) return 1; } +IDatabase *SqliteDriver::Connect2(DatabaseInfo *info, int *errcode, char *error, size_t maxlength) +{ + return Connect(info, errcode, error, maxlength); +} IDatabase *SqliteDriver::Connect(DatabaseInfo *info, int *errcode, char *error, size_t maxlength) { diff --git a/dlls/sqlite/sqlitepp/SqliteDriver.h b/dlls/sqlite/sqlitepp/SqliteDriver.h index 7ee2e786..b23d06e4 100644 --- a/dlls/sqlite/sqlitepp/SqliteDriver.h +++ b/dlls/sqlite/sqlitepp/SqliteDriver.h @@ -9,6 +9,7 @@ namespace SourceMod { public: IDatabase *Connect(DatabaseInfo *info, int *errcode, char *error, size_t maxlength); + IDatabase *Connect2(DatabaseInfo *info, int *errcode, char *error, size_t maxlength); const char *NameString(); bool IsCompatDriver(const char *namestr); };