Commit e0b13405 authored by unknown's avatar unknown

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


sql/sql_select.cc:
  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
parent 7b88672d
......@@ -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())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment