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