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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
49f8ec4c
Commit
49f8ec4c
authored
Jul 26, 2006
by
gkodinov/kgeorge@rakia.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B21019-4.1-opt
parents
dd7ae38d
6766cfcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
mysql-test/r/select.result
mysql-test/r/select.result
+26
-0
mysql-test/t/select.test
mysql-test/t/select.test
+15
-0
sql/sql_select.cc
sql/sql_select.cc
+5
-2
No files found.
mysql-test/r/select.result
View file @
49f8ec4c
...
...
@@ -2744,6 +2744,32 @@ SELECT i='1e+01',i=1e+01, i in (1e+01), i in ('1e+01') FROM t1;
i='1e+01' i=1e+01 i in (1e+01) i in ('1e+01')
0 1 1 1
DROP TABLE t1;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,1), (2,1), (4,10);
CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b));
INSERT INTO t2 VALUES (1,NULL), (2,10);
ALTER TABLE t1 ENABLE KEYS;
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index b b 5 NULL 2 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
a b a b
1 NULL 1 1
1 NULL 2 1
1 NULL 4 10
2 10 4 10
EXPLAIN SELECT STRAIGHT_JOIN SQL_NO_CACHE COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index b b 5 NULL 2 Using index
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
SELECT STRAIGHT_JOIN SQL_NO_CACHE * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL;
a b a b
1 NULL 1 1
1 NULL 2 1
1 NULL 4 10
2 10 4 10
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (key1 float default NULL, UNIQUE KEY key1 (key1));
CREATE TABLE t2 (key2 float default NULL, UNIQUE KEY key2 (key2));
INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941);
...
...
mysql-test/t/select.test
View file @
49f8ec4c
...
...
@@ -2297,6 +2297,21 @@ INSERT INTO t1 VALUES (10);
SELECT
i
=
'1e+01'
,
i
=
1
e
+
01
,
i
in
(
1
e
+
01
),
i
in
(
'1e+01'
)
FROM
t1
;
DROP
TABLE
t1
;
#
# Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
#
CREATE
TABLE
t1
(
a
int
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
1
),
(
4
,
10
);
CREATE
TABLE
t2
(
a
int
PRIMARY
KEY
,
b
int
,
KEY
b
(
b
));
INSERT
INTO
t2
VALUES
(
1
,
NULL
),
(
2
,
10
);
ALTER
TABLE
t1
ENABLE
KEYS
;
EXPLAIN
SELECT
STRAIGHT_JOIN
SQL_NO_CACHE
COUNT
(
*
)
FROM
t2
,
t1
WHERE
t1
.
b
=
t2
.
b
OR
t2
.
b
IS
NULL
;
SELECT
STRAIGHT_JOIN
SQL_NO_CACHE
*
FROM
t2
,
t1
WHERE
t1
.
b
=
t2
.
b
OR
t2
.
b
IS
NULL
;
EXPLAIN
SELECT
STRAIGHT_JOIN
SQL_NO_CACHE
COUNT
(
*
)
FROM
t2
,
t1
WHERE
t1
.
b
=
t2
.
b
OR
t2
.
b
IS
NULL
;
SELECT
STRAIGHT_JOIN
SQL_NO_CACHE
*
FROM
t2
,
t1
WHERE
t1
.
b
=
t2
.
b
OR
t2
.
b
IS
NULL
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
#
# Bug #20954 "avg(keyval) retuns 0.38 but max(keyval) returns an empty set"
#
...
...
sql/sql_select.cc
View file @
49f8ec4c
...
...
@@ -2161,8 +2161,11 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
/* field = expression OR field IS NULL */
old
->
level
=
and_level
;
old
->
optimize
=
KEY_OPTIMIZE_REF_OR_NULL
;
/* Remember the NOT NULL value */
if
(
old
->
val
->
is_null
())
/*
Remember the NOT NULL value unless the value does not depend
on other tables.
*/
if
(
!
old
->
val
->
used_tables
()
&&
old
->
val
->
is_null
())
old
->
val
=
new_fields
->
val
;
/* The referred expression can be NULL: */
old
->
null_rejecting
=
0
;
...
...
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