← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1892370] Re: Database migrations fail when schema includes dash

 

Reviewed:  https://review.opendev.org/747164
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b39d8b8c9675d554791511a13b62651c8546e7b9
Submitter: Zuul
Branch:    master

commit b39d8b8c9675d554791511a13b62651c8546e7b9
Author: Mohammed Naser <mnaser@xxxxxxxxxxxx>
Date:   Thu Aug 20 09:42:57 2020 -0400

    db: fix database migrations when name includes dash
    
    If the name of the database used includes a dash, it will fail the
    migrations with an error like this:
    
      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 '-cell0 DEFAULT
      CHARACTER SET utf8' at line 1
    
    Even more difficult, any future migration fails with the instances table
    already existing making it very hard to troubleshoot.  This patch fixes
    it by wrapping the schema name in the query.
    
    Closes-Bug: #1892370
    Change-Id: Ic96dc415396985737b5bdeffed61077af5f245e6


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1892370

Title:
  Database migrations fail when schema includes dash

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  In our database migrations, we run the following:

  'ALTER DATABASE %s DEFAULT CHARACTER SET utf8'

  If usnig a database name that includes a dash, the migration fails
  because it requires to be wrapped by `.

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


References