diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-05-10 16:12:25 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-05-10 16:14:45 +0900 |
commit | 54772667eef242cb550882f155fd16c4eecfe685 (patch) | |
tree | 466c282836eb6ac9c90b3fac852ef8f62b566187 /activerecord/lib | |
parent | 164125c88e3a3adb363b469cd72c9d0bd22dcad8 (diff) | |
download | rails-54772667eef242cb550882f155fd16c4eecfe685.tar.gz rails-54772667eef242cb550882f155fd16c4eecfe685.tar.bz2 rails-54772667eef242cb550882f155fd16c4eecfe685.zip |
Should quote `lock_name` to pass to `get_advisory_lock`
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 4eb009c873..fdd6bffa13 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -146,11 +146,11 @@ module ActiveRecord end def get_advisory_lock(lock_name, timeout = 0) # :nodoc: - select_value("SELECT GET_LOCK('#{lock_name}', #{timeout});").to_s == '1' + select_value("SELECT GET_LOCK(#{quote(lock_name)}, #{timeout})") == 1 end def release_advisory_lock(lock_name) # :nodoc: - select_value("SELECT RELEASE_LOCK('#{lock_name}')").to_s == '1' + select_value("SELECT RELEASE_LOCK(#{quote(lock_name)})") == 1 end def native_database_types |