Bug #13616 "CALL <dbname>.<procedurename>" executes properly, but displays error
Submitted: 29 Sep 2005 17:40 Modified: 13 Oct 2005 2:21
Reporter: Bart Jan Buijs Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.12/BK source OS:FreeBSD (FreeBSD)
Assigned to: CPU Architecture:Any

[29 Sep 2005 17:40] Bart Jan Buijs
Description:
The query "CALL <dbname>.<procedurename>" works properly, but displays "ERROR 1046 (3D000): No database selected" after the output of the stored procedure when you don't call "USE <dbname>" before.

How to repeat:
Create valid stored procedure. Grant a user execute privilige on this procedure.
Connect to SQL server using this user. Type "CALL <dbname>.<procedurename>".
It will execute the stored procedure properly (as espected), but also results in the error: "ERROR 1046 (3D000): No database selected".

Suggested fix:
It should not display to error.
[29 Sep 2005 17:56] Miguel Solorzano
miguel@hegel:~/dbs/5.0> bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.14-rc-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> call test.myp();
+-----+
| 1+1 |
+-----+
|   2 |
+-----+
1 row in set (0.01 sec)

ERROR 1046 (3D000): No database selected
mysql>
[5 Oct 2005 15:15] 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/internals/30721
[12 Oct 2005 12:12] Per-Erik Martin
Pushed to bk 5.0.15
[13 Oct 2005 2:21] Mike Hillyer
Documented in 5.0.15 changelog:

      <listitem>
        <para>
          When calling a stored procedure with the <literal>CALL
            <schema>.<procedurename></literal> syntax and no default
          schema selected, <literal>ERROR 1046</literal> was displayed after the
          procedure returned. (Bug #13616) 
        </para>
      </listitem>
[21 May 2007 8:14] Sveta Smirnova
Bug #28551 is exists in current versions and can be duplicate of this one.