diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-08 17:43:56 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-08 17:46:46 +0900 |
commit | bf1494a1018a0bdc50dac4e87fdbf4b6b03083fa (patch) | |
tree | 7a84a832f964f4ace8944d6f094b5e52864d4df0 /activerecord/lib/active_record/connection_adapters/abstract | |
parent | 57c7cbb1623c0e8befc58988a34bbb9896fd226a (diff) | |
download | rails-bf1494a1018a0bdc50dac4e87fdbf4b6b03083fa.tar.gz rails-bf1494a1018a0bdc50dac4e87fdbf4b6b03083fa.tar.bz2 rails-bf1494a1018a0bdc50dac4e87fdbf4b6b03083fa.zip |
Fix GROUP BY with calculate longer name field to respect `table_alias_length`
Follow up of c9e4c848eeeb8999b778fa1ae52185ca5537fffe.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb index 1305216be2..75e959045e 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb @@ -5,20 +5,24 @@ require "active_support/deprecation" module ActiveRecord module ConnectionAdapters # :nodoc: module DatabaseLimits + def max_identifier_length # :nodoc: + 64 + end + # Returns the maximum length of a table alias. def table_alias_length - 255 + max_identifier_length end # Returns the maximum length of a column name. def column_name_length - 64 + max_identifier_length end deprecate :column_name_length # Returns the maximum length of a table name. def table_name_length - 64 + max_identifier_length end deprecate :table_name_length @@ -33,7 +37,7 @@ module ActiveRecord # Returns the maximum length of an index name. def index_name_length - 64 + max_identifier_length end # Returns the maximum number of columns per table. |