Bug #15121 | a faulty procedure is executed but no exception is thrown | ||
---|---|---|---|
Submitted: | 22 Nov 2005 0:10 | Modified: | 27 Jan 2006 10:55 |
Reporter: | Roland Bouman | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S3 (Non-critical) |
Version: | 5.0 | OS: | NA |
Assigned to: | Bugs System | CPU Architecture: | Any |
[22 Nov 2005 0:10]
Roland Bouman
[23 Nov 2005 12:24]
Vasily Kishkin
I was not able to reproduce the bug using jdbc:mysql://localhost:3306/test?user=root I've got the follow exception: java.sql.SQLException: Table 'test.idonotexist' doesn't exist But If I use jdbc:mysql://localhost:3306/mysql?user=root I don't have any exception. I would like to notice The table "idonotexist" is not anywhere. My test case is attached.
[23 Nov 2005 12:24]
Vasily Kishkin
Test case
Attachment: Bug15121.java (text/java), 771 bytes.
[23 Nov 2005 12:54]
Roland Bouman
It's not entirely clear to me...should I do something? I mean, I don't see any attachment or something like that
[23 Nov 2005 15:30]
Mark Matthews
Roland, Vasily's note was intended for the developer who will be fixing this (me). One question, do you happen to have a stored procedure with the same name in a different database?
[23 Nov 2005 15:55]
Roland Bouman
Thanks for clearing that up, sorry to bother you about that. To answer your question: I only have one such procedure: test.p_idonotexist
[28 Nov 2005 16:34]
Mark Matthews
Seems to be a server bug. When you prefix the stored procedure name with the catalog (database) the procedure exists in (as the JDBC driver does), the procedure returns without error, but instead a warning: mysql> select version(); +--------------+ | version() | +--------------+ | 5.0.17-debug | +--------------+ 1 row in set (0.00 sec) mysql> call `test`.p_testBug15121(); Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> show warnings; +-------+------+----------------------------------------+ | Level | Code | Message | +-------+------+----------------------------------------+ | Error | 1146 | Table 'test.idonotexist' doesn't exist | +-------+------+----------------------------------------+ 1 row in set (0.00 sec) However, if you change to the current database to the one the procedure is declared in, and execute it you get an error: mysql> use test; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> call p_testBug15121(); ERROR 1146 (42S02): Table 'test.idonotexist' doesn't exist
[27 Jan 2006 10:55]
Per-Erik Martin
I can't repeat this from the mysql client in 5.0.19.