blob: fbab654112cdaff77b4bba7c7cfdca943b4059ec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
module ActiveRecord
module ConnectionAdapters
module MySQL
module Quoting # :nodoc:
QUOTED_TRUE, QUOTED_FALSE = '1', '0'
def quote_column_name(name)
@quoted_column_names[name] ||= "`#{super.gsub('`', '``')}`"
end
def quote_table_name(name)
@quoted_table_names[name] ||= super.gsub('.', '`.`')
end
def quoted_true
QUOTED_TRUE
end
def unquoted_true
1
end
def quoted_false
QUOTED_FALSE
end
def unquoted_false
0
end
def quoted_date(value)
if supports_datetime_with_precision?
super
else
super.sub(/\.\d{6}\z/, '')
end
end
private
def _quote(value)
if value.is_a?(Type::Binary::Data)
"x'#{value.hex}'"
else
super
end
end
end
end
end
end
|