aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
diff options
context:
space:
mode:
authorAli Ibrahim <aibrahim2k2@gmail.com>2019-04-10 14:13:21 -0400
committerAli Ibrahim <aibrahim2k2@gmail.com>2019-04-11 12:57:19 -0400
commit6584fb3939dd3892834ed93fa791064d5299cda2 (patch)
treeaa6b25c50f13e543c3eeb35d5f44209d212f6a62 /activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
parentb86f32bc8529caa767e166aa10725a0fe1add7b5 (diff)
downloadrails-6584fb3939dd3892834ed93fa791064d5299cda2.tar.gz
rails-6584fb3939dd3892834ed93fa791064d5299cda2.tar.bz2
rails-6584fb3939dd3892834ed93fa791064d5299cda2.zip
Cache full MySQL version in schema cache
* The database version is cached in all the adapters, but this didn't include the full MySQL version. Anything that uses the full MySQL version would need to query the database to get that data even if they're using the schema cache. * Now the full MySQL version will be cached in the schema cache via the Version object.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 200184c2f9..bf0bb84c93 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -170,8 +170,11 @@ module ActiveRecord
class Version
include Comparable
- def initialize(version_string)
+ attr_reader :full_version_string
+
+ def initialize(version_string, full_version_string = nil)
@version = version_string.split(".").map(&:to_i)
+ @full_version_string = full_version_string
end
def <=>(version_string)