Bug #812
onedb fails with MySQL
| Status: | Closed | Start date: | 09/15/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% | ||
| Category: | - | |||
| Target version: | Release 3.0 | |||
| Resolution: | fixed | Pull request: | ||
| Affected Versions: |
Description
As reported by Ajay Bhatnagar in the mailing list
./onedb upgrade -v
Version read:
2.0 : Could not read any previous db_versioning data, assuming it is an OpenNebula 2.0 or 2.2 DB.MySQL dump stored in /srv/cloud/var/mysql_localhost_opennebula.sql
Use 'onedb restore' or restore the DB using the mysql command:
mysql -u user -h server -P port db_name < backup_fileRunning migrator /srv/cloud/lib/ruby/onedb/2.0_to_2.9.80.rb
Mysql::Error: FUNCTION opennebula.COUNT does not exist
This change should fix the problem, but needs more testing:
--- a/src/onedb/2.0_to_2.9.80.rb
+++ b/src/onedb/2.0_to_2.9.80.rb
@@ -257,8 +257,8 @@ module Migrator
public = row[:public]
total_leases = 0
- @db.fetch("SELECT COUNT (ip) FROM old_leases WHERE (oid=#{oid} AND used=1)") do |r|
- total_leases = r[:"COUNT (ip)"]
+ @db.fetch("SELECT COUNT(ip) FROM old_leases WHERE (oid=#{oid} AND used=1)") do |r|
+ total_leases = r[:"COUNT(ip)"]
end
Associated revisions
Bug #812: Fix onedb sql syntax to work with mysql
Bug #812: Fix onedb sql syntax to work with mysql(cherry picked from commit 3e8bc8046d763bc53f568d672240050a1be0824b)
History
#1
Updated by Carlos Martín almost 10 years ago
- Status changed from New to Closed
- Resolution set to fixed