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

From: Date: Tue, 06 Mar 2018 10:55:23 +0000
Subject: Bug #61613 [Com]: 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-214221@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
 Comment by:         phpbug at braten dot be
 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
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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.

------------------------------------------------------------------------
[2015-09-16 10:31:26] tony2001@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

Since there are two statements and the first one is valid, you have to use nextRowset() and this is
expected behavior.

------------------------------------------------------------------------


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


Thread (26 messages)

« previous php.bugs (#214221) next »