List:Internals« Previous MessageNext Message »
From:Rick James Date:June 9 2009 5:20pm
Subject:RE: trailing space in column name
View as plain text  
I'm asking about
SELECT COLUMN_NAME FROM information_schema;
and its definition:
  `COLUMN_NAME` varchar(64) NOT NULL DEFAULT '',
It's probably not an issue because VARCHAR retains trailing blanks, right?

I would agree with a language change that disallows (or trims) leading/trailing spaces
from column/table/etc names.  But then, what do you do about characters that are
equivalent 'space' in the UTF8 world?

 
Rick James
MySQL Geeks - Consulting & Review

 

> -----Original Message-----
> From: Zhixuan Zhu [mailto:zzhu@stripped] 
> Sent: Tuesday, June 09, 2009 9:12 AM
> To: Rick James; Ingo.Struewing@stripped
> Cc: internals@stripped
> Subject: RE: trailing space in column name
> 
> Our logic won't touch any system table for sure.
> 
> My questions are:
> 1. Why MySQL choose to have this limitation on column name? 
> Oracle seems to be OK with it.
> 2. We could trim the trailing space in sql_table.cc before 
> the field name is passed to check_column_name(). That sounds 
> like a pretty trivial change, but will that hurt anything 
> else since MySQL has this limitation in the first place?
> 
> Thanks for your time,
> Zhixuan
> 
> -----Original Message-----
> From: Rick James [mailto:rjames@stripped] 
> Sent: Tuesday, June 09, 2009 10:59 AM
> To: Zhixuan Zhu; Ingo.Struewing@stripped
> Cc: internals@stripped
> Subject: RE: trailing space in column name
> 
> I wonder, will SELECTing from the information_schema trim the 
> trailing blank?  If so, will that hurt any internal actions?  
> Or just external scripts?
> 
>  
> Rick James
> MySQL Geeks - Consulting & Review
> 
>  
> 
> > -----Original Message-----
> > From: Zhixuan Zhu [mailto:zzhu@stripped] 
> > Sent: Tuesday, June 09, 2009 8:42 AM
> > To: Ingo.Struewing@stripped
> > Cc: internals@stripped
> > Subject: RE: trailing space in column name
> > 
> > No specific reason. We internally translate SELECT statement 
> > to CREATE TABLE AS SELECT statement for some purpose. And our 
> > QA generate lots of things to test including something like 
> > /select "a ", r_name from region/ stuff and that failed 
> > because literal "a " failed the create table part. 
> > 
> > You know it's hard to persuade QA that some tests they've 
> > done are not reasonable :). BTW, any insights to my question?
> > 
> > -----Original Message-----
> > From: Ingo.Struewing@stripped [mailto:Ingo.Struewing@stripped] 
> > Sent: Tuesday, June 09, 2009 1:39 AM
> > To: Zhixuan Zhu
> > Cc: internals@stripped
> > Subject: Re: trailing space in column name
> > 
> > Hi Zhixuan,
> > 
> > Zhixuan Zhu, 09.06.2009 00:08:
> > 
> > > 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;
> > 
> > just curious: Why do you want to have trailing space in 
> column names?
> > 
> > Regards
> > Ingo
> > -- 
> > Ingo Strüwing, Database Group
> > Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
> > Geschäftsführer: Thomas Schröder,   Wolfgang Engels,   Wolf
> Frenkel
> > Vorsitzender des Aufsichtsrates: Martin Häring   HRB München 161028
> > 
> > -- 
> > MySQL Internals Mailing List
> > For list archives: http://lists.mysql.com/internals
> > To unsubscribe:    
> > http://lists.mysql.com/internals?unsub=1
> > 
> > 
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    
> http://lists.mysql.com/internals?unsub=1
> 
> 
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