3229 Bjorn Munch 2011-07-15 [merge]
null upmerge
3228 Bjorn Munch 2011-07-15 [merge]
merge from 5.5 main
removed:
storage/ndb/test/sql/
storage/ndb/test/sql/BANK.sql
storage/ndb/test/sql/T1.sql
storage/ndb/test/sql/test_create_drop.pl
storage/ndb/test/sql/test_range_bounds.pl
added:
mysql-test/r/secure_file_priv_win.result
mysql-test/suite/rpl/r/rpl_row_corruption.result
mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt
mysql-test/suite/rpl/t/rpl_row_corruption.test
mysql-test/t/secure_file_priv_win-master.opt
mysql-test/t/secure_file_priv_win.test
modified:
VERSION
client/mysqlbinlog.cc
cmake/build_configurations/mysql_release.cmake
dbug/dbug.c
include/mysql/plugin_audit.h
include/probes_mysql_nodtrace.h
include/welcome_copyright_notice.h
libmysqld/lib_sql.cc
mysql-test/r/ctype_utf16.result
mysql-test/r/explain.result
mysql-test/r/gis.result
mysql-test/r/plugin_auth.result
mysql-test/r/sp-security.result
mysql-test/r/sp.result
mysql-test/r/subselect.result
mysql-test/r/xml.result
mysql-test/suite/federated/federated.result
mysql-test/suite/innodb/r/innodb-index.result
mysql-test/suite/innodb/t/innodb-index.test
mysql-test/t/ctype_utf16.test
mysql-test/t/disabled.def
mysql-test/t/explain.test
mysql-test/t/gis.test
mysql-test/t/plugin_auth.test
mysql-test/t/sp-security.test
mysql-test/t/sp.test
mysql-test/t/subselect.test
mysql-test/t/xml.test
mysys/my_symlink.c
plugin/audit_null/audit_null.c
sql/field.h
sql/field_conv.cc
sql/item.cc
sql/item_cmpfunc.cc
sql/item_func.cc
sql/item_subselect.cc
sql/item_sum.cc
sql/item_timefunc.cc
sql/item_xmlfunc.cc
sql/log_event.cc
sql/my_decimal.h
sql/mysqld.cc
sql/protocol.cc
sql/sp_head.cc
sql/sql_acl.cc
sql/sql_class.h
sql/sql_lex.cc
sql/sql_lex.h
sql/sql_load.cc
sql/sql_partition.cc
sql/sql_priv.h
sql/sql_select.cc
storage/innobase/btr/btr0cur.c
storage/innobase/row/row0row.c
storage/perfschema/pfs.cc
support-files/mysql.spec.sh
tests/mysql_client_test.c
unittest/mysys/lf-t.c
3227 Bjorn Munch 2011-07-04 [merge]
null upmerge
=== modified file 'VERSION'
--- a/VERSION 2011-06-10 08:38:27 +0000
+++ b/VERSION 2011-07-13 17:35:34 +0000
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
-MYSQL_VERSION_PATCH=15
+MYSQL_VERSION_PATCH=16
MYSQL_VERSION_EXTRA=
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2011-07-03 23:48:19 +0000
+++ b/client/mysqlbinlog.cc 2011-07-11 16:19:56 +0000
@@ -1261,7 +1261,7 @@ static void print_version()
static void usage()
{
print_version();
- puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001, 2010"));
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2011"));
printf("\
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
the mysql command line client.\n\n");
=== modified file 'cmake/build_configurations/mysql_release.cmake'
--- a/cmake/build_configurations/mysql_release.cmake 2011-06-30 15:46:53 +0000
+++ b/cmake/build_configurations/mysql_release.cmake 2011-07-04 12:27:08 +0000
@@ -210,8 +210,8 @@ IF(UNIX)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
- SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
- SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
+ SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-xO1 ${COMMON_CXX_FLAGS}")
IF(32BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
=== modified file 'dbug/dbug.c'
--- a/dbug/dbug.c 2011-03-08 17:39:25 +0000
+++ b/dbug/dbug.c 2011-07-07 11:22:43 +0000
@@ -1873,7 +1873,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
const char *name,const char *end,int append)
{
REGISTER FILE *fp;
- REGISTER BOOLEAN newfile;
if (name != NULL)
{
@@ -1902,7 +1901,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
}
else
{
- newfile= !EXISTS(name);
if (!(fp= fopen(name, append ? "a+" : "w")))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, name);
=== modified file 'include/mysql/plugin_audit.h'
--- a/include/mysql/plugin_audit.h 2011-06-30 15:46:53 +0000
+++ b/include/mysql/plugin_audit.h 2011-07-05 23:13:50 +0000
@@ -1,12 +1,13 @@
/* Copyright (c) 2007, 2011, 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 Foundation; version 2 of the License.
+ 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 Foundation; version 2 of
+ the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
=== modified file 'include/probes_mysql_nodtrace.h'
--- a/include/probes_mysql_nodtrace.h 2011-06-30 15:46:53 +0000
+++ b/include/probes_mysql_nodtrace.h 2011-07-07 09:42:14 +0000
@@ -1,19 +1,3 @@
-/* Copyright (c) 2008, 2010 Sun Microsystems, Inc.
- Use is subject to license terms.
-
- 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 Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
/*
* Generated by dheadgen(1).
*/
=== modified file 'include/welcome_copyright_notice.h'
--- a/include/welcome_copyright_notice.h 2010-10-06 15:06:13 +0000
+++ b/include/welcome_copyright_notice.h 2011-07-11 16:19:56 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc 2011-06-13 18:41:24 +0000
+++ b/libmysqld/lib_sql.cc 2011-07-07 11:22:43 +0000
@@ -1144,8 +1144,7 @@ bool net_send_error_packet(THD *thd, uin
const char *sqlstate)
{
uint error;
- uchar converted_err[MYSQL_ERRMSG_SIZE];
- uint32 converted_err_len;
+ char converted_err[MYSQL_ERRMSG_SIZE];
MYSQL_DATA *data= thd->cur_data;
struct embedded_query_result *ei;
@@ -1160,12 +1159,12 @@ bool net_send_error_packet(THD *thd, uin
ei= data->embedded_info;
ei->last_errno= sql_errno;
- converted_err_len= convert_error_message((char*)converted_err,
- sizeof(converted_err),
- thd->variables.character_set_results,
- err, strlen(err),
- system_charset_info, &error);
- strmake(ei->info, (const char*) converted_err, sizeof(ei->info)-1);
+ convert_error_message(converted_err, sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err),
+ system_charset_info, &error);
+ /* Converted error message is always null-terminated. */
+ strmake(ei->info, converted_err, sizeof(ei->info)-1);
strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;
=== modified file 'mysql-test/r/ctype_utf16.result'
--- a/mysql-test/r/ctype_utf16.result 2011-03-01 12:09:37 +0000
+++ b/mysql-test/r/ctype_utf16.result 2011-04-28 07:03:56 +0000
@@ -1117,5 +1117,14 @@ CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END
b
DROP TABLE t1;
#
+# Bug#12340997
+# DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE()
+#
+SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
+space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second))
+NULL
+Warnings:
+Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+#
# End of 5.5 tests
#
=== modified file 'mysql-test/r/explain.result'
--- a/mysql-test/r/explain.result 2011-03-24 10:27:11 +0000
+++ b/mysql-test/r/explain.result 2011-05-05 06:13:22 +0000
@@ -176,10 +176,12 @@ SELECT @@session.sql_mode INTO @old_sql_
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
EXPLAIN EXTENDED SELECT 1 FROM t1
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-SHOW WARNINGS;
-Level Code Message
-Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found
+2 SUBQUERY t system NULL NULL NULL NULL 0 0.00 const row not found
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` where 0
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
End of 5.0 tests.
=== modified file 'mysql-test/r/gis.result'
--- a/mysql-test/r/gis.result 2011-04-07 10:57:32 +0000
+++ b/mysql-test/r/gis.result 2011-07-04 11:53:07 +0000
@@ -1076,4 +1076,19 @@ SPATIAL INDEX i1 (col1, col2)
);
ERROR HY000: Incorrect arguments to SPATIAL INDEX
DROP TABLE t0, t1, t2;
+#
+# Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
+#
+CREATE TABLE g1
+(a geometry NOT NULL, UNIQUE KEY i (a(151))) engine=myisam;
+INSERT INTO g1 VALUES (geomfromtext('point(1 1)'));
+INSERT INTO g1 VALUES (geomfromtext('point(1 2)'));
+FLUSH TABLES;
+SELECT 1 FROM g1
+FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
+;
+1
+Warnings:
+Warning 1441 Datetime function: datetime field overflow
+DROP TABLE g1;
End of 5.5 tests
=== modified file 'mysql-test/r/plugin_auth.result'
--- a/mysql-test/r/plugin_auth.result 2011-03-31 13:08:31 +0000
+++ b/mysql-test/r/plugin_auth.result 2011-07-05 23:13:50 +0000
@@ -447,4 +447,19 @@ ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
YES authentication_string
YES plugin
+#
+# Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
+# .-> USING PASSWORD: NO
+#
+# shoud contain "using password=yes"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: YES)
+# shoud contain "using password=no"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: NO)
+#
+# Bug #12610784: SET PASSWORD INCORRECTLY KEEP AN OLD EMPTY PASSWORD
+#
+CREATE USER bug12610784@localhost;
+SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
+ERROR 28000: Access denied for user 'bug12610784'@'localhost' (using password: NO)
+DROP USER bug12610784@localhost;
End of 5.5 tests
=== added file 'mysql-test/r/secure_file_priv_win.result'
--- a/mysql-test/r/secure_file_priv_win.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/secure_file_priv_win.result 2011-05-04 12:47:29 +0000
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517.tmp';
+show global variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv MYSQL_TMP_DIR/
+SELECT load_file('MYSQL_TMP_DIR\\B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+x
+a
+
+SELECT load_file('MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp') AS x;
+x
+NULL
+LOAD DATA INFILE 'MYSQL_TMP_DIR\\B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE 'MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+LOAD DATA INFILE "MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517.tmp" into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\..a..\\..\\..\\B11764517-2.tmp';
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR\\B11764517-2.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR/B11764517-3.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+SELECT * FROM t1 INTO OUTFILE 'MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+DROP TABLE t1;
=== modified file 'mysql-test/r/sp-security.result'
--- a/mysql-test/r/sp-security.result 2010-10-07 16:01:17 +0000
+++ b/mysql-test/r/sp-security.result 2011-04-13 07:59:17 +0000
@@ -592,3 +592,28 @@ ERROR 42000: alter routine command denie
# Connection 'default'.
drop user bug57061_user@localhost;
drop database mysqltest_db;
+#
+# Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+# DEFINITION OF ANY ROUTINE.
+#
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+# Connection con2 as user2
+# The statement below before disclosed info from body_utf8 column.
+SHOW CREATE PROCEDURE db1.p1;
+ERROR 42000: PROCEDURE p1 does not exist
+# Check that SHOW works with SELECT grant on whole table
+# Connection default
+GRANT SELECT ON mysql.proc TO user2@localhost;
+# Connection con2
+# This should work
+SHOW CREATE PROCEDURE db1.p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+# Connection default
+DROP USER user2@localhost;
+DROP DATABASE db1;
=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result 2011-03-17 11:02:19 +0000
+++ b/mysql-test/r/sp.result 2011-06-21 15:24:44 +0000
@@ -7500,4 +7500,76 @@ CALL p1();
DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
+
+# --
+# -- Bug#12652769 - 61470: case operator in stored routine retains old
+# -- value of input parameter
+# ---
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('a');
+CREATE PROCEDURE p1(dt DATETIME, i INT)
+BEGIN
+SELECT
+CASE
+WHEN i = 1 THEN 2
+ELSE dt
+END AS x1;
+SELECT
+CASE _latin1'a'
+ WHEN _utf8'a' THEN 'A'
+ END AS x2;
+SELECT
+CASE _utf8'a'
+ WHEN _latin1'a' THEN _utf8'A'
+ END AS x3;
+SELECT
+CASE s1
+WHEN _latin1'a' THEN _latin1'b'
+ ELSE _latin1'c'
+ END AS x4
+FROM t1;
+END|
+
+CALL p1('2011-04-03 05:14:10', 1);
+x1
+2
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:11', 2);
+x1
+2011-04-03 05:14:11
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:12', 2);
+x1
+2011-04-03 05:14:12
+x2
+A
+x3
+A
+x4
+b
+CALL p1('2011-04-03 05:14:13', 2);
+x1
+2011-04-03 05:14:13
+x2
+A
+x3
+A
+x4
+b
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
# End of 5.5 test
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result 2011-04-15 06:54:05 +0000
+++ b/mysql-test/r/subselect.result 2011-05-10 14:29:44 +0000
@@ -4442,6 +4442,32 @@ pk int_key
3 3
7 3
DROP TABLE t1,t2;
+#
+# Bug#12329653
+# EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
+#
+CREATE TABLE t1(a1 int);
+INSERT INTO t1 VALUES (1),(2);
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1);
+1
+1
+1
+PREPARE stmt FROM
+'SELECT 1 UNION ALL
+SELECT 1 FROM t1
+ORDER BY
+(SELECT 1 FROM t1 AS t1_0
+ WHERE 1 < SOME (SELECT a1 FROM t1)
+)' ;
+EXECUTE stmt ;
+ERROR 21000: Subquery returns more than 1 row
+EXECUTE stmt ;
+ERROR 21000: Subquery returns more than 1 row
+SET SESSION sql_mode=@old_sql_mode;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.0 tests.
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
=== modified file 'mysql-test/r/xml.result'
--- a/mysql-test/r/xml.result 2011-03-01 14:42:37 +0000
+++ b/mysql-test/r/xml.result 2011-05-03 07:48:24 +0000
@@ -1144,5 +1144,23 @@ SELECT UPDATEXML(CONVERT('' USING swe7),
UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0)
NULL
#
+# Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
+#
+SELECT UPDATEXML('','(a)/a','');
+UPDATEXML('','(a)/a','')
+
+SELECT UPDATEXML('<a><a>x</a></a>','(a)/a','<b />');
+UPDATEXML('<a><a>x</a></a>','(a)/a','<b />')
+<a><b /></a>
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
+UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />')
+<a><c><a>x</a></c></a>
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
+UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />')
+<a><c><b /></c></a>
+SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
+ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b')
+aa bb
+#
# End of 5.5 tests
#
=== modified file 'mysql-test/suite/federated/federated.result'
--- a/mysql-test/suite/federated/federated.result 2010-08-09 08:32:50 +0000
+++ b/mysql-test/suite/federated/federated.result 2011-05-16 16:46:44 +0000
@@ -60,7 +60,7 @@ CREATE TABLE federated.t1 (
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://user:pass@stripped:SLAVE_PORT/federated/t1';
SELECT * FROM federated.t1;
-ERROR HY000: Unable to connect to foreign data source: Access denied for user 'user'@'localhost' (using password: NO)
+ERROR HY000: Unable to connect to foreign data source: Access denied for user 'user'@'localhost' (using password: YES)
DROP TABLE federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL,
=== modified file 'mysql-test/suite/innodb/r/innodb-index.result'
--- a/mysql-test/suite/innodb/r/innodb-index.result 2011-06-30 10:23:34 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index.result 2011-07-08 13:16:23 +0000
@@ -1,3 +1,46 @@
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -930,6 +973,7 @@ v16 VARCHAR(500), v17 VARCHAR(500), v18
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
+DELETE FROM t1;
DROP TABLE t1;
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
@@ -1098,44 +1142,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-CREATE TABLE t2 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t2 SELECT * FROM t1;
-BEGIN;
-SELECT * FROM t1;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-SET lock_wait_timeout=1;
-CREATE INDEX t1a ON t1(a);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-CREATE INDEX t2a ON t2(a);
-SELECT * FROM t2;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
-ERROR HY000: Table definition has changed, please retry transaction
-SELECT * FROM t2;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-COMMIT;
-SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
-a b
-0 d
-1 c
-1 e
-3 a
-3 b
-DROP TABLE t1,t2;
+SELECT SLEEP(10);
+SLEEP(10)
+0
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
=== modified file 'mysql-test/suite/innodb/t/innodb-index.test'
--- a/mysql-test/suite/innodb/t/innodb-index.test 2011-06-30 10:23:34 +0000
+++ b/mysql-test/suite/innodb/t/innodb-index.test 2011-07-08 13:16:23 +0000
@@ -4,6 +4,65 @@ let $MYSQLD_DATADIR= `select @@datadir`;
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $per_table=`select @@innodb_file_per_table`;
+let $format=`select @@innodb_file_format`;
+set global innodb_file_per_table=on;
+set global innodb_file_format='Barracuda';
+
+# Test an assertion failure on purge.
+CREATE TABLE t1_purge (
+A INT,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB,
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t1_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
+
+CREATE TABLE t2_purge (
+A INT PRIMARY KEY,
+B BLOB, C BLOB, D BLOB, E BLOB,
+F BLOB, G BLOB, H BLOB, I BLOB,
+J BLOB, K BLOB, L BLOB,
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t2_purge VALUES (1,
+REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
+REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
+REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
+
+CREATE TABLE t3_purge (
+A INT,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
+PRIMARY KEY (B(767), C(767), D(767), E(767), A),
+INDEX (A)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t3_purge SELECT * FROM t1_purge;
+
+CREATE TABLE t4_purge (
+A INT PRIMARY KEY,
+B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
+F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
+J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
+INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+
+INSERT INTO t4_purge SELECT * FROM t2_purge;
+
+# This would trigger the failure (Bug #12429576)
+# if purge gets a chance to run before DROP TABLE t1_purge, ....
+DELETE FROM t1_purge;
+DELETE FROM t2_purge;
+DELETE FROM t3_purge;
+DELETE FROM t4_purge;
+
+eval set global innodb_file_per_table=$per_table;
+eval set global innodb_file_format=$format;
+
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
commit;
@@ -357,8 +416,6 @@ explain select * from t1 where b like 'a
# end disabled45225_1
drop table t1;
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
set global innodb_file_per_table=on;
set global innodb_file_format='Barracuda';
# Test creating a table that could lead to undo log overflow.
@@ -415,6 +472,9 @@ CREATE TABLE t1(a INT,
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
+DELETE FROM t1;
+# Let the purge thread clean up this file.
+-- sleep 10
DROP TABLE t1;
eval set global innodb_file_per_table=$per_table;
@@ -532,35 +592,37 @@ SHOW CREATE TABLE t2;
DROP TABLE t2;
DROP TABLE t1;
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-CREATE TABLE t2 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t2 SELECT * FROM t1;
-connection b;
-BEGIN;
-# This acquires a MDL lock on t1 until commit.
-SELECT * FROM t1;
-connection a;
-# This times out before of the MDL lock held by connection b.
-SET lock_wait_timeout=1;
---error ER_LOCK_WAIT_TIMEOUT
-CREATE INDEX t1a ON t1(a);
-CREATE INDEX t2a ON t2(a);
-connection b;
-SELECT * FROM t2;
---error ER_TABLE_DEF_CHANGED
-SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
-SELECT * FROM t2;
-COMMIT;
-SELECT * FROM t2 FORCE INDEX(t2a) ORDER BY a;
-connection default;
-disconnect a;
-disconnect b;
-
-DROP TABLE t1,t2;
+# The following tests are disabled because of the introduced timeouts for
+# metadata locks at the MySQL level as part of the fix for
+# Bug#45225 Locking: hang if drop table with no timeout
+# The following CREATE INDEX t1a ON t1(a); causes a lock wait timeout
+# start disabled45225_2
+#connect (a,localhost,root,,);
+#connect (b,localhost,root,,);
+#connection a;
+#CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
+#INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
+#connection b;
+#BEGIN;
+#SELECT * FROM t1;
+#connection a;
+#CREATE INDEX t1a ON t1(a);
+#connection b;
+#SELECT * FROM t1;
+#--error ER_TABLE_DEF_CHANGED
+#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
+#SELECT * FROM t1;
+#COMMIT;
+#SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
+#connection default;
+#disconnect a;
+#disconnect b;
+#
+#DROP TABLE t1;
+# end disabled45225_2
+#this delay is needed because 45225_2 is disabled, to allow the purge to run
+SELECT SLEEP(10);
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
#
# restore environment to the state it was before this test execution
=== added file 'mysql-test/suite/rpl/r/rpl_row_corruption.result'
--- a/mysql-test/suite/rpl/r/rpl_row_corruption.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result 2011-07-14 11:15:24 +0000
@@ -0,0 +1,49 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004 (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004 VALUES (2);
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
+include/wait_for_slave_sql_error.inc [errno=1593 ]
+include/stop_slave.inc
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+DROP TABLE t1_11753004, t2_11753004;
+include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+include/start_slave.inc
+include/rpl_reset.inc
+CREATE TABLE t1_11753004 (c1 INT);
+CREATE TABLE t2_11753004_ign (c1 INT);
+INSERT INTO t1_11753004 VALUES (1);
+INSERT INTO t2_11753004_ign VALUES (2);
+UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
+DROP TABLE t1,t2;
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+DROP TABLE t1_11753004;
+DROP TABLE t2_11753004_ign;
+SET GLOBAL debug= @save_debug;
+include/rpl_end.inc
=== added file 'mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt 2011-07-14 11:15:24 +0000
@@ -0,0 +1 @@
+--replicate-ignore-table=test.t2_11753004_ign
=== added file 'mysql-test/suite/rpl/t/rpl_row_corruption.test'
--- a/mysql-test/suite/rpl/t/rpl_row_corruption.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_corruption.test 2011-07-14 11:15:24 +0000
@@ -0,0 +1,115 @@
+#
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+# BUG#11753004: 44360: REPLICATION FAILED
+
+## assert that we get an error when checking the
+## identifiers at the slave (instead of a crash or
+## different table being updated)
+
+--let $t1= t1_11753004
+--let $t2= t2_11753004
+--let $t2_ign= t2_11753004_ign
+
+## test #1: assert that we get an error raised when multiple
+## tables in the same RBR statement are mapped with the
+## same identifier
+
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2 (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2 VALUES (2)
+
+--sync_slave_with_master
+call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
+
+# stop the slave and inject corruption
+--source include/stop_slave.inc
+SET @save_debug= @@global.debug;
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+# both tables get mapped to 0 (in a way, simulating scenario
+# originated by BUG#56226)
+--eval UPDATE $t1, $t2 SET $t1.c1=3, $t2.c1=4 WHERE $t1.c1=1 OR $t2.c1=2
+--connection slave
+
+# wait for error 1593 (ER_SLAVE_FATAL_ERROR)
+--let $slave_sql_errno=1593
+--source include/wait_for_slave_sql_error.inc
+--source include/stop_slave.inc
+
+# clean up
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--connection master
+--source include/rpl_reset.inc
+--eval DROP TABLE $t1, $t2
+--sync_slave_with_master
+
+## test #2: assert that ignored tables that may have been mapped
+## with the same identifier are skipped, thus no error
+## is raised.
+
+--connection slave
+--source include/stop_slave.inc
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--source include/start_slave.inc
+--source include/rpl_reset.inc
+--connection master
+--eval CREATE TABLE $t1 (c1 INT)
+--eval CREATE TABLE $t2_ign (c1 INT)
+--eval INSERT INTO $t1 VALUES (1)
+--eval INSERT INTO $t2_ign VALUES (2)
+--eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2
+
+# must not raise error as second table is filtered
+--sync_slave_with_master
+
+
+## test #3: check that BINLOG statements will also raise an
+## error if containing table map events mapping different
+## tables to same table identifier.
+
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# FD event
+BINLOG '
+SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
+'/*!*/;
+
+#110708 12:21:44 server id 1 end_log_pos 774 Table_map: `test`.`t1` mapped to number 66
+# at 774
+#110708 12:21:44 server id 1 end_log_pos 815 Table_map: `test`.`t2` mapped to number 67
+# at 815
+#110708 12:21:44 server id 1 end_log_pos 855 Update_rows: table id 66
+# at 855
+#110708 12:21:44 server id 1 end_log_pos 895 Update_rows: table id 67 flags: STMT_END_F
+SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table";
+--error ER_SLAVE_FATAL_ERROR
+BINLOG '
+SOgWThMBAAAAKQAAAAYDAAAAAEIAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+SOgWThMBAAAAKQAAAC8DAAAAAEMAAAAAAAEABHRlc3QAAnQyAAEDAAE=
+SOgWThgBAAAAKAAAAFcDAAAAAEIAAAAAAAAAAf///gEAAAD+AwAAAA==
+SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
+'/*!*/;
+
+
+# clean up
+DROP TABLE t1,t2;
+--connection slave
+SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table";
+--connection master
+--eval DROP TABLE $t1
+--eval DROP TABLE $t2_ign
+--sync_slave_with_master
+SET GLOBAL debug= @save_debug;
+
+--source include/rpl_end.inc
=== modified file 'mysql-test/t/ctype_utf16.test'
--- a/mysql-test/t/ctype_utf16.test 2011-03-01 12:09:37 +0000
+++ b/mysql-test/t/ctype_utf16.test 2011-04-28 07:03:56 +0000
@@ -755,6 +755,13 @@ INSERT INTO t1 VALUES ('a');
SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#12340997
+--echo # DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE()
+--echo #
+
+SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second));
+
#
## TODO: add tests for all engines
#
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2011-06-16 13:55:11 +0000
+++ b/mysql-test/t/disabled.def 2011-07-14 09:28:51 +0000
@@ -16,3 +16,4 @@ alter_table-big : Bug#11748731
create-big : Bug#11748731 2010-11-15 mattiasj was not tested
archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
+mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
=== modified file 'mysql-test/t/explain.test'
--- a/mysql-test/t/explain.test 2011-03-24 10:27:11 +0000
+++ b/mysql-test/t/explain.test 2011-05-05 06:13:22 +0000
@@ -157,11 +157,12 @@ CREATE TABLE t1 (f1 INT);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
---error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+# EXPLAIN EXTENDED (with subselect). used to crash.
+# This is actually a valid query for this sql_mode,
+# but it was transformed in such a way that it failed, see
+# Bug#12329653 - EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
EXPLAIN EXTENDED SELECT 1 FROM t1
WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
-SHOW WARNINGS;
SET SESSION sql_mode=@old_sql_mode;
=== modified file 'mysql-test/t/gis.test'
--- a/mysql-test/t/gis.test 2011-04-07 10:57:32 +0000
+++ b/mysql-test/t/gis.test 2011-07-04 11:53:07 +0000
@@ -820,5 +820,23 @@ CREATE TABLE t3 (
# cleanup
DROP TABLE t0, t1, t2;
+--echo #
+--echo # Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE
+--echo #
+
+CREATE TABLE g1
+(a geometry NOT NULL, UNIQUE KEY i (a(151))) engine=myisam;
+
+INSERT INTO g1 VALUES (geomfromtext('point(1 1)'));
+INSERT INTO g1 VALUES (geomfromtext('point(1 2)'));
+
+FLUSH TABLES;
+
+SELECT 1 FROM g1
+FORCE INDEX(i) WHERE a = date_sub(now(), interval 2808.4 year_month)
+;
+
+DROP TABLE g1;
+
--echo End of 5.5 tests
=== modified file 'mysql-test/t/plugin_auth.test'
--- a/mysql-test/t/plugin_auth.test 2011-03-31 13:08:31 +0000
+++ b/mysql-test/t/plugin_auth.test 2011-07-05 23:13:50 +0000
@@ -512,4 +512,32 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INF
ORDER BY COLUMN_NAME;
+--echo #
+--echo # Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
+--echo # .-> USING PASSWORD: NO
+--echo #
+
+--echo # shoud contain "using password=yes"
+--error 1
+--exec $MYSQL -uunknown -punknown 2>&1
+
+--echo # shoud contain "using password=no"
+--error 1
+--exec $MYSQL -uunknown 2>&1
+
+--echo #
+--echo # Bug #12610784: SET PASSWORD INCORRECTLY KEEP AN OLD EMPTY PASSWORD
+--echo #
+
+CREATE USER bug12610784@localhost;
+SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect(b12610784,localhost,bug12610784,,test);
+--enable_query_log
+connect(b12610784,localhost,bug12610784,secret,test);
+connection default;
+disconnect b12610784;
+DROP USER bug12610784@localhost;
+
--echo End of 5.5 tests
=== added file 'mysql-test/t/secure_file_priv_win-master.opt'
--- a/mysql-test/t/secure_file_priv_win-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/secure_file_priv_win-master.opt 2011-04-28 09:22:41 +0000
@@ -0,0 +1 @@
+--secure_file_priv=$MYSQL_TMP_DIR
=== added file 'mysql-test/t/secure_file_priv_win.test'
--- a/mysql-test/t/secure_file_priv_win.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/secure_file_priv_win.test 2011-05-04 12:47:29 +0000
@@ -0,0 +1,79 @@
+#
+# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
+#
+
+# we do the windows specific relative directory testing
+
+--source include/windows.inc
+
+CREATE TABLE t1 (c1 longtext);
+INSERT INTO t1 values ('a');
+
+LET $MYSQL_TMP_DIR_UCASE= `SELECT upper('$MYSQL_TMP_DIR')`;
+LET $MYSQL_TMP_DIR_LCASE= `SELECT lower('$MYSQL_TMP_DIR')`;
+
+#create the file
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+show global variables like 'secure_file_priv';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_UCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT load_file('$MYSQL_TMP_DIR_LCASE/B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT load_file('$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp') AS x;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR\\\\B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_UCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval LOAD DATA INFILE '$MYSQL_TMP_DIR_LCASE/B11764517.tmp' INTO TABLE t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval LOAD DATA INFILE "$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517.tmp" into table t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--error ER_OPTION_PREVENTS_STATEMENT
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\..a..\\\\..\\\\..\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR\\\\B11764517-2.tmp';
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR/B11764517-3.tmp';
+
+--replace_result $MYSQL_TMP_DIR_UCASE MYSQL_TMP_DIR_UCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_UCASE/B11764517-4.tmp';
+
+--replace_result $MYSQL_TMP_DIR_LCASE MYSQL_TMP_DIR_LCASE
+eval SELECT * FROM t1 INTO OUTFILE '$MYSQL_TMP_DIR_LCASE/B11764517-5.tmp';
+
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-2.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-3.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-4.tmp;
+--error 0,1
+--remove_file $MYSQL_TMP_DIR/B11764517-5.tmp;
+DROP TABLE t1;
=== modified file 'mysql-test/t/sp-security.test'
--- a/mysql-test/t/sp-security.test 2010-10-07 16:01:17 +0000
+++ b/mysql-test/t/sp-security.test 2011-04-13 07:59:17 +0000
@@ -959,6 +959,43 @@ drop user bug57061_user@localhost;
drop database mysqltest_db;
+--echo #
+--echo # Bug#11882603 SELECT_ACL ON ANY COLUMN IN MYSQL.PROC ALLOWS TO SEE
+--echo # DEFINITION OF ANY ROUTINE.
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SELECT 1;
+CREATE USER user2@localhost IDENTIFIED BY '';
+GRANT SELECT(db) ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2 as user2
+connect (con2, localhost, user2);
+--echo # The statement below before disclosed info from body_utf8 column.
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Check that SHOW works with SELECT grant on whole table
+--echo # Connection default
+connection default;
+GRANT SELECT ON mysql.proc TO user2@localhost;
+
+--echo # Connection con2
+connection con2;
+--echo # This should work
+SHOW CREATE PROCEDURE db1.p1;
+
+--echo # Connection default
+connection default;
+disconnect con2;
+DROP USER user2@localhost;
+DROP DATABASE db1;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test 2011-03-17 11:02:19 +0000
+++ b/mysql-test/t/sp.test 2011-06-21 15:24:44 +0000
@@ -8778,4 +8778,60 @@ DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
--echo
+
+--echo
+--echo # --
+--echo # -- Bug#12652769 - 61470: case operator in stored routine retains old
+--echo # -- value of input parameter
+--echo # ---
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('a');
+
+delimiter |;
+
+CREATE PROCEDURE p1(dt DATETIME, i INT)
+BEGIN
+ SELECT
+ CASE
+ WHEN i = 1 THEN 2
+ ELSE dt
+ END AS x1;
+
+ SELECT
+ CASE _latin1'a'
+ WHEN _utf8'a' THEN 'A'
+ END AS x2;
+
+ SELECT
+ CASE _utf8'a'
+ WHEN _latin1'a' THEN _utf8'A'
+ END AS x3;
+
+ SELECT
+ CASE s1
+ WHEN _latin1'a' THEN _latin1'b'
+ ELSE _latin1'c'
+ END AS x4
+ FROM t1;
+END|
+
+delimiter ;|
+
+--echo
+CALL p1('2011-04-03 05:14:10', 1);
+CALL p1('2011-04-03 05:14:11', 2);
+CALL p1('2011-04-03 05:14:12', 2);
+CALL p1('2011-04-03 05:14:13', 2);
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--echo
+
--echo # End of 5.5 test
=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test 2011-04-15 06:54:05 +0000
+++ b/mysql-test/t/subselect.test 2011-05-10 14:29:44 +0000
@@ -3387,6 +3387,39 @@ ORDER BY outr.pk;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#12329653
+--echo # EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
+--echo #
+
+CREATE TABLE t1(a1 int);
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+
+## First a simpler query, illustrating the transformation
+## '1 < some (...)' => '1 < max(...)'
+SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1);
+
+## The query which made the server crash.
+PREPARE stmt FROM
+'SELECT 1 UNION ALL
+SELECT 1 FROM t1
+ORDER BY
+(SELECT 1 FROM t1 AS t1_0
+ WHERE 1 < SOME (SELECT a1 FROM t1)
+)' ;
+
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE stmt ;
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE stmt ;
+
+SET SESSION sql_mode=@old_sql_mode;
+
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
--echo End of 5.0 tests.
=== modified file 'mysql-test/t/xml.test'
--- a/mysql-test/t/xml.test 2011-03-01 14:42:37 +0000
+++ b/mysql-test/t/xml.test 2011-05-03 07:48:24 +0000
@@ -665,5 +665,14 @@ SET NAMES latin1;
SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
--echo #
+--echo # Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
+--echo #
+SELECT UPDATEXML('','(a)/a','');
+SELECT UPDATEXML('<a><a>x</a></a>','(a)/a','<b />');
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
+SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
+SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
+
+--echo #
--echo # End of 5.5 tests
--echo #
=== modified file 'mysys/my_symlink.c'
--- a/mysys/my_symlink.c 2011-06-30 15:46:53 +0000
+++ b/mysys/my_symlink.c 2011-07-07 09:42:14 +0000
@@ -144,24 +144,23 @@ int my_realpath(char *to, const char *fi
result= -1;
}
DBUG_RETURN(result);
-#else
-#ifdef _WIN32
- int ret= GetFullPathName(filename,FN_REFLEN,
- to,
- NULL);
+#elif defined(_WIN32)
+ int ret= GetFullPathName(filename,FN_REFLEN, to, NULL);
if (ret == 0 || ret > FN_REFLEN)
{
- if (ret > FN_REFLEN)
- my_errno= ENAMETOOLONG;
- else
- my_errno= EACCES;
+ my_errno= (ret > FN_REFLEN) ? ENAMETOOLONG : GetLastError();
if (MyFlags & MY_WME)
my_error(EE_REALPATH, MYF(0), filename, my_errno);
- return -1;
+ /*
+ GetFullPathName didn't work : use my_load_path() which is a poor
+ substitute original name but will at least be able to resolve
+ paths that starts with '.'.
+ */
+ my_load_path(to, filename, NullS);
+ return -1;
}
#else
my_load_path(to, filename, NullS);
#endif
return 0;
-#endif
}
=== modified file 'plugin/audit_null/audit_null.c'
--- a/plugin/audit_null/audit_null.c 2011-06-30 15:46:53 +0000
+++ b/plugin/audit_null/audit_null.c 2011-07-05 23:13:50 +0000
@@ -1,12 +1,13 @@
/* Copyright (c) 2006, 2011, 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 Foundation; version 2 of the License.
+ 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 Foundation; version 2 of
+ the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
=== modified file 'sql/field.h'
--- a/sql/field.h 2011-07-03 23:48:19 +0000
+++ b/sql/field.h 2011-07-04 11:53:07 +0000
@@ -1906,7 +1906,13 @@ public:
int store(longlong nr, bool unsigned_val);
int store_decimal(const my_decimal *);
uint size_of() const { return sizeof(*this); }
- int reset(void) { return !maybe_null() || Field_blob::reset(); }
+
+ /**
+ Non-nullable GEOMETRY types cannot have defaults,
+ but the underlying blob must still be reset.
+ */
+ int reset(void) { return Field_blob::reset() || !maybe_null(); }
+
geometry_type get_geometry_type() { return geom_type; };
};
#endif /*HAVE_SPATIAL*/
=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc 2011-07-03 23:48:19 +0000
+++ b/sql/field_conv.cc 2011-07-04 11:53:07 +0000
@@ -178,7 +178,10 @@ set_field_to_null_with_conversions(Field
((Field_timestamp*) field)->set_time();
return 0; // Ok to set time to NULL
}
+
+ // Note: we ignore any potential failure of reset() here.
field->reset();
+
if (field == field->table->next_number_field)
{
field->table->auto_increment_field_not_null= FALSE;
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item.cc 2011-07-07 09:42:14 +0000
@@ -4821,14 +4821,14 @@ mark_non_agg_field:
SELECT_LEX *select_lex= cached_table ?
cached_table->select_lex : context->select_lex;
if (!thd->lex->in_sum_func)
- select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
+ select_lex->set_non_agg_field_used(true);
else
{
if (outer_fixed)
thd->lex->in_sum_func->outer_fields.push_back(this);
else if (thd->lex->in_sum_func->nest_level !=
thd->lex->current_select->nest_level)
- select_lex->full_group_by_flag|= NON_AGG_FIELD_USED;
+ select_lex->set_non_agg_field_used(true);
}
}
return FALSE;
=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item_cmpfunc.cc 2011-07-05 23:13:50 +0000
@@ -3007,11 +3007,35 @@ void Item_func_case::agg_num_lengths(Ite
}
+/**
+ Check if (*place) and new_value points to different Items and call
+ THD::change_item_tree() if needed.
+
+ This function is a workaround for implementation deficiency in
+ Item_func_case. The problem there is that the 'args' attribute contains
+ Items from different expressions.
+
+ The function must not be used elsewhere and will be remove eventually.
+*/
+
+static void change_item_tree_if_needed(THD *thd,
+ Item **place,
+ Item *new_value)
+{
+ if (*place == new_value)
+ return;
+
+ thd->change_item_tree(place, new_value);
+}
+
+
void Item_func_case::fix_length_and_dec()
{
Item **agg;
uint nagg;
uint found_types= 0;
+ THD *thd= current_thd;
+
if (!(agg= (Item**) sql_alloc(sizeof(Item*)*(ncases+1))))
return;
@@ -3036,9 +3060,10 @@ void Item_func_case::fix_length_and_dec(
Some of the items might have been changed to Item_func_conv_charset.
*/
for (nagg= 0 ; nagg < ncases / 2 ; nagg++)
- args[nagg * 2 + 1]= agg[nagg];
+ change_item_tree_if_needed(thd, &args[nagg * 2 + 1], agg[nagg]);
+
if (else_expr_num != -1)
- args[else_expr_num]= agg[nagg++];
+ change_item_tree_if_needed(thd, &args[else_expr_num], agg[nagg++]);
}
else
collation.set_numeric();
@@ -3098,9 +3123,10 @@ void Item_func_case::fix_length_and_dec(
arrray, because some of the items might have been changed to converters
(e.g. Item_func_conv_charset, or Item_string for constants).
*/
- args[first_expr_num]= agg[0];
+ change_item_tree_if_needed(thd, &args[first_expr_num], agg[0]);
+
for (nagg= 0; nagg < ncases / 2; nagg++)
- args[nagg * 2]= agg[nagg + 1];
+ change_item_tree_if_needed(thd, &args[nagg * 2], agg[nagg + 1]);
}
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
{
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item_func.cc 2011-07-07 11:22:43 +0000
@@ -4965,8 +4965,9 @@ longlong Item_func_get_user_var::val_int
*/
-int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
- LEX_STRING &name, user_var_entry **out_entry)
+static int
+get_var_with_binlog(THD *thd, enum_sql_command sql_command,
+ LEX_STRING &name, user_var_entry **out_entry)
{
BINLOG_USER_VAR_EVENT *user_var_event;
user_var_entry *var_entry;
@@ -5096,7 +5097,7 @@ void Item_func_get_user_var::fix_length_
'var_entry' is NULL only if there occured an error during the call to
get_var_with_binlog.
*/
- if (var_entry)
+ if (!error && var_entry)
{
m_cached_result_type= var_entry->type;
unsigned_flag= var_entry->unsigned_flag;
=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item_subselect.cc 2011-07-07 09:42:14 +0000
@@ -38,6 +38,7 @@
#include "set_var.h"
#include "sql_select.h"
#include "sql_parse.h" // check_stack_overrun
+#include "sql_test.h"
inline Item * and_items(Item* cond, Item *item)
{
@@ -1025,6 +1026,14 @@ Item_in_subselect::single_value_transfor
it.replace(item);
}
+ DBUG_EXECUTE("where",
+ print_where(item, "rewrite with MIN/MAX", QT_ORDINARY););
+ if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
+ {
+ DBUG_ASSERT(select_lex->non_agg_field_used());
+ select_lex->set_non_agg_field_used(false);
+ }
+
save_allow_sum_func= thd->lex->allow_sum_func;
thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level;
/*
=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item_sum.cc 2011-07-07 09:42:14 +0000
@@ -259,10 +259,10 @@ bool Item_sum::check_sum_func(THD *thd,
in_sum_func->outer_fields.push_back(field);
}
else
- sel->full_group_by_flag|= NON_AGG_FIELD_USED;
+ sel->set_non_agg_field_used(true);
}
if (sel->nest_level > aggr_level &&
- (sel->full_group_by_flag & SUM_FUNC_USED) &&
+ (sel->agg_func_used()) &&
!sel->group_list.elements)
{
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
@@ -271,7 +271,7 @@ bool Item_sum::check_sum_func(THD *thd,
}
}
}
- aggr_sel->full_group_by_flag|= SUM_FUNC_USED;
+ aggr_sel->set_agg_func_used(true);
update_used_tables();
thd->lex->in_sum_func= in_sum_func;
return FALSE;
=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc 2011-07-03 23:48:19 +0000
+++ b/sql/item_timefunc.cc 2011-07-05 23:13:50 +0000
@@ -1451,7 +1451,7 @@ bool get_interval_value(Item *args,inter
else
{
String *res;
- if (!(res=args->val_str(str_value)))
+ if (!(res= args->val_str_ascii(str_value)))
return (1);
/* record negative intervalls in interval->neg */
=== modified file 'sql/item_xmlfunc.cc'
--- a/sql/item_xmlfunc.cc 2011-06-30 15:46:53 +0000
+++ b/sql/item_xmlfunc.cc 2011-07-05 23:13:50 +0000
@@ -1973,6 +1973,9 @@ static int my_xpath_parse_UnionExpr(MY_X
static int
my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
{
+ Item *context= xpath->context;
+ int rc;
+
if (!my_xpath_parse_FilterExpr(xpath))
return 0;
@@ -1986,8 +1989,22 @@ my_xpath_parse_FilterExpr_opt_slashes_Re
return 0;
}
- my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH);
- return my_xpath_parse_RelativeLocationPath(xpath);
+ /*
+ The context for the next relative path is the nodeset
+ returned by FilterExpr
+ */
+ xpath->context= xpath->item;
+
+ /* treat double slash (//) as /descendant-or-self::node()/ */
+ if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
+ xpath->context= new Item_nodeset_func_descendantbyname(xpath->context,
+ "*", 1, xpath->pxml, 1);
+ rc= my_xpath_parse_RelativeLocationPath(xpath);
+
+ /* push back the context and restore the item */
+ xpath->item= xpath->context;
+ xpath->context= context;
+ return rc;
}
static int my_xpath_parse_PathExpr(MY_XPATH *xpath)
{
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2011-07-03 23:48:19 +0000
+++ b/sql/log_event.cc 2011-07-15 11:43:38 +0000
@@ -71,6 +71,11 @@ static int rows_event_stmt_cleanup(Relay
static const char *HA_ERR(int i)
{
+ /*
+ This function should only be called in case of an error
+ was detected
+ */
+ DBUG_ASSERT(i != 0);
switch (i) {
case HA_ERR_KEY_NOT_FOUND: return "HA_ERR_KEY_NOT_FOUND";
case HA_ERR_FOUND_DUPP_KEY: return "HA_ERR_FOUND_DUPP_KEY";
@@ -123,7 +128,7 @@ static const char *HA_ERR(int i)
case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT";
case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY";
}
- return 0;
+ return "No Error!";
}
/**
@@ -144,7 +149,7 @@ static void inline slave_rows_error_repo
TABLE *table, const char * type,
const char *log_name, ulong pos)
{
- const char *handler_error= HA_ERR(ha_error);
+ const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL);
char buff[MAX_SLAVE_ERRMSG], *slider;
const char *buff_end= buff + sizeof(buff);
uint len;
@@ -7765,7 +7770,8 @@ int Rows_log_event::do_apply_event(Relay
error= do_exec_row(rli);
- DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
+ if (error)
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
table->in_use = old_thd;
@@ -8387,6 +8393,97 @@ Table_map_log_event::~Table_map_log_even
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
+enum enum_tbl_map_status
+{
+ /* no duplicate identifier found */
+ OK_TO_PROCESS= 0,
+
+ /* this table map must be filtered out */
+ FILTERED_OUT= 1,
+
+ /* identifier mapping table with different properties */
+ SAME_ID_MAPPING_DIFFERENT_TABLE= 2,
+
+ /* a duplicate identifier was found mapping the same table */
+ SAME_ID_MAPPING_SAME_TABLE= 3
+};
+
+/*
+ Checks if this table map event should be processed or not. First
+ it checks the filtering rules, and then looks for duplicate identifiers
+ in the existing list of rli->tables_to_lock.
+
+ It checks that there hasn't been any corruption by verifying that there
+ are no duplicate entries with different properties.
+
+ In some cases, some binary logs could get corrupted, showing several
+ tables mapped to the same table_id, 0 (see: BUG#56226). Thus we do this
+ early sanity check for such cases and avoid that the server crashes
+ later.
+
+ In some corner cases, the master logs duplicate table map events, i.e.,
+ same id, same database name, same table name (see: BUG#37137). This is
+ different from the above as it's the same table that is mapped again
+ to the same identifier. Thus we cannot just check for same ids and
+ assume that the event is corrupted we need to check every property.
+
+ NOTE: in the event that BUG#37137 ever gets fixed, this extra check
+ will still be valid because we would need to support old binary
+ logs anyway.
+
+ @param rli The relay log info reference.
+ @param table_list A list element containing the table to check against.
+ @return OK_TO_PROCESS
+ if there was no identifier already in rli->tables_to_lock
+
+ FILTERED_OUT
+ if the event is filtered according to the filtering rules
+
+ SAME_ID_MAPPING_DIFFERENT_TABLE
+ if the same identifier already maps a different table in
+ rli->tables_to_lock
+
+ SAME_ID_MAPPING_SAME_TABLE
+ if the same identifier already maps the same table in
+ rli->tables_to_lock.
+*/
+static enum_tbl_map_status
+check_table_map(Relay_log_info const *rli, RPL_TABLE_LIST *table_list)
+{
+ DBUG_ENTER("check_table_map");
+ enum_tbl_map_status res= OK_TO_PROCESS;
+
+ if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
+ (!rpl_filter->db_ok(table_list->db) ||
+ (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
+ res= FILTERED_OUT;
+ else
+ {
+ for(RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(rli->tables_to_lock);
+ ptr;
+ ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_local))
+ {
+ if (ptr->table_id == table_list->table_id)
+ {
+
+ if (strcmp(ptr->db, table_list->db) ||
+ strcmp(ptr->alias, table_list->table_name) ||
+ ptr->lock_type != TL_WRITE) // the ::do_apply_event always sets TL_WRITE
+ res= SAME_ID_MAPPING_DIFFERENT_TABLE;
+ else
+ res= SAME_ID_MAPPING_SAME_TABLE;
+
+ break;
+ }
+ }
+ }
+
+ DBUG_PRINT("debug", ("check of table map ended up with: %u", res));
+
+ DBUG_RETURN(res);
+}
+
int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
{
RPL_TABLE_LIST *table_list;
@@ -8413,18 +8510,11 @@ int Table_map_log_event::do_apply_event(
tname_mem, strlen(tname_mem),
tname_mem, TL_WRITE);
- table_list->table_id= m_table_id;
+ table_list->table_id= DBUG_EVALUATE_IF("inject_tblmap_same_id_maps_diff_table", 0, m_table_id);
table_list->updating= 1;
-
- int error= 0;
-
- if (rli->sql_thd->slave_thread /* filtering is for slave only */ &&
- (!rpl_filter->db_ok(table_list->db) ||
- (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list))))
- {
- my_free(memory);
- }
- else
+ DBUG_PRINT("debug", ("table: %s is mapped to %u", table_list->table_name, table_list->table_id));
+ enum_tbl_map_status tblmap_status= check_table_map(rli, table_list);
+ if (tblmap_status == OK_TO_PROCESS)
{
DBUG_ASSERT(thd->lex->query_tables != table_list);
@@ -8454,8 +8544,48 @@ int Table_map_log_event::do_apply_event(
const_cast<Relay_log_info*>(rli)->tables_to_lock_count++;
/* 'memory' is freed in clear_tables_to_lock */
}
+ else // FILTERED_OUT, SAME_ID_MAPPING_*
+ {
+ /*
+ If mapped already but with different properties, we raise an
+ error.
+ If mapped already but with same properties we skip the event.
+ If filtered out we skip the event.
+
+ In all three cases, we need to free the memory previously
+ allocated.
+ */
+ if (tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE)
+ {
+ /*
+ Something bad has happened. We need to stop the slave as strange things
+ could happen if we proceed: slave crash, wrong table being updated, ...
+ As a consequence we push an error in this case.
+ */
+
+ char buf[256];
+
+ my_snprintf(buf, sizeof(buf),
+ "Found table map event mapping table id %u which "
+ "was already mapped but with different settings.",
+ table_list->table_id);
+
+ if (thd->slave_thread)
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER(ER_SLAVE_FATAL_ERROR), buf);
+ else
+ /*
+ For the cases in which a 'BINLOG' statement is set to
+ execute in a user session
+ */
+ my_printf_error(ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR),
+ MYF(0), buf);
+ }
+
+ my_free(memory);
+ }
- DBUG_RETURN(error);
+ DBUG_RETURN(tblmap_status == SAME_ID_MAPPING_DIFFERENT_TABLE);
}
Log_event::enum_skip_reason
@@ -9384,7 +9514,8 @@ int Rows_log_event::find_row(const Relay
restart_rnd_next:
error= table->file->rnd_next(table->record[0]);
- DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
+ if (error)
+ DBUG_PRINT("info", ("error: %s", HA_ERR(error)));
switch (error) {
case 0:
=== modified file 'sql/my_decimal.h'
--- a/sql/my_decimal.h 2011-07-03 23:48:19 +0000
+++ b/sql/my_decimal.h 2011-07-05 23:13:50 +0000
@@ -144,8 +144,6 @@ public:
void swap(my_decimal &rhs)
{
swap_variables(my_decimal, *this, rhs);
- /* Swap the buffer pointers back */
- swap_variables(decimal_digit_t *, buf, rhs.buf);
}
};
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2011-07-03 23:48:19 +0000
+++ b/sql/mysqld.cc 2011-07-07 11:22:43 +0000
@@ -5161,6 +5161,9 @@ void handle_connections_sockets()
DBUG_ENTER("handle_connections_sockets");
+ (void) ip_flags;
+ (void) socket_flags;
+
#ifndef HAVE_POLL
FD_ZERO(&clientFDs);
#endif
@@ -7543,12 +7546,15 @@ fn_format_relative_to_data_home(char * t
bool is_secure_file_path(char *path)
{
char buff1[FN_REFLEN], buff2[FN_REFLEN];
+ size_t opt_secure_file_priv_len;
/*
All paths are secure if opt_secure_file_path is 0
*/
if (!opt_secure_file_priv)
return TRUE;
+ opt_secure_file_priv_len= strlen(opt_secure_file_priv);
+
if (strlen(path) >= FN_REFLEN)
return FALSE;
@@ -7566,11 +7572,24 @@ bool is_secure_file_path(char *path)
return FALSE;
}
convert_dirname(buff2, buff1, NullS);
- if (strncmp(opt_secure_file_priv, buff2, strlen(opt_secure_file_priv)))
- return FALSE;
+ if (!lower_case_file_system)
+ {
+ if (strncmp(opt_secure_file_priv, buff2, opt_secure_file_priv_len))
+ return FALSE;
+ }
+ else
+ {
+ if (files_charset_info->coll->strnncoll(files_charset_info,
+ (uchar *) buff2, strlen(buff2),
+ (uchar *) opt_secure_file_priv,
+ opt_secure_file_priv_len,
+ TRUE))
+ return FALSE;
+ }
return TRUE;
}
+
static int fix_paths(void)
{
char buff[FN_REFLEN],*pos;
=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc 2011-06-30 15:46:53 +0000
+++ b/sql/protocol.cc 2011-07-15 12:29:07 +0000
@@ -368,9 +368,8 @@ bool net_send_error_packet(THD *thd, uin
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
*/
uint error;
- uchar converted_err[MYSQL_ERRMSG_SIZE];
- uint32 converted_err_len;
- uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
+ char converted_err[MYSQL_ERRMSG_SIZE];
+ char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
DBUG_ENTER("send_error_packet");
@@ -390,19 +389,16 @@ bool net_send_error_packet(THD *thd, uin
{
/* The first # is to make the protocol backward compatible */
buff[2]= '#';
- pos= (uchar*) strmov((char*) buff+3, sqlstate);
+ pos= strmov(buff+3, sqlstate);
}
- converted_err_len= convert_error_message((char*)converted_err,
- sizeof(converted_err),
- thd->variables.character_set_results,
- err, strlen(err),
- system_charset_info, &error);
- length= (uint) (strmake((char*) pos, (char*)converted_err,
- MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
- err= (char*) buff;
+ convert_error_message(converted_err, sizeof(converted_err),
+ thd->variables.character_set_results,
+ err, strlen(err), system_charset_info, &error);
+ /* Converted error message is always null-terminated. */
+ length= (uint) (strmake(pos, converted_err, MYSQL_ERRMSG_SIZE - 1) - buff);
- DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
+ DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
length));
}
@@ -984,8 +980,8 @@ bool Protocol_text::store(const char *fr
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
- DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos,
- field_count, (length == 0? "" : from)));
+ DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*s", field_pos,
+ field_count, (int) length, (length == 0 ? "" : from)));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2011-07-03 23:48:19 +0000
+++ b/sql/sp_head.cc 2011-07-07 09:42:14 +0000
@@ -2591,8 +2591,9 @@ bool check_show_routine_access(THD *thd,
bzero((char*) &tables,sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
- *full_access= (!check_table_access(thd, SELECT_ACL, &tables, FALSE,
- 1, TRUE) ||
+ *full_access= ((!check_table_access(thd, SELECT_ACL, &tables, FALSE,
+ 1, TRUE) &&
+ (tables.grant.privilege & SELECT_ACL) != 0) ||
(!strcmp(sp->m_definer_user.str,
thd->security_ctx->priv_user) &&
!strcmp(sp->m_definer_host.str,
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2011-07-03 23:48:19 +0000
+++ b/sql/sql_acl.cc 2011-07-05 23:13:50 +0000
@@ -825,8 +825,6 @@ static my_bool acl_load(THD *thd, TABLE_
char *password= get_field(&mem, table->field[2]);
uint password_len= password ? strlen(password) : 0;
- user.auth_string.str= password ? password : const_cast<char*>("");
- user.auth_string.length= password_len;
set_user_salt(&user, password, password_len);
if (set_user_plugin(&user, password_len))
@@ -915,7 +913,7 @@ static my_bool acl_load(THD *thd, TABLE_
char *tmpstr= get_field(&mem, table->field[next_field++]);
if (tmpstr)
{
- if (user.auth_string.length)
+ if (password_len)
{
sql_print_warning("'user' entry '%s@%s' has both a password "
"and an authentication plugin specified. The "
@@ -1483,8 +1481,8 @@ static void acl_insert_user(const char *
{
acl_user.plugin= password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 ?
old_password_plugin_name : native_password_plugin_name;
- acl_user.auth_string.str= strmake_root(&mem, password, password_len);
- acl_user.auth_string.length= password_len;
+ acl_user.auth_string.str= const_cast<char*>("");
+ acl_user.auth_string.length= 0;
}
acl_user.access=privileges;
@@ -8232,7 +8230,7 @@ static bool find_mpvio_user(MPVIO_EXT *m
if (!mpvio->acl_user)
{
- login_failed_error(mpvio, 0);
+ login_failed_error(mpvio, mpvio->auth_info.password_used);
DBUG_RETURN (1);
}
@@ -8380,7 +8378,7 @@ static bool parse_com_change_user_packet
old_password_plugin, otherwise MySQL will think that server
and client plugins don't match.
*/
- if (mpvio->acl_user->auth_string.length == 0)
+ if (mpvio->acl_user->salt_len == 0)
mpvio->acl_user_plugin= old_password_plugin_name;
}
}
@@ -8680,6 +8678,14 @@ static ulong parse_client_handshake_pack
return packet_error;
}
+ /*
+ Set the default for the password supplied flag for non-existing users
+ as the default plugin (native passsword authentication) would do it
+ for compatibility reasons.
+ */
+ if (passwd_len)
+ mpvio->auth_info.password_used= PASSWORD_USED_YES;
+
size_t client_plugin_len= 0;
char *client_plugin= get_string(&end, &bytes_remaining_in_packet,
&client_plugin_len);
@@ -8759,7 +8765,7 @@ static ulong parse_client_handshake_pack
old_password_plugin, otherwise MySQL will think that server
and client plugins don't match.
*/
- if (mpvio->acl_user->auth_string.length == 0)
+ if (mpvio->acl_user->salt_len == 0)
mpvio->acl_user_plugin= old_password_plugin_name;
}
}
@@ -9547,7 +9553,7 @@ static int native_password_authenticate(
#endif
if (pkt_len == 0) /* no password */
- DBUG_RETURN(info->auth_string[0] ? CR_ERROR : CR_OK);
+ DBUG_RETURN(mpvio->acl_user->salt_len != 0 ? CR_ERROR : CR_OK);
info->password_used= PASSWORD_USED_YES;
if (pkt_len == SCRAMBLE_LENGTH)
@@ -9596,7 +9602,7 @@ static int old_password_authenticate(MYS
pkt_len= strnlen((char*)pkt, pkt_len);
if (pkt_len == 0) /* no password */
- return info->auth_string[0] ? CR_ERROR : CR_OK;
+ return mpvio->acl_user->salt_len != 0 ? CR_ERROR : CR_OK;
if (secure_auth(mpvio))
return CR_ERROR;
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2011-07-03 23:48:19 +0000
+++ b/sql/sql_class.h 2011-07-07 11:22:43 +0000
@@ -3642,14 +3642,6 @@ void add_diff_to_status(STATUS_VAR *to_v
STATUS_VAR *dec_var);
void mark_transaction_to_rollback(THD *thd, bool all);
-/*
- This prototype is placed here instead of in item_func.h because it
- depends on the definition of enum_sql_command, which is in this
- file.
- */
-int get_var_with_binlog(THD *thd, enum_sql_command sql_command,
- LEX_STRING &name, user_var_entry **out_entry);
-
/* Inline functions */
inline bool add_item_to_list(THD *thd, Item *item)
=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc 2011-07-03 23:48:19 +0000
+++ b/sql/sql_lex.cc 2011-07-07 09:42:14 +0000
@@ -1755,6 +1755,8 @@ void st_select_lex::init_query()
exclude_from_table_unique_test= no_wrap_view_item= FALSE;
nest_level= 0;
link_next= 0;
+ m_non_agg_field_used= false;
+ m_agg_func_used= false;
}
void st_select_lex::init_select()
@@ -1785,7 +1787,8 @@ void st_select_lex::init_select()
non_agg_fields.empty();
cond_value= having_value= Item::COND_UNDEF;
inner_refs_list.empty();
- full_group_by_flag= 0;
+ m_non_agg_field_used= false;
+ m_agg_func_used= false;
}
/*
=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h 2011-07-03 23:48:19 +0000
+++ b/sql/sql_lex.h 2011-07-07 09:42:14 +0000
@@ -800,16 +800,7 @@ public:
joins on the right.
*/
List<String> *prev_join_using;
- /*
- Bitmap used in the ONLY_FULL_GROUP_BY_MODE to prevent mixture of aggregate
- functions and non aggregated fields when GROUP BY list is absent.
- Bits:
- 0 - non aggregated fields are used in this select,
- defined as NON_AGG_FIELD_USED.
- 1 - aggregate functions are used in this select,
- defined as SUM_FUNC_USED.
- */
- uint8 full_group_by_flag;
+
void init_query();
void init_select();
st_select_lex_unit* master_unit();
@@ -918,7 +909,22 @@ public:
void clear_index_hints(void) { index_hints= NULL; }
-private:
+ /*
+ For MODE_ONLY_FULL_GROUP_BY we need to maintain two flags:
+ - Non-aggregated fields are used in this select.
+ - Aggregate functions are used in this select.
+ In MODE_ONLY_FULL_GROUP_BY only one of these may be true.
+ */
+ bool non_agg_field_used() const { return m_non_agg_field_used; }
+ bool agg_func_used() const { return m_agg_func_used; }
+
+ void set_non_agg_field_used(bool val) { m_non_agg_field_used= val; }
+ void set_agg_func_used(bool val) { m_agg_func_used= val; }
+
+private:
+ bool m_non_agg_field_used;
+ bool m_agg_func_used;
+
/* current index hint kind. used in filling up index_hints */
enum index_hint_type current_index_hint_type;
index_clause_map current_index_hint_clause;
=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc 2011-07-03 23:48:19 +0000
+++ b/sql/sql_load.cc 2011-07-07 11:22:43 +0000
@@ -177,6 +177,7 @@ int mysql_load(THD *thd,sql_exchange *ex
#ifndef EMBEDDED_LIBRARY
LOAD_FILE_INFO lf_info;
THD::killed_state killed_status= THD::NOT_KILLED;
+ bool is_concurrent;
#endif
char *db = table_list->db; // This is never null
/*
@@ -187,7 +188,6 @@ int mysql_load(THD *thd,sql_exchange *ex
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
bool transactional_table;
- bool is_concurrent;
DBUG_ENTER("mysql_load");
/*
@@ -256,7 +256,9 @@ int mysql_load(THD *thd,sql_exchange *ex
table= table_list->table;
transactional_table= table->file->has_transactions();
+#ifndef EMBEDDED_LIBRARY
is_concurrent= (table_list->lock_type == TL_WRITE_CONCURRENT_INSERT);
+#endif
if (!fields_vars.elements)
{
@@ -398,8 +400,8 @@ int mysql_load(THD *thd,sql_exchange *ex
#if !defined(__WIN__) && ! defined(__NETWARE__)
MY_STAT stat_info;
- if (!my_stat(name,&stat_info,MYF(MY_WME)))
- DBUG_RETURN(TRUE);
+ if (!my_stat(name, &stat_info, MYF(MY_WME)))
+ DBUG_RETURN(TRUE);
// if we are not in slave thread, the file must be:
if (!thd->slave_thread &&
@@ -407,11 +409,11 @@ int mysql_load(THD *thd,sql_exchange *ex
((stat_info.st_mode & S_IFREG) == S_IFREG || // regular file
(stat_info.st_mode & S_IFIFO) == S_IFIFO))) // named pipe
{
- my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
- DBUG_RETURN(TRUE);
+ my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
+ DBUG_RETURN(TRUE);
}
if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
- is_fifo = 1;
+ is_fifo= 1;
#endif
if ((file= mysql_file_open(key_file_load,
name, O_RDONLY, MYF(MY_WME))) < 0)
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2011-05-21 08:21:08 +0000
+++ b/sql/sql_partition.cc 2011-06-08 08:56:11 +0000
@@ -1077,8 +1077,6 @@ static bool fix_fields_part_func(THD *th
int error;
LEX *old_lex= thd->lex;
LEX lex;
- uint8 saved_full_group_by_flag;
- nesting_map saved_allow_sum_func;
DBUG_ENTER("fix_fields_part_func");
if (init_lex_with_single_table(thd, table, &lex))
@@ -1103,19 +1101,22 @@ static bool fix_fields_part_func(THD *th
This is a tricky call to prepare for since it can have a large number
of interesting side effects, both desirable and undesirable.
*/
- saved_full_group_by_flag= thd->lex->current_select->full_group_by_flag;
- saved_allow_sum_func= thd->lex->allow_sum_func;
- thd->lex->allow_sum_func= 0;
-
- error= func_expr->fix_fields(thd, (Item**)&func_expr);
-
- /*
- Restore full_group_by_flag and allow_sum_func,
- fix_fields should not affect mysql_select later, see Bug#46923.
- */
- thd->lex->current_select->full_group_by_flag= saved_full_group_by_flag;
- thd->lex->allow_sum_func= saved_allow_sum_func;
-
+ {
+ const bool save_agg_field= thd->lex->current_select->non_agg_field_used();
+ const bool save_agg_func= thd->lex->current_select->agg_func_used();
+ const nesting_map saved_allow_sum_func= thd->lex->allow_sum_func;
+ thd->lex->allow_sum_func= 0;
+
+ error= func_expr->fix_fields(thd, (Item**)&func_expr);
+
+ /*
+ Restore agg_field/agg_func and allow_sum_func,
+ fix_fields should not affect mysql_select later, see Bug#46923.
+ */
+ thd->lex->current_select->set_non_agg_field_used(save_agg_field);
+ thd->lex->current_select->set_agg_func_used(save_agg_func);
+ thd->lex->allow_sum_func= saved_allow_sum_func;
+ }
if (unlikely(error))
{
DBUG_PRINT("info", ("Field in partition function not part of table"));
=== modified file 'sql/sql_priv.h'
--- a/sql/sql_priv.h 2011-07-03 23:48:19 +0000
+++ b/sql/sql_priv.h 2011-07-07 09:42:14 +0000
@@ -261,13 +261,6 @@ enum enum_yes_no_unknown
#ifdef MYSQL_SERVER
/*
- A set of constants used for checking non aggregated fields and sum
- functions mixture in the ONLY_FULL_GROUP_BY_MODE.
-*/
-#define NON_AGG_FIELD_USED 1
-#define SUM_FUNC_USED 2
-
-/*
External variables
*/
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2011-07-03 23:48:19 +0000
+++ b/sql/sql_select.cc 2011-07-07 09:42:14 +0000
@@ -455,19 +455,18 @@ inline int setup_without_group(THD *thd,
int res;
nesting_map save_allow_sum_func=thd->lex->allow_sum_func ;
/*
- Need to save the value, so we can turn off only the new NON_AGG_FIELD
+ Need to save the value, so we can turn off only any new non_agg_field_used
additions coming from the WHERE
*/
- uint8 saved_flag= thd->lex->current_select->full_group_by_flag;
+ const bool saved_non_agg_field_used=
+ thd->lex->current_select->non_agg_field_used();
DBUG_ENTER("setup_without_group");
thd->lex->allow_sum_func&= ~(1 << thd->lex->current_select->nest_level);
res= setup_conds(thd, tables, leaves, conds);
/* it's not wrong to have non-aggregated columns in a WHERE */
- if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
- thd->lex->current_select->full_group_by_flag= saved_flag |
- (thd->lex->current_select->full_group_by_flag & ~NON_AGG_FIELD_USED);
+ thd->lex->current_select->set_non_agg_field_used(saved_non_agg_field_used);
thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level;
res= res || setup_order(thd, ref_pointer_array, tables, fields, all_fields,
@@ -673,7 +672,8 @@ JOIN::prepare(Item ***rref_pointer_array
aggregate functions with implicit grouping (there is no GROUP BY).
*/
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY && !group_list &&
- select_lex->full_group_by_flag == (NON_AGG_FIELD_USED | SUM_FUNC_USED))
+ select_lex->non_agg_field_used() &&
+ select_lex->agg_func_used())
{
my_message(ER_MIX_OF_GROUP_FUNC_AND_FIELDS,
ER(ER_MIX_OF_GROUP_FUNC_AND_FIELDS), MYF(0));
=== modified file 'storage/innobase/btr/btr0cur.c'
--- a/storage/innobase/btr/btr0cur.c 2011-06-23 12:57:25 +0000
+++ b/storage/innobase/btr/btr0cur.c 2011-07-07 11:22:43 +0000
@@ -3575,7 +3575,6 @@ static
void
btr_record_not_null_field_in_rec(
/*=============================*/
- rec_t* rec, /*!< in: physical record */
ulint n_unique, /*!< in: dict_index_get_n_unique(index),
number of columns uniquely determine
an index entry */
@@ -3595,9 +3594,8 @@ btr_record_not_null_field_in_rec(
for (i = 0; i < n_unique; i++) {
ulint rec_len;
- byte* field;
- field = rec_get_nth_field(rec, offsets, i, &rec_len);
+ rec_get_nth_field_offs(offsets, i, &rec_len);
if (rec_len != UNIV_SQL_NULL) {
n_not_null[i]++;
@@ -3712,7 +3710,7 @@ btr_estimate_number_of_different_key_val
if (n_not_null) {
btr_record_not_null_field_in_rec(
- rec, n_cols, offsets_rec, n_not_null);
+ n_cols, offsets_rec, n_not_null);
}
}
@@ -3747,7 +3745,7 @@ btr_estimate_number_of_different_key_val
if (n_not_null) {
btr_record_not_null_field_in_rec(
- next_rec, n_cols, offsets_next_rec,
+ n_cols, offsets_next_rec,
n_not_null);
}
=== modified file 'storage/innobase/row/row0row.c'
--- a/storage/innobase/row/row0row.c 2011-06-30 10:23:34 +0000
+++ b/storage/innobase/row/row0row.c 2011-07-08 13:16:23 +0000
@@ -148,22 +148,27 @@ row_build_index_entry(
continue;
}
} else if (dfield_is_ext(dfield)) {
- /* This table should be in Antelope format
- (ROW_FORMAT=REDUNDANT or ROW_FORMAT=COMPACT).
- In that format, the maximum column prefix
+ /* This table is either in Antelope format
+ (ROW_FORMAT=REDUNDANT or ROW_FORMAT=COMPACT)
+ or a purge record where the ordered part of
+ the field is not external.
+ In Antelope, the maximum column prefix
index length is 767 bytes, and the clustered
index record contains a 768-byte prefix of
each off-page column. */
ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
len -= BTR_EXTERN_FIELD_REF_SIZE;
+ dfield_set_len(dfield, len);
}
/* If a column prefix index, take only the prefix. */
- ut_ad(ind_field->prefix_len);
- len = dtype_get_at_most_n_mbchars(
- col->prtype, col->mbminmaxlen,
- ind_field->prefix_len, len, dfield_get_data(dfield));
- dfield_set_len(dfield, len);
+ if (ind_field->prefix_len) {
+ len = dtype_get_at_most_n_mbchars(
+ col->prtype, col->mbminmaxlen,
+ ind_field->prefix_len, len,
+ dfield_get_data(dfield));
+ dfield_set_len(dfield, len);
+ }
}
ut_ad(dtuple_check_typed(entry));
=== removed directory 'storage/ndb/test/sql'
=== removed file 'storage/ndb/test/sql/BANK.sql'
--- a/storage/ndb/test/sql/BANK.sql 2011-06-30 15:37:13 +0000
+++ b/storage/ndb/test/sql/BANK.sql 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
--- Copyright (c) 2005 MySQL AB
--- Use is subject to license terms.
---
--- 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 Foundation; version 2 of the License.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-CREATE DATABASE IF NOT EXISTS BANK default charset=latin1 default collate=latin1_bin;
-USE BANK;
-DROP TABLE IF EXISTS GL;
-CREATE TABLE GL ( TIME BIGINT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- DEPOSIT_COUNT INT UNSIGNED NOT NULL,
- DEPOSIT_SUM INT UNSIGNED NOT NULL,
- WITHDRAWAL_COUNT INT UNSIGNED NOT NULL,
- WITHDRAWAL_SUM INT UNSIGNED NOT NULL,
- PURGED INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TIME,ACCOUNT_TYPE))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS ACCOUNT;
-CREATE TABLE ACCOUNT ( ACCOUNT_ID INT UNSIGNED NOT NULL,
- OWNER INT UNSIGNED NOT NULL,
- BALANCE INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_ID))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS TRANSACTION;
-CREATE TABLE TRANSACTION ( TRANSACTION_ID BIGINT UNSIGNED NOT NULL,
- ACCOUNT INT UNSIGNED NOT NULL,
- ACCOUNT_TYPE INT UNSIGNED NOT NULL,
- OTHER_ACCOUNT INT UNSIGNED NOT NULL,
- TRANSACTION_TYPE INT UNSIGNED NOT NULL,
- TIME BIGINT UNSIGNED NOT NULL,
- AMOUNT INT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (TRANSACTION_ID,ACCOUNT))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS SYSTEM_VALUES;
-CREATE TABLE SYSTEM_VALUES ( SYSTEM_VALUES_ID INT UNSIGNED NOT NULL,
- VALUE BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (SYSTEM_VALUES_ID))
- ENGINE = NDB;
-
-DROP TABLE IF EXISTS ACCOUNT_TYPE;
-CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
- DESCRIPTION CHAR(64) NOT NULL,
- PRIMARY KEY USING HASH (ACCOUNT_TYPE_ID))
- ENGINE = NDB;
=== removed file 'storage/ndb/test/sql/T1.sql'
--- a/storage/ndb/test/sql/T1.sql 2011-06-30 15:37:13 +0000
+++ b/storage/ndb/test/sql/T1.sql 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
--- Copyright (c) 2005 MySQL AB
--- Use is subject to license terms.
---
--- 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 Foundation; version 2 of the License.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program; if not, write to the Free Software
--- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-create database if not exists TEST_DB;
-use TEST_DB;
-drop table if exists T1;
-create table T1 (KOL1 int unsigned not null,
- KOL2 int unsigned not null,
- KOL3 int unsigned not null,
- KOL4 int unsigned not null,
- KOL5 int unsigned not null,
- primary key using hash(KOL1)) engine=ndb;
=== removed file 'storage/ndb/test/sql/test_create_drop.pl'
--- a/storage/ndb/test/sql/test_create_drop.pl 2010-12-28 23:47:05 +0000
+++ b/storage/ndb/test/sql/test_create_drop.pl 1970-01-01 00:00:00 +0000
@@ -1,196 +0,0 @@
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-use strict;
-use IO::Socket;
-use DBI;
-
-# mgm info
-my $mgmhost = "localhost";
-my $mgmport = 38101;
-
-# location of ndb_x_fs
-my $datadir = "c2";
-my @schemafiles = <$datadir/ndb_*_fs/D[12]/DBDICT/P0.SchemaLog>;
-@schemafiles or die "no schemafiles in $datadir";
-
-my $dsn;
-$dsn = "dbi:mysql:test:localhost;port=38100";
-
-# this works better for me
-my $cnf = $ENV{MYSQL_HOME} . "/var/my.cnf";
-$dsn = "dbi:mysql:database=test;host=localhost;mysql_read_default_file=$cnf";
-
-my $dbh;
-$dbh = DBI->connect($dsn, 'root', undef, { RaiseError => 0, PrintError => 0 });
-$dbh or die $DBI::errstr;
-
-# mgm commands
-
-my $mgm = undef;
-
-sub mgmconnect {
- $mgm = IO::Socket::INET->new(
- Proto => "tcp",
- PeerHost => $mgmhost,
- PeerPort => $mgmport);
- $mgm or die "connect to mgm failed: $!";
- $mgm->autoflush(1);
-};
-
-mgmconnect();
-warn "connected to mgm $mgmhost $mgmport\n";
-
-my $nodeinfo = {};
-
-sub getnodeinfo {
- $nodeinfo = {};
- $mgm->print("get status\n");
- $mgm->print("\n");
- while (defined($_ = $mgm->getline)) {
- /^node\s+status/ && last;
- }
- while (defined($_ = $mgm->getline)) {
- /^\s*$/ && last;
- /^node\.(\d+)\.(\w+):\s*(\S+)/ && ($nodeinfo->{$1}{$2} = $3);
- }
-}
-
-getnodeinfo();
-
-my @dbnode = ();
-for my $n (keys %$nodeinfo) {
- my $p = $nodeinfo->{$n};
- ($p->{type} eq 'NDB') && push(@dbnode, $n);
-}
-@dbnode = sort { $a <=> $b } @dbnode;
-@dbnode or die "mgm error, found no db nodes";
-warn "db nodes: @dbnode\n";
-
-sub restartnode {
- my($n, $initialstart) = @_;
- warn "restart node $n initialstart=$initialstart\n";
- $mgm->print("restart node\n");
- $mgm->print("node: $n\n");
- $mgm->print("initialstart: $initialstart\n");
- $mgm->print("\n");
- while (1) {
- sleep 5;
- getnodeinfo();
- my $status = $nodeinfo->{$n}{status};
- my $sp = $nodeinfo->{$n}{startphase};
- warn "node $n status: $status sp: $sp\n";
- last if $status eq 'STARTED';
- }
-}
-
-sub restartall {
- warn "restart all\n";
- $mgm->print("restart all\n");
- $mgm->print("\n");
- while (1) {
- sleep 5;
- getnodeinfo();
- my $ok = 1;
- for my $n (@dbnode) {
- my $status = $nodeinfo->{$n}{status};
- my $sp = $nodeinfo->{$n}{startphase};
- warn "node $n status: $status sp: $sp\n";
- $ok = 0 if $status ne 'STARTED';
- }
- last if $ok;
- }
-}
-
-# the sql stuff
-
-my $maxtab = 300;
-my @tab = ();
-
-sub create {
- my($n) = @_;
- my $sql = "create table t$n (a int primary key, b varchar(20), key (b)) engine=ndb";
- warn "create t$n\n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
-}
-
-sub drop {
- my($n) = @_;
- my $sql = "drop table t$n";
- warn "drop t$n\n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
-}
-
-sub dropall {
- for my $n (0..($maxtab-1)) {
- my $sql = "drop table if exists t$n";
- $dbh->do($sql) or die "$sql\n$DBI::errstr";
- }
-}
-
-sub createdrop {
- my $n = int(rand($maxtab));
- if (! $tab[$n]) {
- create($n);
- $tab[$n] = 1;
- } else {
- drop($n);
- $tab[$n] = 0;
- }
-}
-
-sub checkschemafiles {
- system("printSchemaFile -ce @schemafiles");
- $? == 0 or die "schemafiles check failed";
-}
-
-sub randomrestart {
- my($k) = @_;
- my $s = int(rand(500));
- if ($s < 2) {
- my $i = $k % scalar(@dbnode);
- my $n = $dbnode[$i];
- my $initialstart = ($s < 1 ? 0 : 1);
- restartnode($n, $initialstart);
- return 1;
- }
- if ($s < 3) {
- restartall();
- return 1;
- }
- return 0;
-}
-
-# deterministic
-srand(1);
-
-warn "drop any old tables\n";
-dropall();
-
-my $loop = 1000000;
-for my $k (0..($loop-1)) {
- warn "$k\n";
- createdrop();
- checkschemafiles();
- if (randomrestart($k)) {
- checkschemafiles();
- }
-}
-
-$dbh->disconnect or die $DBI::errstr;
-
-# vim: set sw=2:
=== removed file 'storage/ndb/test/sql/test_range_bounds.pl'
--- a/storage/ndb/test/sql/test_range_bounds.pl 2010-12-28 23:47:05 +0000
+++ b/storage/ndb/test/sql/test_range_bounds.pl 1970-01-01 00:00:00 +0000
@@ -1,235 +0,0 @@
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-#
-# test range scan bounds
-# give option --all to test all cases
-# set MYSQL_HOME to installation top
-#
-
-use strict;
-use integer;
-use Getopt::Long;
-use DBI;
-
-my $opt_all = 0;
-my $opt_cnt = 5;
-my $opt_verbose = 0;
-GetOptions("all" => \$opt_all, "cnt=i" => \$opt_cnt, "verbose" => \$opt_verbose)
- or die "options are: --all --cnt=N --verbose";
-
-my $mysql_home = $ENV{MYSQL_HOME};
-defined($mysql_home) or die "no MYSQL_HOME";
-my $dsn = "dbi:mysql:database=test;host=localhost;mysql_read_default_file=$mysql_home/var/my.cnf";
-my $opts = { RaiseError => 0, PrintError => 0, AutoCommit => 1, };
-
-my $dbh;
-my $sth;
-my $sql;
-
-$dbh = DBI->connect($dsn, "root", undef, $opts) or die $DBI::errstr;
-
-my $table = 't';
-
-$sql = "drop table if exists $table";
-$dbh->do($sql) or die $DBI::errstr;
-
-sub cut ($$$) {
- my($op, $key, $val) = @_;
- $op = '==' if $op eq '=';
- my(@w) = @$val;
- eval "\@w = grep(\$_ $op $key, \@w)";
- $@ and die $@;
- return [ @w ];
-}
-
-sub mkdummy ($) {
- my ($val) = @_;
- return {
- 'dummy' => 1,
- 'exp' => '9 = 9',
- 'res' => $val,
- };
-}
-
-sub mkone ($$$$) {
- my($col, $op, $key, $val) = @_;
- my $res = cut($op, $key, $val);
- return {
- 'exp' => "$col $op $key",
- 'res' => $res,
- };
-}
-
-sub mktwo ($$$$$$) {
- my($col, $op1, $key1, $op2, $key2, $val) = @_;
- my $res = cut($op2, $key2, cut($op1, $key1, $val));
- return {
- 'exp' => "$col $op1 $key1 and $col $op2 $key2",
- 'res' => $res,
- };
-}
-
-sub mkall ($$$$) {
- my($col, $key1, $key2, $val) = @_;
- my @a = ();
- my $p = mkdummy($val);
- push(@a, $p) if $opt_all;
- my @ops = qw(< <= = >= >);
- for my $op (@ops) {
- my $p = mkone($col, $op, $key1, $val);
- push(@a, $p) if $opt_all || @{$p->{res}} != 0;
- }
- my @ops1 = $opt_all ? @ops : qw(= >= >);
- my @ops2 = $opt_all ? @ops : qw(<= <);
- for my $op1 (@ops1) {
- for my $op2 (@ops2) {
- my $p = mktwo($col, $op1, $key1, $op2, $key2, $val);
- push(@a, $p) if $opt_all || @{$p->{res}} != 0;
- }
- }
- warn scalar(@a)." cases\n" if $opt_verbose;
- return \@a;
-}
-
-my $casecnt = 0;
-
-sub verify ($$$) {
- my($sql, $ord, $res) = @_;
- warn "$sql\n" if $opt_verbose;
- $sth = $dbh->prepare($sql) or die "prepare: $sql: $DBI::errstr";
- $sth->execute() or die "execute: $sql: $DBI::errstr";
- #
- # BUG: execute can return success on error so check again
- #
- $sth->err and die "execute: $sql: $DBI::errstr";
- my @out = ();
- for my $b (@{$res->[0]}) {
- for my $c (@{$res->[1]}) {
- for my $d (@{$res->[2]}) {
- push(@out, [$b, $c, $d]);
- }
- }
- }
- if ($ord) {
- @out = sort {
- $ord * ($a->[0] - $b->[0]) ||
- $ord * ($a->[1] - $b->[1]) ||
- $ord * ($a->[2] - $b->[2]) ||
- 0
- } @out;
- }
- my $cnt = scalar @out;
- my $n = 0;
- while (1) {
- my $row = $sth->fetchrow_arrayref;
- $row || last;
- @$row == 3 or die "bad row: $sql: @$row";
- for my $v (@$row) {
- $v =~ s/^\s+|\s+$//g;
- $v =~ /^\d+$/ or die "bad value: $sql: $v";
- }
- if ($ord) {
- my $out = $out[$n];
- $row->[0] == $out->[0] &&
- $row->[1] == $out->[1] &&
- $row->[2] == $out->[2] or
- die "$sql: row $n: got row @$row != @$out";
- }
- $n++;
- }
- $sth->err and die "fetch: $sql: $DBI::errstr";
- $n == $cnt or die "verify: $sql: got row count $n != $cnt";
- $casecnt++;
-}
-
-for my $nn ("bcd", "") {
- my %nn;
- for my $x (qw(b c d)) {
- $nn{$x} = $nn =~ /$x/ ? "not null" : "null";
- }
- warn "create table\n";
- $sql = <<EOF;
-create table $table (
- a int primary key,
- b int $nn{b},
- c int $nn{c},
- d int $nn{d},
- index (b, c, d)
-) engine=ndb
-EOF
- $dbh->do($sql) or die $DBI::errstr;
- warn "insert\n";
- $sql = "insert into $table values(?, ?, ?, ?)";
- $sth = $dbh->prepare($sql) or die $DBI::errstr;
- my @val = (0..($opt_cnt-1));
- my $v0 = 0;
- for my $v1 (@val) {
- for my $v2 (@val) {
- for my $v3 (@val) {
- $sth->bind_param(1, $v0) or die $DBI::errstr;
- $sth->bind_param(2, $v1) or die $DBI::errstr;
- $sth->bind_param(3, $v2) or die $DBI::errstr;
- $sth->bind_param(4, $v3) or die $DBI::errstr;
- $sth->execute or die $DBI::errstr;
- $v0++;
- }
- }
- }
- warn "generate cases\n";
- my $key1 = 1;
- my $key2 = 3;
- my $a1 = mkall('b', $key1, $key2, \@val);
- my $a2 = mkall('c', $key1, $key2, \@val);
- my $a3 = mkall('d', $key1, $key2, \@val);
- warn "select\n";
- for my $ord (0, +1, -1) {
- my $orderby =
- $ord == 0 ? "" :
- $ord == +1 ? " order by b, c, d" :
- $ord == -1 ? " order by b desc, c desc, d desc" : die "not here";
- for my $p1 (@$a1) {
- my $res = [ $p1->{res}, \@val, \@val ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- for my $p2 (@$a2) {
- my $res = [ $p1->{res}, $p2->{res}, \@val ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp} and $p2->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- for my $p3 (@$a3) {
- my $res = [ $p1->{res}, $p2->{res}, $p3->{res} ];
- $sql = "select b, c, d from $table" .
- " where $p1->{exp} and $p2->{exp} and $p3->{exp}" .
- $orderby;
- verify($sql, $ord, $res);
- }
- }
- }
- }
- warn "drop table\n";
- $sql = "drop table $table";
- $dbh->do($sql) or die $DBI::errstr;
-}
-
-warn "verified $casecnt cases\n";
-warn "done\n";
-
-# vim: set sw=2:
=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc 2010-08-26 15:45:25 +0000
+++ b/storage/perfschema/pfs.cc 2011-07-07 11:22:43 +0000
@@ -1574,6 +1574,9 @@ static void unlock_rwlock_v1(PSI_rwlock
aggregate_single_stat_chain(&pfs_rwlock->m_read_lock_stat, locked_time);
}
}
+#else
+ (void) last_reader;
+ (void) last_writer;
#endif
}
=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh 2011-06-30 15:46:53 +0000
+++ b/support-files/mysql.spec.sh 2011-07-07 15:27:44 +0000
@@ -721,13 +721,12 @@ else
fi
# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
if [ ! -d $mysql_datadir/mysql ] ; then
- mkdir $mysql_datadir/mysql;
+ mkdir $mysql_datadir/mysql $mysql_datadir/test
echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
else
# If the directory exists, we may assume it is an upgrade.
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
fi
-if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
@@ -762,7 +761,12 @@ chown -R %{mysqld_user}:%{mysqld_group}
# ----------------------------------------------------------------------
# Initiate databases if needed
# ----------------------------------------------------------------------
-%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
+ # Fix bug#45415: no "mysql_install_db" on an upgrade
+ # Do this as a negative to err towards more "install" runs
+ # rather than to miss one.
+ %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+fi
# ----------------------------------------------------------------------
# Upgrade databases if needed would go here - but it cannot be automated yet
@@ -1126,6 +1130,13 @@ echo "====="
# merging BK trees)
##############################################################################
%changelog
+* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@stripped>
+
+- Fix bug#45415: "rpm upgrade recreates test database"
+ Let the creation of the "test" database happen only during a new installation,
+ not in an RPM upgrade.
+ This affects both the "mkdir" and the call of "mysql_install_db".
+
* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@stripped>
- Fix bug#56581: If an installation deviates from the default file locations
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2011-07-03 23:48:19 +0000
+++ b/tests/mysql_client_test.c 2011-07-07 11:22:43 +0000
@@ -18596,11 +18596,8 @@ static void test_bug38486(void)
static void test_bug33831(void)
{
MYSQL *l_mysql;
- my_bool error;
DBUG_ENTER("test_bug33831");
-
- error= 0;
if (!(l_mysql= mysql_client_init(NULL)))
{
@@ -18623,9 +18620,8 @@ static void test_bug33831(void)
DIE_UNLESS(0);
}
-
mysql_close(l_mysql);
-
+
DBUG_VOID_RETURN;
}
=== modified file 'unittest/mysys/lf-t.c'
--- a/unittest/mysys/lf-t.c 2011-06-30 15:46:53 +0000
+++ b/unittest/mysys/lf-t.c 2011-07-07 11:22:43 +0000
@@ -34,8 +34,7 @@ int with_my_thread_init=0;
*/
pthread_handler_t test_lf_pinbox(void *arg)
{
- int m= *(int *)arg;
- int32 x= 0;
+ int m= *(int *)arg;
LF_PINS *pins;
if (with_my_thread_init)
@@ -43,7 +42,7 @@ pthread_handler_t test_lf_pinbox(void *a
pins= lf_pinbox_get_pins(&lf_allocator.pinbox);
- for (x= ((int)(intptr)(&m)); m ; m--)
+ for (; m ; m--)
{
lf_pinbox_put_pins(pins);
pins= lf_pinbox_get_pins(&lf_allocator.pinbox);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-mtr branch (bjorn.munch:3227 to 3229) | Bjorn Munch | 17 Jul |