From 00c989eb44772b0dbb7a412e389caf18250ebcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 29 Jan 2013 22:23:49 +0000 Subject: [PATCH] [GB.DB.SQLITE3] * BUG: Quote index name and primary key fields. git-svn-id: svn://localhost/gambas/trunk@5527 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.db.sqlite3/src/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gb.db.sqlite3/src/main.cpp b/gb.db.sqlite3/src/main.cpp index 1f68f19f9..99e8b054b 100644 --- a/gb.db.sqlite3/src/main.cpp +++ b/gb.db.sqlite3/src/main.cpp @@ -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(" )");