Commit 08399602 authored by He Zhenxing's avatar He Zhenxing

Auto Merge

parents bd35cfe2 85388091
...@@ -389,6 +389,9 @@ client/readline.cpp ...@@ -389,6 +389,9 @@ client/readline.cpp
client/rpl_constants.h client/rpl_constants.h
client/rpl_record_old.cc client/rpl_record_old.cc
client/rpl_record_old.h client/rpl_record_old.h
client/rpl_tblmap.h
client/rpl_tblmap.cc
client/rpl_utility.h
client/select_test client/select_test
client/sql_string.cpp client/sql_string.cpp
client/ssl_test client/ssl_test
......
...@@ -176,7 +176,7 @@ check_cpu () { ...@@ -176,7 +176,7 @@ check_cpu () {
fi fi
cc_ver=`$cc --version | sed 1q` cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
set -- `echo $cc_verno | tr '.' ' '` set -- `echo $cc_verno | tr '.' ' '`
cc_major=$1 cc_major=$1
cc_minor=$2 cc_minor=$2
......
...@@ -49,7 +49,7 @@ bin-dist: all ...@@ -49,7 +49,7 @@ bin-dist: all
$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@ $(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# Remove BK's "SCCS" subdirectories from source distribution # Remove BK's "SCCS" subdirectories from source distribution
# Create initial database files for Windows installations. # Create initial database files for Windows installations and check them.
dist-hook: dist-hook:
rm -rf `find $(distdir) -type d -name SCCS -print` rm -rf `find $(distdir) -type d -name SCCS -print`
mkdir -p $(distdir)/win mkdir -p $(distdir)/win
...@@ -57,6 +57,7 @@ dist-hook: ...@@ -57,6 +57,7 @@ dist-hook:
--builddir=$(top_builddir) \ --builddir=$(top_builddir) \
--datadir=$(distdir)/win/data \ --datadir=$(distdir)/win/data \
--srcdir=$(top_srcdir) --srcdir=$(top_srcdir)
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
tags: tags:
support-files/build-tags support-files/build-tags
......
...@@ -104,6 +104,7 @@ DEFS = -DUNDEF_THREADS_HACK \ ...@@ -104,6 +104,7 @@ DEFS = -DUNDEF_THREADS_HACK \
-DDATADIR="\"$(localstatedir)\"" -DDATADIR="\"$(localstatedir)\""
sql_src=log_event.h mysql_priv.h rpl_constants.h \ sql_src=log_event.h mysql_priv.h rpl_constants.h \
rpl_utility.h rpl_tblmap.h rpl_tblmap.cc \
log_event.cc my_decimal.h my_decimal.cc \ log_event.cc my_decimal.h my_decimal.cc \
log_event_old.h log_event_old.cc \ log_event_old.h log_event_old.cc \
rpl_record_old.h rpl_record_old.cc rpl_record_old.h rpl_record_old.cc
......
...@@ -64,7 +64,8 @@ static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); ...@@ -64,7 +64,8 @@ static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0; static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 0; static bool opt_hexdump= 0;
const char *base64_output_mode_names[]= {"NEVER", "AUTO", "ALWAYS", NullS}; const char *base64_output_mode_names[]=
{"NEVER", "AUTO", "ALWAYS", "UNSPEC", "DECODE-ROWS", NullS};
TYPELIB base64_output_mode_typelib= TYPELIB base64_output_mode_typelib=
{ array_elements(base64_output_mode_names) - 1, "", { array_elements(base64_output_mode_names) - 1, "",
base64_output_mode_names, NULL }; base64_output_mode_names, NULL };
...@@ -83,6 +84,8 @@ static const char* user = 0; ...@@ -83,6 +84,8 @@ static const char* user = 0;
static char* pass = 0; static char* pass = 0;
static char *charset= 0; static char *charset= 0;
static uint verbose= 0;
static ulonglong start_position, stop_position; static ulonglong start_position, stop_position;
#define start_position_mot ((my_off_t)start_position) #define start_position_mot ((my_off_t)start_position)
#define stop_position_mot ((my_off_t)stop_position) #define stop_position_mot ((my_off_t)stop_position)
...@@ -1063,6 +1066,9 @@ that may lead to an endless loop.", ...@@ -1063,6 +1066,9 @@ that may lead to an endless loop.",
{"user", 'u', "Connect to the remote server as username.", {"user", 'u', "Connect to the remote server as username.",
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, (uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"verbose", 'v', "Reconstruct SQL statements out of row events. "
"-v -v adds comments on column data types",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, {"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT, {"open_files_limit", OPT_OPEN_FILES_LIMIT,
...@@ -1258,6 +1264,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -1258,6 +1264,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
(find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1); (find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1);
} }
break; break;
case 'v':
if (argument == disabled_my_option)
verbose= 0;
else
verbose++;
break;
case 'V': case 'V':
print_version(); print_version();
exit(0); exit(0);
...@@ -1343,6 +1355,8 @@ static Exit_status dump_log_entries(const char* logname) ...@@ -1343,6 +1355,8 @@ static Exit_status dump_log_entries(const char* logname)
*/ */
fprintf(result_file, "DELIMITER /*!*/;\n"); fprintf(result_file, "DELIMITER /*!*/;\n");
strmov(print_event_info.delimiter, "/*!*/;"); strmov(print_event_info.delimiter, "/*!*/;");
print_event_info.verbose= short_form ? 0 : verbose;
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) : rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname)); dump_local_log_entries(&print_event_info, logname));
......
...@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM ...@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
# #
# When changing major version number please also check switch statement # When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version(). # in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 5.1.28) AM_INIT_AUTOMAKE(mysql, 5.1.30)
AM_CONFIG_HEADER([include/config.h:config.h.in]) AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
......
...@@ -246,7 +246,7 @@ extern int NEAR my_umask, /* Default creation mask */ ...@@ -246,7 +246,7 @@ extern int NEAR my_umask, /* Default creation mask */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */ NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR mysys_uses_curses, my_use_symdir; extern my_bool NEAR mysys_uses_curses, my_use_symdir;
extern ulong sf_malloc_cur_memory, sf_malloc_max_memory; extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size; extern ulong my_default_record_cache_size;
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
...@@ -577,6 +577,7 @@ extern int my_close(File Filedes,myf MyFlags); ...@@ -577,6 +577,7 @@ extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, myf MyFlags); extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags); extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags); extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags); extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename, extern File my_create_with_symlink(const char *linkname, const char *filename,
int createflags, int access_flags, int createflags, int access_flags,
......
...@@ -256,6 +256,10 @@ extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; ...@@ -256,6 +256,10 @@ extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_off_t myisam_max_temp_length; extern my_off_t myisam_max_temp_length;
extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* usually used to check if a symlink points into the mysql data home */
/* which is normally forbidden */
extern int (*myisam_test_invalid_symlink)(const char *filename);
/* Prototypes for myisam-functions */ /* Prototypes for myisam-functions */
extern int mi_close(struct st_myisam_info *file); extern int mi_close(struct st_myisam_info *file);
......
...@@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend() ...@@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend()
data->embedded_info->prev_ptr= &cur->next; data->embedded_info->prev_ptr= &cur->next;
next_field=cur->data; next_field=cur->data;
next_mysql_field= data->embedded_info->fields_list; next_mysql_field= data->embedded_info->fields_list;
#ifndef DBUG_OFF
field_pos= 0;
#endif
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -43,6 +43,7 @@ nobase_test_DATA = lib/mtr_cases.pm \ ...@@ -43,6 +43,7 @@ nobase_test_DATA = lib/mtr_cases.pm \
lib/My/SafeProcess.pm \ lib/My/SafeProcess.pm \
lib/My/File/Path.pm \ lib/My/File/Path.pm \
lib/My/SysInfo.pm \ lib/My/SysInfo.pm \
lib/My/CoreDump.pm \
lib/My/SafeProcess/Base.pm \ lib/My/SafeProcess/Base.pm \
lib/My/SafeProcess/safe_process.pl lib/My/SafeProcess/safe_process.pl
......
SHOW PROCESSLIST; SHOW PROCESSLIST;
exit;
This diff is collapsed.
--require r/case_insensitive_file_system.require
--disable_query_log
show variables like "lower_case_file_system";
--enable_query_log
--require r/lowercase0.require --require r/lowercase0.require
--disable_query_log --disable_query_log
show variables like 'lower_case_%'; show variables like "lower_case_table_names";
--enable_query_log --enable_query_log
--require r/lowercase2.require
--disable_query_log
show variables like 'lower_case_table_names';
--enable_query_log
...@@ -8,7 +8,7 @@ use mtr|| ...@@ -8,7 +8,7 @@ use mtr||
-- --
CREATE TABLE suspicious_patterns ( CREATE TABLE suspicious_patterns (
pattern VARCHAR(255) pattern VARCHAR(255)
)|| ) ENGINE=MyISAM||
-- --
...@@ -46,7 +46,7 @@ INSERT INTO suspicious_patterns VALUES ...@@ -46,7 +46,7 @@ INSERT INTO suspicious_patterns VALUES
-- --
CREATE TABLE test_supressions ( CREATE TABLE test_supressions (
pattern VARCHAR(255) pattern VARCHAR(255)
)|| ) ENGINE=MyISAM||
-- --
...@@ -69,7 +69,7 @@ END ...@@ -69,7 +69,7 @@ END
-- --
CREATE TABLE global_supressions ( CREATE TABLE global_supressions (
pattern VARCHAR(255) pattern VARCHAR(255)
)|| ) ENGINE=MyISAM||
-- Declare a trigger that makes sure -- Declare a trigger that makes sure
...@@ -227,7 +227,7 @@ BEGIN ...@@ -227,7 +227,7 @@ BEGIN
CREATE TEMPORARY TABLE error_log ( CREATE TEMPORARY TABLE error_log (
row INT AUTO_INCREMENT PRIMARY KEY, row INT AUTO_INCREMENT PRIMARY KEY,
line mediumtext NULL line mediumtext NULL
); ) ENGINE=MyISAM;
SELECT variable_value INTO @log_error SELECT variable_value INTO @log_error
FROM information_schema.global_variables FROM information_schema.global_variables
...@@ -255,7 +255,7 @@ BEGIN ...@@ -255,7 +255,7 @@ BEGIN
WHERE line REGEXP "^CURRENT_TEST:"; WHERE line REGEXP "^CURRENT_TEST:";
DELETE FROM error_log WHERE row < @max_row; DELETE FROM error_log WHERE row < @max_row;
CREATE TEMPORARY TABLE suspect_lines AS CREATE TEMPORARY TABLE suspect_lines ENGINE=MyISAM AS
SELECT DISTINCT el.line, 0 as "supressed" SELECT DISTINCT el.line, 0 as "supressed"
FROM error_log el, suspicious_patterns ep FROM error_log el, suspicious_patterns ep
WHERE el.line REGEXP ep.pattern; WHERE el.line REGEXP ep.pattern;
......
This diff is collapsed.
# include/ps_ddl_1.inc
#
# Auxiliary script to be used in ps_ddl.test
#
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
execute stmt_sp;
connection con1;
eval $my_drop;
#
connection default;
--echo # XXX: used to be a bug
execute stmt_sf;
--echo # XXX: used to be a bug
execute stmt_sp;
#
--echo # XXX: used to be a bug
execute stmt_sf;
--echo # XXX: used to be a bug
execute stmt_sp;
connection default;
...@@ -9,3 +9,4 @@ show engines; ...@@ -9,3 +9,4 @@ show engines;
show variables; show variables;
--echo ===== STOP ===== --echo ===== STOP =====
--enable_query_log --enable_query_log
exit;
\ No newline at end of file
...@@ -27,6 +27,16 @@ sub value { ...@@ -27,6 +27,16 @@ sub value {
return $self->{value}; return $self->{value};
} }
sub option {
my ($self)= @_;
my $name= $self->{name};
my $value= $self->{value};
my $opt= $name;
$opt= "$name=$value" if ($value);
$opt= "--$opt" unless ($opt =~ /^--/);
return $opt;
}
package My::Config::Group; package My::Config::Group;
......
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
#
# 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
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
package My::CoreDump;
use strict;
use Carp;
use My::Platform;
use File::Temp qw/ tempfile tempdir /;
sub _gdb {
my ($core_name)= @_;
return unless -f $core_name;
my $dir = tempdir( CLEANUP => 1 );
my ($tmp, $tmp_name) = tempfile( DIR => $dir );
print $tmp
"thread apply all bt\n",
"quit\n";
# Find out name of binary that generated core
my $list= `gdb -c $core_name -x $tmp_name -q --batch 2>&1`
or return;
my $binary;
foreach my $line (split('\n', $list))
{
$binary= $1
if ($line =~ /Core was generated by `(\S+)/);
}
return unless $binary;
print "Generated by '$binary'\n";
my $list= `gdb $binary -c $core_name -x $tmp_name -q --batch 2>&1`
or return;
print $list, "\n";
return 1;
}
sub show {
my ($class, $core_name)= @_;
my @debuggers =
(
\&_gdb,
# TODO...
);
foreach my $debugger (@debuggers){
if ($debugger->($core_name)){
return;
}
}
return;
}
1;
...@@ -26,7 +26,7 @@ use Carp; ...@@ -26,7 +26,7 @@ use Carp;
use My::Platform; use My::Platform;
use base qw(Exporter); use base qw(Exporter);
our @EXPORT= qw(my_find_bin my_find_dir NOT_REQUIRED); our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED);
our $vs_config_dir; our $vs_config_dir;
...@@ -53,7 +53,7 @@ sub NOT_REQUIRED { return 0; } ...@@ -53,7 +53,7 @@ sub NOT_REQUIRED { return 0; }
# binary is not found # binary is not found
# my $mysql_exe= my_find_bin($basedir, # my $mysql_exe= my_find_bin($basedir,
# ["client", "bin"], # ["client", "bin"],
# "mysql", 0); # "mysql", NOT_REQUIRED);
# #
# NOTE: The function honours MTR_VS_CONFIG environment variable # NOTE: The function honours MTR_VS_CONFIG environment variable
# #
...@@ -77,6 +77,40 @@ sub my_find_bin { ...@@ -77,6 +77,40 @@ sub my_find_bin {
} }
#
# my_find_file - find a file with "name_1...name_n" in
# paths "path_1...path_n" and return the full path
#
# Example:
# my $mysqld_exe= my_find_file($basedir.
# ["sql", "bin"],
# "filename");
#
#
# Also supports NOT_REQUIRED flag
#
# NOTE: The function honours MTR_VS_CONFIG environment variable
#
#
sub my_find_file {
my ($base, $paths, $names, $required)= @_;
croak "usage: my_find_file(<base>, <paths>, <names>, [<required>])"
unless @_ == 4 or @_ == 3;
# -------------------------------------------------------
# Find and return the first executable
# -------------------------------------------------------
foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) {
return $path if ( -f $path );
}
if (defined $required and $required == NOT_REQUIRED){
# Return empty string to indicate not found
return "";
}
find_error($base, $paths, $names);
}
# #
# my_find_dir - find the first existing directory in one of # my_find_dir - find the first existing directory in one of
# the given paths # the given paths
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
package My::Platform; package My::Platform;
use strict; use strict;
use File::Basename;
use My::File::Path; # Patched version of File::Path
use base qw(Exporter); use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
...@@ -62,19 +64,23 @@ BEGIN { ...@@ -62,19 +64,23 @@ BEGIN {
# in cygwin perl (that uses unix paths) # in cygwin perl (that uses unix paths)
# #
use Memoize;
memoize('mixed_path');
memoize('native_path');
memoize('posix_path');
sub mixed_path { sub mixed_path {
my ($path)= @_; my ($path)= @_;
if (IS_CYGWIN){ if (IS_CYGWIN){
return unless defined $path; return unless defined $path;
my $cmd= "cygpath -m $path"; my $cmd= "cygpath -m $path";
print "$cmd\n"; $path= `$cmd` or
$path= `$cmd`; print "Failed to run: '$cmd', $!\n";
chomp $path; chomp $path;
} }
return $path; return $path;
} }
sub native_path { sub native_path {
my ($path)= @_; my ($path)= @_;
$path=~ s/\//\\/g $path=~ s/\//\\/g
...@@ -82,7 +88,6 @@ sub native_path { ...@@ -82,7 +88,6 @@ sub native_path {
return $path; return $path;
} }
sub posix_path { sub posix_path {
my ($path)= @_; my ($path)= @_;
if (IS_CYGWIN){ if (IS_CYGWIN){
...@@ -102,14 +107,27 @@ sub check_socket_path_length { ...@@ -102,14 +107,27 @@ sub check_socket_path_length {
require IO::Socket::UNIX; require IO::Socket::UNIX;
my $sock = new IO::Socket::UNIX my $sock;
( eval {
Local => $path, # Create the directories where the
Listen => 1, # socket till be created
); mkpath(dirname($path));
$sock= new IO::Socket::UNIX
(
Local => $path,
Listen => 1,
);
};
if ($@)
{
print $@, '\n';
return 2;
}
if (!defined $sock){ if (!defined $sock){
# Could not create a UNIX domain socket #print "Could not create UNIX domain socket: $!\n";
return 0; # Ok, will not be used by mysqld either return 3;
} }
if ($path ne $sock->hostpath()){ if ($path ne $sock->hostpath()){
# Path was truncated # Path was truncated
......
...@@ -397,7 +397,7 @@ sub collect_one_suite($) ...@@ -397,7 +397,7 @@ sub collect_one_suite($)
my $comb= {}; my $comb= {};
$comb->{name}= $group->name(); $comb->{name}= $group->name();
foreach my $option ( $group->options() ) { foreach my $option ( $group->options() ) {
push(@{$comb->{comb_opt}}, $option->name()."=".$option->value()); push(@{$comb->{comb_opt}}, $option->option());
} }
push(@combinations, $comb); push(@combinations, $comb);
} }
...@@ -699,6 +699,12 @@ sub collect_one_test_case { ...@@ -699,6 +699,12 @@ sub collect_one_test_case {
# should fail by default # should fail by default
$tinfo->{result_file}= $result_file; $tinfo->{result_file}= $result_file;
} }
else {
# No .result file exist
# Remember the path where it should be
# saved in case of --record
$tinfo->{record_file}= $result_file;
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Skip some tests but include in list, just mark them as skipped # Skip some tests but include in list, just mark them as skipped
......
...@@ -20,25 +20,14 @@ ...@@ -20,25 +20,14 @@
use strict; use strict;
# These are not to be prefixed with "mtr_" sub gcov_prepare ($) {
my ($dir)= @_;
sub gcov_prepare (); `find $dir -name \*.gcov \
sub gcov_collect ();
##############################################################################
#
#
#
##############################################################################
sub gcov_prepare () {
`find $::glob_basedir -name \*.gcov \
-or -name \*.da | xargs rm`; -or -name \*.da | xargs rm`;
} }
# Used by gcov my @mysqld_src_dirs=
our @mysqld_src_dirs=
( (
"strings", "strings",
"mysys", "mysys",
...@@ -53,21 +42,24 @@ our @mysqld_src_dirs= ...@@ -53,21 +42,24 @@ our @mysqld_src_dirs=
"sql", "sql",
); );
sub gcov_collect () { sub gcov_collect ($$$) {
my ($dir, $gcov, $gcov_msg, $gcov_err)= @_;
my $start_dir= cwd();
print "Collecting source coverage info...\n"; print "Collecting source coverage info...\n";
-f $::opt_gcov_msg and unlink($::opt_gcov_msg); -f $gcov_msg and unlink($gcov_msg);
-f $::opt_gcov_err and unlink($::opt_gcov_err); -f $gcov_err and unlink($gcov_err);
foreach my $d ( @mysqld_src_dirs ) foreach my $d ( @mysqld_src_dirs )
{ {
chdir("$::glob_basedir/$d"); chdir("$dir/$d");
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
{ {
`$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`; `$gcov $f 2>>$gcov_err >>$gcov_msg`;
} }
chdir($::glob_mysql_test_dir); chdir($start_dir);
} }
print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n"; print "gcov info in $gcov_msg, errors in $gcov_err\n";
} }
......
This diff is collapsed.
'#---------------------BS_STVARS_002_01----------------------#' '#---------------------BS_STVARS_002_01----------------------#'
SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format); SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format) COUNT(@@GLOBAL.binlog_format)
1 1
...@@ -9,19 +10,13 @@ COUNT(@@SESSION.binlog_format) ...@@ -9,19 +10,13 @@ COUNT(@@SESSION.binlog_format)
1 Expected 1 Expected
'#---------------------BS_STVARS_002_02----------------------#' '#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1; SET @@GLOBAL.binlog_format=1;
Expected error 'Read only variable' SELECT @@GLOBAL.binlog_format;
Bug: Writeable static variable @@GLOBAL.binlog_format
SELECT COUNT(@@GLOBAL.binlog_format); STATEMENT
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SET @@SESSION.binlog_format=1; SET @@SESSION.binlog_format=1;
Expected error 'Read only variable' SELECT @@SESSION.binlog_format;
Bug: Writeable static variable @@SESSION.binlog_format
SELECT COUNT(@@SESSION.binlog_format); STATEMENT
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_03----------------------#' '#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -34,14 +29,14 @@ COUNT(@@GLOBAL.binlog_format) ...@@ -34,14 +29,14 @@ COUNT(@@GLOBAL.binlog_format)
1 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format'; WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE) COUNT(VARIABLE_VALUE)
1 1
1 Expected 1 Expected
'#---------------------BS_STVARS_002_04----------------------#' '#---------------------BS_STVARS_002_04----------------------#'
SELECT @@SESSION.binlog_format = VARIABLE_VALUE SELECT @@SESSION.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format'; WHERE VARIABLE_NAME='binlog_format';
@@SESSION.binlog_format = VARIABLE_VALUE @@SESSION.binlog_format = VARIABLE_VALUE
1 1
...@@ -51,7 +46,7 @@ COUNT(@@SESSION.binlog_format) ...@@ -51,7 +46,7 @@ COUNT(@@SESSION.binlog_format)
1 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format'; WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE) COUNT(VARIABLE_VALUE)
1 1
...@@ -73,3 +68,4 @@ SELECT COUNT(@@GLOBAL.binlog_format); ...@@ -73,3 +68,4 @@ SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format) COUNT(@@GLOBAL.binlog_format)
1 1
1 Expected 1 Expected
SET @@global.binlog_format= @start_value;
Variable_name Value
lower_case_file_system ON
...@@ -15,7 +15,7 @@ utf8 ...@@ -15,7 +15,7 @@ utf8
'#--------------------FN_DYNVARS_011_02-------------------------#' '#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default' 'connection default'
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8); CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
'--verify that character_set_connection converts character_set_client--' '--verify that character_set_connection converts character_set_client--'
SET @@session.character_set_client = utf8; SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8; SET @@session.character_set_results = utf8;
...@@ -53,3 +53,4 @@ SET @@global.character_set_connection = @global_character_set_connection; ...@@ -53,3 +53,4 @@ SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection; SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client; SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results; SET @@session.character_set_results = @session_character_set_results;
DROP TABLE t1;
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name varchar(30) name VARCHAR(30)
) ENGINE = INNODB; ) ENGINE = INNODB;
'#--------------------FN_DYNVARS_017_01-------------------------#' '#--------------------FN_DYNVARS_017_01-------------------------#'
## Creating new connection ## ## Creating new connection ##
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0; SET @@autocommit = 0;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
## Setting value of variable to 0 ## ## Setting value of variable to 0 ##
SET @@session.completion_type = 0; SET @@session.completion_type = 0;
## Here commit & rollback should work normally ## ## Here commit & rollback should work normally ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
2 Record_2 2 Record_2
3 Record_3 3 Record_3
DELETE FROM t1 where id = 2; DELETE FROM t1 WHERE id = 2;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
COMMIT; COMMIT;
'#--------------------FN_DYNVARS_017_02-------------------------#' '#--------------------FN_DYNVARS_017_02-------------------------#'
SET @@session.completion_type = 2; SET @@session.completion_type = 2;
## Here commit should work as COMMIT RELEASE ## ## Here commit should work as COMMIT RELEASE ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
4 Record_4 4 Record_4
5 Record_5 5 Record_5
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
INSERT into t1(name) values('Record_7'); INSERT INTO t1(name) VALUES('Record_7');
COMMIT; COMMIT;
## Inserting rows should give error here because connection should ## ## Inserting rows should give error here because connection should ##
## disconnect after using COMMIT ## ## disconnect after using COMMIT ##
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors Got one of the listed errors
## Creating new connection test_con2 ## ## Creating new connection test_con2 ##
SET @@session.completion_type = 2; SET @@session.completion_type = 2;
## Inserting rows and using Rollback which should Rollback & release ## ## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION; START TRANSACTION;
SELECT * from t1; SELECT * FROM t1;
id name id name
1 Record_1 1 Record_1
3 Record_3 3 Record_3
...@@ -69,8 +69,9 @@ id name ...@@ -69,8 +69,9 @@ id name
5 Record_5 5 Record_5
6 Record_6 6 Record_6
7 Record_7 7 Record_7
INSERT into t1(name) values('Record_8'); INSERT INTO t1(name) VALUES('Record_8');
INSERT into t1(name) values('Record_9'); INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK; ROLLBACK;
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors Got one of the listed errors
DROP TABLE t1;
This diff is collapsed.
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
name varchar(30) name VARCHAR(30)
); );
'#--------------------FN_DYNVARS_018_01-------------------------#' '#--------------------FN_DYNVARS_018_01-------------------------#'
SET @start_value= @@global.concurrent_insert;
## Setting initial value of variable to 1 ## ## Setting initial value of variable to 1 ##
SET @@global.concurrent_insert = 1; SET @@global.concurrent_insert = 1;
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
## locking table ## ## locking table ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
## Creating new connection to insert some rows in table ## ## Creating new connection to insert some rows in table ##
connection test_con1;
## New records should come at the end of all rows ## ## New records should come at the end of all rows ##
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_2 Record_2
Record_3 Record_3
Record_4 Record_4
## unlocking tables ## ## unlocking tables ##
unlock tables; connection default;
## deleting record to create hole in table ## UNLOCK TABLES;
DELETE from t1 where name ='Record_2'; ## deleting record to create hole in table ##
DELETE FROM t1 WHERE name ='Record_2';
'#--------------------FN_DYNVARS_018_02-------------------------#' '#--------------------FN_DYNVARS_018_02-------------------------#'
LOCK TABLE t1 READ LOCAL;
connection test_con1;
SET @@global.concurrent_insert=1;
## send INSERT which should be blocked until unlock of the table ##
INSERT INTO t1(name) VALUES('Record_7');
connection default;
## show processlist info and state ##
SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE state= "Locked" AND info LIKE "INSERT INTO t1%";
state info
Locked INSERT INTO t1(name) VALUES('Record_7')
## table contents befor UNLOCK ##
SELECT * FROM t1;
name
Record_1
Record_3
Record_4
UNLOCK TABLES;
## table contens after UNLOCK ##
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
INSERT INTO t1(name) VALUES('Record_6');
connection test_con1;
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
Record_6
connection default;
'#--------------------FN_DYNVARS_018_03-------------------------#' '#--------------------FN_DYNVARS_018_03-------------------------#'
## lock table and connect with connection1 ## ## lock table and connect with connection1 ##
lock table t1 read local; LOCK TABLE t1 READ LOCAL;
connection test_con1;
## setting value of concurrent_insert to 2 ## ## setting value of concurrent_insert to 2 ##
SET @@global.concurrent_insert=2; SET @@global.concurrent_insert=2;
## Inserting record in table, record should go at the end of the table ## ## Inserting record in table, record should go at the end of the table ##
INSERT into t1(name) values('Record_5'); INSERT INTO t1(name) VALUES('Record_5');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
SELECT @@concurrent_insert; SELECT @@concurrent_insert;
@@concurrent_insert @@concurrent_insert
2 2
## Switching to default connection ## connection default;
## Unlocking table ## ## Unlocking table ##
unlock tables; UNLOCK TABLES;
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
## Inserting new row, this should go in the hole ## ## Inserting new row, this should go in the hole ##
INSERT into t1(name) values('Record_6'); INSERT INTO t1(name) VALUES('Record_6');
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_6 Record_7
Record_3 Record_3
Record_4 Record_4
Record_6
Record_5 Record_5
Record_6
## connection test_con1 ## ## connection test_con1 ##
DELETE from t1 where name ='Record_3'; DELETE FROM t1 WHERE name ='Record_3';
SELECT * from t1; SELECT * FROM t1;
name name
Record_1 Record_1
Record_6 Record_7
Record_4 Record_4
Record_6
Record_5 Record_5
Record_6
## Dropping table ## ## Dropping table ##
DROP table t1; DROP TABLE t1;
## Disconnecting connection ## ## Disconnecting connection ##
SET @@global.concurrent_insert= @start_value;
...@@ -5388,4 +5388,10 @@ select * from t1; ...@@ -5388,4 +5388,10 @@ select * from t1;
c1 c1
That That
drop table t1; drop table t1;
create table t1 (a int not null) engine=csv;
lock tables t1 read;
select * from t1;
ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
End of 5.1 tests End of 5.1 tests
'#--------------------FN_DYNVARS_023_01-------------------------#' '#--------------------FN_DYNVARS_023_01-------------------------#'
SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON; SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write; SELECT @@global.delay_key_write;
@@global.delay_key_write @@global.delay_key_write
...@@ -28,8 +29,8 @@ Key_writes 9 ...@@ -28,8 +29,8 @@ Key_writes 9
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
'----check when delay_key_write is ON---' '----check when delay_key_write is ON---'
SET @@global.delay_key_write = ON; SET @@global.delay_key_write = ON;
...@@ -44,8 +45,8 @@ Key_writes 0 ...@@ -44,8 +45,8 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
'----check when delay_key_write is ALL---' '----check when delay_key_write is ALL---'
SET @@global.delay_key_write = ALL; SET @@global.delay_key_write = ALL;
...@@ -60,8 +61,9 @@ Key_writes 0 ...@@ -60,8 +61,9 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests'; SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value Variable_name Value
Key_write_requests 9 Key_write_requests 9
select count(*) from t1; SELECT COUNT(*) FROM t1;
count(*) COUNT(*)
9 9
DROP PROCEDURE sp_addRecords; DROP PROCEDURE sp_addRecords;
DROP TABLE t1; DROP TABLE t1;
SET @@global.delay_key_write= @start_value;
...@@ -115,3 +115,21 @@ SELECT 1 REGEXP NULL; ...@@ -115,3 +115,21 @@ SELECT 1 REGEXP NULL;
1 REGEXP NULL 1 REGEXP NULL
NULL NULL
End of 5.0 tests End of 5.0 tests
CREATE TABLE t1(a INT, b CHAR(4));
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
DEALLOCATE PREPARE stmt1;
DROP TABLE t1;
End of 5.1 tests
...@@ -17,3 +17,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES ...@@ -17,3 +17,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file'; WHERE VARIABLE_NAME='general_log_file';
@@global.general_log_file = VARIABLE_VALUE @@global.general_log_file = VARIABLE_VALUE
1 1
SET @@global.general_log_file= @start_value;
drop table if exists t1; DROP TABLE IF EXISTS t1;
## Creating new table ## ## Creating new table ##
CREATE TABLE t1 CREATE TABLE t1
( (
id INT NOT NULL auto_increment, id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id), PRIMARY KEY (id),
name VARCHAR(30) name VARCHAR(30)
); );
...@@ -10,10 +10,10 @@ name VARCHAR(30) ...@@ -10,10 +10,10 @@ name VARCHAR(30)
SELECT @@general_log_file; SELECT @@general_log_file;
@@general_log_file @@general_log_file
mysql-test.log mysql-test.log
INSERT into t1(name) values('Record_1'); INSERT INTO t1(name) VALUES('Record_1');
INSERT into t1(name) values('Record_2'); INSERT INTO t1(name) VALUES('Record_2');
INSERT into t1(name) values('Record_3'); INSERT INTO t1(name) VALUES('Record_3');
INSERT into t1(name) values('Record_4'); INSERT INTO t1(name) VALUES('Record_4');
## Verifying general log file ## ## Verifying general log file ##
## Dropping table ## ## Dropping table ##
DROP TABLE t1; DROP TABLE t1;
...@@ -2372,3 +2372,79 @@ a MIN(b) MAX(b) AVG(b) ...@@ -2372,3 +2372,79 @@ a MIN(b) MAX(b) AVG(b)
2 1 3 2.0000 2 1 3 2.0000
1 1 3 2.0000 1 1 3 2.0000
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into t1 (a,b) values
(0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),
(0,7),(0,8),(0,9),(0,10),(0,11),(0,12),(0,13),
(1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),
(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),
(2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),
(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(2,13),
(3,0),(3,1),(3,2),(3,3),(3,4),(3,5),(3,6),
(3,7),(3,8),(3,9),(3,10),(3,11),(3,12),(3,13);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
select * from t1;
a b
0 0
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
2 0
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
3 0
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 13
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 3 100.00 Using where; Using index for group-by; Using temporary
Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
drop table t1;
...@@ -484,6 +484,7 @@ c1 ...@@ -484,6 +484,7 @@ c1
handler t1 close; handler t1 close;
read the result from the other connection read the result from the other connection
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
proceed with the normal connection proceed with the normal connection
drop table t1; drop table t1;
...@@ -698,6 +699,7 @@ handler a2 read a first; ...@@ -698,6 +699,7 @@ handler a2 read a first;
a a
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
handler a1 close; handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER ERROR 42S02: Unknown table 'a1' in HANDLER
......
...@@ -3,4 +3,5 @@ create table t1(a int not null auto_increment primary key) engine=innodb; ...@@ -3,4 +3,5 @@ create table t1(a int not null auto_increment primary key) engine=innodb;
insert into t1 set a = -1; insert into t1 set a = -1;
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
This diff is collapsed.
...@@ -166,6 +166,7 @@ level id parent_id ...@@ -166,6 +166,7 @@ level id parent_id
1 1007 101 1 1007 101
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
show keys from t1; show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -190,6 +191,7 @@ create table t1 (a int) engine=innodb; ...@@ -190,6 +191,7 @@ create table t1 (a int) engine=innodb;
insert into t1 values (1), (2); insert into t1 values (1), (2);
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
delete from t1 where a = 1; delete from t1 where a = 1;
select * from t1; select * from t1;
...@@ -738,6 +740,7 @@ world 2 ...@@ -738,6 +740,7 @@ world 2
hello 1 hello 1
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
show keys from t1; show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
...@@ -3109,6 +3112,7 @@ BEGIN; ...@@ -3109,6 +3112,7 @@ BEGIN;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK test.t1 optimize status OK
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
...@@ -3263,3 +3267,14 @@ AUTO_INCREMENT ...@@ -3263,3 +3267,14 @@ AUTO_INCREMENT
200 200
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (c1 int default NULL,
c2 int default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
TRUNCATE TABLE t1;
affected rows: 0
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
affected rows: 5
info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
SET @global_start_value = @@global.innodb_autoextend_increment ; SET @global_start_value = @@global.innodb_autoextend_increment ;
SELECT @global_start_value;
@global_start_value
8
'#--------------------FN_DYNVARS_046_01------------------------#' '#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_autoextend_increment = 0; SET @@global.innodb_autoextend_increment = 0;
Warnings: Warnings:
...@@ -57,16 +54,16 @@ SELECT @@global.innodb_autoextend_increment; ...@@ -57,16 +54,16 @@ SELECT @@global.innodb_autoextend_increment;
@@global.innodb_autoextend_increment @@global.innodb_autoextend_increment
1000 1000
'#----------------------FN_DYNVARS_046_05------------------------#' '#----------------------FN_DYNVARS_046_05------------------------#'
SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment '; WHERE VARIABLE_NAME='innodb_autoextend_increment ';
@@global.innodb_autoextend_increment = VARIABLE_VALUE @@global.innodb_autoextend_increment = VARIABLE_VALUE
1 1
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment @@global.innodb_autoextend_increment
1000 1000
SELECT VARIABLE_VALUE SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_autoextend_increment '; WHERE VARIABLE_NAME='innodb_autoextend_increment ';
VARIABLE_VALUE VARIABLE_VALUE
1000 1000
...@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0' ...@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ; SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment @@global.innodb_autoextend_increment
1 1
SET @@global.innodb_autoextend_increment = @global_start_value;
...@@ -9,14 +9,15 @@ DROP TABLE IF EXISTS t1; ...@@ -9,14 +9,15 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1( CREATE TABLE t1(
a INT AUTO_INCREMENT PRIMARY KEY, a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR b CHAR
)ENGINE=INNODB, AUTO_INCREMENT=100; ) ENGINE=INNODB, AUTO_INCREMENT=100;
INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d'); INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d');
INSERT INTO t1 (a,b) VALUES (NULL,'e'); INSERT INTO t1 (a,b) VALUES (NULL,'e');
'the new auto incremented value should be 104' 'the new auto incremented value should be 104'
SELECT * from t1; SELECT * FROM t1;
a b a b
1 c 1 c
5 a 5 a
100 b 100 b
101 d 101 d
104 e 104 e
DROP TABLE t1;
f4 f8
xxx zzz
f4 f8
xxx zzz
...@@ -93,14 +93,14 @@ ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be ...@@ -93,14 +93,14 @@ ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be
SET @@local.innodb_fast_shutdown = 0; SET @@local.innodb_fast_shutdown = 0;
ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be set with SET GLOBAL
'#----------------------FN_DYNVARS_042_06------------------------#' '#----------------------FN_DYNVARS_042_06------------------------#'
SELECT count(VARIABLE_VALUE) AS res_is_0 SELECT count(VARIABLE_VALUE) AS res_is_0
FROM INFORMATION_SCHEMA.SESSION_VARIABLES FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown'; WHERE VARIABLE_NAME='innodb_fast_shutdown';
res_is_0 res_is_0
1 1
'#----------------------FN_DYNVARS_042_07------------------------#' '#----------------------FN_DYNVARS_042_07------------------------#'
SELECT @@global.innodb_fast_shutdown = SELECT @@global.innodb_fast_shutdown =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_fast_shutdown'; WHERE VARIABLE_NAME='innodb_fast_shutdown';
@@global.innodb_fast_shutdown = @@global.innodb_fast_shutdown =
VARIABLE_VALUE VARIABLE_VALUE
...@@ -125,3 +125,7 @@ SET @@global.innodb_fast_shutdown = FALSE; ...@@ -125,3 +125,7 @@ SET @@global.innodb_fast_shutdown = FALSE;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown @@global.innodb_fast_shutdown
0 0
SET @@global.innodb_fast_shutdown = @global_start_value;
SELECT @@global.innodb_fast_shutdown;
@@global.innodb_fast_shutdown
1
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.
Variable_name Value Variable_name Value
lower_case_file_system ON
lower_case_table_names 0 lower_case_table_names 0
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 was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
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.
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.
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