Re: MYSQL_OPT_RECONNECT
| From: | Alexey Zakhlestin | Date: | Mon, 09 Jul 2012 12:49:17 +0000 |
| Subject: | Re: MYSQL_OPT_RECONNECT | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61116@lists.php.net to get a copy of this message | ||
On 09.07.2012, at 14:17, Johannes Schlüter wrote:
> an example like this:
>
> $pdo = new PDO("mysql:...");
> $select = $pdo->prepare("SELECT * FROM t WHERE id = ?");
> /* do something ... connection break in between */
> $delete = $pdo->prepare("DELETE FROM t WHERE id = ?");
> $select->execute([1]);
>
> This will in fact do a DELETE, not a SELECT as the statement handle
> effectively is nothing but a per-connection counted unsigned long.
Well, this sounds like a bug
Prepared statements should become invalid once connection is lost and further attempts to execute
them should lead to exception