Commit 7935311f authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0

into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1


BitKeeper/etc/logging_ok:
  auto-union
sql/ha_innodb.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
parents 16fd4ff6 1a0bddb8
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@

# This file is public domain and comes with NO WARRANTY of any kind

if HAVE_YASSL
  yassl_dummy_link_fix= $(top_srcdir)/extra/yassl/src/dummy.cpp
else
  yassl_dummy_link_fix=
endif
#AUTOMAKE_OPTIONS =              nostdinc
INCLUDES =			-I$(top_srcdir)/include -I$(top_srcdir)/regex \
				$(openssl_includes) -I$(top_builddir)/include
@@ -30,12 +35,17 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
mysql_SOURCES =			mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES =		mysqladmin.cc
mysql_LDADD =			@readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqltest_SOURCES=		mysqltest.c $(top_srcdir)/mysys/my_getsystime.c
mysqltest_SOURCES=              mysqltest.c $(top_srcdir)/mysys/my_getsystime.c \
                                $(yassl_dummy_link_fix)
mysqltest_LDADD =		$(top_builddir)/regex/libregex.a $(LDADD)
mysqlbinlog_SOURCES =   mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c $(top_srcdir)/mysys/my_new.cc
mysqlbinlog_LDADD =		$(LDADD) $(CXXLDFLAGS)
mysqltestmanagerc_SOURCES =   mysqlmanagerc.c 
mysqltestmanager_pwgen_SOURCES =   mysqlmanager-pwgen.c 
mysqltestmanagerc_SOURCES=      mysqlmanagerc.c $(yassl_dummy_link_fix)
mysqlcheck_SOURCES=             mysqlcheck.c $(yassl_dummy_link_fix)
mysqlshow_SOURCES=              mysqlshow.c $(yassl_dummy_link_fix)
mysqldump_SOURCES=              mysqldump.c $(yassl_dummy_link_fix)
mysqlimport_SOURCES=            mysqlimport.c $(yassl_dummy_link_fix)
sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc
strings_src=decimal.c

+1 −0
Original line number Diff line number Diff line
@@ -30,4 +30,5 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
  AC_SUBST(openssl_libs)
  AC_SUBST(openssl_includes)
  AC_SUBST(yassl_dir)
  AM_CONDITIONAL([HAVE_YASSL], [ test "$yassl" = "yes" ])
])
+180 −0
Original line number Diff line number Diff line
# include/rpl_stmt_seq.inc
#
# Please be very careful when editing this routine, because the handling of 
# the $variables is extreme sensitive. 
#

######## The typical test sequence
# 1. INSERT without commit
#    check table content of master and slave
# 2. EXECUTE the statement
#    check table content of master and slave
# 3. ROLLBACK
#    check table content of master and slave
# 4. flush the logs

let $VERSION=`select version()`;

--disable_query_log
# SELECT '######## new test sequence ########' as "";
eval SELECT CONCAT('######## ','$my_stmt','  ########') as "";
--enable_query_log


###############################################################
# Predict the number of the current log
###############################################################
# Disable the logging of the log number computation. 
--disable_query_log
# $_log_num_n should contain the number of the current binlog in numeric style.
# If this routine is called for the first time, $_log_num will not initialized
# and contain the value '' instead of '1'. So we will correct it here.
#
eval set @aux= IF('$_log_num_n' = '', '1', '$_log_num_n');
let $_log_num_n= `SELECT @aux`;
eval set @aux= LPAD('$_log_num_n',6,'0');
#              SELECT @aux AS "@aux is";
#
# $_log_num_s should contain the number of the current binlog in string style.
let $_log_num_s= `select @aux`;
# eval SELECT '$log_num' ;
--enable_query_log

###############################################################
# INSERT 
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
# Maybe it would be smarter to use a table with autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
eval INSERT INTO t1 SET f1= $MAX + 1;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;

connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';

###############################################################
# command to be tested
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs
let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;

connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';

###############################################################
# ROLLBACK
###############################################################
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
ROLLBACK;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
# Try to detect if the DDL command caused that the INSERT is committed
# $MAX holds the highest/last value just before the insert of MAX + 1
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
               IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
               IF((MAX(f1) = $MAX + 1) XOR NOT $my_master_commit,
                ' (Succeeded)',
                ' (Failed)')) AS "" 
               FROM mysqltest1.t1;
--enable_query_log
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;

connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
--disable_query_log
eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE:  The INSERT is ',
               IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
               IF((MAX(f1) = $MAX + 1) XOR NOT $my_slave_commit,
                ' (Succeeded)',
                ' (Failed)')) AS "" 
               FROM mysqltest1.t1;
--enable_query_log
--replace_result $VERSION VERSION
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';

###############################################################
# Manipulate binlog
###############################################################
#let $manipulate= 0;
let $manipulate= 1;
while ($manipulate)
{
#### Manipulate the binary logs,
# so that the output of SHOW BINLOG EVENTS IN <current log>
# contains only commands of the current test sequence.
# - flush the master and the slave log
#   ---> both start to write into new logs with incremented number
# - increment $_log_num_n
connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;

connection slave;
--disable_query_log
SELECT '-------- switch to slave --------' as "";
--enable_query_log
# the final content of the binary log
flush logs;
# The next sleep is urgent needed.
# Without this sleep the slaves crashes often, when the SHOW BINLOG
# is executed.   :-(
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
inc $_log_num_n;
let $manipulate= 0;
}

connection master;
--disable_query_log
SELECT '-------- switch to master -------' as "";
--enable_query_log
+34 −0
Original line number Diff line number Diff line
@@ -905,3 +905,37 @@ select * from t1 where city = 'Durban ';
id	city
2	Durban
drop table t1;
SET NAMES UTF8;
CREATE TABLE t1 (
`id` int(20) NOT NULL auto_increment,
`country` varchar(100) NOT NULL default '',
`shortcode` varchar(100) NOT NULL default '',
`operator` varchar(100) NOT NULL default '',
`momid` varchar(30) NOT NULL default '',
`keyword` varchar(160) NOT NULL default '',
`content` varchar(160) NOT NULL default '',
`second_token` varchar(160) default NULL,
`gateway_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`msisdn` varchar(15) NOT NULL default '',
PRIMARY KEY  (`id`),
UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
KEY `IX_mobile_originated_message_keyword` (`keyword`),
KEY `IX_mobile_originated_message_created` (`created`),
KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES 
(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
CREATE TABLE t2 (
`msisdn` varchar(15) NOT NULL default '',
`operator_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
UNIQUE KEY `PK_user` (`msisdn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
content	msisdn
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми	1234567890
11 g	1234567890
DROP TABLE t1,t2;
+3 −4
Original line number Diff line number Diff line
@@ -909,7 +909,6 @@ set autocommit=0;
create table t1 (a int not null) engine= innodb;
insert into t1 values(1),(2);
truncate table t1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
commit;
truncate table t1;
truncate table t1;
@@ -1638,14 +1637,14 @@ t2 CREATE TABLE `t2` (
drop table t2, t1;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	153
Binlog_cache_use	155
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	154
Binlog_cache_use	156
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	1
@@ -1654,7 +1653,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name	Value
Binlog_cache_use	155
Binlog_cache_use	157
show status like "binlog_cache_disk_use";
Variable_name	Value
Binlog_cache_disk_use	1
Loading