]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dbtable.cpp
Made widgets sample take up less space
[wxWidgets.git] / src / common / dbtable.cpp
index fcdbf3e1b42aa0d2a7b8a3640d4f6a00711c8fbb..cf3860dfcfb1fcf1cbea72be97ecb60f5b7c2244 100644 (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(")");