Commit 417103de authored by unknown's avatar unknown

several bug fixes and tests


mysql-test/mysql-test-run.sh:
  Fix for LOAD DATA LOCAL ...
mysql-test/r/select_found.result:
  Added result for a new test of combo of options for FOUND_ROWS and
  BUFFER_RESULT
mysql-test/t/select_found.test:
  Added test for combo of options for BUFFER_RESULT and FOUND_ROWS
sql/sql_select.cc:
  Added fix for combo of options for BUFFER_RESULT and FOUND_ROWS
parent f4dc6b47
......@@ -730,6 +730,7 @@ start_master()
--server-id=1 \
--basedir=$MY_BASEDIR \
--port=$MASTER_MYPORT \
--local-infile \
--exit-info=256 \
--core \
--datadir=$MASTER_MYDDIR \
......@@ -749,6 +750,7 @@ start_master()
--server-id=1 --rpl-recovery-rank=1 \
--basedir=$MY_BASEDIR --init-rpl-role=master \
--port=$MASTER_MYPORT \
--local-infile \
--datadir=$MASTER_MYDDIR \
--pid-file=$MASTER_MYPID \
--socket=$MASTER_MYSOCK \
......
......@@ -20,6 +20,12 @@ a b
select found_rows();
FOUND_ROWS()
8
select SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS * from t1 limit 1;
a b
1 2
select found_rows();
FOUND_ROWS()
8
select SQL_CALC_FOUND_ROWS * from t1 order by b desc limit 1;
a b
8 9
......
......@@ -9,6 +9,8 @@ select SQL_CALC_FOUND_ROWS * from t1;
select found_rows();
select SQL_CALC_FOUND_ROWS * from t1 limit 1;
select found_rows();
select SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS * from t1 limit 1;
select found_rows();
select SQL_CALC_FOUND_ROWS * from t1 order by b desc limit 1;
select found_rows();
select SQL_CALC_FOUND_ROWS distinct b from t1 limit 1;
......
......@@ -187,7 +187,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
TABLE *tmp_table;
int error, tmp_error;
bool need_tmp,hidden_group_fields;
bool simple_order,simple_group,no_order, skip_sort_order;
bool simple_order,simple_group,no_order, skip_sort_order, buffer_result;
Item::cond_result cond_value;
SQL_SELECT *select;
DYNAMIC_ARRAY keyuse;
......@@ -201,6 +201,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
/* Check that all tables, fields, conds and order are ok */
select_distinct=test(select_options & SELECT_DISTINCT);
buffer_result=test(select_options & OPTION_BUFFER_RESULT) && !test(select_options & OPTION_FOUND_ROWS);
tmp_table=0;
select=0;
no_order=skip_sort_order=0;
......@@ -546,8 +547,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
need_tmp= (join.const_tables != join.tables &&
((select_distinct || !simple_order || !simple_group) ||
(group && order) ||
test(select_options & OPTION_BUFFER_RESULT)));
(group && order) || buffer_result));
// No cache for MATCH
make_join_readinfo(&join,
......
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