Replaced <iostream.h> reference with "wx/ioswrap.h"
Replaced wxMessageBox() with wxLogDebug() calls When calling GetColumns(), some drivers/datasources would not return a proper value for columnSize. If columnSize is less than 1, columnSize gets set to bufferLength git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,7 +47,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DBDEBUG_CONSOLE
|
#ifdef DBDEBUG_CONSOLE
|
||||||
#include <iostream.h>
|
#include "wx/ioswrap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
@@ -897,7 +897,7 @@ void wxDB::Close(void)
|
|||||||
{
|
{
|
||||||
s.sprintf("(%-20s) tableID:[%6lu] pDb:[%p]", tiu->tableName,tiu->tableID,tiu->pDb);
|
s.sprintf("(%-20s) tableID:[%6lu] pDb:[%p]", tiu->tableName,tiu->tableID,tiu->pDb);
|
||||||
s2.sprintf("Orphaned found using pDb:[%p]",this);
|
s2.sprintf("Orphaned found using pDb:[%p]",this);
|
||||||
wxMessageBox (s,s2);
|
wxLogDebug (s,s2);
|
||||||
}
|
}
|
||||||
pNode = pNode->Next();
|
pNode = pNode->Next();
|
||||||
}
|
}
|
||||||
@@ -961,7 +961,7 @@ bool wxDB::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
wxMessageBox(odbcErrMsg.GetData(),"DEBUG MESSAGE from DispAllErrors()");
|
wxLogDebug(odbcErrMsg.GetData(),"DEBUG MESSAGE from DispAllErrors()");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1678,7 +1678,16 @@ wxColInf *wxDB::GetColumns(char *tableName[], const char *userID)
|
|||||||
// Determine the wxDB data type that is used to represent the native data type of this data source
|
// Determine the wxDB data type that is used to represent the native data type of this data source
|
||||||
colInf[colNo].dbDataType = 0;
|
colInf[colNo].dbDataType = 0;
|
||||||
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
|
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
|
||||||
|
{
|
||||||
|
if (colInf[colNo].columnSize < 1)
|
||||||
|
{
|
||||||
|
// Apparently mySQL and Postgres (or their ODBC drivers) do not
|
||||||
|
// return a columnSize, so set columnSize = bufferLength
|
||||||
|
// if no column size was returned
|
||||||
|
colInf[colNo].columnSize = colInf[colNo].bufferLength;
|
||||||
|
}
|
||||||
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
|
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
|
||||||
|
}
|
||||||
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
|
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
|
||||||
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
|
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
|
||||||
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
|
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
|
||||||
@@ -1843,7 +1852,16 @@ wxColInf *wxDB::GetColumns(char *tableName, int *numCols, const char *userID)
|
|||||||
// Determine the wxDB data type that is used to represent the native data type of this data source
|
// Determine the wxDB data type that is used to represent the native data type of this data source
|
||||||
colInf[colNo].dbDataType = 0;
|
colInf[colNo].dbDataType = 0;
|
||||||
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
|
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
|
||||||
|
{
|
||||||
|
if (colInf[colNo].columnSize < 1)
|
||||||
|
{
|
||||||
|
// Apparently mySQL and Postgres (or their ODBC drivers) do not
|
||||||
|
// return a columnSize, so set columnSize = bufferLength
|
||||||
|
// if no column size was returned
|
||||||
|
colInf[colNo].columnSize = colInf[colNo].bufferLength;
|
||||||
|
}
|
||||||
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
|
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
|
||||||
|
}
|
||||||
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
|
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
|
||||||
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
|
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
|
||||||
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
|
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
|
||||||
|
Reference in New Issue
Block a user