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
d2e3b33b
Commit
d2e3b33b
authored
Feb 26, 2012
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rolled back the patch for bug 791761.
A better fix for this bug will be pulled from mariadb-5.2.
parent
b161b2e1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
54 deletions
+1
-54
mysql-test/r/having.result
mysql-test/r/having.result
+0
-24
mysql-test/t/having.test
mysql-test/t/having.test
+0
-25
sql/item.h
sql/item.h
+0
-1
sql/item_sum.h
sql/item_sum.h
+0
-1
sql/sql_select.cc
sql/sql_select.cc
+1
-3
No files found.
mysql-test/r/having.result
View file @
d2e3b33b
...
...
@@ -570,27 +570,3 @@ ORDER BY t1.f1;
f1
DROP TABLE t1,t2;
End of 5.1 tests
#
# LP bug #791761: MAX over an empty join + HAVING
#
CREATE TABLE t1 (a int, b int , KEY (b)) ;
INSERT INTO t1 VALUES (3,1);
CREATE TABLE t2 (a int NOT NULL ) ;
INSERT INTO t2 VALUES (29);
SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a > 0 HAVING MAX(t1.b) <> 6;
MAX(t1.b)
1
SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a > 0 HAVING MAX(t1.b) IS NULL;
MAX(t1.b)
EXPLAIN
SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a < 0 HAVING MAX(t1.b) <> 6;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
SELECT MAX(t1.b) FROM t1,t2 WHERE t2.a < 0 HAVING MAX(t1.b) <> 6;
MAX(t1.b)
CREATE TABLE t3 ( f3 int) ;
INSERT INTO t3 VALUES (NULL);
SELECT MAX(t1.b) AS f FROM t1 JOIN t2 ON t2.a != 0
WHERE (SELECT f3 FROM t3) <> 0 HAVING f <> 6 ;
f
DROP TABLE t1,t2,t3;
mysql-test/t/having.test
View file @
d2e3b33b
...
...
@@ -591,28 +591,3 @@ DROP TABLE t1,t2;
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# LP bug #791761: MAX over an empty join + HAVING
--
echo
#
CREATE
TABLE
t1
(
a
int
,
b
int
,
KEY
(
b
))
;
INSERT
INTO
t1
VALUES
(
3
,
1
);
CREATE
TABLE
t2
(
a
int
NOT
NULL
)
;
INSERT
INTO
t2
VALUES
(
29
);
SELECT
MAX
(
t1
.
b
)
FROM
t1
,
t2
WHERE
t2
.
a
>
0
HAVING
MAX
(
t1
.
b
)
<>
6
;
SELECT
MAX
(
t1
.
b
)
FROM
t1
,
t2
WHERE
t2
.
a
>
0
HAVING
MAX
(
t1
.
b
)
IS
NULL
;
EXPLAIN
SELECT
MAX
(
t1
.
b
)
FROM
t1
,
t2
WHERE
t2
.
a
<
0
HAVING
MAX
(
t1
.
b
)
<>
6
;
SELECT
MAX
(
t1
.
b
)
FROM
t1
,
t2
WHERE
t2
.
a
<
0
HAVING
MAX
(
t1
.
b
)
<>
6
;
CREATE
TABLE
t3
(
f3
int
)
;
INSERT
INTO
t3
VALUES
(
NULL
);
SELECT
MAX
(
t1
.
b
)
AS
f
FROM
t1
JOIN
t2
ON
t2
.
a
!=
0
WHERE
(
SELECT
f3
FROM
t3
)
<>
0
HAVING
f
<>
6
;
DROP
TABLE
t1
,
t2
,
t3
;
sql/item.h
View file @
d2e3b33b
...
...
@@ -1032,7 +1032,6 @@ class Item {
virtual
bool
update_table_bitmaps_processor
(
uchar
*
arg
)
{
return
0
;
}
virtual
bool
view_used_tables_processor
(
uchar
*
arg
)
{
return
0
;
}
virtual
bool
eval_not_null_tables
(
uchar
*
opt_arg
)
{
return
0
;
}
virtual
bool
clear_sum_processor
(
uchar
*
opt_arg
)
{
return
0
;
}
virtual
bool
is_subquery_processor
(
uchar
*
opt_arg
)
{
return
0
;
}
virtual
bool
limit_index_condition_pushdown_processor
(
uchar
*
opt_arg
)
{
...
...
sql/item_sum.h
View file @
d2e3b33b
...
...
@@ -390,7 +390,6 @@ class Item_sum :public Item_result_field
{
return
trace_unsupported_by_check_vcol_func_processor
(
func_name
());
}
bool
clear_sum_processor
(
uchar
*
arg
)
{
clear
();
return
0
;
}
};
...
...
sql/sql_select.cc
View file @
d2e3b33b
...
...
@@ -10470,9 +10470,7 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables,
if
(
!
table
->
is_jtbm
())
mark_as_null_row
(
table
->
table
);
// All fields are NULL
}
if
(
having
&&
!
having
->
walk
(
&
Item
::
clear_sum_processor
,
FALSE
,
NULL
)
&&
having
->
val_int
()
==
0
)
if
(
having
&&
having
->
val_int
()
==
0
)
send_row
=
0
;
}
if
(
!
(
result
->
send_fields
(
fields
,
...
...
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