mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-03 13:47:01 +03:00
B#1557 onedb fsck breaks the resources when they contain non-ASCII chars (#2200)
This commit is contained in:
parent
a3a273aa0f
commit
988ef875c2
@ -305,6 +305,13 @@ class BackEndMySQL < OneDBBacKEnd
|
||||
|
||||
begin
|
||||
@db = Sequel.connect(endpoint)
|
||||
|
||||
encoding = "utf8mb4"
|
||||
@db.fetch("SELECT @@CHARACTER_SET_DATABASE;") do |row|
|
||||
encoding = row[:@@CHARACTER_SET_DATABASE]
|
||||
end
|
||||
|
||||
@db = Sequel.connect(endpoint + "?encoding=#{encoding}")
|
||||
rescue Exception => e
|
||||
raise "Error connecting to DB: " + e.message
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user