@@ -18,6 +18,9 @@ module MySQL
1818
1919 include BulkChangeTable if const_defined? :BulkChangeTable
2020
21+ # @private
22+ ActiveRecordError = ::ActiveRecord ::ActiveRecordError
23+
2124 # @see ActiveRecord::ConnectionAdapters::JdbcAdapter#jdbc_connection_class
2225 def self . jdbc_connection_class
2326 ::ActiveRecord ::ConnectionAdapters ::MySQLJdbcConnection
@@ -586,7 +589,7 @@ def rename_column(table_name, column_name, new_column_name)
586589 options [ :default ] = column . default if type != :text && type != :binary
587590 options [ :null ] = column . null
588591 else
589- raise ActiveRecord :: ActiveRecordError , "No such column: #{ table_name } .#{ column_name } "
592+ raise ActiveRecordError , "No such column: #{ table_name } .#{ column_name } "
590593 end
591594
592595 current_type = select_one ( "SHOW COLUMNS FROM #{ quote_table_name ( table_name ) } LIKE '#{ column_name } '" ) [ "Type" ]
@@ -662,7 +665,7 @@ def type_to_sql(type, limit = nil, precision = nil, scale = nil)
662665 when 0 ..0xfff ; "varbinary(#{ limit } )"
663666 when nil ; "blob"
664667 when 0x1000 ..0xffffffff ; "blob(#{ limit } )"
665- else raise ActiveRecord :: ActiveRecordError , "No binary type has character length #{ limit } "
668+ else raise ActiveRecordError , "No binary type has character length #{ limit } "
666669 end
667670 when 'integer'
668671 case limit
@@ -671,15 +674,15 @@ def type_to_sql(type, limit = nil, precision = nil, scale = nil)
671674 when 3 ; 'mediumint'
672675 when nil , 4 , 11 ; 'int(11)' # compatibility with MySQL default
673676 when 5 ..8 ; 'bigint'
674- else raise ActiveRecord :: ActiveRecordError , "No integer type has byte size #{ limit } "
677+ else raise ActiveRecordError , "No integer type has byte size #{ limit } "
675678 end
676679 when 'text'
677680 case limit
678681 when 0 ..0xff ; 'tinytext'
679682 when nil , 0x100 ..0xffff ; 'text'
680683 when 0x10000 ..0xffffff ; 'mediumtext'
681684 when 0x1000000 ..0xffffffff ; 'longtext'
682- else raise ActiveRecord :: ActiveRecordError , "No text type has character length #{ limit } "
685+ else raise ActiveRecordError , "No text type has character length #{ limit } "
683686 end
684687 else
685688 super
0 commit comments