|
2 | 2 | * Generated by build-library.php, Please DO NOT modify!
|
3 | 3 | */
|
4 | 4 |
|
5 |
| -/* $Id: c1d47051d7a949c0a76ca595f6d523faa2ecc3b9 */ |
| 5 | +/* $Id: b2d3486c3bca310c730de8575e71b27d2d0ee30d */ |
6 | 6 |
|
7 | 7 | static const char* swoole_library_source_constants =
|
8 | 8 | "\n"
|
@@ -2803,9 +2803,14 @@ static const char* swoole_library_source_core_database_pdo_proxy =
|
2803 | 2803 | " || $n === 0\n"
|
2804 | 2804 | " || $this->__object->inTransaction()\n"
|
2805 | 2805 | " ) {\n"
|
2806 |
| - " $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n" |
2807 |
| - " $exception->errorInfo = $errorInfo;\n" |
2808 |
| - " throw $exception;\n" |
| 2806 | + " /* '00000' means “no error.”, as specified by ANSI SQL and ODBC. */\n" |
| 2807 | + " if (!empty($errorInfo) && $errorInfo[0] !== '00000') {\n" |
| 2808 | + " $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n" |
| 2809 | + " $exception->errorInfo = $errorInfo;\n" |
| 2810 | + " throw $exception;\n" |
| 2811 | + " }\n" |
| 2812 | + " /* no error info, just return false */\n" |
| 2813 | + " break;\n" |
2809 | 2814 | " }\n"
|
2810 | 2815 | " $this->reconnect();\n"
|
2811 | 2816 | " continue;\n"
|
@@ -2917,12 +2922,14 @@ static const char* swoole_library_source_core_database_pdo_statement_proxy =
|
2917 | 2922 | " ) {\n"
|
2918 | 2923 | " $errorInfo = $this->__object->errorInfo();\n"
|
2919 | 2924 | "\n"
|
2920 |
| - " // '00000' means “no error.”, as specified by ANSI SQL and ODBC.\n" |
2921 |
| - " if ($errorInfo[0] !== '00000') {\n" |
| 2925 | + " /* '00000' means “no error.”, as specified by ANSI SQL and ODBC. */\n" |
| 2926 | + " if (!empty($errorInfo) && $errorInfo[0] !== '00000') {\n" |
2922 | 2927 | " $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n"
|
2923 | 2928 | " $exception->errorInfo = $errorInfo;\n"
|
2924 | 2929 | " throw $exception;\n"
|
2925 | 2930 | " }\n"
|
| 2931 | + " /* no error info, just return false */\n" |
| 2932 | + " break;\n" |
2926 | 2933 | " }\n"
|
2927 | 2934 | " if ($this->parent->getRound() === $this->parentRound) {\n"
|
2928 | 2935 | " /* if not equal, parent has reconnected */\n"
|
|
0 commit comments