Bug #76936 RowDataDynamic.isInterrupted is is not setted when a query has been killed
Submitted: 5 May 2015 7:43 Modified: 15 May 2015 10:37
Reporter: sun sun Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.35 OS:Any
Assigned to: CPU Architecture:Any
Tags: isInterrupted MySQLQueryInterruptedException

[5 May 2015 7:43] sun sun
Description:
A MySQLQueryInterruptedException is thrown when a query has been killed. But there are two MySQLQueryInterruptedException in 5.1.35:
com.mysql.jdbc.exceptions.MySQLQueryInterruptedException 
com.mysql.jdbc.exceptions.jdbc4.MySQLQueryInterruptedException 

Line 397 in RowDataDynamic:
            } else if (sqlEx instanceof MySQLQueryInterruptedException) {
                this.isInterrupted = true;
            }
com.mysql.jdbc.exceptions.MySQLQueryInterruptedException is to be caught when com.mysql.jdbc.exceptions.jdbc4.MySQLQueryInterruptedException is thrown actually.

This cause isInterrupted would not be set to true.

How to repeat:
1、do a query which will return a lot of rows,next() a few times;
2、kill it in another thread;
3、continue to next();
4、a com.mysql.jdbc.exceptions.jdbc4.MySQLQueryInterruptedException without isInterrupted setted to true.

Suggested fix:
catch both com.mysql.jdbc.exceptions.MySQLQueryInterruptedException and  com.mysql.jdbc.exceptions.jdbc4.MySQLQueryInterruptedException:

            } else if (sqlEx instanceof com.mysql.jdbc.exceptions.MySQLQueryInterruptedExceptio) {
                this.isInterrupted = true;
            }else if (sqlEx instanceof com.mysql.jdbc.exceptions.jdbc4.MySQLQueryInterruptedException) {
                this.isInterrupted = true;
            }
[6 May 2015 0:04] Filipe Silva
Hi Sun,

Thank you for this bug report.
Could you please provide a working example of the behavior you are describing?

Thank you,
[15 May 2015 10:37] Filipe Silva
Hi,

This was verified as described. However, the flag RowDataDynamic.isInterrupted has no relevance for anything in this code, at the most we can clean it up  a little bit.

Thank you,