diff options
-rw-r--r-- | VERSION | 2 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 2 | ||||
-rw-r--r-- | mysql-test/r/win.result | 32 | ||||
-rw-r--r-- | mysql-test/suite/encryption/r/tempfiles_encrypted.result | 32 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_relay_max_extension.test | 2 | ||||
-rw-r--r-- | mysql-test/t/win.test | 27 | ||||
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 5 | ||||
-rw-r--r-- | scripts/wsrep_sst_mysqldump.sh | 5 | ||||
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 6 | ||||
-rw-r--r-- | sql/item_windowfunc.cc | 3 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 3 |
11 files changed, 110 insertions, 9 deletions
@@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=2 -MYSQL_VERSION_PATCH=42 +MYSQL_VERSION_PATCH=43 diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index aa6a02a4541..bbe5df4c57a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1908,7 +1908,7 @@ sub collect_mysqld_features_from_running_server () } 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"); diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index bc017ea70a3..30650f29555 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -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 # diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index f66a5fd0b25..aaba6bb044a 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -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 # # diff --git a/mysql-test/suite/rpl/t/rpl_relay_max_extension.test b/mysql-test/suite/rpl/t/rpl_relay_max_extension.test index e1e087f2e0e..acca2f6954c 100644 --- a/mysql-test/suite/rpl/t/rpl_relay_max_extension.test +++ b/mysql-test/suite/rpl/t/rpl_relay_max_extension.test @@ -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 diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test index 72e789dff3f..126ed735c88 100644 --- a/mysql-test/t/win.test +++ b/mysql-test/t/win.test @@ -2704,5 +2704,32 @@ 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 # diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index aa9442b0601..471b0e5f5b0 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -1,4 +1,7 @@ -#!/bin/bash -ue +#!/usr/bin/env bash + +set -ue + # Copyright (C) 2017-2021 MariaDB # Copyright (C) 2013 Percona Inc # diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh index bed2cac0a9a..1c8fc181328 100644 --- a/scripts/wsrep_sst_mysqldump.sh +++ b/scripts/wsrep_sst_mysqldump.sh @@ -1,4 +1,7 @@ -#!/bin/bash -ue +#!/usr/bin/env bash + +set -ue + # Copyright (C) 2009-2015 Codership Oy # Copyright (C) 2017-2021 MariaDB # diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 28dfed18218..cc73db5da87 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -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:" diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc index bb4a8a9f3af..03f99540771 100644 --- a/sql/item_windowfunc.cc +++ b/sql/item_windowfunc.cc @@ -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=.... ? diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a4b105862f3..6f3274aced5 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -10557,9 +10557,6 @@ window_func: simple_window_func | sum_expr - { - ((Item_sum *) $1)->mark_as_window_func_sum_expr(); - } ; simple_window_func: |