We have also to test 'conds' even if there was no tables.

(This is because conds may not be a constant)
This bug caused a failure in the test suite for select.test becasue for prepared statements in one case a 'constant sub query' was not regarded as a constant
Sanja will as a separate task check if we can fix that the sub query can be recognized as a constant
Bug #12217
This commit is contained in:
monty@mysql.com 2005-07-27 22:58:55 +03:00
parent a5b6057db5
commit d28f576cf4

View File

@ -1072,7 +1072,14 @@ JOIN::exec()
else
{
result->send_fields(fields_list,1);
if (cond_value != Item::COND_FALSE && (!having || having->val_int()))
/*
We have to test for 'conds' here as the WHERE may not be constant
even if we don't have any tables for prepared statements or if
conds uses something like 'rand()'.
*/
if (cond_value != Item::COND_FALSE &&
(!conds || conds->val_int()) &&
(!having || having->val_int()))
{
if (do_send_rows && (procedure ? (procedure->send_row(fields_list) ||
procedure->end_of_records())