Commit f80f1cc2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

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

parent f4bcb105
......@@ -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");
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment