Semi-Blind fixes for trying to handle different versions of MySQL and MySQL windows drivers

Hopefully better handling of DATE type fields
New parameter added to optionally not have database connections fail if a basic data type (like DATE) is not reported as supported by the datasource


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2002-03-22 13:43:15 +00:00
parent b58a1455e1
commit e25cdb868f
3 changed files with 47 additions and 18 deletions

View File

@@ -1384,7 +1384,8 @@ bool wxDbTable::CreateTable(bool attemptDrop)
break;
}
// For varchars, append the size of the string
if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)// ||
if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR &&
(pDb->Dbms() != dbmsMY_SQL || pDb->GetTypeInfVarchar().TypeName != "text"))// ||
// colDefs[i].DbDataType == DB_DATA_TYPE_BLOB)
{
wxString s;
@@ -1456,7 +1457,14 @@ bool wxDbTable::CreateTable(bool attemptDrop)
if (j++) // Multi part key, comma separate names
sqlStmt += wxT(",");
sqlStmt += pDb->SQLColumnName(colDefs[i].ColName);
// sqlStmt += colDefs[i].ColName;
if (pDb->Dbms() == dbmsMY_SQL &&
colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR)
{
wxString s;
s.Printf(wxT("(%d)"), colDefs[i].SzDataObj);
sqlStmt += s;
}
}
}
sqlStmt += wxT(")");