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
23290e42
Commit
23290e42
authored
Jul 21, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
e2afdb1e
' into bb-10.2-ext
parents
34668e10
e2afdb1e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
7 deletions
+47
-7
mysql-test/r/win.result
mysql-test/r/win.result
+21
-2
mysql-test/r/win_insert_select.result
mysql-test/r/win_insert_select.result
+0
-4
mysql-test/t/win.test
mysql-test/t/win.test
+19
-0
sql/sql_select.cc
sql/sql_select.cc
+7
-1
No files found.
mysql-test/r/win.result
View file @
23290e42
...
...
@@ -2762,10 +2762,8 @@ CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (3), (1), (2);
SELECT i, ROW_NUMBER() OVER () FROM t1 WHERE 1 = 2;
i ROW_NUMBER() OVER ()
NULL 1
SELECT i, COUNT(*) OVER () FROM t1 WHERE 1 = 2;
i COUNT(*) OVER ()
NULL 1
DROP TABLE t1;
#
# MDEV-12051: window function in query with implicit grouping
...
...
@@ -3142,6 +3140,27 @@ sum(i) over (order by i) interval(sum(i) over (order by i), 10, 20)
63 2
drop table t1;
#
# MDEV-13352: Server crashes in st_join_table::remove_duplicates
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
SELECT DISTINCT ROW_NUMBER() OVER(), i FROM t1 WHERE 0;
ROW_NUMBER() OVER() i
SELECT ROW_NUMBER() OVER(), i FROM t1 WHERE 0;
ROW_NUMBER() OVER() i
DROP TABLE t1;
#
# MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery
# with window function and constant table
# (Testcase only)
#
CREATE TABLE t1 (c CHAR(8)) ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES ('foo');
SELECT ('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1);
('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1)
0
DROP TABLE t1;
#
# Start of 10.3 tests
#
#
...
...
mysql-test/r/win_insert_select.result
View file @
23290e42
...
...
@@ -11,10 +11,6 @@ c1 c2
4 manual_insert_2
11 should repeat 4 times [11-14]
12 should repeat 4 times [11-14]
13 should repeat 4 times [11-14]
14 should repeat 4 times [11-14]
2 should_have_2
NULL should_have_NULL
DELETE FROM t1;
EXECUTE populate_table;
INSERT INTO t1
...
...
mysql-test/t/win.test
View file @
23290e42
...
...
@@ -1924,6 +1924,25 @@ select sum(i) over (order by i), interval(sum(i) over (order by i), 10, 20)
from
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-13352: Server crashes in st_join_table::remove_duplicates
--
echo
#
CREATE
TABLE
t1
(
i
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
SELECT
DISTINCT
ROW_NUMBER
()
OVER
(),
i
FROM
t1
WHERE
0
;
SELECT
ROW_NUMBER
()
OVER
(),
i
FROM
t1
WHERE
0
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery
--
echo
# with window function and constant table
--
echo
# (Testcase only)
--
echo
#
CREATE
TABLE
t1
(
c
CHAR
(
8
))
ENGINE
=
MyISAM
;
INSERT
IGNORE
INTO
t1
VALUES
(
'foo'
);
SELECT
(
'bar'
,
1
)
IN
(
SELECT
c
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
c
)
FROM
t1
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Start of 10.3 tests
--
echo
#
...
...
sql/sql_select.cc
View file @
23290e42
...
...
@@ -3405,8 +3405,14 @@ void JOIN::exec_inner()
if
(
zero_result_cause
)
{
if
(
select_lex
->
have_window_funcs
())
if
(
select_lex
->
have_window_funcs
()
&&
send_row_on_empty_set
()
)
{
/*
The query produces just one row but it has window functions.
The only way to compute the value of window function(s) is to
run the entire window function computation step (there is no shortcut).
*/
const_tables
=
table_count
;
first_select
=
sub_select_postjoin_aggr
;
}
...
...
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