Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
83e6352c
Commit
83e6352c
authored
Apr 19, 2007
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#27939: Early NULLs filtering doesn't work for eq_ref access
- Turn it on for JT_EQ_REF access method
parent
7d71d580
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
2 deletions
+127
-2
mysql-test/r/bdb_notembedded.result
mysql-test/r/bdb_notembedded.result
+35
-0
mysql-test/r/join.result
mysql-test/r/join.result
+28
-0
mysql-test/t/bdb_notembedded.test
mysql-test/t/bdb_notembedded.test
+38
-0
mysql-test/t/join.test
mysql-test/t/join.test
+23
-0
sql/sql_select.cc
sql/sql_select.cc
+3
-2
No files found.
mysql-test/r/bdb_notembedded.result
0 → 100644
View file @
83e6352c
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
mysql-test/r/join.result
View file @
83e6352c
...
...
@@ -779,4 +779,32 @@ Field Type Null Key Default Extra
Name varchar(50) YES NULL
DROP VIEW v1;
DROP TABLE t1,t2,tv1,tv2;
create table t1 (a int, b int);
insert into t1 values
(NULL, 1),
(NULL, 2),
(NULL, 3),
(NULL, 4);
create table t2 (a int not null, primary key(a));
insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t3 (a int not null, primary key(a));
insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
flush status;
select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
a b a a
explain select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
We expect rnd_next=5, and read_key must be 0 because of short-cutting:
show status like 'Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 5
drop table t1, t2, t3;
End of 5.0 tests.
mysql-test/t/bdb_notembedded.test
0 → 100644
View file @
83e6352c
--
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
mysql-test/t/join.test
View file @
83e6352c
...
...
@@ -610,4 +610,27 @@ DESCRIBE tv2;
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
,
tv1
,
tv2
;
# BUG#27939: Early NULLs filtering doesn't work for eq_ref access
create
table
t1
(
a
int
,
b
int
);
insert
into
t1
values
(
NULL
,
1
),
(
NULL
,
2
),
(
NULL
,
3
),
(
NULL
,
4
);
create
table
t2
(
a
int
not
null
,
primary
key
(
a
));
insert
into
t2
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t3
(
a
int
not
null
,
primary
key
(
a
));
insert
into
t3
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
flush
status
;
select
*
from
t1
,
t2
,
t3
where
t3
.
a
=
t1
.
a
and
t2
.
a
=
t1
.
b
;
explain
select
*
from
t1
,
t2
,
t3
where
t3
.
a
=
t1
.
a
and
t2
.
a
=
t1
.
b
;
--
echo
We
expect
rnd_next
=
5
,
and
read_key
must
be
0
because
of
short
-
cutting
:
show
status
like
'Handler_read%'
;
drop
table
t1
,
t2
,
t3
;
--
echo
End
of
5.0
tests
.
sql/sql_select.cc
View file @
83e6352c
...
...
@@ -5444,7 +5444,8 @@ static void add_not_null_conds(JOIN *join)
for
(
uint
i
=
join
->
const_tables
;
i
<
join
->
tables
;
i
++
)
{
JOIN_TAB
*
tab
=
join
->
join_tab
+
i
;
if
((
tab
->
type
==
JT_REF
||
tab
->
type
==
JT_REF_OR_NULL
)
&&
if
((
tab
->
type
==
JT_REF
||
tab
->
type
==
JT_EQ_REF
||
tab
->
type
==
JT_REF_OR_NULL
)
&&
!
tab
->
table
->
maybe_null
)
{
for
(
uint
keypart
=
0
;
keypart
<
tab
->
ref
.
key_parts
;
keypart
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment