Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15345123
D21608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21608.diff
View Options
diff --git a/resources/sql/autopatches/20210215.changeset.02.phid-populate.php b/resources/sql/autopatches/20210215.changeset.02.phid-populate.php
--- a/resources/sql/autopatches/20210215.changeset.02.phid-populate.php
+++ b/resources/sql/autopatches/20210215.changeset.02.phid-populate.php
@@ -11,12 +11,20 @@
$temporary_table = 'tmp_20210215_changeset_id_map';
-queryfx(
- $conn,
- 'CREATE TEMPORARY TABLE %T (
- changeset_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
- changeset_phid VARBINARY(64) NOT NULL)',
- $temporary_table);
+try {
+ queryfx(
+ $conn,
+ 'CREATE TEMPORARY TABLE %T (
+ changeset_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ changeset_phid VARBINARY(64) NOT NULL)',
+ $temporary_table);
+} catch (AphrontAccessDeniedQueryException $ex) {
+ throw new PhutilProxyException(
+ pht(
+ 'Failed to "CREATE TEMPORARY TABLE". You may need to "GRANT" the '.
+ 'current MySQL user this permission.'),
+ $ex);
+}
$table_iterator = id(new LiskRawMigrationIterator($conn, $table_name))
->setPageSize($chunk_size);
diff --git a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
--- a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
+++ b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
@@ -347,7 +347,16 @@
case 1142: // Access denied to table
case 1143: // Access denied to column
case 1227: // Access denied (e.g., no SUPER for SHOW SLAVE STATUS).
- throw new AphrontAccessDeniedQueryException($message);
+
+ // See T13622. Try to help users figure out that this is a GRANT
+ // problem.
+
+ $more = pht(
+ 'This error usually indicates that you need to "GRANT" the '.
+ 'MySQL user additional permissions. See "GRANT" in the MySQL '.
+ 'manual for help.');
+
+ throw new AphrontAccessDeniedQueryException("{$message}\n\n{$more}");
case 1045: // Access denied (auth)
throw new AphrontInvalidCredentialsQueryException($message);
case 1146: // No such table
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 8:40 AM (1 w, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7228029
Default Alt Text
D21608.diff (2 KB)
Attached To
Mode
D21608: Provide more help around GRANT errors, particularly for missing TEMPORARY TABLE permission
Attached
Detach File
Event Timeline
Log In to Comment