Commit 1707d5e6 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint

into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint


mysql-test/mysql-test-run.pl:
  Auto merged
parents 6bc475c5 870b2e0a
452a92d0-31-8wSzSfZi165fcGcXPA 452a92d0-31-8wSzSfZi165fcGcXPA
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ
This diff is collapsed.
...@@ -2,8 +2,9 @@ This is a release of MySQL, a dual-license SQL database server. ...@@ -2,8 +2,9 @@ This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB. MySQL is brought to you by the MySQL team at MySQL AB.
License information can be found in these files: License information can be found in these files:
- For GPL (free) distributions, see the COPYING file. - For GPL (free) distributions, see the COPYING file and
- For commercial distributions, see the MySQLEULA.txt file. the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.
For further information about MySQL or additional documentation, see: For further information about MySQL or additional documentation, see:
...@@ -15,11 +16,10 @@ Some manual sections of special interest: ...@@ -15,11 +16,10 @@ Some manual sections of special interest:
- If you are migrating from an older version of MySQL, please read the - If you are migrating from an older version of MySQL, please read the
"Upgrading from..." section first! "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section. - To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installation chapter. - For installation instructions, see the Installing and Upgrading chapter.
- For future plans, see the TODO appendix. - For the new features/bugfix history, see the Change History appendix.
- For the new features/bugfix history, see the News appendix. - For the currently known bugs/misfeatures (known errors) see the Problems
- For the currently known bugs/misfeatures (known errors) see the problems and Common Errors appendix.
appendix.
- For a list of developers and other contributors, see the Credits - For a list of developers and other contributors, see the Credits
appendix. appendix.
......
...@@ -80,13 +80,13 @@ enum { ...@@ -80,13 +80,13 @@ enum {
OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES, OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES,
OPT_MARK_PROGRESS OPT_MARK_PROGRESS, OPT_CHARSETS_DIR
}; };
static int record= 0, opt_sleep= -1; static int record= 0, opt_sleep= -1;
static char *db= 0, *pass= 0; static char *db= 0, *pass= 0;
const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./"; const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./";
const char *opt_include= 0; const char *opt_include= 0, *opt_charsets_dir;
static int port= 0; static int port= 0;
static int opt_max_connect_retries; static int opt_max_connect_retries;
static my_bool opt_compress= 0, silent= 0, verbose= 0; static my_bool opt_compress= 0, silent= 0, verbose= 0;
...@@ -145,7 +145,6 @@ static struct st_test_file* file_stack_end; ...@@ -145,7 +145,6 @@ static struct st_test_file* file_stack_end;
static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */ static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */
static const char *charset_name= "latin1"; /* Default character set name */
static const char *embedded_server_groups[]= static const char *embedded_server_groups[]=
{ {
...@@ -3093,7 +3092,11 @@ void do_connect(struct st_command *command) ...@@ -3093,7 +3092,11 @@ void do_connect(struct st_command *command)
if (opt_compress || con_compress) if (opt_compress || con_compress)
mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS); mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name); mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
if (opt_use_ssl || con_ssl) if (opt_use_ssl || con_ssl)
...@@ -3779,6 +3782,9 @@ static struct my_option my_long_options[] = ...@@ -3779,6 +3782,9 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir, {"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir,
(gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.", (gptr*) &opt_charsets_dir,
(gptr*) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol.", {"compress", 'C', "Use the compressed server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
...@@ -5511,7 +5517,11 @@ int main(int argc, char **argv) ...@@ -5511,7 +5517,11 @@ int main(int argc, char **argv)
if (opt_compress) if (opt_compress)
mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name); mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
......
This diff is collapsed.
...@@ -4252,29 +4252,47 @@ fil_flush_file_spaces( ...@@ -4252,29 +4252,47 @@ fil_flush_file_spaces(
{ {
fil_system_t* system = fil_system; fil_system_t* system = fil_system;
fil_space_t* space; fil_space_t* space;
ulint* space_ids;
ulint n_space_ids;
ulint i;
mutex_enter(&(system->mutex)); mutex_enter(&(system->mutex));
space = UT_LIST_GET_FIRST(system->unflushed_spaces); n_space_ids = UT_LIST_GET_LEN(system->unflushed_spaces);
if (n_space_ids == 0) {
while (space) { mutex_exit(&system->mutex);
if (space->purpose == purpose && !space->is_being_deleted) { return;
}
space->n_pending_flushes++; /* prevent dropping of the /* Assemble a list of space ids to flush. Previously, we
space while we are traversed system->unflushed_spaces and called UT_LIST_GET_NEXT()
flushing */ on a space that was just removed from the list by fil_flush().
mutex_exit(&(system->mutex)); Thus, the space could be dropped and the memory overwritten. */
space_ids = mem_alloc(n_space_ids * sizeof *space_ids);
fil_flush(space->id); n_space_ids = 0;
mutex_enter(&(system->mutex)); for (space = UT_LIST_GET_FIRST(system->unflushed_spaces);
space;
space = UT_LIST_GET_NEXT(unflushed_spaces, space)) {
space->n_pending_flushes--; if (space->purpose == purpose && !space->is_being_deleted) {
space_ids[n_space_ids++] = space->id;
} }
space = UT_LIST_GET_NEXT(unflushed_spaces, space);
} }
mutex_exit(&(system->mutex)); mutex_exit(&system->mutex);
/* Flush the spaces. It will not hurt to call fil_flush() on
a non-existing space id. */
for (i = 0; i < n_space_ids; i++) {
fil_flush(space_ids[i]);
}
mem_free(space_ids);
} }
/********************************************************************** /**********************************************************************
......
...@@ -441,7 +441,6 @@ sub mtr_kill_leftovers () { ...@@ -441,7 +441,6 @@ sub mtr_kill_leftovers () {
# Only read pid from files that end with .pid # Only read pid from files that end with .pid
if ( $elem =~ /.*[.]pid$/) if ( $elem =~ /.*[.]pid$/)
{ {
my $pidfile= "$rundir/$elem"; my $pidfile= "$rundir/$elem";
if ( -f $pidfile ) if ( -f $pidfile )
...@@ -465,7 +464,8 @@ sub mtr_kill_leftovers () { ...@@ -465,7 +464,8 @@ sub mtr_kill_leftovers () {
} }
else else
{ {
mtr_warning("Found non pid file $elem in $rundir"); mtr_warning("Found non pid file $elem in $rundir")
if -f "$rundir/$elem";
next; next;
} }
} }
......
...@@ -190,7 +190,7 @@ our $opt_fast; ...@@ -190,7 +190,7 @@ our $opt_fast;
our $opt_force; our $opt_force;
our $opt_reorder= 0; our $opt_reorder= 0;
our $opt_enable_disabled; our $opt_enable_disabled;
our $opt_mem; our $opt_mem= $ENV{'MTR_MEM'};
our $opt_gcov; our $opt_gcov;
our $opt_gcov_err; our $opt_gcov_err;
...@@ -596,7 +596,7 @@ sub command_line_setup () { ...@@ -596,7 +596,7 @@ sub command_line_setup () {
'tmpdir=s' => \$opt_tmpdir, 'tmpdir=s' => \$opt_tmpdir,
'vardir=s' => \$opt_vardir, 'vardir=s' => \$opt_vardir,
'benchdir=s' => \$glob_mysql_bench_dir, 'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem, 'mem:s' => \$opt_mem,
# Misc # Misc
'comment=s' => \$opt_comment, 'comment=s' => \$opt_comment,
...@@ -738,17 +738,18 @@ sub command_line_setup () { ...@@ -738,17 +738,18 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Check if we should speed up tests by trying to run on tmpfs # Check if we should speed up tests by trying to run on tmpfs
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $opt_mem ) if ( defined $opt_mem )
{ {
mtr_error("Can't use --mem and --vardir at the same time ") mtr_error("Can't use --mem and --vardir at the same time ")
if $opt_vardir; if $opt_vardir;
mtr_error("Can't use --mem and --tmpdir at the same time ") mtr_error("Can't use --mem and --tmpdir at the same time ")
if $opt_tmpdir; if $opt_tmpdir;
# Use /dev/shm as the preferred location for vardir and # Search through list of locations that are known
# thus implicitly also tmpdir. Add other locations to list # to be "fast disks" to list to find a suitable location
my @tmpfs_locations= ("/dev/shm"); # Use --mem=<dir> as first location to look.
# One could maybe use "mount" to find tmpfs location(s) my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp");
foreach my $fs (@tmpfs_locations) foreach my $fs (@tmpfs_locations)
{ {
if ( -d $fs ) if ( -d $fs )
...@@ -2986,9 +2987,9 @@ sub analyze_testcase_failure_sync_with_master($) ...@@ -2986,9 +2987,9 @@ sub analyze_testcase_failure_sync_with_master($)
mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'}); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'});
mtr_add_arg($args, "--port=%d", $master->[0]->{'port'}); mtr_add_arg($args, "--port=%d", $master->[0]->{'port'});
...@@ -3359,6 +3360,11 @@ sub mysqld_arguments ($$$$$) { ...@@ -3359,6 +3360,11 @@ sub mysqld_arguments ($$$$$) {
if ( $opt_valgrind_mysqld ) if ( $opt_valgrind_mysqld )
{ {
mtr_add_arg($args, "%s--skip-safemalloc", $prefix); mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
if ( $mysql_version_id < 50100 )
{
mtr_add_arg($args, "%s--skip-bdb", $prefix);
}
} }
my $pidfile; my $pidfile;
...@@ -4167,9 +4173,9 @@ sub run_check_testcase ($$) { ...@@ -4167,9 +4173,9 @@ sub run_check_testcase ($$) {
mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'}); mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
mtr_add_arg($args, "--port=%d", $mysqld->{'port'}); mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
...@@ -4213,9 +4219,9 @@ sub run_mysqltest ($) { ...@@ -4213,9 +4219,9 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent"); mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
if ($tinfo->{'component_id'} eq 'im') if ($tinfo->{'component_id'} eq 'im')
{ {
...@@ -4300,13 +4306,11 @@ sub run_mysqltest ($) { ...@@ -4300,13 +4306,11 @@ sub run_mysqltest ($) {
if ( $opt_ssl ) if ( $opt_ssl )
{ {
# Turn on SSL for _all_ test cases if option --ssl was used # Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl", mtr_add_arg($args, "--ssl");
$glob_mysql_test_dir);
} }
elsif ( $opt_ssl_supported ) elsif ( $opt_ssl_supported )
{ {
mtr_add_arg($args, "--skip-ssl", mtr_add_arg($args, "--skip-ssl");
$glob_mysql_test_dir);
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -4641,9 +4645,12 @@ Options to control directories to use ...@@ -4641,9 +4645,12 @@ Options to control directories to use
vardir=DIR The directory where files generated from the test run vardir=DIR The directory where files generated from the test run
is stored (default: ./var). Specifying a ramdisk or is stored (default: ./var). Specifying a ramdisk or
tmpfs will speed up tests. tmpfs will speed up tests.
mem=DIR Run testsuite in "memory" using tmpfs if mem[=DIR] Run testsuite in "memory" using tmpfs or ramdisk
available(default: /dev/shm) Attempts to use DIR first if specified else
uses as builtin list of standard locations
for tmpfs (/dev/shm)
The option can also be set using environment
variable MTR_MEM=[DIR]
Options to control what test suites or cases to run Options to control what test suites or cases to run
......
...@@ -183,3 +183,78 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; ...@@ -183,3 +183,78 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
2 2 -2 -2 2 2 -2 -2
select (12%0) <=> null as '1';
1
1
select (12%0) is null as '1';
1
1
select 12%0 as 'NULL';
NULL
NULL
select 12%2 as '0';
0
0
select 12%NULL as 'NULL';
NULL
NULL
select 12 % null as 'NULL';
NULL
NULL
select null % 12 as 'NULL';
NULL
NULL
select null % 0 as 'NULL';
NULL
NULL
select 0 % null as 'NULL';
NULL
NULL
select null % null as 'NULL';
NULL
NULL
select (12 mod 0) <=> null as '1';
1
1
select (12 mod 0) is null as '1';
1
1
select 12 mod 0 as 'NULL';
NULL
NULL
select 12 mod 2 as '0';
0
0
select 12 mod null as 'NULL';
NULL
NULL
select null mod 12 as 'NULL';
NULL
NULL
select null mod 0 as 'NULL';
NULL
NULL
select 0 mod null as 'NULL';
NULL
NULL
select null mod null as 'NULL';
NULL
NULL
select mod(12.0, 0) as 'NULL';
NULL
NULL
select mod(12, 0.0) as 'NULL';
NULL
NULL
select mod(12, NULL) as 'NULL';
NULL
NULL
select mod(12.0, NULL) as 'NULL';
NULL
NULL
select mod(NULL, 2) as 'NULL';
NULL
NULL
select mod(NULL, 2.0) as 'NULL';
NULL
NULL
...@@ -108,4 +108,36 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; ...@@ -108,4 +108,36 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
#
# Bug#23411: The "%" (MOD) operator is not documented; MOD-ing zero returns strange result
# Manual: "Division by zero produces a NULL result"
#
select (12%0) <=> null as '1';
select (12%0) is null as '1';
select 12%0 as 'NULL';
select 12%2 as '0';
select 12%NULL as 'NULL';
select 12 % null as 'NULL';
select null % 12 as 'NULL';
select null % 0 as 'NULL';
select 0 % null as 'NULL';
select null % null as 'NULL';
select (12 mod 0) <=> null as '1';
select (12 mod 0) is null as '1';
select 12 mod 0 as 'NULL';
select 12 mod 2 as '0';
select 12 mod null as 'NULL';
select null mod 12 as 'NULL';
select null mod 0 as 'NULL';
select 0 mod null as 'NULL';
select null mod null as 'NULL';
select mod(12.0, 0) as 'NULL';
select mod(12, 0.0) as 'NULL';
select mod(12, NULL) as 'NULL';
select mod(12.0, NULL) as 'NULL';
select mod(NULL, 2) as 'NULL';
select mod(NULL, 2.0) as 'NULL';
# End of 4.1 tests # End of 4.1 tests
...@@ -105,7 +105,7 @@ copyfileto() ...@@ -105,7 +105,7 @@ copyfileto()
copyfileto $BASE/docs ChangeLog Docs/mysql.info copyfileto $BASE/docs ChangeLog Docs/mysql.info
copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \
EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW EXCEPTIONS-CLIENT LICENSE.mysql
# Non platform-specific bin dir files: # Non platform-specific bin dir files:
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
...@@ -282,10 +282,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then ...@@ -282,10 +282,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then
$BASE/support-files/build-tags \ $BASE/support-files/build-tags \
$BASE/support-files/MySQL-shared-compat.spec \ $BASE/support-files/MySQL-shared-compat.spec \
$BASE/support-files/ndb-config-2-node.ini \ $BASE/support-files/ndb-config-2-node.ini \
$BASE/INSTALL-BINARY \ $BASE/INSTALL-BINARY
$BASE/MySQLEULA.txt
else
rm -f $BASE/README.NW
fi fi
# Make safe_mysqld a symlink to mysqld_safe for backwards portability # Make safe_mysqld a symlink to mysqld_safe for backwards portability
......
...@@ -96,7 +96,7 @@ Item_func::Item_func(THD *thd, Item_func *item) ...@@ -96,7 +96,7 @@ Item_func::Item_func(THD *thd, Item_func *item)
/* /*
Resolve references to table column for a function and it's argument Resolve references to table column for a function and its argument
SYNOPSIS: SYNOPSIS:
fix_fields() fix_fields()
...@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int() ...@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int()
void Item_func_mod::fix_length_and_dec() void Item_func_mod::fix_length_and_dec()
{ {
Item_num_op::fix_length_and_dec(); Item_num_op::fix_length_and_dec();
maybe_null= 1;
} }
......
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