X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8d267726acaf5e00b6e16afe60fe5d5f2904028..fa6416df7f26f0b57afa4f7cbde75dd5d5dcbf27:/src/common/dbtable.cpp diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index a07fa6e013..d5f848518b 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -755,7 +755,6 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) int i; wxString sqlStmt; wxString s; -// int NumKeyCols=0; // Calculate the maximum size of the concatenated // keys for use with wxDbGrid @@ -764,7 +763,6 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) { if (colDefs[i].KeyField) { -// NumKeyCols++; m_keysize += colDefs[i].SzDataObj; } } @@ -852,7 +850,6 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (needComma) sqlStmt += wxT(","); sqlStmt += pDb->SQLColumnName(colDefs[i].ColName); -// sqlStmt += colDefs[i].ColName; needComma = true; } needComma = false; @@ -1103,7 +1100,6 @@ void wxDbTable::BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool disti { pSqlStmt += wxT(","); pSqlStmt += pDb->SQLTableName(queryTableName); -// pSqlStmt += queryTableName; pSqlStmt += wxT(".ROWID"); } else @@ -1312,7 +1308,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, switch(colDefs[colNumber].SqlCtype) { case SQL_C_CHAR: -#ifndef __UNIX__ +#ifdef SQL_C_WCHAR case SQL_C_WCHAR: #endif //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR @@ -1857,6 +1853,7 @@ bool wxDbTable::DropIndex(const wxString &indexName) (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,wxT("37000"))) || (pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || (pDb->Dbms() == dbmsINTERBASE && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || + (pDb->Dbms() == dbmsMAXDB && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || (pDb->Dbms() == dbmsFIREBIRD && !wxStrcmp(pDb->sqlState,wxT("HY000"))) || (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,wxT("S0002"))) || // Base table not found (pDb->Dbms() == dbmsMY_SQL && !wxStrcmp(pDb->sqlState,wxT("42S12"))) || // tested by Christopher Ludwik Marino-Cebulski using v3.23.21beta @@ -2205,7 +2202,7 @@ void wxDbTable::ClearMemberVar(UWORD colNumber, bool setToNull) switch(colDefs[colNumber].SqlCtype) { case SQL_C_CHAR: -#ifndef __UNIX__ +#ifdef SQL_C_WCHAR case SQL_C_WCHAR: #endif //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR @@ -2714,8 +2711,14 @@ wxVariant wxDbTable::GetColumn(const int colNumber) const { switch (colDefs[colNumber].SqlCtype) { +#if wxUSE_UNICODE + #if defined(SQL_WCHAR) case SQL_WCHAR: + #endif + #if defined(SQL_WVARCHAR) case SQL_WVARCHAR: + #endif +#endif case SQL_CHAR: case SQL_VARCHAR: val = (wxChar *)(colDefs[colNumber].PtrDataObj); @@ -2780,8 +2783,14 @@ void wxDbTable::SetColumn(const int colNumber, const wxVariant val) switch (colDefs[colNumber].SqlCtype) { +#if wxUSE_UNICODE + #if defined(SQL_WCHAR) case SQL_WCHAR: + #endif + #if defined(SQL_WVARCHAR) case SQL_WVARCHAR: + #endif +#endif case SQL_CHAR: case SQL_VARCHAR: csstrncpyt((wxChar *)(colDefs[colNumber].PtrDataObj),