Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow DESCRIBE queries on read-only connections #37240

Merged

Conversation

dylanahsmith
Copy link
Contributor

@rafaelfranca

Problem

We want to allow employees to query for production table metadata by allowing them to make raw queries on a restricted connection. One of the statements they have been using is DESCRIBE or DESC which are aliases for EXPLAIN. However, when the mysql connection configuration uses replica: true then this results in a ActiveRecord::ReadOnlyError

Solution

I've added :describe and :desc to the read-only query whitelist for mysql.

@georgeclaghorn georgeclaghorn merged commit 3322e23 into rails:master Sep 19, 2019
@georgeclaghorn
Copy link
Contributor

Backported to 6-0-stable in d7073d3.

@dylanahsmith dylanahsmith deleted the add-describe-to-mysql-read-queries branch September 19, 2019 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants