Increased the max length of allowed WHERE clauses and full statements (eventually needs to be changed over to use wxString).

Fixed the order of params in TablePrivileges()
Changed 0s to NULLs in params


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker 2000-11-24 16:46:11 +00:00
parent 2b63ff5d38
commit eb3b9ddac4
2 changed files with 10 additions and 9 deletions

View File

@ -124,8 +124,8 @@ extern char const *SQL_CATALOG_FILENAME;
// Database Globals
const int DB_TYPE_NAME_LEN = 40;
const int DB_MAX_STATEMENT_LEN = 2048;
const int DB_MAX_WHERE_CLAUSE_LEN = 1024;
const int DB_MAX_STATEMENT_LEN = 4096;
const int DB_MAX_WHERE_CLAUSE_LEN = 2048;
const int DB_MAX_ERROR_MSG_LEN = 512;
const int DB_MAX_ERROR_HISTORY = 5;
const int DB_MAX_TABLE_NAME_LEN = 128;
@ -532,7 +532,7 @@ public:
int GetColumnCount(char *tableName, const char *userID=NULL);
const char *GetDatabaseName(void) {return dbInf.dbmsName;}
const char *GetDataSource(void) {return (const char *)dsn;}
const char *GetDataSourceName(void){return (const char *)dsn;}
const char *GetDatasourceName(void){return (const char *)dsn;}
const char *GetUsername(void) {return (const char *)uid;}
const char *GetPassword(void) {return (const char *)authStr;}
bool IsOpen(void) {return dbIsOpen;}
@ -546,8 +546,8 @@ public:
wxDbSqlTypeInfo GetTypeInfDate() {return typeInfDate;}
bool TableExists(const char *tableName, const char *userID=NULL, const char *path=NULL); // Table name can refer to a table, view, alias or synonym
bool TablePrivileges(const char *tableName, const char* priv, const char *schema=NULL, const char *userID=NULL, const char *path=""); // Table name can refer to a table, view, alias or synonym
void LogError(const char *errMsg, const char *SQLState = 0) {logError(errMsg, SQLState);}
bool TablePrivileges(const char *tableName, const char* priv, const char *userID="", const char *schema=NULL, const char *path=""); // Table name can refer to a table, view, alias or synonym
void LogError(const char *errMsg, const char *SQLState = NULL) {logError(errMsg, SQLState);}
void SetDebugErrorMessages(bool state) { silent = !state; }
bool SetSqlLogging(wxDbSqlLogState state, const wxChar *filename = SQL_LOG_FILENAME, bool append = FALSE);
bool WriteSqlLog(const wxChar *logMsg);

View File

@ -563,7 +563,7 @@ bool wxDb::Open(char *Dsn, char *Uid, char *AuthStr)
bool wxDb::Open(wxDb *copyDb)
{
dsn = (char *)copyDb->GetDataSourceName();
dsn = (char *)copyDb->GetDatasourceName();
uid = (char *)copyDb->GetUsername();
authStr = (char *)copyDb->GetPassword();
@ -3032,8 +3032,8 @@ bool wxDb::TableExists(const char *tableName, const char *userID, const char *ta
/********** wxDb::TablePrivileges() **********/
bool wxDb::TablePrivileges(const char *tableName, const char* priv, const char *schema,
const char *userID, const char *tablePath)
bool wxDb::TablePrivileges(const char *tableName, const char* priv, const char *userID,
const char *schema, const char *tablePath)
{
wxDbTablePrivilegeInfo result;
SDWORD cbRetVal;
@ -3047,6 +3047,7 @@ bool wxDb::TablePrivileges(const char *tableName, const char* priv, const char *
wxString UserID;
wxString TableName;
assert(userID);
assert(tableName && wxStrlen(tableName));
if (userID)
@ -3452,7 +3453,7 @@ void WXDLLEXPORT wxDbCloseConnections(void)
} // wxDbCloseConnections()
/********** wxDbNumberConnectionsInUse() **********/
/********** wxDbConnectionsInUse() **********/
int WXDLLEXPORT wxDbConnectionsInUse(void)
{
wxDbList *pList;