Consistently extract checking version for all adapters
#34232

kamipo wants to merge kamipo:check_version into rails:master

We do not currently have an analysis of these two commits