Commit 3393fd19 authored by Andrei Elkin's avatar Andrei Elkin

merge from 5.1-bt to a local branch

parents f36a37af ec39e58d
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
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
......
......@@ -84,7 +84,7 @@ case $FLAG in
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("#include \"config.h\"\n#include \"el.h\"\n");
printf("private const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
......@@ -169,7 +169,7 @@ case $FLAG in
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#include \"sys.h\"\n#include \"el.h\"\n");
printf("#include \"config.h\"\n#include \"el.h\"\n");
printf("private const el_func_t el_func[] = {");
maxlen = 80;
needn = 1;
......
......@@ -51,13 +51,10 @@
#else
#include "np/vis.h"
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include "readline/readline.h"
#include "el.h"
#include "fcns.h" /* for EL_NUM_FCNS */
#include "histedit.h"
#include "readline/readline.h"
#include "filecomplete.h"
void rl_prep_terminal(int);
......
......@@ -66,7 +66,7 @@ typedef KEYMAP_ENTRY *Keymap;
#ifndef CTRL
#include <sys/ioctl.h>
#if !defined(__sun__) && !defined(__hpux__)
#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
......
......@@ -914,14 +914,14 @@ vi_comment_out(EditLine *el, int c)
* NB: posix implies that we should enter insert mode, however
* this is against historical precedent...
*/
#ifdef __weak_reference
#if defined(__weak_reference) && !defined(__FreeBSD__)
extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
#endif
protected el_action_t
/*ARGSUSED*/
vi_alias(EditLine *el, int c)
{
#ifdef __weak_reference
#if defined(__weak_reference) && !defined(__FreeBSD__)
char alias_name[3];
char *alias_text;
......
......@@ -302,7 +302,9 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
_MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
AC_SUBST([mysql_se_dirs])
AC_SUBST([mysql_se_distdirs])
AC_SUBST([mysql_pg_dirs])
AC_SUBST([mysql_pg_distdirs])
AC_SUBST([mysql_se_unittest_dirs])
AC_SUBST([mysql_pg_unittest_dirs])
AC_SUBST([condition_dependent_plugin_modules])
......@@ -354,6 +356,24 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
fi
AC_MSG_RESULT([no])
],[
# Plugin is not disabled, determine if it should be built,
# or only distributed
m4_ifdef([$6], [
if test ! -d "$srcdir/$6"; then
# Plugin directory was removed after autoconf was run; treat
# this as a disabled plugin
if test "X[$with_plugin_]$2" = Xyes; then
AC_MSG_RESULT([error])
AC_MSG_ERROR([disabled])
fi
# The result message will be printed below
[with_plugin_]$2=no
fi
])
m4_ifdef([$9],[
if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([error])
......@@ -372,6 +392,8 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
;;
esac
])
if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([no])
else
......@@ -448,28 +470,36 @@ dnl Although this is "pretty", it breaks libmysqld build
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
])
fi
m4_ifdef([$6],[
if test -n "$mysql_use_plugin_dir" ; then
mysql_plugin_dirs="$mysql_plugin_dirs $6"
m4_syscmd(test -f "$6/configure")
ifelse(m4_sysval, 0,
[AC_CONFIG_SUBDIRS($6)],
[AC_CONFIG_FILES($6/Makefile)]
)
ifelse(m4_substr($6, 0, 8), [storage/],
[
[mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)"
mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
],
m4_substr($6, 0, 7), [plugin/],
[
[mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)"
mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
],
[AC_FATAL([don't know how to handle plugin dir ]$6)])
fi
])
fi
m4_ifdef([$6], [
if test -d "$srcdir/$6"; then
# Even if we don't build a plugin, we bundle its source into the dist
# file. So its Makefile (and Makefiles for any subdirs) must be
# generated for 'make dist' to work.
m4_syscmd(test -f "$6/configure")
ifelse(m4_sysval, 0,
[AC_CONFIG_SUBDIRS($6)],
[AC_CONFIG_FILES($6/Makefile)]
)
ifelse(
m4_substr($6, 0, 8), [storage/], [
mysql_se_distdirs="$mysql_se_distdirs m4_substr($6, 8)"
if test -n "$mysql_use_plugin_dir" ; then
mysql_se_dirs="$mysql_se_dirs m4_substr($6, 8)"
mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
fi],
m4_substr($6, 0, 7), [plugin/], [
mysql_pg_distdirs="$mysql_pg_distdirs m4_substr($6, 7)"
if test -n "$mysql_use_plugin_dir" ; then
mysql_pg_dirs="$mysql_pg_dirs m4_substr($6, 7)"
mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
fi],
[AC_FATAL([don't know how to handle plugin dir ]$6)])
fi
])
])
])
......
......@@ -36,6 +36,7 @@ MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
MYSQL_COPYRIGHT_YEAR=`date '+%Y'`
# Add previous major version for debian package upgrade path
MYSQL_PREVIOUS_BASE_VERSION=5.0
......@@ -70,6 +71,7 @@ AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
AC_SUBST(MYSQL_COPYRIGHT_YEAR)
AC_SUBST(PROTOCOL_VERSION)
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
[mysql client protocol version])
......
......@@ -13,80 +13,42 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* See md5.c for explanation and copyright information. */
/* MD5.H - header file for MD5C.C
/*
* $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
/* Unlike previous versions of this code, uint32 need not be exactly
32 bits, merely 32 bits or more. Choosing a data type which is 32
bits instead of 64 is not important; speed is considerably more
important. ANSI guarantees that "unsigned long" will be big enough,
and always using it seems to have few disadvantages. */
typedef uint32 cvs_uint32;
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
/* GLOBAL.H - RSAREF types and constants
*/
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 0 if it has not already
been defined with C compiler flags.
*/
/* egcs 1.1.2 under linux didn't defined it.... :( */
#ifndef PROTOTYPES
#define PROTOTYPES 1 /* Assume prototypes */
#endif
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
typedef uint16 UINT2; /* Fix for MySQL / Alpha */
/* UINT4 defines a four byte word */
typedef uint32 UINT4; /* Fix for MySQL / Alpha */
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
returns an empty list.
*/
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif
/* MD5 context. */
typedef struct {
UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
unsigned char buffer[64]; /* input buffer */
} my_MD5_CTX;
cvs_uint32 buf[4];
cvs_uint32 bits[2];
unsigned char in[64];
} my_MD5Context;
#ifdef __cplusplus
extern "C" {
#endif
void my_MD5Init PROTO_LIST ((my_MD5_CTX *));
void my_MD5Update PROTO_LIST
((my_MD5_CTX *, unsigned char *, unsigned int));
void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *));
void my_MD5Init (my_MD5Context *context);
void my_MD5Update (my_MD5Context *context,
unsigned char const *buf, unsigned len);
void my_MD5Final (unsigned char digest[16],
my_MD5Context *context);
#ifdef __cplusplus
}
#endif
#define MY_MD5_HASH(digest,buf,len) \
do { \
my_MD5Context ctx; \
my_MD5Init (&ctx); \
my_MD5Update (&ctx, buf, len); \
my_MD5Final (digest, &ctx); \
} while (0)
......@@ -637,6 +637,7 @@ extern int nt_share_delete(const char *name,myf MyFlags);
extern void TERMINATE(FILE *file, uint flag);
#endif
extern void init_glob_errs(void);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags);
......
......@@ -71,17 +71,17 @@ SUBDIRS = lib/My/SafeProcess
EXTRA_DIST = README \
valgrind.supp \
$(test_SCRIPTS) \
$(nobase_test_DATA)
$(nobase_test_DATA)
# List of directories containing test + result files and the
# related test data files that should be copied
TEST_DIRS = t r include std_data std_data/parts \
TEST_DIRS = t r include std_data std_data/parts collections \
std_data/ndb_backup50 std_data/ndb_backup51 \
std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \
std_data/funcs_1 \
extra/binlog_tests/ extra/rpl_tests \
suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
suite/bugs/data suite/bugs/t suite/bugs/r \
suite/bugs suite/bugs/data suite/bugs/t suite/bugs/r \
suite/federated \
suite/funcs_1 suite/funcs_1/bitdata \
suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
......@@ -90,7 +90,7 @@ TEST_DIRS = t r include std_data std_data/parts \
suite/funcs_2 suite/funcs_2/charset suite/funcs_2/data \
suite/funcs_2/include suite/funcs_2/lib suite/funcs_2/r \
suite/funcs_2/t \
suite/jp suite/jp/t suite/jp/r suite/jp/std_data \
suite/jp suite/jp/t suite/jp/r suite/jp/std_data suite/jp/include \
suite/manual/t suite/manual/r \
suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
suite/rpl suite/rpl/data suite/rpl/include suite/rpl/r \
......
This directory contains collections of test runs that we run during our
integration and release testing. Each file contains zero or more lines,
with one invocation of mysql-test-run.pl on each. These invocations are
written so that, with the assumption that perl is in your search path,
any collection can run as a shell script or a batch file, with the parent
mysql-test directory being the current working directory.
During integration testing, we choose the collection to run by following
these steps:
1) We choose the extension to look for, based on these rules:
- If we're running a per-push test, we choose ".push" as the extension.
- If we're running a daily test, we choose ".daily" as the extension.
- If we're running a weekly test, we choose ".weekly" as the extension.
2) If there is a collection that has the same name as the branch we're
testing plus the extension as determined in step 1, we choose that
collection.
3) If the branch is unknown or we have removed all characters from it
and still not found a matching collection, we choose the name "default"
plus the extension determined in step 1. If there is no such file,
we give up and don't test anything at all.
4) If we haven't found a collection yet, we remove the last character from
the branch name and go back to step 2.
5) The commands from the collection are run line by line via execv() or
similar system calls. They are not run as a shell script. Shell
expansions are not guaranteed to work and most likely won't.
The .experimental files in this directory contain names of test cases that
are still in development and whose failures should be considered expected,
instead of regressions.
These files are to be used with the --experimental option of
mysql-test-run.pl. Please look at its help screen for usage information.
The syntax is as follows:
1) One line per test case.
2) Empty lines and lines starting with a hash (#) are ignored.
3) If any other line contains a blank followed by a hash (#), the hash
and any subsequent characters are ignored.
4) The full test case name including the suite and execution mode
must be specified, for example:
main.alias 'row' # bug#00000
5) As an exception to item 4, the last character of the test case
specification may be an asterisk (*). In that case, all test cases that
start with the same characters up to the last letter before the asterisk
are considered experimental:
main.a* # get rid of main.alias, main.alibaba and main.agliolio
perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental
funcs_1.charset_collation_1 # depends on compile-time decisions
perl mysql-test-run.pl --timer --force --comment=n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --comment=embedded --embedded --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --comment=rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
......@@ -26,7 +26,7 @@ create temporary table error_log (
) engine=myisam;
# Get the name of servers error log
let $log_error= query_get_value(show variables like 'log_error', Value, 1);
let $log_error= $MTR_LOG_ERROR;
let $log_warning= $log_error.warnings;
# Try tload the warnings into a temporary table,
......
......@@ -2,14 +2,23 @@
#
# SUMMARY
#
# Waits until the passed number ($count_sessions) of concurrent sessions was
# observed via
# Waits until the passed number ($count_sessions) of concurrent sessions or
# a smaller number was observed via
# SHOW STATUS LIKE 'Threads_connected'
# or the operation times out.
# Note: Starting with 5.1 we could also use
# SELECT COUNT(*) FROM information_schema.processlist
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
# runs in all versions 5.0+
# Note:
# 1. We wait for $current_sessions <= $count_sessions because in the use case
# with count_sessions.inc before and wait_until_count_sessions.inc after
# the core of the test it could happen that the disconnects of sessions
# belonging to the preceeding test are not finished.
# sessions at test begin($count_sessions) = m + n
# sessions of the previous test which will be soon disconnected = n (n >= 0)
# sessions at test end ($current sessions, assuming the test disconnects
# all additional sessions) = m
# 2. Starting with 5.1 we could also use
# SELECT COUNT(*) FROM information_schema.processlist
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
# runs in all versions 5.0+
#
#
# USAGE
......@@ -19,20 +28,20 @@
#
# OR typical example of a test which uses more than one session
# Such a test could harm successing tests if there is no server shutdown
# and start between.cw
# and start between.
#
# If the testing box is slow than the disconnect of sessions belonging to
# the current test might happen when the successing test gets executed.
# This means the successing test might see activities like unexpected
# rows within the general log or the PROCESSLIST.
# Example from bug http://bugs.mysql.com/bug.php?id=40377
# --- bzr_mysql-6.0-rpl/.../r/log_state.result
# --- bzr_mysql-6.0-rpl/.../r/log_state.result
# +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
# @@ -25,6 +25,7 @@
# event_time user_host ... command_type argument
# TIMESTAMP USER_HOST ... Query create table t1(f1 int)
# TIMESTAMP USER_HOST ... Query select * from mysql.general_log
# +TIMESTAMP USER_HOST ... Quit
# event_time user_host ... command_type argument
# TIMESTAMP USER_HOST ... Query create table t1(f1 int)
# TIMESTAMP USER_HOST ... Query select * from mysql.general_log
# +TIMESTAMP USER_HOST ... Quit
# ....
#
# What to do?
......@@ -79,7 +88,11 @@
# backup.test, grant3.test
#
#
# Created: 2009-01-14 mleich
# Created:
# 2009-01-14 mleich
# Modified:
# 2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
# random PB failures
#
let $wait_counter= 100;
......@@ -93,7 +106,7 @@ let $wait_timeout= 0;
while ($wait_counter)
{
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
let $success= `SELECT $current_sessions = $count_sessions`;
let $success= `SELECT $current_sessions <= $count_sessions`;
if ($success)
{
let $wait_counter= 0;
......@@ -107,7 +120,7 @@ while ($wait_counter)
if (!$success)
{
--echo # Timeout in wait_until_count_sessions.inc
--echo # Number of sessions expected: $count_sessions found: $current_sessions
--echo # Number of sessions expected: <= $count_sessions found: $current_sessions
SHOW PROCESSLIST;
}
......@@ -116,8 +116,8 @@ sub fix_tmpdir {
sub fix_log_error {
my ($self, $config, $group_name, $group)= @_;
my $dir= dirname($group->value('datadir'));
return "$dir/mysqld.err";
my $dir= $self->{ARGS}->{vardir};
return "$dir/log/$group_name.err";
}
sub fix_log {
......@@ -203,7 +203,7 @@ my @mysqld_rules=
{ '#host' => \&fix_host },
{ 'port' => \&fix_port },
{ 'socket' => \&fix_socket },
{ 'log-error' => \&fix_log_error },
{ '#log-error' => \&fix_log_error },
{ 'log' => \&fix_log },
{ 'log-slow-queries' => \&fix_log_slow_queries },
{ '#user' => sub { return shift->{ARGS}->{user} || ""; } },
......@@ -389,7 +389,7 @@ sub post_check_embedded_group {
my @no_copy =
(
'log-error', # Embedded server writes stderr to mysqltest's log file
'#log-error', # Embedded server writes stderr to mysqltest's log file
'slave-net-timeout', # Embedded server are not build with replication
);
......
......@@ -113,8 +113,8 @@ sub check_socket_path_length {
# Create a tempfile name with same length as "path"
my $tmpdir = tempdir( CLEANUP => 0);
my $len = length($path) - length($tmpdir);
my $testfile = $tmpdir . "x" x ($len > 0 ? $len : 1);
my $len = length($path) - length($tmpdir) - 1;
my $testfile = $tmpdir . "/" . "x" x ($len > 0 ? $len : 1);
my $sock;
eval {
$sock= new IO::Socket::UNIX
......@@ -126,17 +126,15 @@ sub check_socket_path_length {
die "Could not create UNIX domain socket: $!"
unless defined $sock;
die "UNIX domain socket patch was truncated"
die "UNIX domain socket path was truncated"
unless ($testfile eq $sock->hostpath());
$truncated= 0; # Yes, it worked!
};
#print "check_socket_path_length, failed: ", $@, '\n' if ($@);
$sock= undef; # Close socket
unlink($testfile); # Remove the physical file
rmdir($tmpdir); # Remove the tempdir
rmtree($tmpdir); # Remove the tempdir and any socket file created
return $truncated;
}
......
......@@ -117,6 +117,7 @@ sub new {
my $output = delete($opts{'output'});
my $error = delete($opts{'error'});
my $verbose = delete($opts{'verbose'});
my $nocore = delete($opts{'nocore'});
my $host = delete($opts{'host'});
my $shutdown = delete($opts{'shutdown'});
my $user_data= delete($opts{'user_data'});
......@@ -137,6 +138,7 @@ sub new {
push(@safe_args, $safe_script) if defined $safe_script;
push(@safe_args, "--verbose") if $verbose > 0;
push(@safe_args, "--nocore") if $nocore;
# Point the safe_process at the right parent if running on cygwin
push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
......
......@@ -45,6 +45,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/resource.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdio.h>
......@@ -149,7 +150,8 @@ int main(int argc, char* const argv[] )
char* const* child_argv= 0;
pid_t own_pid= getpid();
pid_t parent_pid= getppid();
bool nocore = false;
/* Install signal handlers */
signal(SIGTERM, handle_signal);
signal(SIGINT, handle_signal);
......@@ -181,6 +183,9 @@ int main(int argc, char* const argv[] )
start++; /* Step past = */
if ((parent_pid= atoi(start)) == 0)
die("Invalid value '%s' passed to --parent-id", start);
} else if ( strcmp(arg, "--nocore") == 0 )
{
nocore = true; // Don't allow the process to dump core
}
else
die("Unknown option: %s", arg);
......@@ -218,6 +223,15 @@ int main(int argc, char* const argv[] )
// it and any childs(that hasn't changed group themself)
setpgid(0, 0);
if (nocore)
{
struct rlimit corelim = { 0, 0 };
if (setrlimit (RLIMIT_CORE, &corelim) < 0)
{
message("setrlimit failed, errno=%d", errno);
}
}
// Signal that child is ready
buf= 37;
write(pfd[1], &buf, 1);
......
......@@ -69,6 +69,8 @@ sub _mtr_report_test_name ($) {
print _name(), _timestamp();
printf "%-40s ", $tname;
return $tname;
}
......@@ -105,20 +107,48 @@ sub mtr_report_test_passed ($) {
sub mtr_report_test ($) {
my ($tinfo)= @_;
_mtr_report_test_name($tinfo);
my $test_name = _mtr_report_test_name($tinfo);
my $comment= $tinfo->{'comment'};
my $logfile= $tinfo->{'logfile'};
my $warnings= $tinfo->{'warnings'};
my $result= $tinfo->{'result'};
my $retry= $tinfo->{'retries'} ? "retry-" : "";
if ($result eq 'MTR_RES_FAILED'){
my $timest = format_time();
my $fail = "fail";
if ( $::opt_experimental )
{
# Find out if this test case is an experimental one, so we can treat
# the failure as an expected failure instead of a regression.
for my $exp ( @$::experimental_test_cases ) {
if ( $exp ne $test_name ) {
# if the expression is not the name of this test case, but has
# an asterisk at the end, determine if the characters up to
# but excluding the asterisk are the same
if ( $exp ne "" && substr($exp, -1, 1) eq "*" ) {
$exp = substr($exp, 0, length($exp) - 1);
if ( substr($test_name, 0, length($exp)) ne $exp ) {
# no match, try next entry
next;
}
# if yes, fall through to set the exp-fail status
} else {
# no match, try next entry
next;
}
}
$fail = "exp-fail";
last;
}
}
if ( $warnings )
{
mtr_report("[ fail ] Found warnings/errors in server log file!");
mtr_report("[ $retry$fail ] Found warnings/errors in server log file!");
mtr_report(" Test ended at $timest");
mtr_report($warnings);
return;
......@@ -126,14 +156,14 @@ sub mtr_report_test ($) {
my $timeout= $tinfo->{'timeout'};
if ( $timeout )
{
mtr_report("[ fail ] timeout after $timeout seconds");
mtr_report("[ $retry$fail ] timeout after $timeout seconds");
mtr_report(" Test ended at $timest");
mtr_report("\n$tinfo->{'comment'}");
return;
}
else
{
mtr_report("[ fail ]\n Test ended at $timest");
mtr_report("[ $retry$fail ]\n Test ended at $timest");
}
if ( $logfile )
......@@ -176,7 +206,7 @@ sub mtr_report_test ($) {
{
my $timer_str= $tinfo->{timer} || "";
$tot_real_time += ($timer_str/1000);
mtr_report("[ pass ] ", sprintf("%5s", $timer_str));
mtr_report("[ ${retry}pass ] ", sprintf("%5s", $timer_str));
# Show any problems check-testcase found
if ( defined $tinfo->{'check'} )
......
......@@ -188,6 +188,8 @@ sub mtr_release_unique_id($) {
flock SEM, LOCK_UN or warn "can't unlock $file.sem";
close SEM;
delete $mtr_unique_ids{$$};
}
......
......@@ -110,8 +110,8 @@ my $opt_tmpdir; # Path to use for tmp/ dir
my $opt_tmpdir_pid;
END {
if (defined $opt_tmpdir_pid and
$opt_tmpdir_pid == $$){
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{
# Remove the tempdir this process has created
mtr_verbose("Removing tmpdir '$opt_tmpdir");
rmtree($opt_tmpdir);
......@@ -181,12 +181,18 @@ our $opt_client_debugger;
my $config; # The currently running config
my $current_config_name; # The currently running config file template
our $opt_experimental;
our $experimental_test_cases;
my $baseport;
my $opt_build_thread= $ENV{'MTR_BUILD_THREAD'} || "auto";
my $build_thread= 0;
my $opt_record;
my $opt_report_features;
my $opt_skip_core;
our $opt_check_testcases= 1;
my $opt_mark_progress;
......@@ -677,14 +683,9 @@ sub run_worker ($) {
report_option('name',"worker[$thread_num]");
# --------------------------------------------------------------------------
# Use auto build thread in all but first worker
# Set different ports per thread
# --------------------------------------------------------------------------
set_build_thread_ports($thread_num > 1 ? 'auto' : $opt_build_thread);
if (check_ports_free()){
# Some port was not free(which one has already been printed)
mtr_error("Some port(s) was not free")
}
set_build_thread_ports($thread_num);
# --------------------------------------------------------------------------
# Turn off verbosity in workers, unless explicitly specified
......@@ -804,7 +805,7 @@ sub command_line_setup {
'big-test' => \$opt_big_test,
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \$opt_experimental,
'skip-im' => \&ignore_option,
# Specify ports
......@@ -944,12 +945,12 @@ sub command_line_setup {
}
# Look for language files and charsetsdir, use same share
my $path_share= mtr_path_exists("$basedir/share/mysql",
"$basedir/sql/share",
"$basedir/share");
$path_language= mtr_path_exists("$basedir/share/mysql/english",
"$basedir/sql/share/english",
"$basedir/share/english");
$path_language= mtr_path_exists("$path_share/english");
my $path_share= dirname($path_language);
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
if (using_extern())
......@@ -971,6 +972,33 @@ sub command_line_setup {
mtr_print_thick_line('#');
}
if ( $opt_experimental )
{
# read the list of experimental test cases from the file specified on
# the command line
open(FILE, "<", $opt_experimental) or mtr_error("Can't read experimental file: $opt_experimental");
mtr_report("Using experimental file: $opt_experimental");
$experimental_test_cases = [];
while(<FILE>) {
chomp;
# remove comments (# foo) at the beginning of the line, or after a
# blank at the end of the line
s/( +|^)#.*$//;
# remove whitespace
s/^ +//;
s/ +$//;
# if nothing left, don't need to remember this line
if ( $_ eq "" ) {
next;
}
# remember what is left as the name of another test case that should be
# treated as experimental
print " - $_\n";
push @$experimental_test_cases, $_;
}
close FILE;
}
foreach my $arg ( @ARGV )
{
if ( $arg =~ /^--skip-/ )
......@@ -1094,6 +1122,14 @@ sub command_line_setup {
$opt_shutdown_timeout= 0; # Kill processes instead of nice shutdown
}
# --------------------------------------------------------------------------
# Check parallel value
# --------------------------------------------------------------------------
if ($opt_parallel < 1)
{
mtr_error("0 or negative parallel value makes no sense, use positive number");
}
# --------------------------------------------------------------------------
# Record flag
# --------------------------------------------------------------------------
......@@ -1283,18 +1319,32 @@ sub command_line_setup {
# But a fairly safe range seems to be 5001 - 32767
#
sub set_build_thread_ports($) {
my $build_thread= shift || 0;
my $thread= shift || 0;
if ( lc($build_thread) eq 'auto' ) {
#mtr_report("Requesting build thread... ");
$build_thread= mtr_get_unique_id(250, 299);
if ( !defined $build_thread ) {
mtr_error("Could not get a unique build thread id");
if ( lc($opt_build_thread) eq 'auto' ) {
my $found_free = 0;
$build_thread = 250; # Start attempts from here
while (! $found_free)
{
$build_thread= mtr_get_unique_id($build_thread, 299);
if ( !defined $build_thread ) {
mtr_error("Could not get a unique build thread id");
}
$found_free= check_ports_free($build_thread);
# If not free, release and try from next number
mtr_release_unique_id($build_thread++) unless $found_free;
}
#mtr_report(" - got $build_thread");
}
else
{
$build_thread = $opt_build_thread + $thread - 1;
}
$ENV{MTR_BUILD_THREAD}= $build_thread;
$opt_build_thread= $build_thread;
if (! check_ports_free($build_thread)) {
# Some port was not free(which one has already been printed)
mtr_error("Some port(s) was not free")
}
# Calculate baseport
$baseport= $build_thread * 10 + 10000;
......@@ -2448,22 +2498,18 @@ sub kill_leftovers ($) {
# Check that all the ports that are going to
# be used are free
#
sub check_ports_free
sub check_ports_free ($)
{
my @ports_to_check;
for ($baseport..$baseport+9){
push(@ports_to_check, $_);
}
#mtr_report("Checking ports...");
# print "@ports_to_check\n";
foreach my $port (@ports_to_check){
if (mtr_ping_port($port)){
mtr_report(" - 'localhost:$port' was not free");
return 1; # One port was not free
my $bthread= shift;
my $portbase = $bthread * 10 + 10000;
for ($portbase..$portbase+9){
if (mtr_ping_port($_)){
mtr_report(" - 'localhost:$_' was not free");
return 0; # One port was not free
}
}
return 0; # All ports free
return 1; # All ports free
}
......@@ -3482,7 +3528,10 @@ sub start_check_warnings ($$) {
my $name= "warnings-".$mysqld->name();
extract_warning_lines($mysqld->value('log-error'));
my $log_error= $mysqld->value('#log-error');
# To be communicated to the test
$ENV{MTR_LOG_ERROR}= $log_error;
extract_warning_lines($log_error);
my $args;
mtr_init_args(\$args);
......@@ -3957,6 +4006,7 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "%s", $arg);
}
}
$opt_skip_core = $found_skip_core;
if ( !$found_skip_core )
{
mtr_add_arg($args, "%s", "--core-file");
......@@ -3996,6 +4046,12 @@ sub mysqld_start ($$) {
$path_vardir_trace, $mysqld->name());
}
if (IS_WINDOWS)
{
# Trick the server to send output to stderr, with --console
mtr_add_arg($args, "--console");
}
if ( $opt_gdb || $opt_manual_gdb )
{
gdb_arguments(\$args, \$exe, $mysqld->name());
......@@ -4028,7 +4084,7 @@ sub mysqld_start ($$) {
# Remove the old pidfile if any
unlink($mysqld->value('pid-file'));
my $output= $mysqld->value('log-error');
my $output= $mysqld->value('#log-error');
if ( $opt_valgrind and $opt_debug )
{
# When both --valgrind and --debug is selected, send
......@@ -4048,6 +4104,7 @@ sub mysqld_start ($$) {
error => $output,
append => 1,
verbose => $opt_verbose,
nocore => $opt_skip_core,
host => undef,
shutdown => sub { mysqld_stop($mysqld) },
);
......@@ -4100,12 +4157,6 @@ sub server_need_restart {
return 0;
}
if ( $opt_embedded_server )
{
mtr_verbose_restart($server, "no start or restart for embedded server");
return 0;
}
if ( $tinfo->{'force_restart'} ) {
mtr_verbose_restart($server, "forced in .opt file");
return 1;
......@@ -4335,7 +4386,7 @@ sub start_servers($) {
# Already started
# Write start of testcase to log file
mark_log($mysqld->value('log-error'), $tinfo);
mark_log($mysqld->value('#log-error'), $tinfo);
next;
}
......@@ -4394,7 +4445,7 @@ sub start_servers($) {
mkpath($tmpdir) unless -d $tmpdir;
# Write start of testcase to log file
mark_log($mysqld->value('log-error'), $tinfo);
mark_log($mysqld->value('#log-error'), $tinfo);
# Run <tname>-master.sh
if ($mysqld->option('#!run-master-sh') and
......@@ -4445,7 +4496,7 @@ sub start_servers($) {
$tinfo->{comment}=
"Failed to start ".$mysqld->name();
my $logfile= $mysqld->value('log-error');
my $logfile= $mysqld->value('#log-error');
if ( defined $logfile and -f $logfile )
{
$tinfo->{logfile}= mtr_fromfile($logfile);
......
......@@ -188,7 +188,7 @@ DROP USER mysqltest_u1@localhost;
# -- End of Bug#33507.
# -- Bug#35074: max_used_connections is not correct.
# -- Bug#35074: max_used_connections is not correct.
FLUSH STATUS;
......
drop table if exists t1;
create table t1 (a int) engine=innodb;
start transaction with consistent snapshot;
insert into t1 values(1);
select * from t1;
DROP TABLE IF EXISTS t1;
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
# Switch to connection con1
CREATE TABLE t1 (a INT) ENGINE=innodb;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
# Switch to connection con2
INSERT INTO t1 VALUES(1);
# Switch to connection con1
SELECT * FROM t1;
a
commit;
delete from t1;
start transaction;
insert into t1 values(1);
select * from t1;
COMMIT;
DELETE FROM t1;
START TRANSACTION;
# Switch to connection con2
INSERT INTO t1 VALUES(1);
# Switch to connection con1
SELECT * FROM t1;
a
1
commit;
drop table t1;
COMMIT;
# Switch to connection default + close connections con1 and con2
DROP TABLE t1;
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
select * from t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
n
1
2
3
drop table t1;
DROP TABLE t1;
......@@ -736,6 +736,17 @@ select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mo
select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS;
event_name originator
ev1 4294967295
DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
SET @@global.concurrent_insert= @concurrent_insert;
......@@ -155,6 +155,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT PRIMARY KEY);
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
ERROR 42000: Key 'a' doesn't exist in table 't1'
DROP TABLE t1;
#
# Bug#37870: Usage of uninitialized value caused failed assertion.
#
......@@ -182,3 +186,4 @@ dt
2001-01-01 01:01:01
2001-01-01 01:01:01
drop tables t1, t2;
End of 5.1 tests.
drop table if exists t1;
create table t1 (a int) engine=innodb;
begin;
insert into t1 values(1);
flush tables with read lock;
select * from t1;
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
# Establish connection con3 (user=root)
# Switch to connection con1
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES(1);
# Switch to connection con2
FLUSH TABLES WITH READ LOCK;
SELECT * FROM t1;
a
commit;
select * from t1;
# Switch to connection con1
COMMIT;
# Switch to connection con2
SELECT * FROM t1;
a
unlock tables;
begin;
select * from t1 for update;
UNLOCK TABLES;
# Switch to connection con1
# Switch to connection con1
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
begin;
select * from t1 for update;
flush tables with read lock;
commit;
# Switch to connection con2
BEGIN;
SELECT * FROM t1 FOR UPDATE;
# Switch to connection con3
FLUSH TABLES WITH READ LOCK;
# Switch to connection con1
COMMIT;
# Switch to connection con2
a
1
unlock tables;
commit;
begin;
insert into t1 values(10);
flush tables with read lock;
commit;
unlock tables;
flush tables with read lock;
unlock tables;
begin;
select * from t1;
# Switch to connection con3
UNLOCK TABLES;
# Switch to connection con2
COMMIT;
# Switch to connection con1
BEGIN;
INSERT INTO t1 VALUES(10);
FLUSH TABLES WITH READ LOCK;
COMMIT;
UNLOCK TABLES;
# Switch to connection con2
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
BEGIN;
SELECT * FROM t1;
a
1
10
show create database test;
SHOW CREATE DATABASE test;
Database Create Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1;
DROP TABLE t1;
# Switch to connection default and close connections con1, con2, con3
create table t1 (a int) engine=innodb;
reset master;
set autocommit=0;
insert t1 values (1);
flush tables with read lock;
show master status;
# Establish connection con1 (user=root)
# Establish connection con2 (user=root)
# Switch to connection con1
CREATE TABLE t1 (a INT) ENGINE=innodb;
RESET MASTER;
SET AUTOCOMMIT=0;
INSERT t1 VALUES (1);
# Switch to connection con2
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
commit;
show master status;
# Switch to connection con1
COMMIT;
# Switch to connection con2
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
unlock tables;
drop table t1;
set autocommit=1;
UNLOCK TABLES;
# Switch to connection con1
DROP TABLE t1;
SET AUTOCOMMIT=1;
# Switch to connection default and close connections con1 and con2
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
drop table if exists t1;
create table t1 (kill_id int);
insert into t1 values(connection_id());
flush tables with read lock;
select ((@id := kill_id) - kill_id) from t1;
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (kill_id INT);
INSERT INTO t1 VALUES(connection_id());
FLUSH TABLES WITH READ LOCK;
SELECT ((@id := kill_id) - kill_id) FROM t1;
((@id := kill_id) - kill_id)
0
kill connection @id;
drop table t1;
set @@global.concurrent_insert= @old_concurrent_insert;
KILL CONNECTION @id;
DROP TABLE t1;
SET @@global.concurrent_insert= @old_concurrent_insert;
......@@ -579,3 +579,291 @@ c1
18446744073709551610
18446744073709551615
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
SELECT * FROM t1;
c1 c2
1 1
2 2
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
SELECT * FROM t1;
c1 c2
1 1
2 2
INSERT INTO t1 VALUES(NULL, 3);
INSERT INTO t1 VALUES(NULL, 4);
SELECT * FROM t1;
c1 c2
1 1
2 2
3 3
4 4
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
SELECT * FROM t1;
c1 c2
1 1
2 2
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
SELECT * FROM t1;
c1 c2
1 1
2 2
INSERT INTO t1 VALUES(NULL, 3);
INSERT INTO t1 VALUES(NULL, 4);
SELECT * FROM t1;
c1 c2
1 1
2 2
3 3
4 4
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t1 (
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
b INT(10) UNSIGNED NOT NULL,
c ENUM('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (a)) ENGINE = InnoDB;
CREATE TABLE t2 (
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
n INT(10) UNSIGNED NOT NULL,
o enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (m)) ENGINE = InnoDB;
INSERT INTO t2 (n,o) VALUES
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`m` int(11) unsigned NOT NULL AUTO_INCREMENT,
`n` int(10) unsigned NOT NULL,
`o` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`m`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
30 1 FALSE
31 2 FALSE
32 3 FALSE
33 4 FALSE
34 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
30 1 FALSE
31 2 FALSE
32 3 FALSE
33 4 FALSE
34 5 FALSE
37 1 FALSE
38 2 FALSE
39 3 FALSE
40 4 FALSE
41 5 FALSE
44 1 FALSE
45 2 FALSE
46 3 FALSE
47 4 FALSE
48 5 FALSE
51 1 FALSE
52 2 FALSE
53 3 FALSE
54 4 FALSE
55 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t1(
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
CREATE TABLE t2(
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 SELECT c1 FROM t1;
Got one of the listed errors
INSERT INTO t2 SELECT NULL FROM t1;
Got one of the listed errors
DROP TABLE t1;
DROP TABLE t2;
......@@ -166,4 +166,31 @@ ERROR HY000: View's SELECT refers to a temporary table 't2'
Cleanup.
drop table t2, t3;
#
# Bug#39843 DELETE requires write access to table in subquery in where clause
#
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
table1_rowid SMALLINT NOT NULL
);
CREATE TABLE t2 (
table2_rowid SMALLINT NOT NULL
);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
LOCK TABLES t1 WRITE, t2 READ;
# Sub-select should not try to aquire a write lock.
DELETE FROM t1
WHERE EXISTS
(
SELECT 'x'
FROM t2
WHERE t1.table1_rowid = t2.table2_rowid
) ;
# While implementing the patch we didn't break old behavior;
# The following sub-select should still requires a write lock:
SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE);
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
UNLOCK TABLES;
DROP TABLE t1,t2;
End of 5.1 tests.
......@@ -51,10 +51,10 @@ Field Type Null Key Default Extra
a int(11) YES NULL
unlock tables;
drop table t1;
use mysql;
USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
use mysql;
USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text
......@@ -65,7 +65,7 @@ mysql.user optimize status OK
UNLOCK TABLES;
Select_priv
N
use test;
USE test;
use test;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
......@@ -133,8 +133,8 @@ DROP TABLE t1;
End of 5.0 tests
create table t1 (i int);
lock table t1 read;
update t1 set i= 10;;
select * from t1;;
update t1 set i= 10;
select * from t1;
kill query ID;
i
ERROR 70100: Query execution was interrupted
......
......@@ -56,7 +56,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
......@@ -65,7 +65,7 @@ Field Type Null Key Default Extra
event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
user_host mediumtext NO NULL
thread_id int(11) NO NULL
server_id int(11) NO NULL
server_id int(10) unsigned NO NULL
command_type varchar(64) NO NULL
argument mediumtext NO NULL
show create table mysql.slow_log;
......@@ -80,7 +80,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show fields from mysql.slow_log;
......@@ -94,7 +94,7 @@ rows_examined int(11) NO NULL
db varchar(512) NO NULL
last_insert_id int(11) NO NULL
insert_id int(11) NO NULL
server_id int(11) NO NULL
server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL
flush logs;
flush tables;
......@@ -167,7 +167,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
......@@ -183,7 +183,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
alter table mysql.general_log engine=myisam;
......@@ -194,7 +194,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log'
......@@ -210,7 +210,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log'
set global general_log='ON';
......@@ -268,7 +268,7 @@ CREATE TABLE `general_log` (
ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
......@@ -283,7 +283,7 @@ ON UPDATE CURRENT_TIMESTAMP,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
set global general_log='ON';
......
......@@ -2103,4 +2103,16 @@ a
UNLOCK TABLES;
# drop the created tables
DROP TABLE t1, t2, t3;
# insert duplicate value in child table while merge table doesn't have key
create table t1 (
col1 int(10),
primary key (col1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE m1 (
col1 int(10) NOT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1);
insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
End of 5.1 tests
......@@ -391,9 +391,9 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
CREATE TABLE t1 (c1 CHAR(10));
flush logs;
FLUSH LOGS;
INSERT INTO t1 VALUES ('0123456789');
flush logs;
FLUSH LOGS;
DROP TABLE t1;
We expect this value to be 1
The bug being tested was that 'Query' lines were not preceded by '#'
......@@ -403,16 +403,16 @@ SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
BUG#28293_expect_1
1
DROP TABLE patch;
flush logs;
create table t1(a int);
insert into t1 values(connection_id());
flush logs;
drop table t1;
FLUSH LOGS;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(connection_id());
FLUSH LOGS;
DROP TABLE t1;
1
drop table t1;
DROP TABLE t1;
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
flush logs;
BUG#31611: Security risk with BINLOG statement
FLUSH LOGS;
Bug#31611 Security risk with BINLOG statement
SET BINLOG_FORMAT=ROW;
CREATE DATABASE mysqltest1;
CREATE USER untrusted@localhost;
......@@ -435,7 +435,7 @@ a b
1 root@localhost
DROP DATABASE mysqltest1;
DROP USER untrusted@localhost;
BUG#32580: mysqlbinlog cannot read binlog event with user variables
Bug#32580 mysqlbinlog cannot read binlog event with user variables
USE test;
SET BINLOG_FORMAT = STATEMENT;
FLUSH LOGS;
......@@ -460,15 +460,15 @@ an_int 1000
a_decimal 907.79
a_string Just a test
DROP TABLE t1;
set @@global.server_id= 4294967295;
reset master;
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null;
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
is not null
SET @@global.server_id= 4294967295;
RESET MASTER;
FLUSH LOGS;
SELECT
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
IS NOT NULL;
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
IS NOT NULL
1
*** Unsigned server_id 4294967295 is found: 1 ***
set @@global.server_id= 1;
SET @@global.server_id= 1;
End of 5.1 tests
......@@ -3815,6 +3815,73 @@ DROP TABLE t1,t2;
-- Dump completed on DATE
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
#
# Bug #42635: mysqldump includes views that were excluded using
# the --ignore-table option
#
create database db42635;
use db42635;
create table t1 (id int);
create view db42635.v1 (c) as select * from db42635.t1;
create view db42635.v2 (c) as select * from db42635.t1;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`c` int(11)
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = latin1 */;
/*!50001 SET character_set_results = latin1 */;
/*!50001 SET collation_connection = latin1_swedish_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v2` AS select `t1`.`id` AS `c` from `t1` */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
use test;
drop database db42635;
#
# Bug#33550 mysqldump 4.0 compatibility broken
#
......
......@@ -743,10 +743,12 @@ select 1;
-- a comment for the server;
mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment
con1
con2
default
con1
default
con1
con2
con1
con2
con2
-closed_connection-
End of tests
......@@ -803,6 +803,8 @@ select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
16382
set global max_prepared_stmt_count=-1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
0
......
......@@ -128,7 +128,7 @@ set global read_only=0;
drop table t1,t2;
drop user test@localhost;
#
# Bug #27440 read_only allows create and drop database
# Bug#27440 read_only allows create and drop database
#
set global read_only= 1;
drop database if exists mysqltest_db1;
......
......@@ -545,9 +545,9 @@ mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table mysqltest.t1;
drop database mysqltest;
set names binary;
delete from mysql.user
delete from mysql.user
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
delete from mysql.db
delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
......@@ -664,7 +664,7 @@ show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table if exists t1;
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
# Bug#12183 SHOW OPEN TABLES behavior doesn't match grammar.
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
......@@ -784,7 +784,7 @@ show status like 'slow_queries';
Variable_name Value
Slow_queries 1
create table t1 (a int);
create trigger tr1 before insert on t1 for each row
create trigger tr1 before insert on t1 for each row
begin
end;
create view v1 as select a from t1;
......@@ -1010,7 +1010,7 @@ def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci
----------------------------------------------------------------
SELECT
SELECT
TRIGGER_CATALOG,
TRIGGER_SCHEMA,
TRIGGER_NAME,
......
......@@ -5,7 +5,7 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
select user();
user()
SELECT USER();
USER()
#
show processlist;
SHOW PROCESSLIST;
......@@ -342,12 +342,12 @@ GRANT SUPER ON *.* TO mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
---> connection: mysqltest_2_con
use mysqltest;
USE mysqltest;
CREATE PROCEDURE wl2897_p1() SELECT 1;
CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
---> connection: mysqltest_1_con
use mysqltest;
USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
......@@ -363,7 +363,7 @@ Warnings:
Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist
---> connection: con1root
use mysqltest;
USE mysqltest;
SHOW CREATE PROCEDURE wl2897_p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`()
......@@ -393,7 +393,7 @@ CREATE USER mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
---> connection: mysqltest_1_con
use mysqltest;
USE mysqltest;
CREATE PROCEDURE bug13198_p1()
SELECT 1;
CREATE FUNCTION bug13198_f1() RETURNS INT
......@@ -406,7 +406,7 @@ bug13198_f1()
1
---> connection: mysqltest_2_con
use mysqltest;
USE mysqltest;
CALL bug13198_p1();
1
1
......@@ -418,7 +418,7 @@ bug13198_f1()
DROP USER mysqltest_1@localhost;
---> connection: mysqltest_2_con
use mysqltest;
USE mysqltest;
CALL bug13198_p1();
ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
SELECT bug13198_f1();
......@@ -435,7 +435,7 @@ Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
---> connection: mysqltest_2_con
use test;
USE test;
CREATE PROCEDURE sp19857() DETERMINISTIC
BEGIN
DECLARE a INT;
......
......@@ -1305,7 +1305,7 @@ set @@sql_mode='traditional';
create table t1 (i int)
comment '123456789*123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*123456789*';
ERROR HY000: Too long comment for table 't1'
ERROR HY000: Comment for table 't1' is too long (max = 60)
create table t1 (
i int comment
'123456789*123456789*123456789*123456789*
......@@ -1315,7 +1315,7 @@ i int comment
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*');
ERROR HY000: Too long comment for field 'i'
ERROR HY000: Comment for field 'i' is too long (max = 255)
set @@sql_mode= @org_mode;
create table t1
(i int comment
......@@ -1327,7 +1327,7 @@ create table t1
123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*');
Warnings:
Warning 1105 Unknown error
Warning 1629 Comment for field 'i' is too long (max = 255)
select column_name, column_comment from information_schema.columns where
table_schema = 'test' and table_name = 't1';
column_name column_comment
......
......@@ -227,7 +227,7 @@ event CREATE TABLE `event` (
`on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`originator` int(10) NOT NULL,
`originator` int(10) unsigned NOT NULL,
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
......@@ -241,7 +241,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
......@@ -257,7 +257,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show tables;
......
......@@ -753,7 +753,7 @@ VARIABLE_NAME VARIABLE_VALUE
MYISAM_DATA_POINTER_SIZE 7
SET GLOBAL table_open_cache=-1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
table_open_cache 1
......@@ -1389,8 +1389,75 @@ SET @@session.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SET @@global.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SELECT @@global.expire_logs_days INTO @old_eld;
SET GLOBAL expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
needs to've been adjusted (0)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = 'TRADITIONAL';
SET GLOBAL expire_logs_days = 100;
ERROR 42000: Variable 'expire_logs_days' can't be set to the value of '100'
needs to be unchanged (11)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
11
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '100'
needs to've been adjusted (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = 11;
SET GLOBAL expire_logs_days = 99;
needs to pass with no warnings (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = @old_eld;
SET GLOBAL auto_increment_offset=-1;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '-1'
SET GLOBAL auto_increment_offset=0;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
select @@storage_engine;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def @@storage_engine 253 6 6 N 1 31 8
@@storage_engine
MyISAM
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = (1 << 32);
Warnings:
Warning 1292 Truncated incorrect server_id value: '4294967296'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = (1 << 60);
Warnings:
Warning 1292 Truncated incorrect server_id value: '1152921504606846976'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = 0;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
0
SET GLOBAL server_id = -1;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-1'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
0
SET GLOBAL server_id = @old_server_id;
End of 5.1 tests
......@@ -1673,9 +1673,9 @@ INSERT INTO t2 VALUES (4,3,'n');
INSERT INTO t2 VALUES (6,1,'n');
INSERT INTO t2 VALUES (8,1,'y');
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT a.col1,a.col2,b.col2,b.col3
SELECT a.col1,a.col2,b.col2,b.col3
FROM t1 a LEFT JOIN t2 b ON a.col1=b.col1
WHERE b.col2 IS NULL OR
WHERE b.col2 IS NULL OR
b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1);
col1 col2 col2 col3
1 trudy 2 y
......@@ -1687,9 +1687,9 @@ col1 col2 col2 col3
7 carsten NULL NULL
8 ranger 1 y
10 matt NULL NULL
SELECT a.col1,a.col2,b.col2,b.col3
SELECT a.col1,a.col2,b.col2,b.col3
FROM v1 a LEFT JOIN t2 b ON a.col1=b.col1
WHERE b.col2 IS NULL OR
WHERE b.col2 IS NULL OR
b.col2=(SELECT MAX(col2) FROM t2 b WHERE b.col1=a.col1);
col1 col2 col2 col3
1 trudy 2 y
......@@ -1743,7 +1743,7 @@ A A
2 2
3 3
create table t3 as select a a,a b from t2;
create view v2 as select * from t3 where
create view v2 as select * from t3 where
a in (select * from t1) or b in (select * from t2);
select * from v2 A, v2 B where A.a = B.b;
a b a b
......@@ -1999,7 +1999,7 @@ dkjhgd
drop view v1;
create table t1 (f59 int, f60 int, f61 int);
insert into t1 values (19,41,32);
create view v1 as select f59, f60 from t1 where f59 in
create view v1 as select f59, f60 from t1 where f59 in
(select f59 from t1);
update v1 set f60=2345;
ERROR HY000: The target table v1 of the UPDATE is not updatable
......@@ -2115,7 +2115,7 @@ pid int NOT NULL
INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d');
INSERT INTO t2 values (1,1), (2,1), (2,2);
CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid;
SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2
WHERE t1.aid = t2.aid GROUP BY pid;
pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1)
1 a b,c d
......@@ -2217,7 +2217,7 @@ group_name varchar(32) NOT NULL
) engine = InnoDB;
create table t2 (
r_object_id char(16) NOT NULL,
i_position int(11) NOT NULL,
i_position int(11) NOT NULL,
users_names varchar(32) default NULL
) Engine = InnoDB;
create view v1 as select r_object_id, group_name from t1;
......@@ -2230,7 +2230,7 @@ insert into t1 values('120001a080000542','tstgroup1');
insert into t2 values('120001a080000542',-1, 'guser01');
insert into t2 values('120001a080000542',-2, 'guser02');
select v1.r_object_id, v2.users_names from v1, v2
where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id
where (v1.group_name='tstgroup1') and v2.r_object_id=v1.r_object_id
order by users_names;
r_object_id users_names
120001a080000542 guser01
......@@ -2380,8 +2380,8 @@ create table t4 (x int, y int, z int);
create view v1 as
select t1.x
from (
(t1 join t2 on ((t1.y = t2.y)))
join
(t1 join t2 on ((t1.y = t2.y)))
join
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
);
prepare stmt1 from "select count(*) from v1 where x = ?";
......@@ -2557,12 +2557,12 @@ Warnings:
Warning 1052 Column 'x' in group statement is ambiguous
DROP VIEW v1;
DROP TABLE t1;
drop table if exists t1;
drop view if exists v1;
create table t1 (id int);
create view v1 as select * from t1;
drop table t1;
show create view v1;
drop table if exists t1;
drop view if exists v1;
create table t1 (id int);
create view v1 as select * from t1;
drop table t1;
show create view v1;
drop view v1;
//
View Create View character_set_client collation_connection
......@@ -2609,7 +2609,7 @@ DROP VIEW v2;
DROP TABLE t1, t2;
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY,
td date DEFAULT NULL, KEY idx(td));
INSERT INTO t1 VALUES
INSERT INTO t1 VALUES
(1, '2005-01-01'), (2, '2005-01-02'), (3, '2005-01-02'),
(4, '2005-01-03'), (5, '2005-01-04'), (6, '2005-01-05'),
(7, '2005-01-05'), (8, '2005-01-05'), (9, '2005-01-06');
......@@ -2973,10 +2973,10 @@ drop view v1;
drop table t1;
CREATE TABLE t1(pk int PRIMARY KEY);
CREATE TABLE t2(pk int PRIMARY KEY, fk int, ver int, org int);
CREATE ALGORITHM=MERGE VIEW v1 AS
CREATE ALGORITHM=MERGE VIEW v1 AS
SELECT t1.*
FROM t1 JOIN t2
ON t2.fk = t1.pk AND
FROM t1 JOIN t2
ON t2.fk = t1.pk AND
t2.ver = (SELECT MAX(t.ver) FROM t2 t WHERE t.org = t2.org);
SHOW WARNINGS;
Level Code Message
......@@ -3306,7 +3306,7 @@ name char(10) NOT NULL
INSERT INTO t1 (lid, name) VALUES
(1, 'YES'), (2, 'NO');
CREATE TABLE t2 (
id int NOT NULL PRIMARY KEY,
id int NOT NULL PRIMARY KEY,
gid int NOT NULL,
lid int NOT NULL,
dt date
......@@ -3405,8 +3405,8 @@ CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int, c int DEFAULT 0);
INSERT INTO t1 (id) VALUES (1);
INSERT INTO t2 (id) VALUES (1);
CREATE VIEW v1 AS
SELECT t2.c FROM t1, t2
CREATE VIEW v1 AS
SELECT t2.c FROM t1, t2
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
UPDATE v1 SET c=1;
DROP VIEW v1;
......@@ -3514,7 +3514,7 @@ role_name varchar(100) default NULL,
app_name varchar(40) NOT NULL,
INDEX idx_app_name(app_name)
);
CREATE VIEW v1 AS
CREATE VIEW v1 AS
SELECT profile.person_id AS person_id
FROM t1 profile, t2 userrole, t3 role
WHERE userrole.person_id = profile.person_id AND
......@@ -3526,7 +3526,7 @@ INSERT INTO t1 VALUES
(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
INSERT INTO t2 VALUES
(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
INSERT INTO t3 VALUES
INSERT INTO t3 VALUES
(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
......@@ -3552,7 +3552,7 @@ i
2
3
4
select table_name, is_updatable from information_schema.views
select table_name, is_updatable from information_schema.views
where table_name = 'v1';
table_name is_updatable
v1 NO
......@@ -3598,8 +3598,8 @@ DROP VIEW v2;
DROP VIEW v3;
DROP TABLE t1;
#
# Bug#29477: Not all fields of the target table were checked to have
# a default value when inserting into a view.
# Bug#29477 Not all fields of the target table were checked to have
# a default value when inserting into a view.
#
create table t1(f1 int, f2 int not null);
create view v1 as select f1 from t1;
......@@ -3616,7 +3616,7 @@ drop table t1;
create table t1 (a int, key(a));
create table t2 (c int);
create view v1 as select a b from t1;
create view v2 as select 1 a from t2, v1 where c in
create view v2 as select 1 a from t2, v1 where c in
(select 1 from t1 where b = a);
insert into t1 values (1), (1);
insert into t2 values (1), (1);
......@@ -3638,7 +3638,7 @@ MAX(a) COUNT(DISTINCT a)
DROP VIEW v1;
DROP TABLE t1;
# -----------------------------------------------------------------
# -- Bug#34337: Server crash when Altering a view using a table name.
# -- Bug#34337 Server crash when Altering a view using a table name.
# -----------------------------------------------------------------
DROP TABLE IF EXISTS t1;
......@@ -3655,8 +3655,8 @@ DROP TABLE t1;
# -- End of test case for Bug#34337.
# -----------------------------------------------------------------
# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
# -- causing syntax error
# -- Bug#35193 VIEW query is rewritten without "FROM DUAL",
# -- causing syntax error
# -----------------------------------------------------------------
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
......@@ -3723,7 +3723,7 @@ DROP DATABASE `d-1`;
USE test;
#
# Bug#26676: VIEW using old table schema in a session.
# Bug#26676 VIEW using old table schema in a session.
#
DROP VIEW IF EXISTS v1;
......@@ -3765,7 +3765,7 @@ DROP TABLE t1;
# End of test case for Bug#26676.
# -----------------------------------------------------------------
# -- Bug#32538: View definition picks up character set, but not collation
# -- Bug#32538 View definition picks up character set, but not collation
# -----------------------------------------------------------------
DROP VIEW IF EXISTS v1;
......
......@@ -646,7 +646,7 @@ CREATE DATABASE test2;
CREATE TABLE test1.t0 (a VARCHAR(20));
CREATE TABLE test2.t1 (a VARCHAR(20));
CREATE VIEW test2.t3 AS SELECT * FROM test1.t0;
CREATE OR REPLACE VIEW test.v1 AS
CREATE OR REPLACE VIEW test.v1 AS
SELECT ta.a AS col1, tb.a AS col2 FROM test2.t3 ta, test2.t1 tb;
DROP VIEW test.v1;
DROP VIEW test2.t3;
......@@ -790,7 +790,7 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP USER u26813@localhost;
DROP DATABASE db26813;
#
# Bug#29908: A user can gain additional access through the ALTER VIEW.
# Bug#29908 A user can gain additional access through the ALTER VIEW.
#
CREATE DATABASE mysqltest_29908;
USE mysqltest_29908;
......@@ -1043,3 +1043,4 @@ DROP VIEW v1, v2;
DROP DATABASE mysqltest1;
DROP VIEW test.v3;
DROP USER mysqluser1@localhost;
USE test;
......@@ -22824,7 +22824,7 @@ f1 f2
ABC 3
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 1.73205080756888
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF';
DESCRIBE t1;
......@@ -22842,7 +22842,7 @@ ABC DEF
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 1.73205080756888
SELECT SQRT('DEF');
SQRT('DEF')
0
......@@ -22862,7 +22862,7 @@ my_sqrt double YES NULL
SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 1.73205080756888
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2 order by 2;
f1 ABC
......
......@@ -55,13 +55,13 @@ SELECT @@session.auto_increment_increment;
'#------------------FN_DYNVARS_001_05-----------------------#'
SET @@global.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-1024'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
......@@ -83,13 +83,13 @@ SELECT @@global.auto_increment_increment;
65535
SET @@session.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '0'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-2'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
......@@ -126,7 +126,7 @@ SELECT @@global.auto_increment_increment;
1
SET @@global.auto_increment_increment = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
......
......@@ -169,7 +169,7 @@ id name
## Verifying behavior of variable with negative value ##
SET @@auto_increment_increment = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
Warning 1292 Truncated incorrect auto_increment_increment value: '-10'
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
......
......@@ -55,13 +55,13 @@ SELECT @@session.auto_increment_offset;
'#------------------FN_DYNVARS_002_05-----------------------#'
SET @@global.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-1024'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
......@@ -88,13 +88,13 @@ SELECT @@global.auto_increment_offset;
65535
SET @@session.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-2'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
......@@ -139,7 +139,7 @@ SELECT @@global.auto_increment_offset;
1
SET @@global.auto_increment_offset = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
......
......@@ -178,7 +178,7 @@ id name
## Assigning -ve value to variable ##
SET @@auto_increment_offset = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
Warning 1292 Truncated incorrect auto_increment_offset value: '-10'
SELECT @@auto_increment_offset = -10;
@@auto_increment_offset = -10
0
......
......@@ -28,12 +28,14 @@ SELECT @@global.concurrent_insert;
2
'#--------------------FN_DYNVARS_018_04-------------------------#'
SET @@global.concurrent_insert = -1;
Warnings:
Warning 1292 Truncated incorrect concurrent_insert value: '-1'
Select @@global.concurrent_insert;
@@global.concurrent_insert
0
SET @@global.concurrent_insert = 100;
Warnings:
Warning 1292 Truncated incorrect concurrent-insert value: '100'
Warning 1292 Truncated incorrect concurrent_insert value: '100'
Select @@global.concurrent_insert;
@@global.concurrent_insert
2
......
......@@ -35,7 +35,7 @@ SELECT @@global.connect_timeout;
2
SET @@global.connect_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect connect_timeout value: '0'
Warning 1292 Truncated incorrect connect_timeout value: '-1024'
SELECT @@global.connect_timeout;
@@global.connect_timeout
2
......
......@@ -64,6 +64,8 @@ SELECT @@global.default_week_format;
@@global.default_week_format
7
SET @@global.default_week_format = -1024;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-1024'
SELECT @@global.default_week_format;
@@global.default_week_format
0
......@@ -100,6 +102,8 @@ SELECT @@session.default_week_format;
@@session.default_week_format
7
SET @@session.default_week_format = -2;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-2'
SELECT @@session.default_week_format;
@@session.default_week_format
0
......
......@@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_timeout;
1
SET @@global.delayed_insert_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect delayed_insert_timeout value: '0'
Warning 1292 Truncated incorrect delayed_insert_timeout value: '-1024'
SELECT @@global.delayed_insert_timeout;
@@global.delayed_insert_timeout
1
......
......@@ -78,6 +78,8 @@ SELECT @@global.div_precision_increment;
@@global.div_precision_increment
30
SET @@global.div_precision_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-1024'
SELECT @@global.div_precision_increment;
@@global.div_precision_increment
0
......@@ -100,6 +102,8 @@ SELECT @@session.div_precision_increment;
@@session.div_precision_increment
30
SET @@session.div_precision_increment = -2;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-2'
SELECT @@session.div_precision_increment;
@@session.div_precision_increment
0
......
......@@ -32,6 +32,8 @@ SELECT @@global.expire_logs_days;
21
'#--------------------FN_DYNVARS_029_04-------------------------#'
SET @@global.expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
......@@ -53,6 +55,8 @@ SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET @@global.expire_logs_days = -1024;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1024'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
......
......@@ -65,7 +65,7 @@ SELECT @@global.group_concat_max_len;
4
SET @@global.group_concat_max_len = -1024;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '0'
Warning 1292 Truncated incorrect group_concat_max_len value: '-1024'
SELECT @@global.group_concat_max_len;
@@global.group_concat_max_len
4
......@@ -91,7 +91,7 @@ SELECT @@session.group_concat_max_len;
4
SET @@session.group_concat_max_len = -2;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '0'
Warning 1292 Truncated incorrect group_concat_max_len value: '-2'
SELECT @@session.group_concat_max_len;
@@session.group_concat_max_len
4
......
......@@ -61,7 +61,7 @@ SELECT @@global.interactive_timeout;
1
SET @@global.interactive_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '0'
Warning 1292 Truncated incorrect interactive_timeout value: '-1024'
SELECT @@global.interactive_timeout;
@@global.interactive_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.interactive_timeout;
1
SET @@session.interactive_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '0'
Warning 1292 Truncated incorrect interactive_timeout value: '-2'
SELECT @@session.interactive_timeout;
@@session.interactive_timeout
1
......
......@@ -76,7 +76,7 @@ SELECT @@global.max_allowed_packet;
1024
SET @@global.max_allowed_packet = -1024;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
Warning 1292 Truncated incorrect max_allowed_packet value: '-1024'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
......
......@@ -39,7 +39,7 @@ SELECT @@global.max_binlog_size;
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '0'
Warning 1292 Truncated incorrect max_binlog_size value: '-1'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
......@@ -56,7 +56,7 @@ SELECT @@global.max_binlog_size;
1073741824
SET @@global.max_binlog_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '0'
Warning 1292 Truncated incorrect max_binlog_size value: '-1024'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
......
......@@ -39,7 +39,7 @@ SELECT @@global.max_connections;
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
Warning 1292 Truncated incorrect max_connections value: '-1'
SELECT @@global.max_connections;
@@global.max_connections
1
......@@ -56,7 +56,7 @@ SELECT @@global.max_connections;
100000
SET @@global.max_connections = -1024;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
Warning 1292 Truncated incorrect max_connections value: '-1024'
SELECT @@global.max_connections;
@@global.max_connections
1
......
......@@ -76,10 +76,14 @@ SELECT @@session.max_delayed_threads;
16383
'#------------------FN_DYNVARS_075_05-----------------------#'
SET @@global.max_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1024'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
SET @@global.max_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
......
......@@ -63,10 +63,14 @@ SELECT @@session.max_error_count;
65534
'#------------------FN_DYNVARS_076_05-----------------------#'
SET @@global.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@global.max_error_count;
@@global.max_error_count
0
SET @@global.max_error_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1024'
SELECT @@global.max_error_count;
@@global.max_error_count
0
......@@ -93,6 +97,8 @@ SELECT @@global.max_error_count;
@@global.max_error_count
65535
SET @@session.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@session.max_error_count;
@@session.max_error_count
0
......@@ -102,6 +108,8 @@ SELECT @@session.max_error_count;
@@session.max_error_count
65535
SET @@session.max_error_count = -2;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-2'
SELECT @@session.max_error_count;
@@session.max_error_count
0
......
......@@ -77,10 +77,14 @@ SELECT @@session.max_insert_delayed_threads;
16383
'#------------------FN_DYNVARS_078_05-----------------------#'
SET @@global.max_insert_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1024'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
SET @@global.max_insert_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
......
......@@ -71,7 +71,7 @@ SELECT @@session.max_length_for_sort_data;
'#------------------FN_DYNVARS_080_05-----------------------#'
SET @@global.max_length_for_sort_data = -1024;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '-1024'
SELECT @@global.max_length_for_sort_data;
@@global.max_length_for_sort_data
4
......@@ -111,7 +111,7 @@ SELECT @@session.max_length_for_sort_data;
8388608
SET @@session.max_length_for_sort_data = -1;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '-1'
SELECT @@session.max_length_for_sort_data;
@@session.max_length_for_sort_data
4
......
......@@ -36,6 +36,8 @@ SELECT @@global.max_prepared_stmt_count;
65535
'#--------------------FN_DYNVARS_081_04-------------------------#'
SET @@global.max_prepared_stmt_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
......@@ -51,6 +53,8 @@ SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
SET @@global.max_prepared_stmt_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
......
......@@ -38,6 +38,8 @@ SELECT @@global.max_relay_log_size;
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_082_04-------------------------#'
SET @@global.max_relay_log_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
......@@ -53,6 +55,8 @@ SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073741824
SET @@global.max_relay_log_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1024'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
......
......@@ -71,7 +71,7 @@ SELECT @@session.max_sort_length;
'#------------------FN_DYNVARS_084_05-----------------------#'
SET @@global.max_sort_length = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '0'
Warning 1292 Truncated incorrect max_sort_length value: '-1024'
SELECT @@global.max_sort_length;
@@global.max_sort_length
4
......@@ -111,7 +111,7 @@ SELECT @@session.max_sort_length;
8388608
SET @@session.max_sort_length = -1;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '0'
Warning 1292 Truncated incorrect max_sort_length value: '-1'
SELECT @@session.max_sort_length;
@@session.max_sort_length
4
......
......@@ -74,6 +74,8 @@ SELECT @@session.max_sp_recursion_depth;
150
'#------------------FN_DYNVARS_085_05-----------------------#'
SET @@global.max_sp_recursion_depth = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1024'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
......@@ -84,6 +86,8 @@ SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
255
SET @@global.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
......@@ -110,6 +114,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
......@@ -120,6 +126,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -001;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
......
......@@ -48,7 +48,7 @@ ERROR HY000: Variable 'myisam_data_pointer_size' is a GLOBAL variable and should
'#------------------FN_DYNVARS_093_05-----------------------#'
SET @@global.myisam_data_pointer_size = -1;
Warnings:
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '0'
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '-1'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
2
......
......@@ -50,7 +50,7 @@ SELECT @@global.net_buffer_length;
1024
SET @@global.net_buffer_length = -1024;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '0'
Warning 1292 Truncated incorrect net_buffer_length value: '-1024'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
......
......@@ -61,7 +61,7 @@ SELECT @@global.net_read_timeout;
1
SET @@global.net_read_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '0'
Warning 1292 Truncated incorrect net_read_timeout value: '-1024'
SELECT @@global.net_read_timeout;
@@global.net_read_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.net_read_timeout;
1
SET @@session.net_read_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '0'
Warning 1292 Truncated incorrect net_read_timeout value: '-2'
SELECT @@session.net_read_timeout;
@@session.net_read_timeout
1
......
......@@ -61,7 +61,7 @@ SELECT @@global.net_write_timeout;
1
SET @@global.net_write_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '0'
Warning 1292 Truncated incorrect net_write_timeout value: '-1024'
SELECT @@global.net_write_timeout;
@@global.net_write_timeout
1
......@@ -89,7 +89,7 @@ SELECT @@session.net_write_timeout;
1
SET @@session.net_write_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '0'
Warning 1292 Truncated incorrect net_write_timeout value: '-2'
SELECT @@session.net_write_timeout;
@@session.net_write_timeout
1
......
......@@ -81,6 +81,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = FELSE;
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = -1024;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-1024'
SELECT @@global.optimizer_prune_level;
@@global.optimizer_prune_level
0
......@@ -107,6 +109,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = 'OFN';
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-2'
SELECT @@session.optimizer_prune_level;
@@session.optimizer_prune_level
0
......
......@@ -72,6 +72,8 @@ SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
63
SET @@global.optimizer_search_depth = -1;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-1'
SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
0
......@@ -98,6 +100,8 @@ SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
63
SET @@session.optimizer_search_depth = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-2'
SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
0
......
......@@ -77,7 +77,7 @@ SELECT @@global.preload_buffer_size;
1024
SET @@global.preload_buffer_size = -1;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '0'
Warning 1292 Truncated incorrect preload_buffer_size value: '-1'
SELECT @@global.preload_buffer_size;
@@global.preload_buffer_size
1024
......@@ -111,7 +111,7 @@ SELECT @@session.preload_buffer_size;
1024
SET @@session.preload_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '0'
Warning 1292 Truncated incorrect preload_buffer_size value: '-2'
SELECT @@session.preload_buffer_size;
@@session.preload_buffer_size
1024
......
......@@ -81,7 +81,7 @@ SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
1
SET @@global.read_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '0'
Warning 1292 Truncated incorrect read_buffer_size value: '-1024'
SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
1
......@@ -109,7 +109,7 @@ SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
1
SET @@session.read_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '0'
Warning 1292 Truncated incorrect read_buffer_size value: '-2'
SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
1
......
......@@ -83,7 +83,7 @@ SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 822
1
SET @@global.read_rnd_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '0'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-1024'
SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
1
......@@ -111,7 +111,7 @@ SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8
1
SET @@session.read_rnd_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '0'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '-2'
SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
1
......
......@@ -23,13 +23,13 @@ SELECT @@global.rpl_recovery_rank;
123456789
SET @@global.rpl_recovery_rank = 2147483648*2;
Warnings:
Warning 1292 Truncated incorrect rpl-recovery-rank value: '4294967296'
Warning 1292 Truncated incorrect rpl_recovery_rank value: '4294967296'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4294967295
SET @@global.rpl_recovery_rank = 2147483648*1024;
Warnings:
Warning 1292 Truncated incorrect rpl-recovery-rank value: '2199023255552'
Warning 1292 Truncated incorrect rpl_recovery_rank value: '2199023255552'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4294967295
......@@ -38,7 +38,7 @@ SELECT @@global.rpl_recovery_rank;
4294967295
SET @@global.rpl_recovery_rank = 2147483648*2147483648;
Warnings:
Warning 1292 Truncated incorrect rpl-recovery-rank value: '4611686018427387904'
Warning 1292 Truncated incorrect rpl_recovery_rank value: '4611686018427387904'
SELECT @@global.rpl_recovery_rank;
@@global.rpl_recovery_rank
4294967295
......
......@@ -61,7 +61,7 @@ SELECT @@global.server_id;
0
SET @@global.server_id = 2147483649*2;
Warnings:
Warning 1292 Truncated incorrect server-id value: '4294967298'
Warning 1292 Truncated incorrect server_id value: '4294967298'
SELECT @@global.server_id;
@@global.server_id
4294967295
......
......@@ -52,17 +52,23 @@ SET @@local.server_id = 4;
ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
'#------------------FN_DYNVARS_144_05-----------------------#'
SET @@global.server_id = -1;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-1'
SELECT @@global.server_id;
@@global.server_id
0
SET @@global.server_id = -2147483648;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-2147483648'
SELECT @@global.server_id;
@@global.server_id
0
SET @@global.server_id = 2147483649*2;
Warnings:
Warning 1292 Truncated incorrect server_id value: '4294967298'
SELECT @@global.server_id;
@@global.server_id
4294967298
4294967295
SET @@global.server_id = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@global.server_id = '125';
......
......@@ -58,13 +58,13 @@ ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_146_05-----------------------#'
SET @@global.slave_net_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '0'
Warning 1292 Truncated incorrect slave_net_timeout value: '-1'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
SET @@global.slave_net_timeout = -2147483648;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '0'
Warning 1292 Truncated incorrect slave_net_timeout value: '-2147483648'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
......
......@@ -36,6 +36,8 @@ SELECT @@global.slow_launch_time;
65536
'#--------------------FN_DYNVARS_150_04-------------------------#'
SET @@global.slow_launch_time = -1;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
......@@ -57,6 +59,8 @@ SELECT @@global.slow_launch_time;
@@global.slow_launch_time
31536000
SET @@global.slow_launch_time = -1024;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1024'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
......
......@@ -45,7 +45,7 @@ SELECT @@global.table_definition_cache;
256
SET @@global.table_definition_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '0'
Warning 1292 Truncated incorrect table_definition_cache value: '-1024'
SELECT @@global.table_definition_cache;
@@global.table_definition_cache
256
......
......@@ -37,13 +37,13 @@ SELECT @@global.table_lock_wait_timeout ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_lock_wait_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '-1'
SET @@global.table_lock_wait_timeout= 100000000000;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '100000000000'
SET @@global.table_lock_wait_timeout= -1024;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '-1024'
SET @@global.table_lock_wait_timeout= 0;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
......
......@@ -39,7 +39,7 @@ SELECT @@global.table_open_cache ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_open_cache = -1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
......@@ -51,7 +51,7 @@ SELECT @@global.table_open_cache ;
524288
SET @@global.table_open_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
Warning 1292 Truncated incorrect table_open_cache value: '-1024'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
......
......@@ -9,10 +9,9 @@
# in proper order.
--source include/have_binlog_format_mixed_or_statement.inc
#
# Test for bug #25044 "ALTER TABLE ... ENABLE KEYS acquires global
# 'opening tables' lock".
# Test for Bug#25044 ALTER TABLE ... ENABLE KEYS acquires global
# 'opening tables' lock
#
# ALTER TABLE ... ENABLE KEYS should not acquire LOCK_open mutex for
# the whole its duration as it prevents other queries from execution.
......@@ -56,6 +55,7 @@ show binlog events in 'master-bin.000001' from 106;
# Clean up
drop tables t1, t2;
disconnect addconroot;
--echo End of 5.0 tests
......@@ -76,6 +76,7 @@ create table t1 (i int);
reset master;
set session debug="+d,sleep_alter_before_main_binlog";
--send alter table t1 change i c char(10) default 'Test1';
connect (addconroot, localhost, root,,);
connection addconroot;
--sleep 2
insert into t1 values ();
......@@ -105,6 +106,7 @@ connection addconroot;
rename table t1 to t3;
connection default;
--reap
disconnect addconroot;
drop table t3;
set session debug="-d,sleep_alter_before_main_binlog";
......@@ -114,3 +116,4 @@ show binlog events in 'master-bin.000001' from 106;
--echo End of 5.1 tests
......@@ -9,11 +9,14 @@
# of the log tables (which are CSV-based). By connect mysql; show tables;
--source include/have_csv.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
#connect (con1,localhost,root,,"");
#show tables;
connect (con1,localhost,root,,mysql);
......@@ -22,12 +25,16 @@ connect (con2,localhost,root,,test);
show tables;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,root,z,test2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,root,z,);
connection default;
disconnect con1;
disconnect con2;
grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
......@@ -39,20 +46,23 @@ show tables;
connect (con4,localhost,test,gambling,test);
show tables;
connection default;
disconnect con3;
disconnect con4;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,,test2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,,"");
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,zorro,test2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,zorro,);
# check if old password version also works
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
......@@ -61,55 +71,57 @@ connect (con10,localhost,test,gambling2,);
connect (con5,localhost,test,gambling2,mysql);
connection con5;
set password="";
--error 1372
--error ER_PASSWD_LENGTH
set password='gambling3';
set password=old_password('gambling3');
show tables;
connect (con6,localhost,test,gambling3,test);
show tables;
connection default;
disconnect con10;
disconnect con5;
disconnect con6;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,,test2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,,);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,zorro,test2);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (fail_con,localhost,test,zorro,);
# remove user 'test' so that other tests which may use 'test'
# do not depend on this test.
delete from mysql.user where user=_binary"test";
flush privileges;
#
# Bug#12517: Clear user variables and replication events before
# closing temp tables in thread cleanup.
# Bug#12517 Clear user variables and replication events before
# closing temp tables in thread cleanup.
connect (con7,localhost,root,,test);
connection con7;
let $connection_id= `select connection_id()`;
create table t1 (id integer not null auto_increment primary key);
create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
disconnect con7;
--sleep 5
connection default;
disconnect con7;
# Wait till the session con7 is disconnected
let $wait_condition =
SELECT COUNT(*) = 0
FROM information_schema.processlist
WHERE id = '$connection_id';
--source include/wait_condition.inc
drop table t1;
--disconnect con1
--disconnect con2
--disconnect con3
--disconnect con4
--disconnect con5
--disconnect con6
--disconnect con10
--echo # ------------------------------------------------------------------
--echo # -- End of 4.1 tests
--echo # ------------------------------------------------------------------
......@@ -147,7 +159,7 @@ let $wait_condition =
--echo # -- Check that we allow exactly three user connections, no matter how
--echo # -- many threads are running.
--echo
--echo
--echo # -- Connecting (1)...
let $con_name = con_1;
let $con_user_name = mysqltest_u1;
......@@ -237,7 +249,7 @@ DROP USER mysqltest_u1@localhost;
###########################################################################
--echo # -- Bug#35074: max_used_connections is not correct.
--echo # -- Bug#35074: max_used_connections is not correct.
--echo
FLUSH STATUS;
......@@ -250,11 +262,7 @@ SHOW STATUS LIKE 'max_used_connections';
SET GLOBAL event_scheduler = ON;
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
SELECT COUNT(*) = 1
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
--source include/running_event_scheduler.inc
# NOTE: We should use a new connection here instead of reconnect in order to
# avoid races (we can not for sure when the connection being disconnected is
......@@ -278,11 +286,7 @@ SHOW STATUS LIKE 'max_used_connections';
SET GLOBAL event_scheduler = OFF;
--echo # -- Waiting for Event Scheduler to stop...
let $wait_condition =
SELECT COUNT(*) = 0
FROM information_schema.processlist
WHERE user = 'event_scheduler';
--source include/wait_condition.inc
--source include/no_running_events.inc
--echo
--echo # -- End of Bug#35074.
......@@ -291,3 +295,7 @@ let $wait_condition =
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
-- source include/have_innodb.inc
--source include/have_innodb.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings
drop table if exists t1;
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
### Test 1:
### - While a consistent snapshot transaction is executed,
### no external inserts should be visible to the transaction.
--echo # Switch to connection con1
connection con1;
create table t1 (a int) engine=innodb;
start transaction with consistent snapshot;
CREATE TABLE t1 (a INT) ENGINE=innodb;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
--echo # Switch to connection con2
connection con2;
insert into t1 values(1);
INSERT INTO t1 VALUES(1);
--echo # Switch to connection con1
connection con1;
select * from t1; # if consistent snapshot was set as expected, we
SELECT * FROM t1; # if consistent snapshot was set as expected, we
# should see nothing.
commit;
COMMIT;
### Test 2:
### - For any non-consistent snapshot transaction, external
### committed inserts should be visible to the transaction.
delete from t1;
start transaction; # Now we omit WITH CONSISTENT SNAPSHOT
DELETE FROM t1;
START TRANSACTION; # Now we omit WITH CONSISTENT SNAPSHOT
--echo # Switch to connection con2
connection con2;
insert into t1 values(1);
INSERT INTO t1 VALUES(1);
--echo # Switch to connection con1
connection con1;
select * from t1; # if consistent snapshot was not set, as expected, we
SELECT * FROM t1; # if consistent snapshot was not set, as expected, we
# should see 1.
commit;
COMMIT;
drop table t1;
--echo # Switch to connection default + close connections con1 and con2
connection default;
disconnect con1;
disconnect con2;
DROP TABLE t1;
# End of 4.1 tests
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
......@@ -5,12 +9,19 @@ dirty_close con1;
connection con2;
--disable_warnings
drop table if exists t1;
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (n int);
insert into t1 values (1),(2),(3);
select * from t1;
drop table t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
DROP TABLE t1;
connection default;
disconnect con2;
# End of 4.1 tests
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
......@@ -1209,6 +1209,18 @@ select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mo
select name from mysql.event where name = 'p' and sql_mode = @full_mode;
drop event e1;
#
# Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large server_id
#
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
SELECT @@GLOBAL.server_id;
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
###########################################################################
#
# End of tests
......
......@@ -123,6 +123,21 @@ execute s1;
DROP TABLE t1,t2;
#
# Bug #43354: Use key hint can crash server in explain extended query
#
CREATE TABLE t1 (a INT PRIMARY KEY);
--error ER_KEY_DOES_NOT_EXITS
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
DROP TABLE t1;
# End of 5.0 tests.
--echo #
--echo # Bug#37870: Usage of uninitialized value caused failed assertion.
--echo #
......@@ -141,4 +156,4 @@ flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
drop tables t1, t2;
# End of 5.0 tests.
--echo End of 5.1 tests.
......@@ -4,74 +4,106 @@
# This is intended to mimick how mysqldump and innobackup work.
# And it requires InnoDB
-- source include/have_innodb.inc
--source include/have_innodb.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--echo # Establish connection con3 (user=root)
connect (con3,localhost,root,,);
--echo # Switch to connection con1
connection con1;
--disable_warnings
drop table if exists t1;
DROP TABLE IF EXISTS t1;
--enable_warnings
create table t1 (a int) engine=innodb;
CREATE TABLE t1 (a INT) ENGINE=innodb;
# blocks COMMIT ?
begin;
insert into t1 values(1);
BEGIN;
INSERT INTO t1 VALUES(1);
--echo # Switch to connection con2
connection con2;
flush tables with read lock;
select * from t1;
FLUSH TABLES WITH READ LOCK;
SELECT * FROM t1;
--echo # Switch to connection con1
connection con1;
send commit; # blocked by con2
send COMMIT; # blocked by con2
sleep 1;
--echo # Switch to connection con2
connection con2;
select * from t1; # verify con1 was blocked and data did not move
unlock tables;
SELECT * FROM t1; # verify con1 was blocked and data did not move
UNLOCK TABLES;
--echo # Switch to connection con1
connection con1;
reap;
# No deadlock ?
--echo # Switch to connection con1
connection con1;
begin;
select * from t1 for update;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
--echo # Switch to connection con2
connection con2;
begin;
send select * from t1 for update; # blocked by con1
BEGIN;
send SELECT * FROM t1 FOR UPDATE; # blocked by con1
sleep 1;
--echo # Switch to connection con3
connection con3;
send flush tables with read lock; # blocked by con2
send FLUSH TABLES WITH READ LOCK; # blocked by con2
--echo # Switch to connection con1
connection con1;
commit; # should not be blocked by con3
COMMIT; # should not be blocked by con3
--echo # Switch to connection con2
connection con2;
reap;
--echo # Switch to connection con3
connection con3;
reap;
unlock tables;
UNLOCK TABLES;
# BUG#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES
# WITH READ LOCK
# Bug#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES
# WITH READ LOCK
--echo # Switch to connection con2
connection con2;
commit; # unlock InnoDB row locks to allow insertions
COMMIT; # unlock InnoDB row locks to allow insertions
--echo # Switch to connection con1
connection con1;
begin;
insert into t1 values(10);
flush tables with read lock;
commit;
unlock tables;
BEGIN;
INSERT INTO t1 VALUES(10);
FLUSH TABLES WITH READ LOCK;
COMMIT;
UNLOCK TABLES;
--echo # Switch to connection con2
connection con2;
flush tables with read lock; # bug caused hang here
unlock tables;
FLUSH TABLES WITH READ LOCK; # bug caused hang here
UNLOCK TABLES;
# Bug#7358 SHOW CREATE DATABASE fails if open transaction
BEGIN;
SELECT * FROM t1;
SHOW CREATE DATABASE test;
# BUG#7358 SHOW CREATE DATABASE fails if open transaction
DROP TABLE t1;
begin;
select * from t1;
show create database test;
drop table t1;
# Cleanup
--echo # Switch to connection default and close connections con1, con2, con3
connection default;
disconnect con1;
disconnect con2;
disconnect con3;
# End of 4.1 tests
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
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.
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.
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.
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