msi: Accept '\5' and '-' in SQL identifiers.

This commit is contained in:
Hans Leidekker 2010-02-19 12:25:09 +01:00 committed by Alexandre Julliard
parent f4bcb105d2
commit f80f1cc2db
2 changed files with 26 additions and 2 deletions

View File

@ -683,6 +683,30 @@ static void test_msibadqueries(void)
r = try_query( hdb, "select * from 'c'");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "CREATE TABLE `\5a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "SELECT * FROM \5a" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "CREATE TABLE `a\5` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "SELECT * FROM a\5" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "CREATE TABLE `-a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "SELECT * FROM -a" );
todo_wine ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "CREATE TABLE `a-` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = try_query( hdb, "SELECT * FROM a-" );
ok( r == ERROR_SUCCESS , "query failed: %u\n", r );
r = MsiCloseHandle( hdb );
ok(r == ERROR_SUCCESS , "Failed to close database transact\n");

View File

@ -166,9 +166,9 @@ static int sqliteKeywordCode(const WCHAR *z, int n){
*/
static const char isIdChar[] = {
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, /* 2x */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */