From 628082d4270f6ceb3a7c87bec14f953f646d40fe Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 4 Sep 2011 14:57:33 -0700 Subject: [PATCH] Don't flag "EXPLAIN" as a write Summary: These queries are safe to run without a CSRF token, and we need them for the query analyzer in DarkConsole. Test Plan: "Analyze Query Plans" works again. Reviewers: jungejason, nh, tuomaspelkonen, aran Reviewed By: nh CC: aran, epriestley, nh Differential Revision: 895 --- src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php b/src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php index 4cce4ed84e..6a9b7639c9 100644 --- a/src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php +++ b/src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php @@ -209,7 +209,7 @@ class AphrontMySQLDatabaseConnection extends AphrontDatabaseConnection { $this->requireConnection(); // TODO: Do we need to include transactional statements here? - $is_write = !preg_match('/^(SELECT|SHOW)\s/', $raw_query); + $is_write = !preg_match('/^(SELECT|SHOW|EXPLAIN)\s/', $raw_query); if ($is_write) { AphrontWriteGuard::willWrite(); }