summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-09-30 20:59:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-09-30 20:59:47 +0000
commit8eb1e94f4d18a8e3d268392aa518b039dbc749c0 (patch)
treebf415c8464852cb83f4b9f61e44b4031172076e3 /lib
parentf0323575f99bb2db7b4586499a46b0fc44719750 (diff)
downloadredmine-8eb1e94f4d18a8e3d268392aa518b039dbc749c0.tar.gz
redmine-8eb1e94f4d18a8e3d268392aa518b039dbc749c0.zip
SQL error with MySQL (#19657).
git-svn-id: http://svn.redmine.org/redmine/trunk@14633 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/database.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb
index d8b4b7ccb..89a80129b 100644
--- a/lib/redmine/database.rb
+++ b/lib/redmine/database.rb
@@ -44,6 +44,11 @@ module Redmine
end
end
+ # Returns true if the database is MySQL
+ def mysql?
+ (ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present?
+ end
+
# Returns a SQL statement for case/accent (if possible) insensitive match
def like(left, right, options={})
neg = (options[:match] == false ? 'NOT ' : '')