1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

fixed processing aggregate functions with static tables (BUG#1318)

mysql-test/r/func_group.result:
  test of BUG#1318
mysql-test/r/subselect.result:
  correct results
mysql-test/t/func_group.test:
  test of BUG#1318
sql/sql_select.cc:
  hixed processing of static tables
This commit is contained in:
unknown
2003-09-20 18:30:36 +03:00
parent cbc431dbdf
commit e603c1efde
4 changed files with 24 additions and 3 deletions

View File

@ -5295,9 +5295,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
join->send_records=0;
if (join->tables == join->const_tables)
{
if (!join->select_lex->dependent ||
((!join->conds || join->conds->val_int()) &&
(!join->having || join->having->val_int())))
/*
HAVING will be chcked after processing aggregate functions,
But WHERE should checkd here (we alredy have read tables)
*/
if(!join->conds || join->conds->val_int())
{
if (!(error=(*end_select)(join,join_tab,0)) || error == -3)
error=(*end_select)(join,join_tab,1);