Commit 29f44c77 authored by He Zhenxing's avatar He Zhenxing

Auto Merge

parents a4cd8862 7fbab750
......@@ -389,6 +389,9 @@ client/readline.cpp
client/rpl_constants.h
client/rpl_record_old.cc
client/rpl_record_old.h
client/rpl_tblmap.h
client/rpl_tblmap.cc
client/rpl_utility.h
client/select_test
client/sql_string.cpp
client/ssl_test
......
......@@ -176,7 +176,7 @@ check_cpu () {
fi
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 '.' ' '`
cc_major=$1
cc_minor=$2
......
......@@ -49,7 +49,7 @@ bin-dist: all
$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# 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:
rm -rf `find $(distdir) -type d -name SCCS -print`
mkdir -p $(distdir)/win
......@@ -57,6 +57,7 @@ dist-hook:
--builddir=$(top_builddir) \
--datadir=$(distdir)/win/data \
--srcdir=$(top_srcdir)
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
tags:
support-files/build-tags
......
......@@ -104,6 +104,7 @@ DEFS = -DUNDEF_THREADS_HACK \
-DDATADIR="\"$(localstatedir)\""
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_old.h log_event_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);
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 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=
{ array_elements(base64_output_mode_names) - 1, "",
base64_output_mode_names, NULL };
......@@ -83,6 +84,8 @@ static const char* user = 0;
static char* pass = 0;
static char *charset= 0;
static uint verbose= 0;
static ulonglong start_position, stop_position;
#define start_position_mot ((my_off_t)start_position)
#define stop_position_mot ((my_off_t)stop_position)
......@@ -1063,6 +1066,9 @@ that may lead to an endless loop.",
{"user", 'u', "Connect to the remote server as username.",
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 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,
0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
......@@ -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);
}
break;
case 'v':
if (argument == disabled_my_option)
verbose= 0;
else
verbose++;
break;
case 'V':
print_version();
exit(0);
......@@ -1344,6 +1356,8 @@ static Exit_status dump_log_entries(const char* logname)
fprintf(result_file, "DELIMITER /*!*/;\n");
strmov(print_event_info.delimiter, "/*!*/;");
print_event_info.verbose= short_form ? 0 : verbose;
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
......
......@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# 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])
PROTOCOL_VERSION=10
......
......@@ -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_dont_interrupt; /* call remember_intr when set */
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 my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
......@@ -577,6 +577,7 @@ extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, 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_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename,
int createflags, int access_flags,
......
......@@ -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 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 */
extern int mi_close(struct st_myisam_info *file);
......
......@@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend()
data->embedded_info->prev_ptr= &cur->next;
next_field=cur->data;
next_mysql_field= data->embedded_info->fields_list;
#ifndef DBUG_OFF
field_pos= 0;
#endif
DBUG_VOID_RETURN;
}
......
......@@ -43,6 +43,7 @@ nobase_test_DATA = lib/mtr_cases.pm \
lib/My/SafeProcess.pm \
lib/My/File/Path.pm \
lib/My/SysInfo.pm \
lib/My/CoreDump.pm \
lib/My/SafeProcess/Base.pm \
lib/My/SafeProcess/safe_process.pl
......
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
--disable_query_log
show variables like 'lower_case_%';
show variables like "lower_case_table_names";
--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||
--
CREATE TABLE suspicious_patterns (
pattern VARCHAR(255)
)||
) ENGINE=MyISAM||
--
......@@ -46,7 +46,7 @@ INSERT INTO suspicious_patterns VALUES
--
CREATE TABLE test_supressions (
pattern VARCHAR(255)
)||
) ENGINE=MyISAM||
--
......@@ -69,7 +69,7 @@ END
--
CREATE TABLE global_supressions (
pattern VARCHAR(255)
)||
) ENGINE=MyISAM||
-- Declare a trigger that makes sure
......@@ -227,7 +227,7 @@ BEGIN
CREATE TEMPORARY TABLE error_log (
row INT AUTO_INCREMENT PRIMARY KEY,
line mediumtext NULL
);
) ENGINE=MyISAM;
SELECT variable_value INTO @log_error
FROM information_schema.global_variables
......@@ -255,7 +255,7 @@ BEGIN
WHERE line REGEXP "^CURRENT_TEST:";
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"
FROM error_log el, suspicious_patterns ep
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;
show variables;
--echo ===== STOP =====
--enable_query_log
exit;
\ No newline at end of file
......@@ -27,6 +27,16 @@ sub 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;
......
# -*- 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;
use My::Platform;
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;
......@@ -53,7 +53,7 @@ sub NOT_REQUIRED { return 0; }
# binary is not found
# my $mysql_exe= my_find_bin($basedir,
# ["client", "bin"],
# "mysql", 0);
# "mysql", NOT_REQUIRED);
#
# NOTE: The function honours MTR_VS_CONFIG environment variable
#
......@@ -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
# the given paths
......
......@@ -17,6 +17,8 @@
package My::Platform;
use strict;
use File::Basename;
use My::File::Path; # Patched version of File::Path
use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
......@@ -62,19 +64,23 @@ BEGIN {
# in cygwin perl (that uses unix paths)
#
use Memoize;
memoize('mixed_path');
memoize('native_path');
memoize('posix_path');
sub mixed_path {
my ($path)= @_;
if (IS_CYGWIN){
return unless defined $path;
my $cmd= "cygpath -m $path";
print "$cmd\n";
$path= `$cmd`;
$path= `$cmd` or
print "Failed to run: '$cmd', $!\n";
chomp $path;
}
return $path;
}
sub native_path {
my ($path)= @_;
$path=~ s/\//\\/g
......@@ -82,7 +88,6 @@ sub native_path {
return $path;
}
sub posix_path {
my ($path)= @_;
if (IS_CYGWIN){
......@@ -102,14 +107,27 @@ sub check_socket_path_length {
require IO::Socket::UNIX;
my $sock = new IO::Socket::UNIX
my $sock;
eval {
# Create the directories where the
# socket till be created
mkpath(dirname($path));
$sock= new IO::Socket::UNIX
(
Local => $path,
Listen => 1,
);
};
if ($@)
{
print $@, '\n';
return 2;
}
if (!defined $sock){
# Could not create a UNIX domain socket
return 0; # Ok, will not be used by mysqld either
#print "Could not create UNIX domain socket: $!\n";
return 3;
}
if ($path ne $sock->hostpath()){
# Path was truncated
......
......@@ -397,7 +397,7 @@ sub collect_one_suite($)
my $comb= {};
$comb->{name}= $group->name();
foreach my $option ( $group->options() ) {
push(@{$comb->{comb_opt}}, $option->name()."=".$option->value());
push(@{$comb->{comb_opt}}, $option->option());
}
push(@combinations, $comb);
}
......@@ -699,6 +699,12 @@ sub collect_one_test_case {
# should fail by default
$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
......
......@@ -20,25 +20,14 @@
use strict;
# These are not to be prefixed with "mtr_"
sub gcov_prepare ($) {
my ($dir)= @_;
sub gcov_prepare ();
sub gcov_collect ();
##############################################################################
#
#
#
##############################################################################
sub gcov_prepare () {
`find $::glob_basedir -name \*.gcov \
`find $dir -name \*.gcov \
-or -name \*.da | xargs rm`;
}
# Used by gcov
our @mysqld_src_dirs=
my @mysqld_src_dirs=
(
"strings",
"mysys",
......@@ -53,21 +42,24 @@ our @mysqld_src_dirs=
"sql",
);
sub gcov_collect () {
sub gcov_collect ($$$) {
my ($dir, $gcov, $gcov_msg, $gcov_err)= @_;
my $start_dir= cwd();
print "Collecting source coverage info...\n";
-f $::opt_gcov_msg and unlink($::opt_gcov_msg);
-f $::opt_gcov_err and unlink($::opt_gcov_err);
-f $gcov_msg and unlink($gcov_msg);
-f $gcov_err and unlink($gcov_err);
foreach my $d ( @mysqld_src_dirs )
{
chdir("$::glob_basedir/$d");
chdir("$dir/$d");
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----------------------#'
SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
......@@ -9,19 +10,13 @@ COUNT(@@SESSION.binlog_format)
1 Expected
'#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT @@GLOBAL.binlog_format;
@@GLOBAL.binlog_format
STATEMENT
SET @@SESSION.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT @@SESSION.binlog_format;
@@SESSION.binlog_format
STATEMENT
'#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
......@@ -73,3 +68,4 @@ SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SET @@global.binlog_format= @start_value;
Variable_name Value
lower_case_file_system ON
......@@ -15,7 +15,7 @@ utf8
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
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--'
SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
......@@ -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_client = @session_character_set_client;
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 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
name varchar(30)
name VARCHAR(30)
) ENGINE = INNODB;
'#--------------------FN_DYNVARS_017_01-------------------------#'
## Creating new connection ##
INSERT into t1(name) values('Record_1');
INSERT INTO t1(name) VALUES('Record_1');
SET @@autocommit = 0;
SELECT * from t1;
SELECT * FROM t1;
id name
1 Record_1
## Setting value of variable to 0 ##
SET @@session.completion_type = 0;
## Here commit & rollback should work normally ##
START TRANSACTION;
SELECT * from t1;
SELECT * FROM t1;
id name
1 Record_1
INSERT into t1(name) values('Record_2');
INSERT into t1(name) values('Record_3');
SELECT * from t1;
INSERT INTO t1(name) VALUES('Record_2');
INSERT INTO t1(name) VALUES('Record_3');
SELECT * FROM t1;
id name
1 Record_1
2 Record_2
3 Record_3
DELETE FROM t1 where id = 2;
SELECT * from t1;
DELETE FROM t1 WHERE id = 2;
SELECT * FROM t1;
id name
1 Record_1
3 Record_3
START TRANSACTION;
SELECT * from t1;
SELECT * FROM t1;
id name
1 Record_1
3 Record_3
INSERT into t1(name) values('Record_4');
INSERT into t1(name) values('Record_5');
INSERT INTO t1(name) VALUES('Record_4');
INSERT INTO t1(name) VALUES('Record_5');
COMMIT;
'#--------------------FN_DYNVARS_017_02-------------------------#'
SET @@session.completion_type = 2;
## Here commit should work as COMMIT RELEASE ##
START TRANSACTION;
SELECT * from t1;
SELECT * FROM t1;
id name
1 Record_1
3 Record_3
4 Record_4
5 Record_5
INSERT into t1(name) values('Record_6');
INSERT into t1(name) values('Record_7');
INSERT INTO t1(name) VALUES('Record_6');
INSERT INTO t1(name) VALUES('Record_7');
COMMIT;
## Inserting rows should give error here because connection should ##
## disconnect after using COMMIT ##
INSERT into t1(name) values('Record_4');
INSERT INTO t1(name) VALUES('Record_4');
Got one of the listed errors
## Creating new connection test_con2 ##
SET @@session.completion_type = 2;
## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION;
SELECT * from t1;
SELECT * FROM t1;
id name
1 Record_1
3 Record_3
......@@ -69,8 +69,9 @@ id name
5 Record_5
6 Record_6
7 Record_7
INSERT into t1(name) values('Record_8');
INSERT into t1(name) values('Record_9');
INSERT INTO t1(name) VALUES('Record_8');
INSERT INTO t1(name) VALUES('Record_9');
ROLLBACK;
INSERT into t1(name) values('Record_4');
INSERT INTO t1(name) VALUES('Record_4');
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 ##
CREATE TABLE t1
(
name varchar(30)
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_018_01-------------------------#'
SET @start_value= @@global.concurrent_insert;
## Setting initial value of variable to 1 ##
SET @@global.concurrent_insert = 1;
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
INSERT into t1(name) values('Record_3');
INSERT INTO t1(name) VALUES('Record_1');
INSERT INTO t1(name) VALUES('Record_2');
INSERT INTO t1(name) VALUES('Record_3');
## locking table ##
lock table t1 read local;
LOCK TABLE t1 READ LOCAL;
## Creating new connection to insert some rows in table ##
connection test_con1;
## New records should come at the end of all rows ##
INSERT into t1(name) values('Record_4');
SELECT * from t1;
INSERT INTO t1(name) VALUES('Record_4');
SELECT * FROM t1;
name
Record_1
Record_2
Record_3
Record_4
## unlocking tables ##
unlock tables;
connection default;
UNLOCK TABLES;
## deleting record to create hole in table ##
DELETE from t1 where name ='Record_2';
DELETE FROM t1 WHERE name ='Record_2';
'#--------------------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-------------------------#'
## 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 ##
SET @@global.concurrent_insert=2;
## Inserting record in table, record should go at the end of the table ##
INSERT into t1(name) values('Record_5');
SELECT * from t1;
INSERT INTO t1(name) VALUES('Record_5');
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
Record_6
Record_5
SELECT @@concurrent_insert;
@@concurrent_insert
2
## Switching to default connection ##
connection default;
## Unlocking table ##
unlock tables;
SELECT * from t1;
UNLOCK TABLES;
SELECT * FROM t1;
name
Record_1
Record_7
Record_3
Record_4
Record_6
Record_5
## Inserting new row, this should go in the hole ##
INSERT into t1(name) values('Record_6');
SELECT * from t1;
INSERT INTO t1(name) VALUES('Record_6');
SELECT * FROM t1;
name
Record_1
Record_6
Record_7
Record_3
Record_4
Record_6
Record_5
Record_6
## connection test_con1 ##
DELETE from t1 where name ='Record_3';
SELECT * from t1;
DELETE FROM t1 WHERE name ='Record_3';
SELECT * FROM t1;
name
Record_1
Record_6
Record_7
Record_4
Record_6
Record_5
Record_6
## Dropping table ##
DROP table t1;
DROP TABLE t1;
## Disconnecting connection ##
SET @@global.concurrent_insert= @start_value;
......@@ -5388,4 +5388,10 @@ select * from t1;
c1
That
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
'#--------------------FN_DYNVARS_023_01-------------------------#'
SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write;
@@global.delay_key_write
......@@ -28,8 +29,8 @@ Key_writes 9
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
select count(*) from t1;
count(*)
SELECT COUNT(*) FROM t1;
COUNT(*)
9
'----check when delay_key_write is ON---'
SET @@global.delay_key_write = ON;
......@@ -44,8 +45,8 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
select count(*) from t1;
count(*)
SELECT COUNT(*) FROM t1;
COUNT(*)
9
'----check when delay_key_write is ALL---'
SET @@global.delay_key_write = ALL;
......@@ -60,8 +61,9 @@ Key_writes 0
SHOW STATUS LIKE 'Key_write_requests';
Variable_name Value
Key_write_requests 9
select count(*) from t1;
count(*)
SELECT COUNT(*) FROM t1;
COUNT(*)
9
DROP PROCEDURE sp_addRecords;
DROP TABLE t1;
SET @@global.delay_key_write= @start_value;
......@@ -115,3 +115,21 @@ SELECT 1 REGEXP NULL;
1 REGEXP NULL
NULL
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
WHERE VARIABLE_NAME='general_log_file';
@@global.general_log_file = VARIABLE_VALUE
1
SET @@global.general_log_file= @start_value;
drop table if exists t1;
DROP TABLE IF EXISTS t1;
## Creating new table ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
name VARCHAR(30)
);
......@@ -10,10 +10,10 @@ name VARCHAR(30)
SELECT @@general_log_file;
@@general_log_file
mysql-test.log
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
INSERT into t1(name) values('Record_3');
INSERT into t1(name) values('Record_4');
INSERT INTO t1(name) VALUES('Record_1');
INSERT INTO t1(name) VALUES('Record_2');
INSERT INTO t1(name) VALUES('Record_3');
INSERT INTO t1(name) VALUES('Record_4');
## Verifying general log file ##
## Dropping table ##
DROP TABLE t1;
......@@ -2372,3 +2372,79 @@ a MIN(b) MAX(b) AVG(b)
2 1 3 2.0000
1 1 3 2.0000
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
handler t1 close;
read the result from the other connection
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
proceed with the normal connection
drop table t1;
......@@ -698,6 +699,7 @@ handler a2 read a first;
a
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
......
......@@ -3,4 +3,5 @@ create table t1(a int not null auto_increment primary key) engine=innodb;
insert into t1 set a = -1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
drop table if exists t1;
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (9223372036854775807, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
9223372036854775807 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (127, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
127 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (255, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
255 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (32767, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
32767 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (65535, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
65535 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (8388607, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
8388607 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (16777215, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
16777215 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2147483647, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
2147483647 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (4294967295, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
4294967295 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (9223372036854775807, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
9223372036854775807 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (18446744073709551615, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
18446744073709551615 NULL
DROP TABLE t1;
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
TRUNCATE TABLE t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
DELETE FROM t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
7
8
9
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
DROP TABLE t1;
This diff is collapsed.
SET @global_start_value = @@global.innodb_autoextend_increment ;
SELECT @global_start_value;
@global_start_value
8
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_autoextend_increment = 0;
Warnings:
......@@ -92,3 +89,4 @@ Warning 1292 Truncated incorrect autoextend_increment value: '0'
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
1
SET @@global.innodb_autoextend_increment = @global_start_value;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff 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 is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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