Commit 0be4d2c0 authored by Davi Arnaut's avatar Davi Arnaut

Merge mysql-5.1-bugteam into mysql-5.1 main.

parents b467c15e f4313a4d
...@@ -88,11 +88,12 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ ...@@ -88,11 +88,12 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
mysqltest_SOURCES= mysqltest.c mysqltest_SOURCES= mysqltest.c
mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ mysqltest_LDADD = $(CXXLDFLAGS) \
@CLIENT_EXTRA_LDFLAGS@ \ @CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \ $(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \ $(top_builddir)/mysys/libmysys.a \
$(top_builddir)/regex/libregex.a $(top_builddir)/regex/libregex.a \
$(CLIENT_THREAD_LIBS)
mysql_upgrade_SOURCES= mysql_upgrade.c \ mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c $(top_srcdir)/mysys/my_getpagesize.c
......
...@@ -269,6 +269,10 @@ get_one_option(int optid, const struct my_option *opt, ...@@ -269,6 +269,10 @@ get_one_option(int optid, const struct my_option *opt,
} }
/**
Run a command using the shell, storing its output in the supplied dynamic
string.
*/
static int run_command(char* cmd, static int run_command(char* cmd,
DYNAMIC_STRING *ds_res) DYNAMIC_STRING *ds_res)
{ {
...@@ -341,37 +345,15 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) ...@@ -341,37 +345,15 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
} }
/* /**
Try to get the full path to this exceutable Look for the filename of given tool, with the presumption that it is in the
same directory as mysql_upgrade and that the same executable-searching
Return 0 if path found mechanism will be used when we run our sub-shells with popen() later.
*/ */
static void find_tool(char *tool_executable_name, const char *tool_name,
static my_bool get_full_path_to_executable(char* path) const char *self_name)
{ {
my_bool ret; char *last_fn_libchar;
DBUG_ENTER("get_full_path_to_executable");
#ifdef __WIN__
ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
#else
/* my_readlink returns 0 if a symlink was read */
ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
/* Might also want to try with /proc/$$/exe if the above fails */
#endif
DBUG_PRINT("exit", ("path: %s", path));
DBUG_RETURN(ret);
}
/*
Look for the tool in the same directory as mysql_upgrade.
*/
static void find_tool(char *tool_path, const char *tool_name)
{
size_t path_len;
char path[FN_REFLEN];
DYNAMIC_STRING ds_tmp; DYNAMIC_STRING ds_tmp;
DBUG_ENTER("find_tool"); DBUG_ENTER("find_tool");
DBUG_PRINT("enter", ("progname: %s", my_progname)); DBUG_PRINT("enter", ("progname: %s", my_progname));
...@@ -379,36 +361,24 @@ static void find_tool(char *tool_path, const char *tool_name) ...@@ -379,36 +361,24 @@ static void find_tool(char *tool_path, const char *tool_name)
if (init_dynamic_string(&ds_tmp, "", 32, 32)) if (init_dynamic_string(&ds_tmp, "", 32, 32))
die("Out of memory"); die("Out of memory");
/* Initialize path with the full path to this program */ last_fn_libchar= strrchr(self_name, FN_LIBCHAR);
if (get_full_path_to_executable(path))
if (last_fn_libchar == NULL)
{ {
/* /*
Easy way to get full executable path failed, try mysql_upgrade was found by the shell searching the path. A sibling
other methods next to us should be found the same way.
*/ */
if (my_progname[0] == FN_LIBCHAR) strncpy(tool_executable_name, tool_name, FN_REFLEN);
{
/* 1. my_progname contains full path */
strmake(path, my_progname, FN_REFLEN);
}
else if (my_progname[0] == '.')
{
/* 2. my_progname contains relative path, prepend wd */
char buf[FN_REFLEN];
my_getwd(buf, FN_REFLEN, MYF(0));
my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
} }
else else
{ {
/* 3. Just go for it and hope tool is in path */ int len;
path[0]= 0;
}
}
DBUG_PRINT("info", ("path: '%s'", path)); /*
mysql_upgrade was run absolutely or relatively. We can find a sibling
/* Chop off binary name (i.e mysql-upgrade) from path */ by replacing our name after the LIBCHAR with the new tool name.
dirname_part(path, path, &path_len); */
/* /*
When running in a not yet installed build and using libtool, When running in a not yet installed build and using libtool,
...@@ -418,38 +388,32 @@ static void find_tool(char *tool_path, const char *tool_name) ...@@ -418,38 +388,32 @@ static void find_tool(char *tool_path, const char *tool_name)
mysqlcheck). Thus if path ends in .libs/, step up one directory mysqlcheck). Thus if path ends in .libs/, step up one directory
and execute the tools from there and execute the tools from there
*/ */
path[max(path_len-1, 0)]= 0; /* Chop off last / */ if (((last_fn_libchar - 6) >= self_name) &&
if (strncmp(path + dirname_length(path), ".libs", 5) == 0) (strncmp(last_fn_libchar - 5, ".libs", 5) == 0) &&
(*(last_fn_libchar - 6) == FN_LIBCHAR))
{ {
DBUG_PRINT("info", ("Chopping off .libs from '%s'", path)); DBUG_PRINT("info", ("Chopping off \".libs\" from end of path"));
last_fn_libchar -= 6;
/* Chop off .libs */
dirname_part(path, path, &path_len);
} }
len= last_fn_libchar - self_name;
DBUG_PRINT("info", ("path: '%s'", path)); my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);
/* Format name of the tool to search for */ }
fn_format(tool_path, tool_name,
path, "", MYF(MY_REPLACE_DIR));
verbose("Looking for '%s' in: %s", tool_name, tool_path);
/* Make sure the tool exists */ verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
if (my_access(tool_path, F_OK) != 0)
die("Can't find '%s'", tool_path);
/* /*
Make sure it can be executed Make sure it can be executed
*/ */
if (run_tool(tool_path, if (run_tool(tool_executable_name,
&ds_tmp, /* Get output from command, discard*/ &ds_tmp, /* Get output from command, discard*/
"--help", "--help",
"2>&1", "2>&1",
IF_WIN("> NUL", "> /dev/null"), IF_WIN("> NUL", "> /dev/null"),
NULL)) NULL))
die("Can't execute '%s'", tool_path); die("Can't execute '%s'", tool_executable_name);
dynstr_free(&ds_tmp); dynstr_free(&ds_tmp);
...@@ -759,11 +723,20 @@ static const char *load_default_groups[]= ...@@ -759,11 +723,20 @@ static const char *load_default_groups[]=
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char self_name[FN_REFLEN];
MY_INIT(argv[0]); MY_INIT(argv[0]);
#ifdef __NETWARE__ #ifdef __NETWARE__
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif #endif
#if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
#endif
{
strncpy(self_name, argv[0], FN_REFLEN);
}
if (init_dynamic_string(&ds_args, "", 512, 256)) if (init_dynamic_string(&ds_args, "", 512, 256))
die("Out of memory"); die("Out of memory");
...@@ -789,10 +762,10 @@ int main(int argc, char **argv) ...@@ -789,10 +762,10 @@ int main(int argc, char **argv)
dynstr_append(&ds_args, " "); dynstr_append(&ds_args, " ");
/* Find mysql */ /* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql")); find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
/* Find mysqlcheck */ /* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck")); find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
/* /*
Read the mysql_upgrade_info file to check if mysql_upgrade Read the mysql_upgrade_info file to check if mysql_upgrade
......
...@@ -343,8 +343,8 @@ case $default_charset in ...@@ -343,8 +343,8 @@ case $default_charset in
default_charset_default_collation="ucs2_general_ci" default_charset_default_collation="ucs2_general_ci"
define(UCSC1, ucs2_general_ci ucs2_bin) define(UCSC1, ucs2_general_ci ucs2_bin)
define(UCSC2, ucs2_czech_ci ucs2_danish_ci) define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci) define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci)
define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci) define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci)
define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci) define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci) define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci) define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
...@@ -367,8 +367,8 @@ case $default_charset in ...@@ -367,8 +367,8 @@ case $default_charset in
else else
define(UTFC1, utf8_general_ci utf8_bin) define(UTFC1, utf8_general_ci utf8_bin)
define(UTFC2, utf8_czech_ci utf8_danish_ci) define(UTFC2, utf8_czech_ci utf8_danish_ci)
define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci) define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci)
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci) define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci)
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci) define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci) define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci) define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
......
...@@ -354,6 +354,7 @@ CREATE TABLE t7 (i INT NOT NULL, ...@@ -354,6 +354,7 @@ CREATE TABLE t7 (i INT NOT NULL,
connection master; connection master;
INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t1; let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1; let $diff_table_2=slave:test.t1;
...@@ -363,6 +364,7 @@ source include/diff_tables.inc; ...@@ -363,6 +364,7 @@ source include/diff_tables.inc;
connection master; connection master;
INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t2; let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2; let $diff_table_2=slave:test.t2;
...@@ -387,6 +389,7 @@ source include/wait_for_slave_to_start.inc; ...@@ -387,6 +389,7 @@ source include/wait_for_slave_to_start.inc;
connection master; connection master;
INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t4; let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4; let $diff_table_2=slave:test.t4;
...@@ -426,6 +429,7 @@ source include/wait_for_slave_to_start.inc; ...@@ -426,6 +429,7 @@ source include/wait_for_slave_to_start.inc;
connection master; connection master;
INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t7; let $diff_table_1=master:test.t7;
let $diff_table_2=slave:test.t7; let $diff_table_2=slave:test.t7;
......
...@@ -131,3 +131,49 @@ drop table t1; ...@@ -131,3 +131,49 @@ drop table t1;
select if(0, 18446744073709551610, 18446744073709551610); select if(0, 18446744073709551610, 18446744073709551610);
if(0, 18446744073709551610, 18446744073709551610) if(0, 18446744073709551610, 18446744073709551610)
18446744073709551610 18446744073709551610
CREATE TABLE t1(a DECIMAL(10,3));
SELECT t1.a,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
FROM t1;
a IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
End of 5.0 tests
...@@ -4398,4 +4398,15 @@ INSERT INTO t1 VALUES (1), (3); ...@@ -4398,4 +4398,15 @@ INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b a b
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.0 tests. CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
SELECT * FROM t1
WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
pk a
1 10
3 30
2 20
DROP TABLE t1,t2;
End of 5.1 tests.
...@@ -13,12 +13,7 @@ ...@@ -13,12 +13,7 @@
USE test; USE test;
--source suite/funcs_1/include/tb3.inc --source suite/funcs_1/include/tb3.inc
# This test cannot be used for the embedded server because we check here
# privilgeges.
--source include/not_embedded.inc
USE test;
--source suite/funcs_1/include/tb3.inc
--disable_abort_on_error --disable_abort_on_error
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
USE test; USE test;
--source suite/funcs_1/include/tb3.inc --source suite/funcs_1/include/tb3.inc
USE test;
--source suite/funcs_1/include/tb3.inc
# General setup for Trigger tests # General setup for Trigger tests
let $message= Testcase: 3.5:; let $message= Testcase: 3.5:;
......
...@@ -13,13 +13,6 @@ eval ...@@ -13,13 +13,6 @@ eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt' load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3; into table tb3;
USE test;
--source suite/funcs_1/include/tb3.inc
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
--disable_abort_on_error --disable_abort_on_error
......
...@@ -13,3 +13,4 @@ ...@@ -13,3 +13,4 @@
rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_redirect : Failure is sporadic and and the test is superfluous (mats)
rpl_innodb_bug28430 : Failure on Solaris Bug #36793 rpl_innodb_bug28430 : Failure on Solaris Bug #36793
rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild
rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main
Some of these tests allocate more than 4GB RAM.
So, assure that the machine on which the suite will be executed has more than 4GB RAM.
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
# Reference: # # Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# # # #
# Last Modification: #
# 2008-07-14 hhunger removed values for 64 bit platforms. #
# #
################################################################################ ################################################################################
--source include/load_sysvars.inc --source include/load_sysvars.inc
...@@ -77,9 +74,8 @@ SELECT @@session.query_prealloc_size = 8192; ...@@ -77,9 +74,8 @@ SELECT @@session.query_prealloc_size = 8192;
SET @@global.query_prealloc_size = 8192; SET @@global.query_prealloc_size = 8192;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@global.query_prealloc_size = 4294967295;
#SET @@global.query_prealloc_size = 4294967295; SELECT @@global.query_prealloc_size ;
#SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = 655354; SET @@global.query_prealloc_size = 655354;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
...@@ -93,9 +89,8 @@ SELECT @@global.query_prealloc_size ; ...@@ -93,9 +89,8 @@ SELECT @@global.query_prealloc_size ;
SET @@session.query_prealloc_size = 8192; SET @@session.query_prealloc_size = 8192;
SELECT @@session.query_prealloc_size ; SELECT @@session.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@session.query_prealloc_size = 4294967295;
#SET @@session.query_prealloc_size = 4294967295; SELECT @@session.query_prealloc_size ;
#SELECT @@session.query_prealloc_size ;
SET @@session.query_prealloc_size = 655345; SET @@session.query_prealloc_size = 655345;
SELECT @@session.query_prealloc_size ; SELECT @@session.query_prealloc_size ;
...@@ -114,9 +109,8 @@ SELECT @@global.query_prealloc_size ; ...@@ -114,9 +109,8 @@ SELECT @@global.query_prealloc_size ;
SET @@global.query_prealloc_size = -1024; SET @@global.query_prealloc_size = -1024;
SELECT @@global.query_prealloc_size ; SELECT @@global.query_prealloc_size ;
# Due to problems with 64 bit machines having less than 6 GB main memory. SET @@global.query_prealloc_size = 429496729533;
#SET @@global.query_prealloc_size = 429496729533; SELECT @@global.query_prealloc_size ;
#SELECT @@global.query_prealloc_size ;
--Error ER_PARSE_ERROR --Error ER_PARSE_ERROR
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment