Bug #502 Server crash when substract count with join
Submitted: 25 May 2003 23:25 Modified: 26 May 2003 1:54
Reporter: Georg Richter Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1 OS:
Assigned to: CPU Architecture:Any

[25 May 2003 23:25] Georg Richter
Description:
The following Querie worked fine under 3.x and 4.0.12 but  
crashes under 4.1. 
 
Currently I'm working at customers office, there is no debug 
version installed, so I'm not able to add a stacktrace :(  

How to repeat:
mysql> create table a (a int, b int, index(a,b)); 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> insert into a values (1,2), (4,22), (3,101), (4,34), 
(5,22); 
Query OK, 5 rows affected (0.00 sec) 
Records: 5  Duplicates: 0  Warnings: 0 
 
mysql> create table b (c int, index(c)); 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> insert into b values (3),(6), (7); 
Query OK, 3 rows affected (0.00 sec) 
Records: 3  Duplicates: 0  Warnings: 0 
 
mysql> select b-a,count(c) from a,b where c between a and b 
and a=4 group by a; 
+------+----------+ 
| b-a  | count(c) | 
+------+----------+ 
|   18 |        4 | 
+------+----------+ 
1 row in set (0.00 sec) 
 
mysql> select b-a-count(c) from a,b where c between a and b 
and a=4 group by a; 
ERROR 2013: Lost connection to MySQL server during query
[26 May 2003 1:54] Oleksandr Byelkin
thank you for good test suite, but this bug is same with #380