Bug #33702 | accessing a federated table with a non existing server returns random error code | ||
---|---|---|---|
Submitted: | 5 Jan 2008 8:55 | Modified: | 18 Sep 2008 6:26 |
Reporter: | Giuseppe Maxia | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Federated storage engine | Severity: | S3 (Non-critical) |
Version: | 5.1.23 | OS: | Any (Linux and Mac OS X) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
Tags: | Contribution, error, federated, server |
[5 Jan 2008 8:55]
Giuseppe Maxia
[5 Jan 2008 13:28]
Giuseppe Maxia
This simple change to storage/federated/ha_federated.cc should solve the problem. 577c577 < error_num=1; --- > error_num=ER_FOREIGN_SERVER_DOESNT_EXIST;
[7 Jan 2008 11:01]
MySQL Verification Team
Thank you for the bug report.
[29 Feb 2008 11:53]
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/43215 ChangeSet@1.2530, 2008-02-29 15:48:48+04:00, ramil@mysql.com +3 -0 Fix for bug #33702: accessing a federated table with a non existing server returns random error code Problem: accessing a federated table through a non existing server leads to wrong error number returned. Fix: return a proper error.
[5 Mar 2008 10:59]
Sergey Vojtovich
The patch is ok to push. But I still believe that get_connection() shouldn't report an error. Instead error code should be passed to parse_url_error() function. That is "error" label should be removed, error code should be returned immediately after get_server_by_name().
[7 Mar 2008 15:42]
Ingo Strüwing
I agree with Sergey. Your patch is correct and solves the problem. But the current approach of reporting an error in get_connection() could lead to a buffer overrun. Reporting the error through parse_url_error() would fix it. Also the error message would not repeat "does not exist" in English language. OTOH this is unreleated to the reported problem. Sergey usually opposes against fixing unrelated issues. For the records: I did not find any use of ER_FOREIGN_SERVER_DOESNT_EXIST in the test suite. parse_url_error() is probably untested. And hence parse_url() is poorly tested.
[15 Aug 2008 12:26]
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/51726 2768 Ramil Kalimullin 2008-08-15 Fix for bug #33702: accessing a federated table with a non existing server returns random error code Problem: accessing a federated table through a non existing server leads to wrong error number returned. Fix: return a proper error.
[13 Sep 2008 19:46]
Bugs System
Pushed into 6.0.6-alpha (revid:ramil@mysql.com-20080815122632-udl05gwcqjrgh47e) (version source revid:sergefp@mysql.com-20080611231653-nmuqmw6dedjra79i) (pib:3)
[18 Sep 2008 6:26]
Paul DuBois
Noted in 6.0.6 changelog. Attempts to access a FEDERATED table using a non-existent server did not reliably return a proper error.
[29 Jan 2010 22:08]
MySQL Verification Team
for the record, this bug still affects 5.1.42 and 5.5.99-m3: Server version: 5.5.99-m3-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create table `t1_fed`(`a` int not null) engine=federated; ERROR 1 (HY000): Can't create/write to file 'server name: '' doesn't exist!' (Errcode: 82505120) mysql>
[10 Jul 2012 20:15]
Elena Stepanova
.. and in 5.6, too: Version: '5.6.6-m9-debug-log' Warnings from just before the error: Error 1 server name: 'connect_string' doesn't exist! Error 1 Can't create/write to file 'connect_string' (Errcode: 58905942 - }O)
[10 Jul 2012 20:15]
Elena Stepanova
.. and in 5.6, too: Version: '5.6.6-m9-debug-log' Warnings from just before the error: Error 1 server name: 'connect_string' doesn't exist! Error 1 Can't create/write to file 'connect_string' (Errcode: 58905942 - }O)
[10 Jul 2012 20:19]
Elena Stepanova
Sorry for the duplicate, blame the new captcha system which is barely passable for a living being (and is apparently glitchy, too)