<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -254,7 +254,7 @@ module ActiveRecord
 
       def type_to_sql(type, limit = nil, precision = nil, scale = nil) #:nodoc:
         if native = native_database_types[type]
-          column_type_sql = native.is_a?(Hash) ? native[:name] : native
+          column_type_sql = (native.is_a?(Hash) ? native[:name] : native).dup
 
           if type == :decimal # ignore limit, use precision and scale
             scale ||= native[:scale]
@@ -269,7 +269,7 @@ module ActiveRecord
               raise ArgumentError, &quot;Error adding decimal column: precision cannot be empty if scale if specified&quot;
             end
 
-          elsif limit ||= native.is_a?(Hash) &amp;&amp; native[:limit]
+          elsif (type != :primary_key) &amp;&amp; (limit ||= native.is_a?(Hash) &amp;&amp; native[:limit])
             column_type_sql &lt;&lt; &quot;(#{limit})&quot;
           end
 </diff>
      <filename>activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb</filename>
    </modified>
    <modified>
      <diff>@@ -151,6 +151,8 @@ module ActiveRecord
       @@emulate_booleans = true
       cattr_accessor :emulate_booleans
 
+      ADAPTER_NAME = 'MySQL'.freeze
+
       LOST_CONNECTION_ERROR_MESSAGES = [
         &quot;Server shutdown in progress&quot;,
         &quot;Broken pipe&quot;,
@@ -158,6 +160,21 @@ module ActiveRecord
         &quot;MySQL server has gone away&quot;
       ]
 
+      NATIVE_DATABASE_TYPES = {
+        :primary_key =&gt; &quot;int(11) DEFAULT NULL auto_increment PRIMARY KEY&quot;.freeze,
+        :string      =&gt; { :name =&gt; &quot;varchar&quot;, :limit =&gt; 255 },
+        :text        =&gt; { :name =&gt; &quot;text&quot; },
+        :integer     =&gt; { :name =&gt; &quot;int&quot;},
+        :float       =&gt; { :name =&gt; &quot;float&quot; },
+        :decimal     =&gt; { :name =&gt; &quot;decimal&quot; },
+        :datetime    =&gt; { :name =&gt; &quot;datetime&quot; },
+        :timestamp   =&gt; { :name =&gt; &quot;datetime&quot; },
+        :time        =&gt; { :name =&gt; &quot;time&quot; },
+        :date        =&gt; { :name =&gt; &quot;date&quot; },
+        :binary      =&gt; { :name =&gt; &quot;blob&quot; },
+        :boolean     =&gt; { :name =&gt; &quot;tinyint&quot;, :limit =&gt; 1 }
+      }
+
       def initialize(connection, logger, connection_options, config)
         super(connection, logger)
         @connection_options, @config = connection_options, config
@@ -166,7 +183,7 @@ module ActiveRecord
       end
 
       def adapter_name #:nodoc:
-        'MySQL'
+        ADAPTER_NAME
       end
 
       def supports_migrations? #:nodoc:
@@ -174,20 +191,7 @@ module ActiveRecord
       end
 
       def native_database_types #:nodoc:
-        {
-          :primary_key =&gt; &quot;int(11) DEFAULT NULL auto_increment PRIMARY KEY&quot;,
-          :string      =&gt; { :name =&gt; &quot;varchar&quot;, :limit =&gt; 255 },
-          :text        =&gt; { :name =&gt; &quot;text&quot; },
-          :integer     =&gt; { :name =&gt; &quot;int&quot;, :limit =&gt; 11 },
-          :float       =&gt; { :name =&gt; &quot;float&quot; },
-          :decimal     =&gt; { :name =&gt; &quot;decimal&quot; },
-          :datetime    =&gt; { :name =&gt; &quot;datetime&quot; },
-          :timestamp   =&gt; { :name =&gt; &quot;datetime&quot; },
-          :time        =&gt; { :name =&gt; &quot;time&quot; },
-          :date        =&gt; { :name =&gt; &quot;date&quot; },
-          :binary      =&gt; { :name =&gt; &quot;blob&quot; },
-          :boolean     =&gt; { :name =&gt; &quot;tinyint&quot;, :limit =&gt; 1 }
-        }
+        NATIVE_DATABASE_TYPES
       end
 
 </diff>
      <filename>activerecord/lib/active_record/connection_adapters/mysql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -224,9 +224,26 @@ module ActiveRecord
     # * &lt;tt&gt;:min_messages&lt;/tt&gt; -- An optional client min messages that is used in a SET client_min_messages TO &lt;min_messages&gt; call on the connection.
     # * &lt;tt&gt;:allow_concurrency&lt;/tt&gt; -- If true, use async query methods so Ruby threads don't deadlock; otherwise, use blocking query methods.
     class PostgreSQLAdapter &lt; AbstractAdapter
+      ADAPTER_NAME = 'PostgreSQL'.freeze
+
+      NATIVE_DATABASE_TYPES = {
+        :primary_key =&gt; &quot;serial primary key&quot;.freeze,
+        :string      =&gt; { :name =&gt; &quot;character varying&quot;, :limit =&gt; 255 },
+        :text        =&gt; { :name =&gt; &quot;text&quot; },
+        :integer     =&gt; { :name =&gt; &quot;integer&quot; },
+        :float       =&gt; { :name =&gt; &quot;float&quot; },
+        :decimal     =&gt; { :name =&gt; &quot;decimal&quot; },
+        :datetime    =&gt; { :name =&gt; &quot;timestamp&quot; },
+        :timestamp   =&gt; { :name =&gt; &quot;timestamp&quot; },
+        :time        =&gt; { :name =&gt; &quot;time&quot; },
+        :date        =&gt; { :name =&gt; &quot;date&quot; },
+        :binary      =&gt; { :name =&gt; &quot;bytea&quot; },
+        :boolean     =&gt; { :name =&gt; &quot;boolean&quot; }
+      }
+
       # Returns 'PostgreSQL' as adapter name for identification purposes.
       def adapter_name
-        'PostgreSQL'
+        ADAPTER_NAME
       end
 
       # Initializes and connects a PostgreSQL adapter.
@@ -268,20 +285,7 @@ module ActiveRecord
       end
 
       def native_database_types #:nodoc:
-        {
-          :primary_key =&gt; &quot;serial primary key&quot;,
-          :string      =&gt; { :name =&gt; &quot;character varying&quot;, :limit =&gt; 255 },
-          :text        =&gt; { :name =&gt; &quot;text&quot; },
-          :integer     =&gt; { :name =&gt; &quot;integer&quot; },
-          :float       =&gt; { :name =&gt; &quot;float&quot; },
-          :decimal     =&gt; { :name =&gt; &quot;decimal&quot; },
-          :datetime    =&gt; { :name =&gt; &quot;timestamp&quot; },
-          :timestamp   =&gt; { :name =&gt; &quot;timestamp&quot; },
-          :time        =&gt; { :name =&gt; &quot;time&quot; },
-          :date        =&gt; { :name =&gt; &quot;date&quot; },
-          :binary      =&gt; { :name =&gt; &quot;bytea&quot; },
-          :boolean     =&gt; { :name =&gt; &quot;boolean&quot; }
-        }
+        NATIVE_DATABASE_TYPES
       end
 
       # Does PostgreSQL support migrations?</diff>
      <filename>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -543,7 +543,7 @@ class Fixtures &lt; (RUBY_VERSION &lt; '1.9' ? YAML::Omap : Hash)
     @connection, @table_name, @fixture_path, @file_filter = connection, table_name, fixture_path, file_filter
     @class_name = class_name ||
                   (ActiveRecord::Base.pluralize_table_names ? @table_name.singularize.camelize : @table_name.camelize)
-    @table_name = ActiveRecord::Base.table_name_prefix + @table_name + ActiveRecord::Base.table_name_suffix
+    @table_name = &quot;#{ActiveRecord::Base.table_name_prefix}#{@table_name}#{ActiveRecord::Base.table_name_suffix}&quot;
     @table_name = class_name.table_name if class_name.respond_to?(:table_name)
     @connection = class_name.connection if class_name.respond_to?(:connection)
     read_fixture_files</diff>
      <filename>activerecord/lib/active_record/fixtures.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c329794e7334f3d355d0a039e23a7145ad40ed35</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/71926912a127da29530520d435c83c48778ac2b2</url>
  <id>71926912a127da29530520d435c83c48778ac2b2</id>
  <committed-date>2009-01-14T19:10:03-08:00</committed-date>
  <authored-date>2008-06-08T22:08:59-07:00</authored-date>
  <message>Don't append limit to primary key column definition. Freeze some constants.</message>
  <tree>b77f1e97f5279c6da07afbd146103719b191ed66</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
