summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-05 02:06:51 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-05 02:06:51 +0200
commitf84f577aa15a193f24c3119eafdee554cb9775fb (patch)
treeee531580839374516db09b2409ec4bd57a847e8a
parentf07b3463e7a4ff32316e1cc94d553b5009ac51f2 (diff)
parent31c803e8d0543b330aa8e61ef878da43fe1f68f7 (diff)
downloadmariadb-git-f84f577aa15a193f24c3119eafdee554cb9775fb.tar.gz
Merge tag 'mysql-5.5.44' into bb-5.5-serg
-rw-r--r--VERSION2
-rw-r--r--cmake/make_dist.cmake.in10
-rw-r--r--cmd-line-utils/libedit/el_terminal.h4
-rw-r--r--cmd-line-utils/libedit/emacs.c8
-rw-r--r--cmd-line-utils/libedit/terminal.c15
-rw-r--r--cmd-line-utils/libedit/vi.c8
-rw-r--r--mysql-test/r/partition_innodb.result23
-rw-r--r--mysql-test/suite/innodb/r/xa_recovery.result17
-rw-r--r--mysql-test/suite/innodb/t/xa_recovery.test43
-rw-r--r--mysql-test/suite/parts/r/partition_debug_sync_innodb.result11
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb.test5
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result5
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test10
-rw-r--r--mysql-test/t/partition_innodb.test24
-rw-r--r--packaging/rpm-oel/mysql.spec.in4
-rw-r--r--sql/filesort.cc11
-rw-r--r--sql/ha_ndbcluster_binlog.cc6
-rw-r--r--sql/item_sum.cc18
-rw-r--r--sql/sql_show.cc15
-rw-r--r--sql/sql_table.cc2
-rw-r--r--storage/innobase/buf/buf0buf.c5
-rw-r--r--storage/innobase/dict/dict0dict.c2
-rw-r--r--storage/innobase/handler/ha_innodb.cc34
-rw-r--r--storage/innobase/srv/srv0start.c4
-rw-r--r--storage/innobase/sync/sync0arr.c7
-rw-r--r--storage/myisam/rt_split.c9
-rw-r--r--support-files/mysql.spec.sh4
27 files changed, 233 insertions, 73 deletions
diff --git a/VERSION b/VERSION
index dbfc5f823c9..fa5486099ce 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
-MYSQL_VERSION_PATCH=43
+MYSQL_VERSION_PATCH=44
MYSQL_VERSION_EXTRA=
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index c561baaa415..f35d16834b6 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2015, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,9 +60,9 @@ IF(NOT GIT_EXECUTABLE)
# Save bison output first.
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
- ${CMAKE_BINARY_DIR}/sql_yacc.cc COPY_ONLY)
+ ${CMAKE_BINARY_DIR}/sql_yacc.cc COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
- ${CMAKE_BINARY_DIR}/sql_yacc.h COPY_ONLY)
+ ${CMAKE_BINARY_DIR}/sql_yacc.h COPYONLY)
IF(CMAKE_GENERATOR MATCHES "Makefiles")
# make clean
@@ -74,9 +74,9 @@ IF(NOT GIT_EXECUTABLE)
# Restore bison output
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.cc
- ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPY_ONLY)
+ ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.h
- ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPY_ONLY)
+ ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPYONLY)
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.cc)
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.h)
ENDIF()
diff --git a/cmd-line-utils/libedit/el_terminal.h b/cmd-line-utils/libedit/el_terminal.h
index 807c651783e..db0bb94fa93 100644
--- a/cmd-line-utils/libedit/el_terminal.h
+++ b/cmd-line-utils/libedit/el_terminal.h
@@ -1,7 +1,7 @@
/* $NetBSD: terminal.h,v 1.3 2011/07/29 23:44:45 christos Exp $ */
/*-
- * Copyright (c) 1992, 1993
+ * Copyright (c) 1992, 2015
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -103,7 +103,7 @@ protected int terminal_settc(EditLine *, int, const Char **);
protected int terminal_gettc(EditLine *, int, char **);
protected int terminal_telltc(EditLine *, int, const Char **);
protected int terminal_echotc(EditLine *, int, const Char **);
-protected void terminal_writec(EditLine *, Int);
+protected int terminal_writec(EditLine *, Int);
protected int terminal__putc(EditLine *, Int);
protected void terminal__flush(EditLine *);
diff --git a/cmd-line-utils/libedit/emacs.c b/cmd-line-utils/libedit/emacs.c
index 554d3970485..1f1033a1cb7 100644
--- a/cmd-line-utils/libedit/emacs.c
+++ b/cmd-line-utils/libedit/emacs.c
@@ -1,7 +1,7 @@
/* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */
/*-
- * Copyright (c) 1992, 1993
+ * Copyright (c) 1992, 2015
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -58,8 +58,10 @@ em_delete_or_list(EditLine *el, Int c)
/* if I'm at the end */
if (el->el_line.cursor == el->el_line.buffer) {
/* and the beginning */
- terminal_writec(el, c); /* then do an EOF */
- return CC_EOF;
+ if(!(terminal_writec(el, c))) /* then do an EOF */
+ return CC_EOF;
+ else
+ return CC_ERROR;
} else {
/*
* Here we could list completions, but it is an
diff --git a/cmd-line-utils/libedit/terminal.c b/cmd-line-utils/libedit/terminal.c
index fb5600a4140..18b789a8bea 100644
--- a/cmd-line-utils/libedit/terminal.c
+++ b/cmd-line-utils/libedit/terminal.c
@@ -1,7 +1,7 @@
/* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */
/*-
- * Copyright (c) 1992, 1993
+ * Copyright (c) 1992, 2015
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -1271,14 +1271,19 @@ terminal__flush(EditLine *el)
/* terminal_writec():
* Write the given character out, in a human readable form
*/
-protected void
+protected int
terminal_writec(EditLine *el, Int c)
{
Char visbuf[VISUAL_WIDTH_MAX +1];
ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
- visbuf[vcnt] = '\0';
- terminal_overwrite(el, visbuf, (size_t)vcnt);
- terminal__flush(el);
+ if(vcnt == -1)
+ return 1; /* Error due to insufficient space */
+ else {
+ visbuf[vcnt] = '\0';
+ terminal_overwrite(el, visbuf, (size_t)vcnt);
+ terminal__flush(el);
+ return 0;
+ }
}
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c
index 9a4b97a977e..41242030a98 100644
--- a/cmd-line-utils/libedit/vi.c
+++ b/cmd-line-utils/libedit/vi.c
@@ -1,7 +1,7 @@
/* $NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $ */
/*-
- * Copyright (c) 1992, 1993
+ * Copyright (c) 1992, 2015
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
@@ -607,8 +607,10 @@ vi_list_or_eof(EditLine *el, Int c)
if (el->el_line.cursor == el->el_line.lastchar) {
if (el->el_line.cursor == el->el_line.buffer) {
- terminal_writec(el, c); /* then do a EOF */
- return CC_EOF;
+ if(!(terminal_writec(el, c))) /* then do a EOF */
+ return CC_EOF;
+ else
+ return CC_ERROR;
} else {
/*
* Here we could list completions, but it is an
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 72cfa84dbe0..1da7dce22df 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -367,33 +367,33 @@ DROP TABLE t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned
drop table t1;
create table t1 (a int)
engine = innodb
partition by key (a);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned
insert into t1 values (0), (1), (2), (3);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned
drop table t1;
create table t1 (a int auto_increment primary key)
engine = innodb
partition by key (a);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned
insert into t1 values (NULL), (NULL), (NULL), (NULL);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned
insert into t1 values (NULL), (NULL), (NULL), (NULL);
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
-t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 NULL NULL NULL latin1_swedish_ci NULL partitioned
+t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned
drop table t1;
create table t1 (a int)
partition by key (a)
@@ -575,6 +575,17 @@ a b
0 1
DROP TABLE t1;
#
+# Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE
+# WRONG FOR PARTITIONED TABLES
+#
+CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB
+PARTITION BY HASH (a) PARTITIONS 2;
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE
+CREATE_TIME IS NOT NULL AND TABLE_NAME='t1';
+COUNT(*)
+1
+DROP TABLE t1;
+#
# BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET ==
# SAVE_READ_SET
#
diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result
new file mode 100644
index 00000000000..84cb37ef7c9
--- /dev/null
+++ b/mysql-test/suite/innodb/r/xa_recovery.result
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+XA START 'x';
+UPDATE t1 set a=2;
+XA END 'x';
+XA PREPARE 'x';
+call mtr.add_suppression("Found 1 prepared XA transactions");
+SELECT * FROM t1 LOCK IN SHARE MODE;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+a
+2
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test
new file mode 100644
index 00000000000..62683a2250b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/xa_recovery.test
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+# Embedded server does not support restarting.
+--source include/not_embedded.inc
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+connect (con1,localhost,root);
+XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
+connection default;
+
+call mtr.add_suppression("Found 1 prepared XA transactions");
+
+# Kill and restart the server.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+-- disable_reconnect
+
+disconnect con1;
+connect (con1,localhost,root);
+--send SELECT * FROM t1 LOCK IN SHARE MODE
+
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'Sending data' and
+ info = 'SELECT * FROM t1 LOCK IN SHARE MODE';
+--source include/wait_condition.inc
+
+--source include/restart_mysqld.inc
+
+disconnect con1;
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t1;
+XA ROLLBACK 'x';
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
index 268db30bda0..77129d6bebb 100644
--- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
@@ -58,7 +58,10 @@ t1.frm
t1.par
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
-SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
+PARTITION_DESCRIPTION, TABLE_ROWS
+FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
SET DEBUG_SYNC = 'now WAIT_FOR parked';
# When waiting for the name lock in get_all_tables in sql_show.cc
# this will not be concurrent any more, thus the TIMEOUT
@@ -70,9 +73,9 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
PARTITION p10 VALUES LESS THAN MAXVALUE);
Warnings:
Warning 1639 debug sync point wait timed out
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL
-def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL
+TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS
+test t1 p0 1 10 1
+test t1 p10 2 MAXVALUE 3
t1#P#p0.ibd
t1#P#p10.ibd
t1.frm
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
index fce26132030..df9c06011c2 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
@@ -62,7 +62,10 @@ SHOW CREATE TABLE t1;
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish';
send
-SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
+ PARTITION_DESCRIPTION, TABLE_ROWS
+FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
connect (con1, localhost, root,,);
SET DEBUG_SYNC = 'now WAIT_FOR parked';
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
index 550b3f596e5..0264c9421fc 100644
--- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
@@ -182,6 +182,11 @@ DROP USER test_3@localhost;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
UNLOCK TABLE;
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
DROP USER test_3@localhost;
DROP FUNCTION f2;
DROP PROCEDURE p2;
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
index e9cc098857e..bc4119f332f 100644
--- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
@@ -150,6 +150,16 @@ DROP USER test_3@localhost;
INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
UNLOCK TABLE;
+
+# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS
+# BINLOGGED INCORRECTLY - BREAKS A SLAVE
+CREATE DATABASE db;
+CREATE TABLE db.t1 LIKE t2;
+CREATE TABLE t3 LIKE t2;
+DROP TABLE t3;
+DROP DATABASE db;
+# end of Bug #20439913 test
+
DROP USER test_3@localhost;
DROP FUNCTION f2;
DROP PROCEDURE p2;
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 1ef367a3f38..ee5c58cc5cc 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -390,7 +390,7 @@ DROP TABLE t1;
create table t1 (a int) engine=innodb partition by hash(a) ;
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status like 't1';
drop table t1;
@@ -402,12 +402,12 @@ engine = innodb
partition by key (a);
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status;
insert into t1 values (0), (1), (2), (3);
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status;
drop table t1;
@@ -416,17 +416,17 @@ engine = innodb
partition by key (a);
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status;
insert into t1 values (NULL), (NULL), (NULL), (NULL);
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status;
insert into t1 values (NULL), (NULL), (NULL), (NULL);
# Data_free for InnoDB tablespace varies depending on which
# tests have been run before this one
---replace_column 10 #
+--replace_column 10 # 12 #
show table status;
drop table t1;
@@ -662,6 +662,18 @@ ALTER TABLE t1 ADD UNIQUE KEY (b);
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE
+--echo # WRONG FOR PARTITIONED TABLES
+--echo #
+
+CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB
+PARTITION BY HASH (a) PARTITIONS 2;
+
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE
+CREATE_TIME IS NOT NULL AND TABLE_NAME='t1';
+
+DROP TABLE t1;
--echo #
--echo # BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET ==
diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in
index d8cf49fe993..bb232fb404d 100644
--- a/packaging/rpm-oel/mysql.spec.in
+++ b/packaging/rpm-oel/mysql.spec.in
@@ -1,4 +1,4 @@
-# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -370,7 +370,7 @@ Obsoletes: mariadb-embedded
Obsoletes: MySQL-embedded < %{version}-%{release}
Obsoletes: mysql-embedded < %{version}-%{release}
Provides: mysql-embedded = %{version}-%{release}
-Provides: mysql-emdedded%{?_isa} = %{version}-%{release}
+Provides: mysql-embedded%{?_isa} = %{version}-%{release}
%description embedded
This package contains the MySQL server as an embedded library.
diff --git a/sql/filesort.cc b/sql/filesort.cc
index d6cb22ebe2c..5bb5c64409a 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2014, Monty Program Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -199,6 +199,13 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
set_if_bigger(min_sort_memory, sizeof(BUFFPEK*)*MERGEBUFF2);
if (!table_sort.sort_keys)
{
+ /*
+ Cannot depend on num_rows. For external sort, space for upto MERGEBUFF2
+ rows is required.
+ */
+ if (num_rows < MERGEBUFF2)
+ num_rows= MERGEBUFF2;
+
while (memory_available >= min_sort_memory)
{
ulonglong keys= memory_available / (param.rec_length + sizeof(char*));
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 013929c24e0..ae7bd12f229 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates.
- Copyright (c) 2012, 2013, Monty Proram Ab.
+/* Copyright (c) 2006, 2015, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2530,7 +2529,8 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname)
char path[FN_REFLEN + 1];
build_table_filename(path, sizeof(path) - 1, dbname, "", "", 0);
- if (find_files(thd, &files, dbname, path, NullS, 0) != FIND_FILES_OK)
+ if (find_files(thd, &files, dbname, path, NullS, 0, NULL) !=
+ FIND_FILES_OK)
{
DBUG_PRINT("info", ("Failed to find files"));
DBUG_RETURN(true);
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 27456a94543..d8970ca26b5 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2014, SkySQL Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3294,7 +3294,19 @@ void Item_func_group_concat::cleanup()
}
DBUG_ASSERT(tree == 0);
}
-
+ /*
+ As the ORDER structures pointed to by the elements of the
+ 'order' array may be modified in find_order_in_list() called
+ from Item_func_group_concat::setup() to point to runtime
+ created objects, we need to reset them back to the original
+ arguments of the function.
+ */
+ ORDER **order_ptr= order;
+ for (uint i= 0; i < arg_count_order; i++)
+ {
+ (*order_ptr)->item= &args[arg_count_field + i];
+ order_ptr++;
+ }
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a3b8428f462..22484748523 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2014, Monty Program Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1486,6 +1486,11 @@ static void append_create_options(THD *thd, String *packet,
to tailor the format of the statement. Can be
NULL, in which case only SQL_MODE is considered
when building the statement.
+ show_database If true, then print the database before the table
+ name. The database name is only printed in the event
+ that it is different from the current database.
+ If false, then do not print the database before
+ the table name.
NOTE
Currently always return 0, but might return error code in the
@@ -2189,7 +2194,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
Security_context *tmp_sctx= tmp->security_ctx;
struct st_my_thread_var *mysys_var;
if ((tmp->vio_ok() || tmp->system_thread) &&
- (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user))))
+ (!user || (!tmp->system_thread &&
+ tmp_sctx->user && !strcmp(tmp_sctx->user, user))))
{
thread_info *thd_info= new thread_info;
@@ -2314,7 +2320,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
ulonglong max_counter;
if ((!tmp->vio_ok() && !tmp->system_thread) ||
- (user && (!tmp_sctx->user || strcmp(tmp_sctx->user, user))))
+ (user && (tmp->system_thread || !tmp_sctx->user ||
+ strcmp(tmp_sctx->user, user))))
continue;
restore_record(table, s->default_values);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6ec99cdf901..4139aa7d955 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4894,7 +4894,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
int result __attribute__((unused))=
store_create_info(thd, table, &query,
- create_info, FALSE /* show_database */);
+ create_info, TRUE /* show_database */);
DBUG_ASSERT(result == 0); // store_create_info() always return 0
if (write_bin_log(thd, TRUE, query.ptr(), query.length()))
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index b6bfcc3dbc0..4963f1c30c3 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -1528,6 +1528,9 @@ buf_pool_watch_set(
return(NULL);
}
+ /* The maximum number of purge threads should never exceed
+ BUF_POOL_WATCH_SIZE. So there is no way for purge thread
+ instance to hold a watch when setting another watch. */
for (i = 0; i < BUF_POOL_WATCH_SIZE; i++) {
bpage = &buf_pool->watch[i];
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 49d06120411..cbb17fc5a6f 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index a7854af7014..211caa05ad8 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -8026,6 +8026,13 @@ ha_innobase::estimate_rows_upper_bound(void)
estimate = 2 * local_data_file_length /
dict_index_calc_min_rec_len(index);
+ /* Set num_rows less than MERGEBUFF to simulate the case where we do
+ not have enough space to merge the externally sorted file blocks. */
+ DBUG_EXECUTE_IF("set_num_rows_lt_MERGEBUFF",
+ estimate = 2;
+ DBUG_SET("-d,set_num_rows_lt_MERGEBUFF");
+ );
+
prebuilt->trx->op_info = (char*)"";
DBUG_RETURN((ha_rows) estimate);
@@ -8280,17 +8287,6 @@ ha_innobase::info_low(
prebuilt->trx->op_info = "returning various info to MySQL";
}
- my_snprintf(path, sizeof(path), "%s/%s%s",
- mysql_data_home, ib_table->name, reg_ext);
-
- unpack_filename(path,path);
-
- /* Note that we do not know the access time of the table,
- nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
-
- if (os_file_get_status(path,&stat_info)) {
- stats.create_time = (ulong) stat_info.ctime;
- }
}
if (flag & HA_STATUS_VARIABLE) {
@@ -8535,6 +8531,20 @@ ha_innobase::info_low(
}
dict_table_stats_unlock(ib_table, RW_S_LATCH);
+
+ my_snprintf(path, sizeof(path), "%s/%s%s",
+ mysql_data_home,
+ table->s->normalized_path.str,
+ reg_ext);
+
+ unpack_filename(path,path);
+
+ /* Note that we do not know the access time of the table,
+ nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
+
+ if (os_file_get_status(path,&stat_info)) {
+ stats.create_time = (ulong) stat_info.ctime;
+ }
}
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index ffe18c47e18..b9fd52aa833 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -2240,9 +2240,9 @@ innobase_shutdown_for_mysql(void)
ibuf_close();
log_shutdown();
- lock_sys_close();
trx_sys_file_format_close();
trx_sys_close();
+ lock_sys_close();
mutex_free(&srv_monitor_file_mutex);
mutex_free(&srv_dict_tmpfile_mutex);
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index 5c4ba2058bd..62d35ccd302 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2014, MariaDB Corporation. All Rights Reserved.
@@ -1078,8 +1078,9 @@ sync_array_output_info(
os_thread_id_t r;
fprintf(file,
- "OS WAIT ARRAY INFO: reservation count %ld, signal count %ld\n",
- (long) arr->res_count, (long) arr->sg_count);
+ "OS WAIT ARRAY INFO: reservation count " ULINTPF
+ ", signal count " ULINTPF "\n",
+ arr->res_count, arr->sg_count);
i = 0;
count = 0;
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 9ab0bd99201..be61734e01c 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2002, 2010, Oracle and/or its affiliates
+ Copyright (c) 2002, 2015, Oracle and/or its affiliates
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,6 +69,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim)
b += 2;
}while (a != end);
+ /* Check for infinity or NaN */
+ if (my_isinf(square) || isnan(square))
+ square = DBL_MAX;
+
return square;
}
@@ -103,6 +107,9 @@ static void pick_seeds(SplitStruct *node, int n_entries,
double max_d = -DBL_MAX;
double d;
+ *seed_a = node;
+ *seed_b = node + 1;
+
for (cur1 = node; cur1 < lim1; ++cur1)
{
for (cur2=cur1 + 1; cur2 < lim2; ++cur2)
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index e45573a6d77..aaeed444e2f 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -427,7 +427,7 @@ Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
Provides: mysql-embedded = %{version}-%{release}
-Provides: mysql-emdedded%{?_isa} = %{version}-%{release}
+Provides: mysql-embedded%{?_isa} = %{version}-%{release}
%description -n MySQL-embedded%{product_suffix}
This package contains the MySQL server as an embedded library.