Convert all object identifiers to use the SQL Standard
This blueprint follows from the mailing list thread here:
https:/
This blueprint contains the following tasks:
1) Create test cases for all object identifiers (currently schema, table, and column) which verify that Drizzle follows the SQL Standard for identifiers
The SQL Standard states that *unquoted* identifiers shall be compared in a case-insensitive manner by uppercasing the identifier name, and *quoted* identifiers shall be compared in a case-sensitive manner.
Per Andrew Garner in the above thread:
"The SQL (1992/2003) standards say *unquoted* ("regular") identifiers
are transformed to uppercase for comparison - and so should be case
insensitive. Quoted ("delimited") identifiers are not transformed
that way, however, and may not compare to unquoted identifiers as
expected (at least, if you're not expecting sql-standard behavior).
The following are equivalent:
SELECT foo FROM ...
SELECT FOO FROM ...
SELECT fOo FROM ...
SELECT "FOO" FROM ...
But the following should differ from those above on a standards
compliant implementation:
SELECT "foo" FROM ...
SELECT "fOo" ... FROM ...
I believe this is defined in section 5 of the standard(s), "Lexical
Elements : Syntax Rules".
So the following should be equivalent according to the standard:
select * from t as foo inner join t as bar using (t);
select * from t as foo inner join t as bar using (T);
But not, I believe:
select * from t as foo inner join t as bar using ("t");"
2) Modify the Drizzle source code to comply with the SQL standard for identifier name comparisons. This task will require some think time in order to determine at which point the "conversion" of unquoted identifier names should happen for comparison. Hint: see /drizzled/
3) There is a Table_ident class which is used for comparisons/storage of table identifier names. This class should be converted to the Drizzle naming convention (TableIdent or TableIdentifier) and its member variables protected and given public accessors (e.g. getSchemaName())
4) Create classes which represent a SchemaIdentifier and ColumnIdentifier. Currently, the code base compares these identifiers using the character set my_strcasecmp methods directly on char* strings. Convert this to a C++ object-oriented usage and have identical interfaces for all object identifiers.