lib/zena/db_helper/mysql.rb in zena-1.1.3 vs lib/zena/db_helper/mysql.rb in zena-1.2.0
- old
+ new
@@ -90,10 +90,14 @@
"date_format(#{arg},'%Y-%v')"
when 'day'
"DATE(#{arg})"
when 'random'
'RAND()'
+ when 'min'
+ "MIN(#{args.join(',')})"
+ when 'max'
+ "MAX(#{args.join(',')})"
when 'coalesce'
"COALESCE(#{args.join(',')})"
else
super
end
@@ -163,10 +167,10 @@
# Raise if we are in a nested transaction
raise if connection.open_transactions != 0
if error.message =~ DEADLOCK_REGEX
retry_count += 1
if retry_count < DEADLOCK_MAX_RETRY
- Node.logger.warn "#{Time.now.strftim('%Y-%m-%d %H:%M:%S')} [#{current_site.host}] Retry (#{retry_count}) #{error.message}"
+ Node.logger.warn "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} [#{current_site.host}] Retry (#{retry_count}) #{error.message}"
retry
else
raise
end
else
\ No newline at end of file