Bug #41781 Server send wrong SERVER_MORE_RESULTS_EXISTS after KILL QUERY
Submitted: 29 Dec 2008 14:10 Modified: 30 Dec 2008 11:49
Reporter: xxx xxx Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.0.67 OS:Any
Assigned to: CPU Architecture:Any

[29 Dec 2008 14:10] xxx xxx
Description:
I'm using multi statement support with CLIENT_MULTI_STATEMENTS and CLIENT_MULTI_RESULTS.

Inside one database connection (thread id: 111) I send two SQL statements at once:
SLEEP SELECT(600); // waits ten minutes
SELECT 2,3; // any kind of query

Now I open a second connection (thread id: 112) to that database and execute the command:
KILL QUERY 111;
Inside this connection all works fine.

The first connection (thread id: 111) the database sends a normal result set - that's fine. But inside this result the server status will be reported with a set SERVER_MORE_RESULTS_EXISTS flag - but no further results will be sent.

Because of this the client hangs in a never ending waiting of the result advised by the SERVER_MORE_RESULTS_EXISTS flag.

How to repeat:
see description

Suggested fix:
Do not set SERVER_MORE_RESULTS_EXISTS in the server status.
[29 Dec 2008 17:59] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please send example of  the code you use.
[29 Dec 2008 20:03] xxx xxx
If >YOU< are not able to reproduce - please forward this bug to somebody who is able to do it.

Please go home, if you are not able to reproduce this fine described bug.
[30 Dec 2008 6:42] Sveta Smirnova
Thank you for the feedback.

From your description is not clear how you process results. This is why I ask you about repeatable test case. Also is not clear which programming language do you use (I assume C).
[30 Dec 2008 8:43] xxx xxx
If it's for >YOU< not clear how to process this result please forward this issue to somebody else how is able to understand this problem.

Just go home, if >YOU< are not able to understand it.

I'm sorry, but if MySQL AB pleaes a poor guy like you to handle bug reports I'm not interessed to present a gift to you - seems your company is not able to understand what a bug message is: A present to the developer.

This was my last comment and my last bug report.
[30 Dec 2008 10:40] Sveta Smirnova
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Just for reference if somebody meet similar problem and would be able to provide repeatable test case below is test I used:

#include "mysql.h"
#include <stdio.h>
#include <strings.h>

int main()
{
  MYSQL *mysql;
  char out[10];
  int len;
  int OK;
  char *query;
  MYSQL_ROW row;
  MYSQL_RES *result;

  mysql= mysql_init(NULL);
  mysql= mysql_real_connect(mysql, "127.0.0.1", "root", "", "test", 4040, NULL, CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS);

  query = "select sleep(120); select 1;";

  OK = mysql_real_query(mysql, query, strlen(query));

  if (0 == OK) {
          while (mysql_more_results(mysql)) {
                  mysql_next_result(mysql);
                result = mysql_store_result(mysql);
                if (result) {
                        row = mysql_fetch_row(result);
                        printf("Result of a query: %s\n", row[0]);
                        mysql_free_result(result);
                }
          }
  }

  return 0;
}

Kill SELECT SLEEP in another client.
[30 Dec 2008 11:49] xxx xxx
> Not enough information was provided for us to be able to handle this bug.

I confirmed this before: >YOU< are not able to handle this bug report.

Thank you for confirming your problems!