diff options
author | Stan Hu <stanhu@gmail.com> | 2016-06-09 21:44:10 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-06-09 21:44:10 +0000 |
commit | 4fbb284cfd8a23ed3b754e0f168752c1ab211a7c (patch) | |
tree | abecd42e2bf3ed57d50eaf925841dd0b5b60b43c /lib/tasks | |
parent | 69e72774f2be248b9ceb008d4ba6460a66da551e (diff) | |
parent | 97aecdeadeb85383a793135f92677daf99c6183e (diff) | |
download | gitlab-ce-4fbb284cfd8a23ed3b754e0f168752c1ab211a7c.tar.gz |
Merge branch 'fix_issue_15259' into 'master'
Fix bug with SQL syntax error during backup restoration
## What does this MR do?
It properly escapes the table name in the `DROP TABLE IF EXISTS ...` statement used during restore of a backup.
## Are there points in the code the reviewer needs to double check?
Please check compatibility with PostgreSQL
## Why was this MR needed?
Fix an issue with backups can not be restored if MySQL is used as database for GitLab.
## What are the relevant issue numbers?
#15259
## Screenshots (if relevant)
-
See merge request !4318
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/db.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 86584e91093..e3135532540 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -34,7 +34,7 @@ namespace :gitlab do # PG: http://www.postgresql.org/docs/current/static/ddl-depend.html # MySQL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html # Add `IF EXISTS` because cascade could have already deleted a table. - tables.each { |t| connection.execute("DROP TABLE IF EXISTS #{t} CASCADE") } + tables.each { |t| connection.execute("DROP TABLE IF EXISTS `#{t}` CASCADE") } end desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' |