List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:June 20 2009 7:57pm
Subject:Re: trailing space in column name
View as plain text  
Hi, Zhixuan!

On Jun 08, Zhixuan Zhu wrote:
> This may sound minor, but it creates lots of trouble to us. For some
> reason MySQL disallow column names with trailing space in create table.
> We're doing lots of "create table as select" type of queries and so
> statements like this will fail:
> 
> Create table test as select "command ", command_type from command_table;
> 
> We plan to relax the trailing space limitation by modifying table.cc (we
> build mysql 5.1.26 from source). Will that cause troubles else where?
> Another option is that we can remove the trailing spaces in sql_table.cc
> before the field name is passed to check_column_name(). But just
> wondering why MySQL wouldn't do the same thing. Is there any pitfalls?

[apparently, nobody answered this while I was on vacations, so here it is]

This was introduced to avoid a limitation in column-level grants. MySQL
wasn't able to distinguish a grant on column "a " from a grant on column
"a".

I'm not sure the bug will reappear if you remove the limitation, but I
suppose it will.
 
Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
trailing space in column nameZhixuan Zhu9 Jun
  • Re: trailing space in column nameIngo Strüwing9 Jun
    • RE: trailing space in column nameZhixuan Zhu9 Jun
      • RE: trailing space in column nameRick James9 Jun
        • RE: trailing space in column nameZhixuan Zhu9 Jun
          • RE: trailing space in column nameRick James9 Jun
            • RE: trailing space in column nameZhixuan Zhu9 Jun
  • Re: trailing space in column namePaul DuBois10 Jun
    • Re: trailing space in column nameKristian Nielsen11 Jun
      • Re: trailing space in column nameJoerg Bruehe11 Jun
        • Re: trailing space in column nameKristian Nielsen11 Jun
        • Re: trailing space in column nameRoy Lyseng11 Jun
  • Re: trailing space in column nameSergei Golubchik20 Jun