Commit 5343242c authored by iggy@rolltop.ignatz42.dyndns.org's avatar iggy@rolltop.ignatz42.dyndns.org

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

into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint
parents 5757c9ff c2aca91b
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.
MySQL is brought to you by the MySQL team at MySQL AB.
License information can be found in these files:
- For GPL (free) distributions, see the COPYING file.
- For commercial distributions, see the MySQLEULA.txt file.
- For GPL (free) distributions, see the COPYING file and
the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.
For further information about MySQL or additional documentation, see:
......@@ -15,11 +16,10 @@ Some manual sections of special interest:
- If you are migrating from an older version of MySQL, please read the
"Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installation chapter.
- For future plans, see the TODO appendix.
- For the new features/bugfix history, see the News appendix.
- For the currently known bugs/misfeatures (known errors) see the problems
appendix.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
appendix.
......
......@@ -80,13 +80,13 @@ enum {
OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
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 char *db= 0, *pass= 0;
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 opt_max_connect_retries;
static my_bool opt_compress= 0, silent= 0, verbose= 0;
......@@ -145,7 +145,6 @@ static struct st_test_file* file_stack_end;
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[]=
{
......@@ -3093,7 +3092,11 @@ void do_connect(struct st_command *command)
if (opt_compress || con_compress)
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_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
if (opt_use_ssl || con_ssl)
......@@ -3779,6 +3782,9 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir,
(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.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
......@@ -5511,7 +5517,11 @@ int main(int argc, char **argv)
if (opt_compress)
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_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
......
This diff is collapsed.
......@@ -4252,29 +4252,47 @@ fil_flush_file_spaces(
{
fil_system_t* system = fil_system;
fil_space_t* space;
ulint* space_ids;
ulint n_space_ids;
ulint i;
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) {
if (space->purpose == purpose && !space->is_being_deleted) {
mutex_exit(&system->mutex);
return;
}
space->n_pending_flushes++; /* prevent dropping of the
space while we are
flushing */
mutex_exit(&(system->mutex));
/* Assemble a list of space ids to flush. Previously, we
traversed system->unflushed_spaces and called UT_LIST_GET_NEXT()
on a space that was just removed from the list by fil_flush().
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)) {
if (space->purpose == purpose && !space->is_being_deleted) {
space->n_pending_flushes--;
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 () {
# Only read pid from files that end with .pid
if ( $elem =~ /.*[.]pid$/)
{
my $pidfile= "$rundir/$elem";
if ( -f $pidfile )
......@@ -465,7 +464,8 @@ sub mtr_kill_leftovers () {
}
else
{
mtr_warning("Found non pid file $elem in $rundir");
mtr_warning("Found non pid file $elem in $rundir")
if -f "$rundir/$elem";
next;
}
}
......
......@@ -190,7 +190,7 @@ our $opt_fast;
our $opt_force;
our $opt_reorder= 0;
our $opt_enable_disabled;
our $opt_mem;
our $opt_mem= $ENV{'MTR_MEM'};
our $opt_gcov;
our $opt_gcov_err;
......@@ -596,7 +596,7 @@ sub command_line_setup () {
'tmpdir=s' => \$opt_tmpdir,
'vardir=s' => \$opt_vardir,
'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem,
'mem:s' => \$opt_mem,
# Misc
'comment=s' => \$opt_comment,
......@@ -738,17 +738,18 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# 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 ")
if $opt_vardir;
mtr_error("Can't use --mem and --tmpdir at the same time ")
if $opt_tmpdir;
# Use /dev/shm as the preferred location for vardir and
# thus implicitly also tmpdir. Add other locations to list
my @tmpfs_locations= ("/dev/shm");
# One could maybe use "mount" to find tmpfs location(s)
# Search through list of locations that are known
# to be "fast disks" to list to find a suitable location
# Use --mem=<dir> as first location to look.
my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp");
foreach my $fs (@tmpfs_locations)
{
if ( -d $fs )
......@@ -2986,9 +2987,9 @@ sub analyze_testcase_failure_sync_with_master($)
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc");
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, "--port=%d", $master->[0]->{'port'});
......@@ -3359,6 +3360,11 @@ sub mysqld_arguments ($$$$$) {
if ( $opt_valgrind_mysqld )
{
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
if ( $mysql_version_id < 50100 )
{
mtr_add_arg($args, "%s--skip-bdb", $prefix);
}
}
my $pidfile;
......@@ -4167,9 +4173,9 @@ sub run_check_testcase ($$) {
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc");
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, "--port=%d", $mysqld->{'port'});
......@@ -4213,9 +4219,9 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--silent");
mtr_add_arg($args, "-v");
mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
if ($tinfo->{'component_id'} eq 'im')
{
......@@ -4300,13 +4306,11 @@ sub run_mysqltest ($) {
if ( $opt_ssl )
{
# Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl",
$glob_mysql_test_dir);
mtr_add_arg($args, "--ssl");
}
elsif ( $opt_ssl_supported )
{
mtr_add_arg($args, "--skip-ssl",
$glob_mysql_test_dir);
mtr_add_arg($args, "--skip-ssl");
}
# ----------------------------------------------------------------------
......@@ -4641,9 +4645,12 @@ Options to control directories to use
vardir=DIR The directory where files generated from the test run
is stored (default: ./var). Specifying a ramdisk or
tmpfs will speed up tests.
mem=DIR Run testsuite in "memory" using tmpfs if
available(default: /dev/shm)
mem[=DIR] Run testsuite in "memory" using tmpfs or ramdisk
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
......
......@@ -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;
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
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;
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
......@@ -105,7 +105,7 @@ copyfileto()
copyfileto $BASE/docs ChangeLog Docs/mysql.info
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:
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
......@@ -282,10 +282,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then
$BASE/support-files/build-tags \
$BASE/support-files/MySQL-shared-compat.spec \
$BASE/support-files/ndb-config-2-node.ini \
$BASE/INSTALL-BINARY \
$BASE/MySQLEULA.txt
else
rm -f $BASE/README.NW
$BASE/INSTALL-BINARY
fi
# Make safe_mysqld a symlink to mysqld_safe for backwards portability
......
......@@ -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:
fix_fields()
......@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int()
void Item_func_mod::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