[GB.DB.SQLITE3]
* BUG: Quote index name and primary key fields. git-svn-id: svn://localhost/gambas/trunk@5527 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
41cf42c003
commit
00c989eb44
1 changed files with 9 additions and 3 deletions
|
@ -1645,7 +1645,9 @@ static int table_create(DB_DATABASE * db, const char *table, DB_FIELD * fields,
|
|||
if (i > 0)
|
||||
DB.Query.Add(",");
|
||||
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
DB.Query.Add(primary[i]);
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
}
|
||||
|
||||
DB.Query.Add(")");
|
||||
|
@ -2102,17 +2104,21 @@ static int index_delete(DB_DATABASE * db, const char *table, const char *index)
|
|||
|
||||
*****************************************************************************/
|
||||
|
||||
static int index_create(DB_DATABASE * db, const char *table, const char *index, DB_INDEX * info)
|
||||
static int index_create(DB_DATABASE * db, const char *table, const char *index, DB_INDEX *info)
|
||||
{
|
||||
DB.Query.Init();
|
||||
|
||||
DB.Query.Add("CREATE ");
|
||||
if (info->unique)
|
||||
DB.Query.Add("UNIQUE ");
|
||||
DB.Query.Add("INDEX '");
|
||||
DB.Query.Add("INDEX ");
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
DB.Query.Add(index);
|
||||
DB.Query.Add("' ON ");
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
DB.Query.Add(" ON ");
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
DB.Query.Add(table);
|
||||
DB.Query.Add(QUOTE_STRING);
|
||||
DB.Query.Add(" ( ");
|
||||
DB.Query.Add(info->fields);
|
||||
DB.Query.Add(" )");
|
||||
|
|
Loading…
Reference in a new issue