X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..a631300cb83b23107f5b61bd96a97a6ef05cc122:/src/common/db.cpp diff --git a/src/common/db.cpp b/src/common/db.cpp index 1d014c2ced..6f0e8dce24 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -53,9 +53,6 @@ #include "wx/object.h" #include "wx/list.h" #include "wx/utils.h" - #if wxUSE_GUI - #include "wx/msgdlg.h" - #endif #include "wx/log.h" #endif #include "wx/filefn.h" @@ -3067,7 +3064,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) GetData(7,SQL_C_SLONG, (UCHAR *)&precision, 0, &cb); GetData(8,SQL_C_SLONG, (UCHAR *)&length, 0, &cb); - outStr.Printf(wxT("%-32s %-32s (%04d)%-15s %9d %9d\n"), + outStr.Printf(wxT("%-32s %-32s (%04d)%-15s %9ld %9ld\n"), tblName, colName, sqlDataType, typeName, precision, length); if (fputs(outStr.c_str(), fp) == EOF) { @@ -3576,15 +3573,23 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, } // create the SQL statement - sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(), + if ( Dbms() == dbmsMY_SQL ) + { + sqlStmt.Printf(wxT("ALTER TABLE %s %s %s %s"), tableName.c_str(), alterSlashModify.c_str(), + columnName.c_str(), dataTypeName.c_str()); + } + else + { + sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(), columnName.c_str(), dataTypeName.c_str()); + } // For varchars only, append the size of the column if (dataType == DB_DATA_TYPE_VARCHAR && (Dbms() != dbmsMY_SQL || dataTypeName != "text")) { wxString s; - s.Printf(wxT("(%d)"), columnLength); + s.Printf(wxT("(%lu)"), columnLength); sqlStmt += s; }