Commit ddfa9621 authored by unknown's avatar unknown

Merge mysql.com:/home/hf/work/32942/my50-32942

into  mysql.com:/home/hf/work/32942/my51-32942


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents 44f1375f 274cdcdd
set autocommit=1;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
f n Query 1 n use `test`; insert into bug16206 values(0)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; BEGIN
f n Query 1 n use `test`; insert into bug16206 values(2)
f n Query 1 n use `test`; COMMIT
f n Query 1 n use `test`; insert into bug16206 values(3)
drop table bug16206;
set autocommit=0;
End of 5.0 tests
...@@ -4313,6 +4313,27 @@ SELECT * FROM t1 WHERE c1 > NULL + 1; ...@@ -4313,6 +4313,27 @@ SELECT * FROM t1 WHERE c1 > NULL + 1;
c1 c1
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, c INT, KEY(a));
INSERT INTO t1 VALUES (1, 1), (2, 2);
INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
(2, 1), (2, 2), (2, 3), (2, 4), (2, 5),
(3, 1), (3, 2), (3, 3), (3, 4), (3, 5),
(4, 1), (4, 2), (4, 3), (4, 4), (4, 5);
FLUSH STATUS;
SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
b
1
2
SHOW STATUS LIKE 'Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 6
DROP TABLE t1, t2;
End of 5.0 tests End of 5.0 tests
create table t1(a INT, KEY (a)); create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5); INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
......
-- source include/not_embedded.inc
-- source include/have_bdb.inc
#
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
#
set autocommit=1;
let $VERSION=`select version()`;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
set autocommit=0;
--echo End of 5.0 tests
...@@ -3661,6 +3661,24 @@ DROP TABLE t1; ...@@ -3661,6 +3661,24 @@ DROP TABLE t1;
--echo --echo
#
# Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan"
#
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, c INT, KEY(a));
INSERT INTO t1 VALUES (1, 1), (2, 2);
INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
(2, 1), (2, 2), (2, 3), (2, 4), (2, 5),
(3, 1), (3, 2), (3, 3), (3, 4), (3, 5),
(4, 1), (4, 2), (4, 3), (4, 4), (4, 5);
FLUSH STATUS;
SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
SHOW STATUS LIKE 'Handler_read%';
DROP TABLE t1, t2;
--echo End of 5.0 tests --echo End of 5.0 tests
# #
......
...@@ -11107,7 +11107,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab, ...@@ -11107,7 +11107,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
we found a row, as no new rows can be added to the result. we found a row, as no new rows can be added to the result.
*/ */
if (not_used_in_distinct && found_records != join->found_records) if (not_used_in_distinct && found_records != join->found_records)
return NESTED_LOOP_OK; return NESTED_LOOP_NO_MORE_ROWS;
} }
else else
join_tab->read_record.file->unlock_row(); join_tab->read_record.file->unlock_row();
......
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