-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
The SQLiteWriter::addValue method treats identifiers case-sensitively in its schema handling, which differs from SQLite, where they are treated case-insensitively (ref. sqlite3_stricmp).
This leads to errors if SQLiteWriter thinks tables foo and Foo are different tables, but SQLite does not:
sqw.addValue({{"a", 0}}, "foo");
sqw.addValue({{"c", 0}}, "Foo");
sqw.addValue({{"c", 0}}, "foo");
// exception: Error executing sqlite3 query 'ALTER table "foo" add column "c" INT ': duplicate column name: cSimilarly for column names:
sqw.addValue({{"a", 0}}, "bar");
sqw.addValue({{"A", 0}}, "bar");
// exception: Error executing sqlite3 query 'ALTER table "bar" add column "A" INT ': duplicate column name: AI would expect these identifiers to have their case stored but then be compared case-insensitively, which seems most consistent with how it is currently used; for example, tkconv.cc uses table names link and Zaal; tkserv.cc uses table names Document and document interchangeably. Alternatively, SQLiteWriter could enforce or check that identifiers are, say, always lowercase.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels