On 11/19/09 7:00 AM, Sergei Golubchik wrote:
> Hi, Davi!
>
> On Nov 17, Davi Arnaut wrote:
>> On 11/17/09 10:46 AM, Sergei Golubchik wrote:
>>> On Sep 04, Davi Arnaut wrote:
>>>> # At a local mysql-5.1-bugteam repository of davi
>>>>
>>>> 3114 Davi Arnaut 2009-09-04
>>>> Bug#40277: SHOW CREATE VIEW returns invalid SQL
>>>>
>>>> === modified file 'sql/item.cc'
>>>> - if (name)
>>>> + /*
>>>> + Don't print a alias for auto generated invalid column names.
>>>> + */
>>>> + if (name&& (!is_autogenerated_name ||
> !check_column_name(name)))
>>>
>>> Hm.
>>> Davi, when using such a view - how one would refer to these columns ?
>>
>> Using the autogenerated column name -- hence, it is somewhat
>> compatible with code that already exists. Otherwise, the user is
>> forced to specify a column name. This is step one towards enforcing
>> the same rules as for a CREATE TABLE :-)
>
> But if the autogenerated column name is invalid, one won't be able to
> use it as a reference, right ?
Somewhat.
>>> How these columns will show up in metadata ? Truncated ?
>>
>> They show up as generated without truncation.
>
> For example, "I_S.COLUMNS.COLUMN_NAME" os defined as
> CHAR(NAME_CHAR_LEN), it simply cannot show long name without truncation.
Indeed.
>>> What if two SELECT expressions differ only after NAME_LEN character ?
>>
>> The check for duplicated column compares the whole column name.
>
> Why did you dump your old fix with auto-generating valid names ?
Because it adds unnecessary complexity. My desire would be to just
refuse to create view if the column name is not acceptable.
Anyway, back to the drawing board.
Regards,
--
Davi Arnaut