mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
A fix and a test case for Bug#12736 "Server crash during a select".
The bug was in JOIN::join_free which was wrongly determining that all joins have been already executed and therefore all used tables can be closed.
This commit is contained in:
@ -152,3 +152,23 @@ EXECUTE my_stmt;
|
||||
b count(*)
|
||||
deallocate prepare my_stmt;
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
school_name varchar(45) NOT NULL,
|
||||
country varchar(45) NOT NULL,
|
||||
funds_requested float NOT NULL,
|
||||
schooltype varchar(45) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
insert into t1 values ("the school", "USA", 1200, "Human");
|
||||
select count(country) as countrycount, sum(funds_requested) as smcnt,
|
||||
country, (select sum(funds_requested) from t1) as total_funds
|
||||
from t1
|
||||
group by country;
|
||||
countrycount smcnt country total_funds
|
||||
1 1200 USA 1200
|
||||
select count(country) as countrycount, sum(funds_requested) as smcnt,
|
||||
country, (select sum(funds_requested) from t1) as total_funds
|
||||
from t1
|
||||
group by country;
|
||||
countrycount smcnt country total_funds
|
||||
1 1200 USA 1200
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user