Avi,
So, I remember discussing with you a couple weeks ago why there was a
block of code which stripped the trailing space from column names.
Sergei has answered that question in this forwarded email from
internals@ mysql mailing list.
Seems that this code block was introduced to combat a bug in
column-level privileges. Drizzle doesn't have column-level privileges,
so I don't see any danger in removing the check for end spaces in your
new object identifier classes.
Cheers!
Jay
--- Begin Message ---
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 <[email protected]>
/ /|_/ / // /\ \/ /_/ / /__ 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
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/[email protected]
--- End Message ---
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp