Bug #15943 mysql_next_result hangs on invalid SHOW CREATE VIEW
Submitted: 22 Dec 2005 20:57 Modified: 27 Feb 2006 19:44
Reporter: MySQL-Front Team Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.17 OS:Windows (Windows XP)
Assigned to: Bugs System CPU Architecture:Any

[22 Dec 2005 20:57] MySQL-Front Team
Description:
After executing a SHOW CREATE VIEW query of an invalid view the mysql_next_result function of the libMySQL.dll hangs. So the client application hangs at all.

The server is running well.

This is not a bug of the libMySQL.dll - it's a bug of the server since the server gives a wrong answer to the libMySQL.dll.

How to repeat:
CREATE TABLE `newtable` (
  `id` int(11) NOT NULL auto_increment,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE VIEW `newview` AS select * from `newtable`;
DROP TABLE `newtable`;

SHOW CREATE VIEW `test`.`newview`;

...after executing the last query the mysql_next_result function of the C API hangs.
[23 Dec 2005 7:40] Aleksey Kishkin
At least on windows it works properly. Going to test it on windows

$ ./bug15943
mysql version is: 5.0.17-max
Handling..
Handling..
Handling..
Handling..
Handling..
Handling..
v15943: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v15943` AS select sql_no_cache `test`.`b15943`.`id` AS `id` from `b15943`
[23 Dec 2005 7:40] Aleksey Kishkin
testcase I used

Attachment: bug15943.c (application/octet-stream, text), 1.48 KiB.

[23 Dec 2005 7:41] Aleksey Kishkin
I meant it owrks on linux. Going to test it on windows
[23 Dec 2005 7:57] MySQL-Front Team
Btw: The bug does not occur in 5.0.16.

In 5.0.16 the information_schema.TABLES.TABLE_TYPE column is NULL for this newview after removeing newtable.

This problem has been fixed in 5.0.17.

... maybe on this fix the bug could be based.
[30 Dec 2005 8:48] MySQL-Front Team
MySQL is not interessed to fix this bug.

We know this from a lot of other critcal bugs. :-(
[17 Jan 2006 21:25] MySQL-Front Team
MySQL is not interessed to fix this bug.

We know this from a lot of other critcal bugs. :-(
[13 Feb 2006 16:54] 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/2529
[27 Feb 2006 14:01] Sergey Vlasenko
fix is available in 5.0.19
[27 Feb 2006 19:44] Mike Hillyer
Documented in 5.0.19 changelog:

   <listitem>
        <para>
          Executing a <literal>SHOW CREATE VIEW</literal> query of an
          invalid view caused the
          <function>mysql_next_result</function> function of
          <filename>libMySQL.dll</filename> to hang. (Bug #15943)
        </para>
      </listitem>