break;
}
}
- if (j && pDb->Dbms() != dbmsDBASE) // Found a keyfield
+ if (j && (pDb->Dbms() != dbmsDBASE)
+ && (pDb->Dbms() != dbmsXBASE_SEQUITER)
+ ) // Found a keyfield
{
switch (pDb->Dbms())
{
sqlStmt += pDb->SQLColumnName(pIdxDefs[i].ColName);
// sqlStmt += pIdxDefs[i].ColName;
+ // MySQL requires a key length on VARCHAR keys
+ if ( pDb->Dbms() == dbmsMY_SQL )
+ {
+ // Find the details on this column
+ int j;
+ for ( j = 0; j < noCols; ++j )
+ {
+ if ( wxStrcmp( pIdxDefs[i].ColName, colDefs[j].ColName ) == 0 )
+ {
+ break;
+ }
+ }
+ if ( colDefs[j].DbDataType == DB_DATA_TYPE_VARCHAR)
+ {
+ wxString s;
+ s.Printf(wxT("(%d)"), colDefs[i].SzDataObj);
+ sqlStmt += s;
+ }
+ }
+
// Postgres and SQL Server 7 do not support the ASC/DESC keywords for index columns
if (!((pDb->Dbms() == dbmsMS_SQL_SERVER) && (strncmp(pDb->dbInf.dbmsVer,"07",2)==0)) &&
!(pDb->Dbms() == dbmsPOSTGRES))
pDb->SQLTableName(idxName.c_str()).c_str(),
pDb->SQLTableName(tableName.c_str()).c_str());
else if ((pDb->Dbms() == dbmsMS_SQL_SERVER) ||
- (pDb->Dbms() == dbmsSYBASE_ASE))
+ (pDb->Dbms() == dbmsSYBASE_ASE) ||
+ (pDb->Dbms() == dbmsXBASE_SEQUITER))
sqlStmt.Printf(wxT("DROP INDEX %s.%s"),
pDb->SQLTableName(tableName.c_str()).c_str(),
pDb->SQLTableName(idxName.c_str()).c_str());
void csstrncpyt(char *s, const char *t, int n)
{
- while ((*s++ = *t++) && --n)
- {};
+ while ( (*s++ = *t++) != '\0' && --n )
+ ;
*s = '\0';
}