Bug #61613 [Nab]: No PDO error if first SQL statement of a group is valid.

From: Date: Tue, 06 Mar 2018 10:59:21 +0000
Subject: Bug #61613 [Nab]: No PDO error if first SQL statement of a group is valid.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214222@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61613&edit=1 ID: 61613 Updated by: requinix@php.net Reported by: trebitzki at gmx dot net Summary: No PDO error if first SQL statement of a group is valid. Status: Not a bug Type: Bug Package: PDO MySQL Operating System: Mac OS X PHP Version: 5.3.10 -Assigned To: mysql +Assigned To: -Block user comment: No +Block user comment: Yes Private report: N New Comment: As was explained years ago, this is NOT A BUG. If you execute multiple queries then you need nextRowset() to look at the results from each one. That is how it is supposed to work. Previous Comments: ------------------------------------------------------------------------ [2018-03-06 10:55:20] phpbug at braten dot be I had to abandon using the "feature" of multiple sql statements in one query because of this. So yes, because the feature is buggy, the "simple" solution is not to use it. But I think it is wrong to leave this as a buggy feature that can't be really used. ------------------------------------------------------------------------ [2018-03-06 10:49:36] spam2 at rhsoft dot net just don't place multiple statements in a single query and then wonder why debug it don't work that well - it's that easy ------------------------------------------------------------------------ [2018-03-06 10:45:19] phpbug at braten dot be This bug should be reopened. It really is a problem when you have several DELETE statements and/or UPDATE statments. It happend to me yesterday that the 3rd DELETE statment had a bug, and I could not figure out why the records where still there in my database. No exceptions where thrown. Does using nextRowset() even work when you are using multiple DELETE statements? ------------------------------------------------------------------------ [2015-09-16 12:41:43] benjamin dot morel at gmail dot com I don't think the current implementation is really a problem. But the documentation has to be clear about that, and the fact is, it isn't at the moment. ------------------------------------------------------------------------ [2015-09-16 11:53:26] Daniel at Kraffner dot de Even if this is considered "by design", the issue should be addressed in someway. The current situation is inconsistent and quite a lot developers stumble across it, leading to the visible feedback within this bug report. Why is an exception thrown right away, if a single statement is executed WITHOUT accessing the result set? Why does the result set needs to be accessed when multiple queries are executed? imho, the implementation should - either never throw an exception if the result set is NOT accessed, even if it is a single query. - or always throw an exception without accessing the result set even for multiple queries. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61613 -- Edit this bug report at https://bugs.php.net/bug.php?id=61613&edit=1

« previous php.bugs (#214222) next »