Bug #15206 Misleading message "No data to FETCH"
Submitted: 23 Nov 2005 21:57 Modified: 18 Jan 2006 0:00
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.17-debug OS:Linux (SUSE 10.0)
Assigned to: Konstantin Osipov CPU Architecture:Any

[23 Nov 2005 21:57] Peter Gulutzan
Description:
MySQL's message for the 'no data' situation is
"No data to FETCH".
This can be misleading, because the message
is associated with all "no data" returns -- not
only for the FETCH statement, but also for the
single-row SELECT statement (and .
It might be enough to just change "FETCH"
to "fetch", but here are other suggestions:
"no data -- zero rows selected or fetched"
"no data"
"no data (SELECT of zero rows or FETCH past end)"
  

How to repeat:
mysql> create table t55 (s1 int);
Query OK, 0 rows affected (0.06 sec)

mysql> select s1 into @a from t55;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------+
| Level   | Code | Message          |
+---------+------+------------------+
| Warning | 1329 | No data to FETCH |
+---------+------+------------------+
1 row in set (0.00 sec)
[24 Nov 2005 13:35] Konstantin Osipov
Peter, could you suggest a better message please?
[24 Nov 2005 23:05] Peter Gulutzan
I made some suggestions in the original bug description. But, noting Per-Erik's comment, I guess we should try to cover all circumstances. My suggestion now is:
"No data - zero rows fetched, selected, or processed"
[17 Jan 2006 18:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1212
[17 Jan 2006 18:11] Konstantin Osipov
The new message is distributed in errmsg.txt starting from version 5.0.19
[18 Jan 2006 0:00] Mike Hillyer
Noted in the Functionality Changed section of the 5.0.19 changelog:

  <listitem>
        <para>
          Wording of error 1329 changed to <literal>No data - zero rows
            fetched, selected, or processed</literal>. (Bug #15206)
        </para>
      </listitem>