Skip to content
Permalink
Browse files
Merge branch '10.2' into bb-10.2-release
  • Loading branch information
sanja-byelkin committed Feb 9, 2022
2 parents e2b5021 + c0a44ff commit 941bc70
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 9 deletions.
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=42
MYSQL_VERSION_PATCH=43
@@ -1908,7 +1908,7 @@ ()
}

mtr_add_arg($args, "--silent"); # Tab separated output
mtr_add_arg($args, "-e '%s'", "use mysql; SHOW VARIABLES");
mtr_add_arg($args, "-e \"use mysql; SHOW VARIABLES\"");
my $cmd= "$mysql " . join(' ', @$args);
mtr_verbose("cmd: $cmd");

@@ -4198,5 +4198,37 @@ drop procedure sp7;
drop view v1,v2;
drop table t1;
#
# MDEV-17785: Window functions not working in ONLY_FULL_GROUP_BY mode
#
CREATE TABLE t1(a VARCHAR(10), b int);
INSERT INTO t1 VALUES
('Maths', 60),('Maths', 60),
('Maths', 70),('Maths', 55),
('Biology', 60), ('Biology', 70);
SET @save_sql_mode= @@sql_mode;
SET sql_mode = 'ONLY_FULL_GROUP_BY';
SELECT
RANK() OVER (PARTITION BY a ORDER BY b) AS rank,
a, b FROM t1 ORDER BY a, b DESC;
rank a b
2 Biology 70
1 Biology 60
4 Maths 70
2 Maths 60
2 Maths 60
1 Maths 55
SET sql_mode= @save_sql_mode;
DROP TABLE t1;
CREATE TABLE t1(i int,j int);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
SELECT i, LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) FROM t1 GROUP BY i;
i LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j)
1 6
2 4
3 2
4 2
DROP TABLE t1;
#
# End of 10.2 tests
#
@@ -4204,6 +4204,38 @@ drop procedure sp7;
drop view v1,v2;
drop table t1;
#
# MDEV-17785: Window functions not working in ONLY_FULL_GROUP_BY mode
#
CREATE TABLE t1(a VARCHAR(10), b int);
INSERT INTO t1 VALUES
('Maths', 60),('Maths', 60),
('Maths', 70),('Maths', 55),
('Biology', 60), ('Biology', 70);
SET @save_sql_mode= @@sql_mode;
SET sql_mode = 'ONLY_FULL_GROUP_BY';
SELECT
RANK() OVER (PARTITION BY a ORDER BY b) AS rank,
a, b FROM t1 ORDER BY a, b DESC;
rank a b
2 Biology 70
1 Biology 60
4 Maths 70
2 Maths 60
2 Maths 60
1 Maths 55
SET sql_mode= @save_sql_mode;
DROP TABLE t1;
CREATE TABLE t1(i int,j int);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
SELECT i, LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) FROM t1 GROUP BY i;
i LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j)
1 6
2 4
3 2
4 2
DROP TABLE t1;
#
# End of 10.2 tests
#
#
@@ -28,6 +28,8 @@
# showed
#

# MDEV-27721 rpl.rpl_relay_max_extension test is not FreeBSD-compatible
--source include/linux.inc
--source include/have_innodb.inc
--source include/have_binlog_format_row.inc
--let $rpl_topology=1->2
@@ -2703,6 +2703,33 @@ drop procedure sp7;
drop view v1,v2;
drop table t1;

--echo #
--echo # MDEV-17785: Window functions not working in ONLY_FULL_GROUP_BY mode
--echo #

CREATE TABLE t1(a VARCHAR(10), b int);

INSERT INTO t1 VALUES
('Maths', 60),('Maths', 60),
('Maths', 70),('Maths', 55),
('Biology', 60), ('Biology', 70);

SET @save_sql_mode= @@sql_mode;
SET sql_mode = 'ONLY_FULL_GROUP_BY';

SELECT
RANK() OVER (PARTITION BY a ORDER BY b) AS rank,
a, b FROM t1 ORDER BY a, b DESC;

SET sql_mode= @save_sql_mode;
DROP TABLE t1;

CREATE TABLE t1(i int,j int);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
INSERT INTO t1 VALUES (1,1), (1,5),(1,4), (2,2),(2,5), (3,3),(4,4);
SELECT i, LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j) FROM t1 GROUP BY i;
DROP TABLE t1;

--echo #
--echo # End of 10.2 tests
--echo #
@@ -1,4 +1,7 @@
#!/bin/bash -ue
#!/usr/bin/env bash

set -ue

# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2013 Percona Inc
#
@@ -1,4 +1,7 @@
#!/bin/bash -ue
#!/usr/bin/env bash

set -ue

# Copyright (C) 2009-2015 Codership Oy
# Copyright (C) 2017-2021 MariaDB
#
@@ -1,4 +1,6 @@
#!/bin/bash -ue
#!/usr/bin/env bash

set -ue

# Copyright (C) 2017-2021 MariaDB
# Copyright (C) 2010-2014 Codership Oy
@@ -740,7 +742,7 @@ EOF
elif [ "$OS" = 'Linux' ]; then
tmpfile=$(mktemp "--tmpdir=$tmpdir")
else
tmpfile=$(TMPDIR="$tmpdir"; mktemp '-d')
tmpfile=$(TMPDIR="$tmpdir"; mktemp)
fi

wsrep_log_info "Extracting binlog files:"
@@ -93,6 +93,9 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
my_error(ER_NO_ORDER_LIST_IN_WINDOW_SPEC, MYF(0), window_func()->func_name());
return true;
}

window_func()->mark_as_window_func_sum_expr();

/*
TODO: why the last parameter is 'ref' in this call? What if window_func
decides to substitute itself for something else and does *ref=.... ?
@@ -10557,9 +10557,6 @@ window_func:
simple_window_func
|
sum_expr
{
((Item_sum *) $1)->mark_as_window_func_sum_expr();
}
;

simple_window_func:

0 comments on commit 941bc70

Please sign in to comment.