List:Falcon Storage Engine« Previous MessageNext Message »
From:Olav Sandstaa Date:April 29 2009 2:06am
Subject:Re: Is MYSQLD.1 a valid schema name in Falcon?
View as plain text  
Lars-Erik Bjørk wrote:
> Hi Olav!
>
> Just a side question ... Are schema names supposed to be case 
> sensitive? Will adding quotes
> as you do change the behavior regarding this?

Good question. In this particular case this should not be an issue. In 
this part of the code we have already "upper-cased" the schema name to 
"MYSQL.1" (as also pointed out by Kevin). So for this "internally 
generated" schema name it seems to be safe to add the quotes. My concern 
is if this code is also used in cases where the schema name is not upper 
cased and where we really should not have the quotes?

I think we also have the same situation for the table name. And for 
these we always add quotes. So based on that it seems natural to do the 
same for the schema name as for the table name. Still it would be nice 
to know if there was any particular reason for having added the quotes 
in the code only for the table name and not for the schema name.

I will follow Kevin's suggestion and make a patch where we add these 
quotes and then try to see if there are situations were this does not 
work (the falcon test suites passes at least).

Olav

>
> /Lars-Erik
>
> Olav Sandstaa wrote:
>> Hi,
>>
>> I am working on Bug #42752 "Error when creating Falcon temporary 
>> table with a key". This bug seems to be highlighted by the 
>> introduction of the new mysql-test-run framework (MTR2). Running the 
>> following statement against Falcon:
>>
>>   CREATE TEMPORARY TABLE t1 (s1 INTEGER, KEY(s1));
>>
>> fails when using the new MTR2 while succeeds when running with the 
>> old MTR.
>>
>> With MTR1 the following "mySqlName" is passed into 
>> StorageInterface::create:
>>
>>   /home/olav/mysql/develop/olav-2994/mysql-test/var/tmp/#sql23ff_1_0
>>
>> while with MTR2 the "mySqlName" is:
>>
>>  
>> /home/olav/mysql/develop/olav-2995/mysql-test/var/tmp/mysqld.1/#sql2d05_2_0 
>>
>>
>> Using these two, Falcon uses a schemaName = TMP in the first case and 
>> schemaName = MYSQLD.1 in the second case.
>>
>> The failure occurs when Falcon tries to create an index on this table 
>> by constructing the following SQL statement:
>>
>>  create index "#SQL2D05_2_0$S1" on MYSQLD.1."#SQL2D05_2_0" ("S1")
>>
>> This fails when Falcon is parsing the statement and gives the 
>> following error:
>>
>>   syntax error on line 1
>>   create index "#SQL2D05_2_0$S1" on MYSQLD.1."#SQL2D05_2_0" ("S1")
>>   ^ expected name list got .1
>>
>> In above SQL string everything except the schema name is "quoted". 
>> The quoting occurs in the following code in 
>> StorageInterface::createIndex() in ha_falcon.cpp:
>>
>>           gen.gen("create %sindex \"%s\" on %s.\"%s\" ", unique, 
>> indexDesc.name, schemaName, tableName);
>>
>> Anyone who knows why we have not added quotes around the schema name?
>>
>> If I add quotes around the schema name in the above line the test 
>> case for the bug no longer fails. So that seems like a simple 
>> solution - but before doing so I would like to know if schema names 
>> including "."s should be considered valid for Falcon.
>>
>> Thanks,
>> Olav
>>
>
>

Thread
Is MYSQLD.1 a valid schema name in Falcon?Olav Sandstaa28 Apr
  • Re: Is MYSQLD.1 a valid schema name in Falcon?Lars-Erik Bjørk28 Apr
    • Re: Is MYSQLD.1 a valid schema name in Falcon?Kevin Lewis28 Apr
    • Re: Is MYSQLD.1 a valid schema name in Falcon?Ann W. Harrison28 Apr
    • Re: Is MYSQLD.1 a valid schema name in Falcon?Olav Sandstaa28 Apr
      • Re: Is MYSQLD.1 a valid schema name in Falcon?Hakan Kuecuekyilmaz28 Apr