diff options
author | Ali Ibrahim <aibrahim2k2@gmail.com> | 2019-04-10 14:13:21 -0400 |
---|---|---|
committer | Ali Ibrahim <aibrahim2k2@gmail.com> | 2019-04-11 12:57:19 -0400 |
commit | 6584fb3939dd3892834ed93fa791064d5299cda2 (patch) | |
tree | aa6b25c50f13e543c3eeb35d5f44209d212f6a62 /activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | |
parent | b86f32bc8529caa767e166aa10725a0fe1add7b5 (diff) | |
download | rails-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/mysql2_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index 0dc880c731..2ff411a058 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -125,8 +125,12 @@ module ActiveRecord super end - def full_version - @full_version ||= @connection.server_info[:version] + def full_version # :nodoc: + schema_cache.database_version.full_version_string + end + + def get_full_version # :nodoc: + @connection.server_info[:version] end end end |