#At file:///home/ram/mysql/mysql-next-mr-bugfixing/ based on revid:magne.mahre@stripped
3379 Ramil Kalimullin 2010-11-11 [merge]
Manual-merge from mysql-trunk-bugfixing.
Note: mysql-test/include/subquery.inc has been modified.
As we have some disabled (skipped) tests which include it,
their results must be adjusted when the tests are enabled.
E.g. subquery_all, subquery_nomat_nosj, subquery_none_jcl6.
modified:
cmake/install_layout.cmake
include/mysql/client_plugin.h
mysql-test/include/subquery.inc
mysql-test/r/sp-bugs.result
mysql-test/r/subquery_none.result
mysql-test/t/sp-bugs.test
mysys/default.c
sql-common/client.c
sql/item_func.cc
sql/sp_head.cc
sql/sql_union.cc
=== modified file 'cmake/install_layout.cmake'
--- a/cmake/install_layout.cmake 2010-10-11 17:44:35 +0000
+++ b/cmake/install_layout.cmake 2010-11-10 19:10:04 +0000
@@ -86,7 +86,7 @@ IF(UNIX)
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
CACHE PATH "install prefix" FORCE)
ENDIF()
- SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR5")
+ SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
IF(ind EQUAL -1)
MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
=== modified file 'include/mysql/client_plugin.h'
--- a/include/mysql/client_plugin.h 2010-10-13 15:11:29 +0000
+++ b/include/mysql/client_plugin.h 2010-11-10 15:55:57 +0000
@@ -79,8 +79,7 @@ struct st_mysql_client_plugin_AUTHENTICA
/**
loads a plugin and initializes it
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
@@ -100,8 +99,7 @@ mysql_load_plugin(struct st_mysql *mysql
This is the same as mysql_load_plugin, but take va_list instead of
a list of arguments.
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
@@ -118,8 +116,7 @@ mysql_load_plugin_v(struct st_mysql *mys
/**
finds an already loaded plugin by name, or loads it, if necessary
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded
=== modified file 'mysql-test/include/subquery.inc'
--- a/mysql-test/include/subquery.inc 2010-08-16 06:58:42 +0000
+++ b/mysql-test/include/subquery.inc 2010-11-11 09:40:06 +0000
@@ -4985,6 +4985,24 @@ SELECT i FROM t1 WHERE (1) NOT IN (SELEC
DROP TABLE t2;
DROP TABLE t1;
+
+--echo #
+--echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+--echo # Assertion `file' failed.
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--error ER_OPERAND_COLUMNS
+SELECT 1 FROM
+ (SELECT ROW(
+ (SELECT 1 FROM t1 RIGHT JOIN
+ (SELECT 1 FROM t1, t1 t2) AS d ON 1),
+ 1) FROM t1) AS e;
+
+DROP TABLE t1;
+
+
--echo End of 5.5 tests.
--echo #
@@ -5123,4 +5141,3 @@ WHERE ( 1, 2 ) IN ( SELECT SUBQUERY1_t1.
;
drop table t1;
-
=== modified file 'mysql-test/r/sp-bugs.result'
--- a/mysql-test/r/sp-bugs.result 2010-07-30 15:28:36 +0000
+++ b/mysql-test/r/sp-bugs.result 2010-11-11 05:06:16 +0000
@@ -75,4 +75,40 @@ CALL p1 ();
ERROR HY000: Trigger does not exist
DROP TABLE t1;
DROP PROCEDURE p1;
+#
+# Bug#54375: Error in stored procedure leaves connection
+# in different default schema
+#
+SET @@SQL_MODE = 'STRICT_ALL_TABLES';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1 (
+some_value int
+)
+RETURNS smallint
+DETERMINISTIC
+BEGIN
+INSERT INTO t1 SET c1 = some_value;
+RETURN(LAST_INSERT_ID());
+END$$
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db2;
+USE db2;
+SELECT DATABASE();
+DATABASE()
+db2
+SELECT db1.f1(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT DATABASE();
+DATABASE()
+db2
+USE test;
+DROP FUNCTION db1.f1;
+DROP TABLE db1.t1;
+DROP DATABASE db1;
+DROP DATABASE db2;
End of 5.1 tests
=== modified file 'mysql-test/r/subquery_none.result'
--- a/mysql-test/r/subquery_none.result 2010-09-10 09:38:40 +0000
+++ b/mysql-test/r/subquery_none.result 2010-11-11 09:40:06 +0000
@@ -6133,6 +6133,18 @@ id select_type table type possible_keys
2 DEPENDENT SUBQUERY t2 index_subquery k k 5 const 2 Using index
DROP TABLE t2;
DROP TABLE t1;
+#
+# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+# Assertion `file' failed.
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 FROM
+(SELECT ROW(
+(SELECT 1 FROM t1 RIGHT JOIN
+(SELECT 1 FROM t1, t1 t2) AS d ON 1),
+1) FROM t1) AS e;
+ERROR 21000: Operand should contain 1 column(s)
+DROP TABLE t1;
End of 5.5 tests.
#
# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
=== modified file 'mysql-test/t/sp-bugs.test'
--- a/mysql-test/t/sp-bugs.test 2010-02-13 10:35:14 +0000
+++ b/mysql-test/t/sp-bugs.test 2010-11-11 04:52:51 +0000
@@ -101,4 +101,41 @@ CALL p1 ();
DROP TABLE t1;
DROP PROCEDURE p1;
+--echo #
+--echo # Bug#54375: Error in stored procedure leaves connection
+--echo # in different default schema
+--echo #
+
+--disable_warnings
+SET @@SQL_MODE = 'STRICT_ALL_TABLES';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+CREATE FUNCTION f1 (
+ some_value int
+)
+RETURNS smallint
+DETERMINISTIC
+BEGIN
+ INSERT INTO t1 SET c1 = some_value;
+ RETURN(LAST_INSERT_ID());
+END$$
+DELIMITER ;$$
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db2;
+--enable_warnings
+USE db2;
+SELECT DATABASE();
+--error ER_DUP_ENTRY
+SELECT db1.f1(1);
+SELECT DATABASE();
+USE test;
+DROP FUNCTION db1.f1;
+DROP TABLE db1.t1;
+DROP DATABASE db1;
+DROP DATABASE db2;
--echo End of 5.1 tests
=== modified file 'mysys/default.c'
--- a/mysys/default.c 2010-11-05 15:12:46 +0000
+++ b/mysys/default.c 2010-11-10 11:48:00 +0000
@@ -279,7 +279,14 @@ int my_search_option_files(const char *c
group->type_names[group->count]= 0;
}
- if (my_defaults_file)
+ // If conf_file is an absolute path, we only read it
+ if (dirname_length(conf_file))
+ {
+ if ((error= search_default_file(func, func_ctx, NullS, conf_file)) < 0)
+ goto err;
+ }
+ // If my defaults file is set (from a previous run), we read it
+ else if (my_defaults_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
my_defaults_file, 0)) < 0)
@@ -291,11 +298,6 @@ int my_search_option_files(const char *c
goto err;
}
}
- else if (dirname_length(conf_file))
- {
- if ((error= search_default_file(func, func_ctx, NullS, conf_file)) < 0)
- goto err;
- }
else
{
for (dirs= default_directories ; *dirs; dirs++)
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c 2010-10-25 13:49:55 +0000
+++ b/sql-common/client.c 2010-11-11 09:40:06 +0000
@@ -4280,7 +4280,7 @@ static int native_password_auth_client(M
int pkt_len;
uchar *pkt;
- DBUG_ENTER ("native_password_auth_client");
+ DBUG_ENTER("native_password_auth_client");
if (((MCPVIO_EXT *)vio)->mysql_change_user)
@@ -4296,10 +4296,10 @@ static int native_password_auth_client(M
{
/* read the scramble */
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
- return CR_ERROR;
+ DBUG_RETURN(CR_ERROR);
if (pkt_len != SCRAMBLE_LENGTH + 1)
- DBUG_RETURN (CR_SERVER_HANDSHAKE_ERR);
+ DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
memcpy(mysql->scramble, pkt, SCRAMBLE_LENGTH);
@@ -4309,19 +4309,19 @@ static int native_password_auth_client(M
if (mysql->passwd[0])
{
char scrambled[SCRAMBLE_LENGTH + 1];
- DBUG_PRINT ("info", ("sending scramble"));
+ DBUG_PRINT("info", ("sending scramble"));
scramble(scrambled, (char*)pkt, mysql->passwd);
if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH))
- DBUG_RETURN (CR_ERROR);
+ DBUG_RETURN(CR_ERROR);
}
else
{
- DBUG_PRINT ("info", ("no password"));
+ DBUG_PRINT("info", ("no password"));
if (vio->write_packet(vio, 0, 0)) /* no password */
- DBUG_RETURN (CR_ERROR);
+ DBUG_RETURN(CR_ERROR);
}
- DBUG_RETURN (CR_OK);
+ DBUG_RETURN(CR_OK);
}
/**
@@ -4333,7 +4333,7 @@ static int old_password_auth_client(MYSQ
uchar *pkt;
int pkt_len;
- DBUG_ENTER ("old_password_auth_client");
+ DBUG_ENTER("old_password_auth_client");
if (((MCPVIO_EXT *)vio)->mysql_change_user)
{
@@ -4348,11 +4348,11 @@ static int old_password_auth_client(MYSQ
{
/* read the scramble */
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
- return CR_ERROR;
+ DBUG_RETURN(CR_ERROR);
if (pkt_len != SCRAMBLE_LENGTH_323 + 1 &&
pkt_len != SCRAMBLE_LENGTH + 1)
- DBUG_RETURN (CR_SERVER_HANDSHAKE_ERR);
+ DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */
memcpy(mysql->scramble, pkt, pkt_len);
@@ -4364,11 +4364,11 @@ static int old_password_auth_client(MYSQ
char scrambled[SCRAMBLE_LENGTH_323 + 1];
scramble_323(scrambled, (char*)pkt, mysql->passwd);
if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH_323 + 1))
- DBUG_RETURN (CR_ERROR);
+ DBUG_RETURN(CR_ERROR);
}
else
if (vio->write_packet(vio, 0, 0)) /* no password */
- DBUG_RETURN (CR_ERROR);
+ DBUG_RETURN(CR_ERROR);
- DBUG_RETURN (CR_OK);
+ DBUG_RETURN(CR_OK);
}
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2010-10-27 10:28:09 +0000
+++ b/sql/item_func.cc 2010-11-11 09:40:06 +0000
@@ -179,7 +179,14 @@ Item_func::fix_fields(THD *thd, Item **r
used_tables_cache= not_null_tables_cache= 0;
const_item_cache=1;
- if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
+ /*
+ Use stack limit of STACK_MIN_SIZE * 2 since
+ on some platforms a recursive call to fix_fields
+ requires more than STACK_MIN_SIZE bytes (e.g. for
+ MIPS, it takes about 22kB to make one recursive
+ call to Item_func::fix_fields())
+ */
+ if (check_stack_overrun(thd, STACK_MIN_SIZE * 2, buff))
return TRUE; // Fatal error if flag is set!
if (arg_count)
{ // Print purify happy
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2010-10-27 10:28:09 +0000
+++ b/sql/sp_head.cc 2010-11-11 09:40:06 +0000
@@ -1510,7 +1510,7 @@ sp_head::execute(THD *thd, bool merge_da
If the DB has changed, the pointer has changed too, but the
original thd->db will then have been freed
*/
- if (cur_db_changed && !thd->killed)
+ if (cur_db_changed && thd->killed != THD::KILL_CONNECTION)
{
/*
Force switching back to the saved current database, because it may be
=== modified file 'sql/sql_union.cc'
--- a/sql/sql_union.cc 2010-10-25 09:18:21 +0000
+++ b/sql/sql_union.cc 2010-11-11 09:40:06 +0000
@@ -455,6 +455,7 @@ bool st_select_lex_unit::prepare(THD *th
err:
thd_arg->lex->current_select= lex_select_save;
+ (void) cleanup();
DBUG_RETURN(TRUE);
}
No bundle (reason: revision is a merge).
| Thread |
|---|
| • bzr commit into mysql-next-mr branch (ramil:3379) | Ramil Kalimullin | 11 Nov |