Missing `` around databasename in create_database()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Percona Cluster Charm |
Fix Released
|
High
|
James Page |
Bug Description
$ juju status
Model Controller Cloud/Region Version
tom oil-os-subnets oil-os/RegionOne 2.2-beta1.1
App Version Status Scale Charm Store Rev OS Notes
mysql 5.6.21-25.8 active 1 percona-cluster jujucharms 250 ubuntu
Unit Workload Agent Machine Public address Ports Message
mysql/0* blocked executing 0 10.244.133.197 Unit is ready
Machine State DNS Inst id Series AZ Message
0 started 10.244.133.197 2641a568-
Relation Provides Consumes Type
cluster mysql mysql peer
db mysql remote-
Ran juju debug-hooks mysql/0:
root@juju-
Traceback (most recent call last):
File "hooks/
main()
File "hooks/
hooks.
File "/var/lib/
self.
File "hooks/
password = db_helper.
File "/var/lib/
self.
File "/var/lib/
.format(
File "/usr/lib/
self.
File "/usr/lib/
raise errorvalue
_mysql_
root@juju-
Related branches
- Chris MacNaughton (community): Approve
- charmers: Pending requested
-
Diff: 21 lines (+2/-2)1 file modifiedcharmhelpers/contrib/database/mysql.py (+2/-2)
summary: |
- db-relation-changed hook failed: "You have an error in your SQL - syntax;.... + Missing `` around databasename in create_database() |
Changed in charm-percona-cluster: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in charm-percona-cluster: | |
status: | Triaged → In Progress |
assignee: | nobody → James Page (james-page) |
milestone: | none → 17.08 |
tags: | added: stable-backport |
tags: | added: adrastea |
Changed in charm-percona-cluster: | |
status: | Fix Committed → Fix Released |
From duplicate bug lp#1688401:
strace -s 9000 hooks/db- relation- changed shows:
sendto(3, "1\0\0\0\3CREATE DATABASE hacluster-pxc CHARACTER SET UTF8", 53, 0, NULL, 0) = 53 0\1\377( \4#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-pxc CHARACTER SET UTF8' at line 1",
recvfrom(3, "\262\0\
Fix appears to be adding backticks`{}` around {} in following charmhelpers method call:
charmhelpers/ contrib/ database/ mysql.py: cursor. execute( "CREATE DATABASE {} CHARACTER SET UTF8"
Running cs:xenial/ percona- cluster (#250) (17.02 charmers release)