aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/tasks
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-07-25 14:54:44 -0700
committerGitHub <noreply@github.com>2019-07-25 14:54:44 -0700
commitec7aa03c984a0daeead4f71c7189d241139a6770 (patch)
treef93166db0cf49e76f8524c5bd1093b186091cb25 /activerecord/lib/active_record/tasks
parent04093884a1527777795ad1f17ef1c556e7db9429 (diff)
parent15c81c8ed4930574d9900a6f947d4e0ebaa82a2f (diff)
downloadrails-ec7aa03c984a0daeead4f71c7189d241139a6770.tar.gz
rails-ec7aa03c984a0daeead4f71c7189d241139a6770.tar.bz2
rails-ec7aa03c984a0daeead4f71c7189d241139a6770.zip
Merge pull request #36766 from jhawthorn/call_connection_error_number
Use connection.error_number in MySQLDatabaseTasks
Diffstat (limited to 'activerecord/lib/active_record/tasks')
-rw-r--r--activerecord/lib/active_record/tasks/mysql_database_tasks.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
index a7e04007a9..e3efeb75b5 100644
--- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
@@ -16,7 +16,7 @@ module ActiveRecord
connection.create_database configuration["database"], creation_options
establish_connection configuration
rescue ActiveRecord::StatementInvalid => error
- if error.cause.error_number == ER_DB_CREATE_EXISTS
+ if connection.error_number(error.cause) == ER_DB_CREATE_EXISTS
raise DatabaseAlreadyExists
else
raise