← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1207095] Re: SQL group table query issue as it's a reserved word

 

Changing the name of the `group` table to more accurately reflect what
the table represents (e.g. `user_group`) would be an acceptable
refactor, but manually writing malformed SQL is not a bug.

** Changed in: keystone
   Importance: Undecided => Wishlist

** Changed in: keystone
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1207095

Title:
  SQL group table query issue as it's a reserved word

Status in OpenStack Identity (Keystone):
  Won't Fix

Bug description:
  We create a table named "group" which is a reserved word -
  http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html

  This works well because use of a reserved word is permitted but queering such a table requires a special care. For example it gives following error, 
  mysql> use keystone;
  mysql> describe group;
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group' at line 1
  mysql> select * from group;
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group' at line 1  

  Where as other tables like 'user' or 'project' works fine this way.  e.g.
  mysql> select * from project;
  +----------------------------------+--------------+-------+-------------+---------+-----------+
  | id                               | name         | extra | description | enabled | domain_id |
  +----------------------------------+--------------+-------+-------------+---------+-----------+
  | bd867a5a9af047a7a57231054c10f059 | july30tenant | {}    | NULL        |       1 | default   |
  +----------------------------------+--------------+-------+-------------+---------+-----------+
  1 row in set (0.00 sec)

  
  Table group can be queried fine if you use, 
  mysql> select * from keystone.group;
  Empty set (0.34 sec)

  I guess this can be confusing and requires some extra time to figure
  it out, if you run into above problem...

  Can we change the name group to 'usergroup' or just document this fact
  if leave this as is?

  Thanks!

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1207095/+subscriptions