Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15435219
D15669.id37760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15669.id37760.diff
View Options
diff --git a/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php b/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
--- a/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
+++ b/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
@@ -309,6 +309,7 @@
case 1044: // Access denied to database
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);
case 1045: // Access denied (auth)
throw new AphrontInvalidCredentialsQueryException($message);
diff --git a/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php b/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
--- a/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
+++ b/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
@@ -51,12 +51,30 @@
$pass = $pass->openEnvelope();
}
- $conn = @mysql_connect(
- $host,
- $user,
- $pass,
- $new_link = true,
- $flags = 0);
+ $timeout = $this->getConfiguration('timeout');
+ $timeout_ini = 'mysql.connect_timeout';
+ if ($timeout) {
+ $old_timeout = ini_get($timeout_ini);
+ ini_set($timeout_ini, $timeout);
+ }
+
+ try {
+ $conn = @mysql_connect(
+ $host,
+ $user,
+ $pass,
+ $new_link = true,
+ $flags = 0);
+ } catch (Exception $ex) {
+ if ($timeout) {
+ ini_set($timeout_ini, $old_timeout);
+ }
+ throw $ex;
+ }
+
+ if ($timeout) {
+ ini_set($timeout_ini, $old_timeout);
+ }
if (!$conn) {
$errno = mysql_errno();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 7:26 AM (4 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705860
Default Alt Text
D15669.id37760.diff (1 KB)
Attached To
Mode
D15669: Support "timeout" parameter in older MySQL connections
Attached
Detach File
Event Timeline
Log In to Comment