some warnings fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2082,12 +2082,15 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType,
|
|||||||
|
|
||||||
if (fieldName.Length() > (unsigned int) DB_MAX_COLUMN_NAME_LEN)
|
if (fieldName.Length() > (unsigned int) DB_MAX_COLUMN_NAME_LEN)
|
||||||
{
|
{
|
||||||
int assertColumnNameTooLong = 0;
|
|
||||||
wxStrncpy(colDefs[index].ColName, fieldName, DB_MAX_COLUMN_NAME_LEN);
|
wxStrncpy(colDefs[index].ColName, fieldName, DB_MAX_COLUMN_NAME_LEN);
|
||||||
colDefs[index].ColName[DB_MAX_COLUMN_NAME_LEN] = 0;
|
colDefs[index].ColName[DB_MAX_COLUMN_NAME_LEN] = 0;
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxString tmpMsg;
|
wxString tmpMsg;
|
||||||
tmpMsg.Printf("Column name '%s' is too long. Truncated to '%s'.",fieldName.c_str(),colDefs[index].ColName);
|
tmpMsg.Printf(_T("Column name '%s' is too long. Truncated to '%s'."),
|
||||||
wxASSERT_MSG(assertColumnNameTooLong,tmpMsg.c_str());
|
fieldName.c_str(),colDefs[index].ColName);
|
||||||
|
wxFAIL_MSG(tmpMsg);
|
||||||
|
#endif // __WXDEBUG__
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxStrcpy(colDefs[index].ColName, fieldName);
|
wxStrcpy(colDefs[index].ColName, fieldName);
|
||||||
@@ -2173,8 +2176,7 @@ wxDbColDataPtr* wxDbTable::SetColDefs(wxDbColInf *pColInfs, UWORD numCols)
|
|||||||
pColDataPtrs[index].SqlCtype = SQL_C_TIMESTAMP;
|
pColDataPtrs[index].SqlCtype = SQL_C_TIMESTAMP;
|
||||||
break;
|
break;
|
||||||
case DB_DATA_TYPE_BLOB:
|
case DB_DATA_TYPE_BLOB:
|
||||||
int notSupportedYet = 0;
|
wxFAIL_MSG(wxT("This form of ::SetColDefs() cannot be used with BLOB columns"));
|
||||||
wxASSERT_MSG(notSupportedYet, wxT("This form of ::SetColDefs() cannot be used with BLOB columns"));
|
|
||||||
pColDataPtrs[index].PtrDataObj = /*BLOB ADDITION NEEDED*/NULL;
|
pColDataPtrs[index].PtrDataObj = /*BLOB ADDITION NEEDED*/NULL;
|
||||||
pColDataPtrs[index].SzDataObj = /*BLOB ADDITION NEEDED*/sizeof(void *);
|
pColDataPtrs[index].SzDataObj = /*BLOB ADDITION NEEDED*/sizeof(void *);
|
||||||
pColDataPtrs[index].SqlCtype = SQL_VARBINARY;
|
pColDataPtrs[index].SqlCtype = SQL_VARBINARY;
|
||||||
|
Reference in New Issue
Block a user