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:
@@ -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(")");
|
||||
|
||||
Reference in New Issue
Block a user