From e48392fbf5968a0cd17e4714e54fb05c0f711bc3 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Mon, 16 Jul 2012 17:49:53 +0100 Subject: [PATCH] Fix for syntax error when executing "SELECT * FROM keys" (encountered on MySQL 5.5.24-0ubuntu0.12.04.1) --- lib/tasks/gitlab/backup.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 4fbde37ef3e..014483d4e8c 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -159,7 +159,7 @@ namespace :gitlab do print "- Dumping table #{tbl}... " count = 1 File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| - ActiveRecord::Base.connection.select_all("SELECT * FROM #{tbl}").each do |line| + ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| line.delete_if{|k,v| v.blank?} output = {tbl + '_' + count.to_s => line} file << output.to_yaml.gsub(/^---\n/,'') + "\n" -- GitLab