Bug 1656855 - bad SQL database name for ironic-inspector
Summary: bad SQL database name for ironic-inspector
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: puppet-ironic
Version: 13.0 (Queens)
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Cyril Lopez
QA Contact: Alexander Chuzhoy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-06 13:40 UTC by Cyril Lopez
Modified: 2018-12-06 15:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-06 15:10:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1807151 0 None None None 2018-12-06 13:47:44 UTC
OpenStack gerrit 623206 0 None None None 2018-12-06 13:47:06 UTC

Description Cyril Lopez 2018-12-06 13:40:25 UTC
Description of problem:
Ironic-inspector DBname is ironic-inspector. Following best practice in Mysql, "-" is not allowed. It create some issue like we cannot drop the database from mysql cli.
https://dev.mysql.com/doc/refman/8.0/en/identifiers.html

Version-Release number of selected component (if applicable):
puppet-ironic-12.4.0-3.el7ost.noarch

Actual results:
 [root@director13 ~]# mysql                                                                                                                                                                   
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1420
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| glance             |
| heat               |
| information_schema |
| ironic             |
| ironic-inspector   |
| keystone           |
| mistral            |
| mysql              |
| neutron            |
| nova               |
| nova_api           |
| nova_cell0         |
| nova_placement     |
| performance_schema |
| zaqar              |
+--------------------+
15 rows in set (0.00 sec)

MariaDB [(none)]> drop database ironic-inspector;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-inspector' at line 1

Comment 1 Dmitry Tantsur 2018-12-06 15:10:05 UTC
Ouch. Yeah, good point. But judging by https://serverfault.com/questions/195221/how-to-rename-a-mysql-database database rename is not quite possible in MySQL (or at least dangerous), so I don't think we can fix it now :(

I'm pretty sure you can escape the dash somehow.


Note You need to log in before you can comment on or make changes to this bug.