@@ -202,7 +202,16 @@ def quote(value, column = nil)
202202 else
203203 super
204204 end
205- end
205+ end unless AR42
206+
207+ # @private since AR 4.2
208+ def _quote ( value )
209+ if value . is_a? ( Type ::Binary ::Data )
210+ "x'#{ value . hex } '"
211+ else
212+ super
213+ end
214+ end if AR42
206215
207216 # @override
208217 def quote_column_name ( name )
@@ -254,6 +263,10 @@ def supports_rename_index?
254263 ( version [ 0 ] == 5 && version [ 1 ] >= 7 ) || version [ 0 ] >= 6
255264 end
256265
266+ def index_algorithms
267+ { :default => 'ALGORITHM = DEFAULT' , :copy => 'ALGORITHM = COPY' , :inplace => 'ALGORITHM = INPLACE' }
268+ end if AR42
269+
257270 # @override
258271 def supports_transaction_isolation? ( level = nil )
259272 version [ 0 ] && version [ 0 ] >= 5 # MySQL 5+
@@ -376,7 +389,7 @@ def indexes(table_name, name = nil)
376389 # Returns an array of `Column` objects for the table specified.
377390 # @override
378391 def columns ( table_name , name = nil )
379- sql = "SHOW FULL COLUMNS FROM #{ quote_table_name ( table_name ) } "
392+ sql = "SHOW FULL #{ AR40 ? 'FIELDS' : ' COLUMNS' } FROM #{ quote_table_name ( table_name ) } "
380393 columns = execute ( sql , name || 'SCHEMA' )
381394 strict = strict_mode?
382395 pass_cast_type = respond_to? ( :lookup_cast_type )
@@ -683,6 +696,18 @@ def valid_type?(type)
683696 ! native_database_types [ type ] . nil?
684697 end
685698
699+ def clear_cache!
700+ super
701+ reload_type_map
702+ end if AR42
703+
704+ # @private since AR 4.2
705+ def prepare_column_options ( column , types )
706+ spec = super
707+ spec . delete ( :limit ) if column . type == :boolean
708+ spec
709+ end if AR42
710+
686711 # @private
687712 Type = ActiveRecord ::Type if AR42
688713
@@ -817,6 +842,7 @@ def full_version
817842
818843 # @private
819844 def emulate_booleans ; ::ArJdbc ::MySQL . emulate_booleans? ; end # due AR 4.2
845+ public :emulate_booleans
820846
821847 # @private
822848 class MysqlDateTime < Type ::DateTime
@@ -879,9 +905,9 @@ def adapter
879905
880906 end
881907
882- def initialize ( *args )
883- super # configure_connection happens in super
884- end
908+ # def initialize(*args)
909+ # super # configure_connection happens in super
910+ # end
885911
886912 def jdbc_connection_class ( spec )
887913 ::ArJdbc ::MySQL . jdbc_connection_class
0 commit comments