summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authormonty@mishka.local <>2005-07-19 19:25:05 +0300
committermonty@mishka.local <>2005-07-19 19:25:05 +0300
commit7e83d09ce72e27266eb8f6deababd172c20bbfb6 (patch)
tree98d1121d654b01cf2306965326d1355704fc1218 /sql/sql_select.cc
parent8b3d39163af4075b039638ebad86ae21cbc81323 (diff)
downloadmariadb-git-7e83d09ce72e27266eb8f6deababd172c20bbfb6.tar.gz
Simple fixes during review of new code
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5b4eab36dd2..29560e8701b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1081,14 +1081,18 @@ JOIN::exec()
else
{
error= (int) result->send_eof();
- send_records=1;
+ send_records= ((select_options & OPTION_FOUND_ROWS) ? 1 :
+ thd->sent_row_count);
}
}
else
+ {
error=(int) result->send_eof();
+ send_records= 0;
+ }
}
- /* Single select (without union and limit) always returns 1 row */
- thd->limit_found_rows= 1;
+ /* Single select (without union) always returns 0 or 1 row */
+ thd->limit_found_rows= send_records;
thd->examined_row_count= 0;
DBUG_VOID_RETURN;
}
@@ -3552,6 +3556,7 @@ static void add_not_null_conds(JOIN *join)
if (tab->ref.null_rejecting & (1 << keypart))
{
Item *item= tab->ref.items[keypart];
+ Item *notnull;
DBUG_ASSERT(item->type() == Item::FIELD_ITEM);
Item_field *not_null_item= (Item_field*)item;
JOIN_TAB *referred_tab= not_null_item->field->table->reginfo.join_tab;
@@ -3562,7 +3567,6 @@ static void add_not_null_conds(JOIN *join)
*/
if (!referred_tab || referred_tab->join != join)
continue;
- Item *notnull;
if (!(notnull= new Item_func_isnotnull(not_null_item)))
DBUG_VOID_RETURN;
/*