Bug #32620 Falcon doesn't support quotes as field name and tablespace name identifiers
Submitted: 22 Nov 2007 12:15 Modified: 5 May 2008 15:03
Reporter: Sergey Vojtovich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.4 alpha OS:Linux (FC6)
Assigned to: Ann Harrison CPU Architecture:Any

[22 Nov 2007 12:15] Sergey Vojtovich
Description:
It is not possible to create falcon table with quotes in field name/tablespace name:
CREATE TABLE t1_falcon (`a"` INT) ENGINE=Falcon;
ERROR HY000: Can't create table 'test.t1_falcon' (errno: 156)

Also it is possible to modify falcon internal create table query:
CREATE TABLE t2_falcon (`a" INT, "b` INT, b INT) ENGINE=Falcon;
ERROR HY000: Can't create table 'test.t2_falcon' (errno: 156)

The next statement works fine:
CREATE TABLE t3_falcon (`a""` INT) ENGINE=Falcon;

How to repeat:
CREATE TABLE t1_falcon (`a"` INT) ENGINE=Falcon;

Suggested fix:
Encode quotes in field name/tablespace name identifiers.
[22 Nov 2007 15:20] Kevin Lewis
Ann, should this be legal?  If we support embedded quotes in names, do we need to turn off quote parsing for names received through the handler interface?
[23 Nov 2007 17:46] Paul DuBois
Quote characters in identifiers are legal.

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html says this:

"Identifier quote characters can be included within an identifier if you quote the identifier. If the character to be included within the identifier is the same as that used to quote the identifier itself, then you need to double the character. The following statement creates a table named a`b that contains a column named c"d:

mysql> CREATE TABLE `a``b` (`c"d` INT);
"
[25 Nov 2007 21:51] Kevin Lewis
>Ann Harrison wrote;
>Any character should be legal inside a delimited identifier,
>including a single quote which has to be marked with an escape
>character.  However, since the engine doesn't tell us that the
>identifier is delimited, we're kind of stuck.  Double quotes
>are not allowed in regular identifiers.

This bug then cannot be fixed correctly unless Falcon is provided a flag from the server which indicates that the name is delimited.  The server has the advantage of knowing whether the string is quoted.  The storage engine does not.  

On Windows, all quotes are rejected by the server, preventing this kind of file name from being ported at all.  

This bug is therefore related to Bug#22166, which needs the server to provide support for delimited names independent of the file system.
[25 Nov 2007 22:14] Ann Harrison
Turns out we can detect characters that aren't allowed
in regular identifiers and treat the name as if it were
a delimited identifier.  Jim says we do it for tables,
so we can do it for fields.
[11 Feb 2008 20:26] Ann Harrison
This appears to have been fixed about two months ago by Jim Starkey
as part of another fix.
[19 Apr 2008 21:45] Hakan Küçükyılmaz
Fix is in 6.0.4 release.
[5 May 2008 15:03] Paul DuBois
Noted in 6.0.4 changelog.

Falcon did not properly handle quoted column name or tablespace name
identifiers.