Commit 7aa1d93f authored by unknown's avatar unknown

Merge serg.mylan:/usr/home/serg/Abk/mysql-5.0

into serg.mylan:/usr/home/serg/Abk/mysql-5.0-xa


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
parents d6541adb c5c49716
......@@ -1100,7 +1100,7 @@ at offset %lu ; this could be a log format error or read error",
/* EOF can't be hit here normally, so it's a real error */
die("Could not read a Rotate_log_event event \
at offset %lu ; this could be a log format error or read error",
tmp_pos);
tmp_pos);
}
else
break;
......@@ -1169,9 +1169,15 @@ static int dump_local_log_entries(const char* logname)
Log_event* ev = Log_event::read_log_event(file, description_event);
if (!ev)
{
if (file->error)
/*
if binlog wasn't closed properly ("in use" flag is set) don't complain
about a corruption, but treat it as EOF and move to the next binlog.
*/
if (description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
file->error= 0;
else if (file->error)
{
fprintf(stderr,
fprintf(stderr,
"Could not read entry at offset %s:"
"Error in log format or read error\n",
llstr(old_off,llbuff));
......
......@@ -1887,7 +1887,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \
localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \
mkstemp mlockall perror poll pread pthread_attr_create mmap \
mkstemp mlockall perror poll pread pthread_attr_create mmap getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
......
......@@ -761,7 +761,7 @@ typedef long int32;
#endif
typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
#else
error "Neither int or long is of 4 bytes width"
#error "Neither int or long is of 4 bytes width"
#endif
#if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) && !defined(__USE_MISC)
......
......@@ -689,12 +689,12 @@ extern pthread_t shutdown_th, main_th, signal_th;
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
#if defined (__GNUC__) || defined (__cplusplus)
static inline bool thread_safe_dec_and_test(ulong V, pthread_mutex_t *L)
#ifdef __cplusplus
static inline bool thread_safe_dec_and_test(ulong &V, pthread_mutex_t *L)
{
ulong res;
pthread_mutex_lock(L);
res=V--;
res=--V;
pthread_mutex_unlock(L);
return res==0;
}
......
......@@ -315,7 +315,7 @@ trx_is_active(
}
if (ut_dulint_cmp(trx_id, trx_sys->max_trx_id) >= 0) {
/* There must be corruption: we return TRUE because this
function is only called by lock_clust_rec_some_has_impl()
and row_vers_impl_x_locked_off_kernel() and they have
......@@ -325,8 +325,9 @@ trx_is_active(
}
trx = trx_get_on_id(trx_id);
if (trx && (trx->conc_state == TRX_ACTIVE)) {
if (trx && (trx->conc_state == TRX_ACTIVE ||
trx->conc_state == TRX_PREPARED)) {
return(TRUE);
}
......
......@@ -153,10 +153,11 @@ read_view_open_now(
/* No active transaction should be visible, except cr_trx */
while (trx) {
if (trx != cr_trx && trx->conc_state == TRX_ACTIVE) {
if (trx != cr_trx && (trx->conc_state == TRX_ACTIVE ||
trx->conc_state == TRX_PREPARED)) {
read_view_set_nth_trx_id(view, n, trx->id);
n++;
/* NOTE that a transaction whose trx number is <
......@@ -164,7 +165,7 @@ read_view_open_now(
in the middle of its commit! Note that when a
transaction starts, we initialize trx->no to
ut_dulint_max. */
if (ut_dulint_cmp(view->low_limit_no, trx->no) > 0) {
view->low_limit_no = trx->no;
......
......@@ -1617,20 +1617,21 @@ trx_print(
(ulong) ut_dulint_get_high(trx->id),
(ulong) ut_dulint_get_low(trx->id));
switch (trx->conc_state) {
switch (trx->conc_state) {
case TRX_NOT_STARTED:
fputs(", not started", f);
break;
case TRX_ACTIVE:
case TRX_PREPARED:
fprintf(f, ", ACTIVE %lu sec",
(ulong)difftime(time(NULL), trx->start_time));
break;
break;
case TRX_COMMITTED_IN_MEMORY:
fputs(", COMMITTED IN MEMORY", f);
break;
default:
fprintf(f, " state %lu", (ulong) trx->conc_state);
}
}
#ifdef UNIV_LINUX
fprintf(f, ", process no %lu", trx->mysql_process_no);
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -523,11 +523,12 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 User var 1 135 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 135 Query 1 225 use `test`; insert into t2 values (@v)
master-bin.000001 96 User var 1 136 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 136 Query 1 226 use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test;
SET TIMESTAMP=10000;
......
......@@ -271,7 +271,7 @@ n
6
7
rollback to savepoint `my_savepoint`;
ERROR HY000: Got error 153 during ROLLBACK
ERROR 42000: SAVEPOINT my_savepoint does not exist
set autocommit=1;
rollback;
drop table t1;
......@@ -1633,14 +1633,14 @@ t2 CREATE TABLE `t2` (
drop table t2, t1;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 25
Binlog_cache_use 152
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 26
Binlog_cache_use 153
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
......@@ -1649,7 +1649,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 27
Binlog_cache_use 154
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
......
......@@ -74,8 +74,8 @@ insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 190 use `test`; insert into t1 select * from t2
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 191 use `test`; insert into t1 select * from t2
select * from t1;
a
1
......@@ -88,7 +88,7 @@ create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
drop table t1;
create table t1 (a int not null);
create table t2 (a int not null);
......
......@@ -6,12 +6,12 @@ begin;
insert into t1 values(1);
insert into t2 select * from t1;
commit;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Xid 1 # COMMIT /* xid=7 */
delete from t1;
delete from t2;
reset master;
......@@ -21,12 +21,12 @@ insert into t2 select * from t1;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(2)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; ROLLBACK
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(2)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Query 1 # use `test`; ROLLBACK
delete from t1;
delete from t2;
reset master;
......@@ -39,15 +39,15 @@ rollback to savepoint my_savepoint;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
commit;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(3)
master-bin.000001 252 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 426 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 521 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 619 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(3)
master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 339 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 620 Xid 1 # COMMIT /* xid=24 */
delete from t1;
delete from t2;
reset master;
......@@ -65,16 +65,16 @@ select a from t1 order by a;
a
5
7
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(5)
master-bin.000001 252 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 426 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 521 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 619 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 707 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(5)
master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 339 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 620 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 708 Xid 1 # COMMIT /* xid=36 */
delete from t1;
delete from t2;
reset master;
......@@ -87,40 +87,47 @@ insert into t2 select * from t1;
select get_lock("a",10);
get_lock("a",10)
1
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(8)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; ROLLBACK
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(8)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Query 1 # use `test`; ROLLBACK
master-bin.000001 420 Query 1 # use `test`; DO RELEASE_LOCK("a")
delete from t1;
delete from t2;
reset master;
insert into t1 values(9);
insert into t2 select * from t1;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 183 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 253 Xid 1 # COMMIT /* xid=59 */
master-bin.000001 280 Query 1 # use `test`; insert into t2 select * from t1
delete from t1;
delete from t2;
reset master;
insert into t1 values(10);
begin;
insert into t2 select * from t1;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 184 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 254 Xid 1 # COMMIT /* xid=65 */
master-bin.000001 281 Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11);
commit;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 184 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 279 Query 1 # use `test`; BEGIN
master-bin.000001 348 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 437 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 254 Xid 1 # COMMIT /* xid=65 */
master-bin.000001 281 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 376 Query 1 # use `test`; BEGIN
master-bin.000001 445 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 534 Xid 1 # COMMIT /* xid=67 */
alter table t2 engine=INNODB;
delete from t1;
delete from t2;
......@@ -129,12 +136,12 @@ begin;
insert into t1 values(12);
insert into t2 select * from t1;
commit;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 349 Xid 1 # COMMIT /* xid=77 */
delete from t1;
delete from t2;
reset master;
......@@ -142,7 +149,7 @@ begin;
insert into t1 values(13);
insert into t2 select * from t1;
rollback;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
delete from t1;
delete from t2;
......@@ -154,11 +161,11 @@ insert into t1 values(15);
insert into t2 select * from t1;
rollback to savepoint my_savepoint;
commit;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 253 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 254 Xid 1 # COMMIT /* xid=93 */
delete from t1;
delete from t2;
reset master;
......@@ -174,12 +181,12 @@ select a from t1 order by a;
a
16
18
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 253 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 342 Query 1 # use `test`; COMMIT
master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 165 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 343 Xid 1 # COMMIT /* xid=104 */
delete from t1;
delete from t2;
alter table t2 type=MyISAM;
......
......@@ -15,6 +15,7 @@ flush logs;
--- Local --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -47,6 +48,7 @@ insert into t1 values ("Alas");
--- --database --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
--- --position --
......@@ -60,6 +62,7 @@ insert into t1 values ("Alas");
--- Remote --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -92,6 +95,7 @@ insert into t1 values ("Alas");
--- --database --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
--- --position --
......@@ -105,6 +109,7 @@ insert into t1 values ("Alas");
--- reading stdin --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1065204671;
BEGIN;
......
......@@ -16,6 +16,7 @@ insert into t1 values(null, "f");
--- Local --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -40,6 +41,7 @@ insert into t1 values(null, "e");
--- offset --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
use test;
SET TIMESTAMP=1579609942;
......@@ -75,6 +77,7 @@ insert into t1 values(null, "e");
--- stop-position --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -93,6 +96,7 @@ insert into t1 values(null, "c");
--- start-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=3;
use test;
SET TIMESTAMP=1579609944;
......@@ -109,6 +113,7 @@ insert into t1 values(null, "e");
--- stop-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -124,6 +129,7 @@ insert into t1 values(null, "b");
--- Local with 2 binlogs on command line --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -155,6 +161,7 @@ insert into t1 values(null, "f");
--- offset --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
use test;
SET TIMESTAMP=1579609942;
......@@ -204,6 +211,7 @@ insert into t1 values(null, "f");
--- stop-position --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -229,6 +237,7 @@ SET INSERT_ID=6;
--- start-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=3;
use test;
SET TIMESTAMP=1579609944;
......@@ -252,6 +261,7 @@ insert into t1 values(null, "f");
--- stop-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -267,6 +277,7 @@ insert into t1 values(null, "b");
--- Remote --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -291,6 +302,7 @@ insert into t1 values(null, "e");
--- offset --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
use test;
SET TIMESTAMP=1579609942;
......@@ -326,6 +338,7 @@ insert into t1 values(null, "e");
--- stop-position --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -344,6 +357,7 @@ insert into t1 values(null, "c");
--- start-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=3;
use test;
SET TIMESTAMP=1579609944;
......@@ -360,6 +374,7 @@ insert into t1 values(null, "e");
--- stop-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -375,6 +390,7 @@ insert into t1 values(null, "b");
--- Remote with 2 binlogs on command line --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -406,6 +422,7 @@ insert into t1 values(null, "f");
--- offset --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=1;
use test;
SET TIMESTAMP=1579609942;
......@@ -455,6 +472,7 @@ insert into t1 values(null, "f");
--- stop-position --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -480,6 +498,7 @@ SET INSERT_ID=6;
--- start-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET INSERT_ID=3;
use test;
SET TIMESTAMP=1579609944;
......@@ -503,6 +522,7 @@ insert into t1 values(null, "f");
--- stop-datetime --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......@@ -518,6 +538,7 @@ insert into t1 values(null, "b");
--- to-last-log --
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
use test;
SET TIMESTAMP=1579609942;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
......
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 95
master-bin.000001 96
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
......@@ -17,7 +17,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 95 # # master-bin.000001 Yes Yes 0 0 95 # None 0 No #
# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
drop table if exists t1;
create table t1 (n int);
insert into t1 values (10),(45),(90);
......
......@@ -16,11 +16,11 @@ n
1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 376 # # master-bin.000001 No No 0 0 288 # None 0 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 377 # # master-bin.000001 No No 0 0 289 # None 0 No #
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 288 # # master-bin.000001 No No 0 0 288 # None 0 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 289 # # master-bin.000001 No No 0 0 289 # None 0 No #
select release_lock("a");
release_lock("a")
1
......
......@@ -103,7 +103,7 @@ a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
......@@ -175,6 +175,7 @@ select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
......
......@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 287 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 287 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
......@@ -26,14 +26,14 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 194 use `test`; create table t1 (a int primary key)
master-bin.000001 194 Query 1 287 use `test`; insert into t1 values (1),(1)
master-bin.000001 287 Query 1 364 use `test`; drop table t1
master-bin.000001 364 Query 1 463 use `test`; create table t2 (a int primary key)
master-bin.000001 463 Query 1 551 use `test`; insert into t2 values(1)
master-bin.000001 551 Query 1 639 use `test`; create table t3 (id int)
master-bin.000001 639 Query 1 741 use `test`; insert into t3 values(connection_id())
master-bin.000001 741 Query 1 861 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.000001 861 Query 1 941 use `test`; drop table t2,t3
master-bin.000001 96 Query 1 195 use `test`; create table t1 (a int primary key)
master-bin.000001 195 Query 1 288 use `test`; insert into t1 values (1),(1)
master-bin.000001 288 Query 1 365 use `test`; drop table t1
master-bin.000001 365 Query 1 464 use `test`; create table t2 (a int primary key)
master-bin.000001 464 Query 1 552 use `test`; insert into t2 values(1)
master-bin.000001 552 Query 1 640 use `test`; create table t3 (id int)
master-bin.000001 640 Query 1 742 use `test`; insert into t3 values(connection_id())
master-bin.000001 742 Query 1 862 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.000001 862 Query 1 942 use `test`; drop table t2,t3
......@@ -14,4 +14,4 @@ start slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 206 # # slave-bin.000001 Yes Yes 0 0 206 # None 0 No #
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 207 # # slave-bin.000001 Yes Yes 0 0 207 # None 0 No #
......@@ -14,27 +14,27 @@ rename table t1 to t5, t2 to t1;
flush no_write_to_binlog tables;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 182 use `test`; create table t1 (a int)
master-bin.000001 182 Query 1 272 use `test`; insert into t1 values (10)
master-bin.000001 272 Query 1 359 use `test`; create table t2 (a int)
master-bin.000001 359 Query 1 469 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 469 Query 1 556 use `test`; create table t4 (a int)
master-bin.000001 556 Query 1 651 use `test`; insert into t4 select * from t3
master-bin.000001 651 Query 1 746 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 182 use `test`; create table t1 (a int)
master-bin.000001 182 Query 1 272 use `test`; insert into t1 values (10)
master-bin.000001 272 Query 1 359 use `test`; create table t2 (a int)
master-bin.000001 359 Query 1 469 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 469 Query 1 556 use `test`; create table t4 (a int)
master-bin.000001 556 Query 1 651 use `test`; insert into t4 select * from t3
master-bin.000001 651 Query 1 746 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 746 Query 1 822 use `test`; flush tables
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 747 Query 1 823 use `test`; flush tables
select * from t3;
a
......@@ -22,7 +22,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1096
slave-bin.000001 1097
drop table t1;
drop table t2;
drop table t3;
......@@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1559 # # master-bin.000001 Yes Yes 0 0 1559 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1560 # # master-bin.000001 Yes Yes 0 0 1560 # None 0 No #
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
......@@ -43,7 +43,7 @@ change master to master_user='test';
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1667 # # master-bin.000001 No No 0 0 1667 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1668 # # master-bin.000001 No No 0 0 1668 # None 0 No #
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
......@@ -64,5 +64,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
ERROR 23000: Duplicate entry '2003-03-22' for key 1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 536
master-bin.000001 537
drop table t2;
......@@ -10,8 +10,8 @@ create database mysqltest;
create table t1(a int, b int, unique(b));
use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 197 drop database if exists mysqltest
master-bin.000001 197 Query 1 291 create database mysqltest
master-bin.000001 96 Query 1 198 drop database if exists mysqltest
master-bin.000001 198 Query 1 292 create database mysqltest
drop database mysqltest;
......@@ -10,5 +10,5 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from t1;
count(*)
2
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
......@@ -19,25 +19,25 @@ count(*)
drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
master-bin.000001 337 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
master-bin.000001 518 Create_file 1 1188 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1188 Exec_load 1 1211 ;file_id=1
master-bin.000001 1211 Query 1 1288 use `test`; drop table t1
show binlog events from 95 limit 1;
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 415 use `test`; drop table t1
master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
show binlog events from 96 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
show binlog events from 95 limit 2;
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
show binlog events from 96 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
show binlog events from 95 limit 2,1;
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
show binlog events from 96 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
flush logs;
create table t5 (a int);
drop table t5;
......@@ -49,24 +49,24 @@ insert into t1 values (1);
drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
master-bin.000001 337 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
master-bin.000001 518 Create_file 1 1188 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1188 Exec_load 1 1211 ;file_id=1
master-bin.000001 1211 Query 1 1288 use `test`; drop table t1
master-bin.000001 1288 Rotate 1 1332 master-bin.000002;pos=4
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 218 Intvar 1 246 INSERT_ID=1
master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 415 use `test`; drop table t1
master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
master-bin.000001 1289 Rotate 1 1333 master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000002 95 Query 1 182 use `test`; create table t5 (a int)
master-bin.000002 182 Query 1 259 use `test`; drop table t5
master-bin.000002 259 Query 1 346 use `test`; create table t1 (n int)
master-bin.000002 346 Query 1 435 use `test`; insert into t1 values (1)
master-bin.000002 435 Query 1 512 use `test`; drop table t1
master-bin.000002 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000002 96 Query 1 183 use `test`; create table t5 (a int)
master-bin.000002 183 Query 1 260 use `test`; drop table t5
master-bin.000002 260 Query 1 347 use `test`; create table t1 (n int)
master-bin.000002 347 Query 1 436 use `test`; insert into t1 values (1)
master-bin.000002 436 Query 1 513 use `test`; drop table t1
show binary logs;
Log_name
master-bin.000001
......@@ -78,26 +78,26 @@ slave-bin.000001
slave-bin.000002
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 4 Format_desc 2 95 Server ver: VERSION, Binlog ver: 4
slave-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 217 Intvar 1 245 INSERT_ID=1
slave-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
slave-bin.000001 337 Query 1 414 use `test`; drop table t1
slave-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 518 Create_file 1 1197 db=test;table=t1;file_id=1;block_len=581
slave-bin.000001 1197 Exec_load 1 1220 ;file_id=1
slave-bin.000001 1220 Query 1 1297 use `test`; drop table t1
slave-bin.000001 1297 Query 1 1384 use `test`; create table t5 (a int)
slave-bin.000001 1384 Query 1 1461 use `test`; drop table t5
slave-bin.000001 1461 Rotate 2 1504 slave-bin.000002;pos=4
slave-bin.000001 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
slave-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 218 Intvar 1 246 INSERT_ID=1
slave-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
slave-bin.000001 338 Query 1 415 use `test`; drop table t1
slave-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 519 Create_file 1 1198 db=test;table=t1;file_id=1;block_len=581
slave-bin.000001 1198 Exec_load 1 1221 ;file_id=1
slave-bin.000001 1221 Query 1 1298 use `test`; drop table t1
slave-bin.000001 1298 Query 1 1385 use `test`; create table t5 (a int)
slave-bin.000001 1385 Query 1 1462 use `test`; drop table t5
slave-bin.000001 1462 Rotate 2 1505 slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 4 Format_desc 2 95 Server ver: VERSION, Binlog ver: 4
slave-bin.000002 95 Query 1 182 use `test`; create table t1 (n int)
slave-bin.000002 182 Query 1 271 use `test`; insert into t1 values (1)
slave-bin.000002 271 Query 1 348 use `test`; drop table t1
slave-bin.000002 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
slave-bin.000002 96 Query 1 183 use `test`; create table t1 (n int)
slave-bin.000002 183 Query 1 272 use `test`; insert into t1 values (1)
slave-bin.000002 272 Query 1 349 use `test`; drop table t1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 512 # # master-bin.000002 Yes Yes 0 0 512 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 513 # # master-bin.000002 Yes Yes 0 0 513 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
......@@ -6,10 +6,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 95
master-bin.000001 96
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 95 # # master-bin.000001 Yes Yes 0 0 95 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
stop slave;
change master to master_log_pos=73;
start slave;
......@@ -30,13 +30,13 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 # # master-bin.000001 No Yes 0 0 173 # None 0 No #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 95
master-bin.000001 96
create table if not exists t1 (n int);
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
stop slave;
change master to master_log_pos=95;
change master to master_log_pos=96;
start slave;
select * from t1;
n
......
......@@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
......@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=0;
......@@ -36,7 +36,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave;
reset slave;
flush logs;
......@@ -49,13 +49,13 @@ flush logs;
create table t1 (a int);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73838 # # master-bin.000001 Yes Yes 0 0 73838 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73839 # # master-bin.000001 Yes Yes 0 0 73839 # None 0 No #
flush logs;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73915 # # master-bin.000001 Yes Yes 0 0 73915 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73916 # # master-bin.000001 Yes Yes 0 0 73916 # None 0 No #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 95
master-bin.000002 96
......@@ -18,5 +18,5 @@ max(a)
8000
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743228 # # master-bin.000001 Yes Yes 0 0 743228 # None 0 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743186 # # master-bin.000001 Yes Yes 0 0 743186 # None 0 No #
drop table t1;
......@@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1617 # # master-bin.000001 Yes Yes test.t1 0 0 1617 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1618 # # master-bin.000001 Yes Yes test.t1 0 0 1618 # None 0 No #
......@@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 95 # # master-bin.000001 Yes Yes 0 0 95 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
stop slave;
change master to master_user='test';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 95 # # master-bin.000001 No No 0 0 95 # None 0 No #
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 No No 0 0 96 # None 0 No #
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
......@@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 95 # # master-bin.000001 Yes Yes 0 0 95 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 96 # # master-bin.000001 Yes Yes 0 0 96 # None 0 No #
stop slave;
reset slave;
start slave;
......
......@@ -16,7 +16,7 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 549 # # master-bin.000001 Yes Yes 0 0 549 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 550 # # master-bin.000001 Yes Yes 0 0 550 # None 0 No #
select * from t1;
s
Could not break slave
......@@ -57,7 +57,7 @@ master-bin.000003
insert into t2 values (65);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 497 # # master-bin.000003 Yes Yes 0 0 497 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 498 # # master-bin.000003 Yes Yes 0 0 498 # None 0 No #
select * from t2;
m
34
......@@ -79,13 +79,13 @@ master-bin.000004
master-bin.000005
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000005 2050
master-bin.000005 2051
select * from t4;
a
testing temporary tables part 2
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2050 # # master-bin.000005 Yes Yes 0 0 2050 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2051 # # master-bin.000005 Yes Yes 0 0 2051 # None 0 No #
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
......
......@@ -10,7 +10,7 @@ stop slave;
change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 95 None 0 No NULL
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 96 None 0 No NULL
start slave;
insert into t1 values (1);
show status like "slave_running";
......
......@@ -10,7 +10,7 @@ stop slave;
change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 95 None 0 No NULL
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 96 None 0 No NULL
start slave;
insert into t1 values (1);
select * from t1;
......
......@@ -38,19 +38,19 @@ f
7
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 185 use `test`; drop table if exists t1,t2
master-bin.000001 185 Query 1 271 use `test`; create table t1(f int)
master-bin.000001 271 Query 1 357 use `test`; create table t2(f int)
master-bin.000001 357 Query 1 483 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 483 Query 1 579 use `test`; create temporary table t3(f int)
master-bin.000001 579 Query 1 684 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 684 Query 1 780 use `test`; create temporary table t3(f int)
master-bin.000001 780 Query 1 882 use `test`; insert into t2 select count(*) from t3
master-bin.000001 882 Query 1 988 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 988 Query 1 1075 use `test`; drop temporary table t3
master-bin.000001 1075 Query 1 1177 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1177 Query 1 1264 use `test`; drop temporary table t3
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 186 use `test`; drop table if exists t1,t2
master-bin.000001 186 Query 1 272 use `test`; create table t1(f int)
master-bin.000001 272 Query 1 358 use `test`; create table t2(f int)
master-bin.000001 358 Query 1 484 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 484 Query 1 580 use `test`; create temporary table t3(f int)
master-bin.000001 580 Query 1 685 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 685 Query 1 781 use `test`; create temporary table t3(f int)
master-bin.000001 781 Query 1 883 use `test`; insert into t2 select count(*) from t3
master-bin.000001 883 Query 1 989 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 989 Query 1 1076 use `test`; drop temporary table t3
master-bin.000001 1076 Query 1 1178 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1178 Query 1 1265 use `test`; drop temporary table t3
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;
......
......@@ -32,13 +32,13 @@ t
2004-06-11 09:39:02
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 188 use `test`; create table t1 (t timestamp)
master-bin.000001 188 Query 1 280 use `test`; create table t2 (t char(32))
master-bin.000001 280 Query 1 372 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
master-bin.000001 372 Query 1 496 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 496 Query 1 574 use `test`; delete from t1
master-bin.000001 574 Query 1 698 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 189 use `test`; create table t1 (t timestamp)
master-bin.000001 189 Query 1 281 use `test`; create table t2 (t char(32))
master-bin.000001 281 Query 1 373 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
master-bin.000001 373 Query 1 497 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 497 Query 1 575 use `test`; delete from t1
master-bin.000001 575 Query 1 699 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
set time_zone='MET';
insert into t2 (select t from t1);
select * from t1;
......
......@@ -14,14 +14,14 @@ insert into t2 values (3),(4);
drop table t2;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Query 1 318 use `test`; insert into t1 values (1),(2),(3),(4)
master-bin.000001 318 Query 1 395 use `test`; drop table t1
master-bin.000001 395 Query 1 517 use `test`; create table t2(n int not null auto_increment primary key)
master-bin.000001 517 Query 1 610 use `test`; insert into t2 values (1),(2)
master-bin.000001 610 Query 1 703 use `test`; insert into t2 values (3),(4)
master-bin.000001 703 Query 1 780 use `test`; drop table t2
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 218 Query 1 319 use `test`; insert into t1 values (1),(2),(3),(4)
master-bin.000001 319 Query 1 396 use `test`; drop table t1
master-bin.000001 396 Query 1 518 use `test`; create table t2(n int not null auto_increment primary key)
master-bin.000001 518 Query 1 611 use `test`; insert into t2 values (1),(2)
master-bin.000001 611 Query 1 704 use `test`; insert into t2 values (3),(4)
master-bin.000001 704 Query 1 781 use `test`; drop table t2
start slave until master_log_file='master-bin.000001', master_log_pos=304;
select * from t1;
n
......@@ -31,7 +31,7 @@ n
4
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 318 # Master master-bin.000001 304 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-bin.000001 304 No #
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1;
n
......@@ -41,7 +41,7 @@ n
4
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 318 # Master master-no-such-bin.000001 291 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-no-such-bin.000001 291 No #
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=710;
select * from t2;
n
......@@ -49,13 +49,13 @@ n
2
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 610 # Relay slave-relay-bin.000004 710 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 611 # Relay slave-relay-bin.000004 710 No #
start slave;
stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=710;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 780 # Master master-bin.000001 710 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 781 # Master master-bin.000001 710 No #
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
......
......@@ -76,35 +76,35 @@ abcn1n2
NULL
NULL
NULL
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 95 Query 1 186 use `test`; create table t1(n char(30))
slave-bin.000001 186 User var 2 229 @`i1`=12345678901234
slave-bin.000001 229 User var 2 272 @`i2`=-12345678901234
slave-bin.000001 272 User var 2 315 @`i3`=0
slave-bin.000001 315 User var 2 358 @`i4`=-1
slave-bin.000001 358 Query 1 470 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 470 User var 2 509 @`r1`=12.5
slave-bin.000001 509 User var 2 548 @`r2`=-12.5
slave-bin.000001 548 Query 1 646 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 646 User var 2 695 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 695 User var 2 730 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 730 User var 2 772 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 772 User var 2 814 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 814 User var 2 856 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 856 Query 1 975 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 975 User var 2 1001 @`n1`=NULL
slave-bin.000001 1001 Query 1 1092 use `test`; insert into t1 values (@n1)
slave-bin.000001 1092 User var 2 1118 @`n2`=NULL
slave-bin.000001 1118 Query 1 1209 use `test`; insert into t1 values (@n2)
slave-bin.000001 1209 Query 1 1326 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1326 User var 2 1368 @`a`=2
slave-bin.000001 1368 Query 1 1469 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1469 User var 2 1506 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1506 Query 1 1639 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1639 User var 2 1681 @`a`=5
slave-bin.000001 1681 Query 1 1776 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1776 User var 2 1801 @`a`=NULL
slave-bin.000001 1801 Query 1 1903 use `test`; insert into t1 values (@a),(@a),(@a*5)
slave-bin.000001 96 Query 1 187 use `test`; create table t1(n char(30))
slave-bin.000001 187 User var 2 230 @`i1`=12345678901234
slave-bin.000001 230 User var 2 273 @`i2`=-12345678901234
slave-bin.000001 273 User var 2 316 @`i3`=0
slave-bin.000001 316 User var 2 359 @`i4`=-1
slave-bin.000001 359 Query 1 471 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 471 User var 2 510 @`r1`=12.5
slave-bin.000001 510 User var 2 549 @`r2`=-12.5
slave-bin.000001 549 Query 1 647 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 647 User var 2 696 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 696 User var 2 731 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 731 User var 2 773 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 773 User var 2 815 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 815 User var 2 857 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 857 Query 1 976 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 976 User var 2 1002 @`n1`=NULL
slave-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values (@n1)
slave-bin.000001 1093 User var 2 1119 @`n2`=NULL
slave-bin.000001 1119 Query 1 1210 use `test`; insert into t1 values (@n2)
slave-bin.000001 1210 Query 1 1327 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1327 User var 2 1369 @`a`=2
slave-bin.000001 1369 Query 1 1470 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1470 User var 2 1507 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1507 Query 1 1640 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1640 User var 2 1682 @`a`=5
slave-bin.000001 1682 Query 1 1777 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1777 User var 2 1802 @`a`=NULL
slave-bin.000001 1802 Query 1 1904 use `test`; insert into t1 values (@a),(@a),(@a*5)
drop table t1;
stop slave;
......@@ -174,14 +174,15 @@ INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa";
SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
show binlog events from 95;
show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 136 Query 1 229 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 229 User var 1 271 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 271 User var 1 309 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 309 Query 1 410 use `test`; insert into t1 values (@var1),(@var2)
master-bin.000001 96 User var 1 137 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 137 Query 1 230 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 230 User var 1 272 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 272 User var 1 310 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 310 Query 1 411 use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
ROLLBACK;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
use test;
SET TIMESTAMP=10000;
......
......@@ -338,7 +338,7 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
show binlog events from 95;
show binlog events from 96;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
......
......@@ -139,7 +139,7 @@ select n from t1;
rollback to savepoint `savept2`;
release savepoint `my_savepoint`;
select n from t1;
-- error 1181
-- error 1305
rollback to savepoint `my_savepoint`;
set autocommit=1;
# nop
......
......@@ -26,7 +26,8 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=12" "xid=7"
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -39,7 +40,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
show binlog events from 95;
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -54,7 +55,8 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=45" "xid=24"
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -71,7 +73,8 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=67" "xid=36"
show binlog events from 96;
# and when ROLLBACK is not explicit?
delete from t1;
......@@ -92,7 +95,7 @@ connection con2;
# logging has been done, we use a user lock.
select get_lock("a",10);
--replace_column 5 #
show binlog events from 95;
show binlog events from 96;
# and when not in a transact1on?
delete from t1;
......@@ -103,7 +106,8 @@ insert into t1 values(9);
insert into t2 select * from t1;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=116" "xid=59"
show binlog events from 96;
# Check that when the query updat1ng the MyISAM table is the first in the
# transaction, we log it immediately.
......@@ -115,12 +119,14 @@ insert into t1 values(10); # first make t1 non-empty
begin;
insert into t2 select * from t1;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=130" "xid=65"
show binlog events from 96;
insert into t1 values(11);
commit;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=130" "xid=65" "xid=133" "xid=67"
show binlog events from 96;
# Check that things work like before this BEGIN/ROLLBACK code was added,
......@@ -138,7 +144,8 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=152" "xid=77"
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -150,7 +157,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
show binlog events from 95;
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -165,7 +172,8 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=184" "xid=93"
show binlog events from 96;
delete from t1;
delete from t2;
......@@ -182,7 +190,8 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
show binlog events from 95;
--replace_result "xid=205" "xid=104"
show binlog events from 96;
# Test for BUG#5714, where a MyISAM update in the transaction used to
# release row-level locks in InnoDB
......
......@@ -61,7 +61,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=118 $MYSQL_TEST_DIR/var/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=119 $MYSQL_TEST_DIR/var/log/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
......@@ -93,7 +93,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=118 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=119 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin)
--disable_query_log
......@@ -107,3 +107,4 @@ select "--- reading stdin --" as "";
# clean up
drop table t1, t2;
......@@ -46,11 +46,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=601 $MYSQL_TEST_DIR/var/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=601 $MYSQL_TEST_DIR/var/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --stop-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -75,11 +75,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=601 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --start-position=602 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=123 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --stop-position=124 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -102,11 +102,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=601 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=601 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--exec $MYSQL_BINLOG --short-form --stop-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -129,11 +129,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=601 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--exec $MYSQL_BINLOG --short-form --start-position=602 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=123 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--exec $MYSQL_BINLOG --short-form --stop-position=124 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......
......@@ -107,7 +107,7 @@ connection master;
drop database mysqltest2;
drop database mysqltest3;
--replace_column 2 # 5 #
show binlog events from 95;
show binlog events from 96;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
......@@ -156,3 +156,4 @@ connection master;
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
drop table t1;
sync_slave_with_master;
......@@ -48,7 +48,7 @@ connection master;
--error 0,1053;
reap;
connection master1;
show binlog events from 95;
show binlog events from 96;
save_master_pos;
connection slave;
# SQL slave thread should not have stopped (because table of the killed
......
......@@ -19,5 +19,5 @@ create database mysqltest;
create table t1(a int, b int, unique(b));
use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
show binlog events from 95; # should be nothing
show binlog events from 96; # should be nothing
drop database mysqltest;
......@@ -17,4 +17,4 @@ save_master_pos;
connection slave;
sync_with_master;
select count(*) from t1; # check that LOAD was replicated
show binlog events from 95; # should be nothing
show binlog events from 96; # should be nothing
......@@ -38,9 +38,9 @@ select count(*) from t1;
drop table t1;
--replace_result $VERSION VERSION
show binlog events;
show binlog events from 95 limit 1;
show binlog events from 95 limit 2;
show binlog events from 95 limit 2,1;
show binlog events from 96 limit 1;
show binlog events from 96 limit 2;
show binlog events from 96 limit 2,1;
flush logs;
# We need an extra update before doing save_master_pos.
......
......@@ -38,7 +38,7 @@ insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
stop slave;
change master to master_log_pos=95;
change master to master_log_pos=96;
start slave;
sync_with_master;
select * from t1;
......
......@@ -46,7 +46,7 @@ save_master_pos;
connection slave;
sync_with_master;
select * from t1;
show binlog events from 95;
show binlog events from 96;
connection master;
drop table t1;
save_master_pos;
......
......@@ -866,12 +866,12 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
--error 1400
--error 1406
INSERT INTO t1 (col1) VALUES ('hellobob');
--error 1265
INSERT INTO t1 (col2) VALUES ('hellobob');
INSERT INTO t1 (col2) VALUES ('hello ');
--error 1400
--error 1406
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
--error 1265
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
......
......@@ -110,7 +110,7 @@ INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa";
SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
show binlog events from 95;
show binlog events from 96;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
......
......@@ -103,7 +103,7 @@ static inline void hash_free_elements(HASH *hash)
hash_free()
hash the hash to delete elements of
NOTES: Hash can't be reused wuthing calling hash_init again.
NOTES: Hash can't be reused without calling hash_init again.
*/
void hash_free(HASH *hash)
......
......@@ -135,6 +135,23 @@ static HASH archive_open_tables;
#define DATA_BUFFER_SIZE 2 // Size of the data used in the data file
#define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption
/* dummy handlerton - only to have something to return from archive_db_init */
static handlerton archive_hton = {
0, /* slot */
0, /* savepoint size. */
0, /* close_connection */
0, /* savepoint */
0, /* rollback to savepoint */
0, /* releas savepoint */
0, /* commit */
0, /* rollback */
0, /* prepare */
0, /* recover */
0, /* commit_by_xid */
0 /* rollback_by_xid */
};
/*
Used for hash table that tracks open tables.
*/
......@@ -154,19 +171,20 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length,
void
RETURN
FALSE OK
TRUE Error
&archive_hton OK
0 Error
*/
bool archive_db_init()
handlerton *archive_db_init()
{
archive_inited= 1;
VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST));
return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
(hash_get_key) archive_get_key, 0, 0));
if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
(hash_get_key) archive_get_key, 0, 0))
return 0;
return &archive_hton;
}
/*
Release the archive handler.
......
......@@ -102,11 +102,34 @@ static int write_status(DB *status_block, char *buff, uint length);
static void update_status(BDB_SHARE *share, TABLE *table);
static void berkeley_noticecall(DB_ENV *db_env, db_notices notice);
static int berkeley_close_connection(THD *thd);
static int berkeley_commit(THD *thd, bool all);
static int berkeley_rollback(THD *thd, bool all);
static handlerton berkeley_hton = {
0, /* slot */
0, /* savepoint size */
berkeley_close_connection,
NULL, /* savepoint_set */
NULL, /* savepoint_rollback */
NULL, /* savepoint_release */
berkeley_commit,
berkeley_rollback,
NULL, /* prepare */
NULL, /* recover */
NULL, /* commit_by_xid */
NULL /* rollback_by_xid */
};
typedef struct st_berkeley_trx_data {
DB_TXN *all;
DB_TXN *stmt;
uint bdb_lock_count;
} berkeley_trx_data;
/* General functions */
bool berkeley_init(void)
handlerton *berkeley_init(void)
{
DBUG_ENTER("berkeley_init");
......@@ -135,7 +158,7 @@ bool berkeley_init(void)
berkeley_log_file_size= max(berkeley_log_file_size, 10*1024*1024L);
if (db_env_create(&db_env,0))
DBUG_RETURN(1); /* purecov: inspected */
DBUG_RETURN(0);
db_env->set_errcall(db_env,berkeley_print_error);
db_env->set_errpfx(db_env,"bdb");
db_env->set_noticecall(db_env, berkeley_noticecall);
......@@ -163,16 +186,15 @@ bool berkeley_init(void)
DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN |
DB_CREATE | DB_THREAD, 0666))
{
db_env->close(db_env,0); /* purecov: inspected */
db_env=0; /* purecov: inspected */
goto err;
db_env->close(db_env,0);
db_env=0;
DBUG_RETURN(0);
}
(void) hash_init(&bdb_open_tables,system_charset_info,32,0,0,
(hash_get_key) bdb_get_key,0,0);
pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST);
err:
DBUG_RETURN(db_env == 0);
DBUG_RETURN(&berkeley_hton);
}
......@@ -190,6 +212,11 @@ bool berkeley_end(void)
DBUG_RETURN(error != 0);
}
static int berkeley_close_connection(THD *thd)
{
my_free((gptr)thd->ha_data[berkeley_hton.slot], MYF(0));
}
bool berkeley_flush_logs()
{
int error;
......@@ -208,26 +235,29 @@ bool berkeley_flush_logs()
DBUG_RETURN(result);
}
int berkeley_commit(THD *thd, void *trans)
static int berkeley_commit(THD *thd, bool all)
{
DBUG_ENTER("berkeley_commit");
DBUG_PRINT("trans",("ending transaction %s",
trans == thd->transaction.stmt.bdb_tid ? "stmt" : "all"));
int error=txn_commit((DB_TXN*) trans,0);
DBUG_PRINT("trans",("ending transaction %s", all ? "all" : "stmt"));
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DB_TXN **txn= all ? &trx->all : &trx->stmt;
int error=txn_commit(*txn,0);
*txn=0;
#ifndef DBUG_OFF
if (error)
DBUG_PRINT("error",("error: %d",error)); /* purecov: inspected */
DBUG_PRINT("error",("error: %d",error));
#endif
DBUG_RETURN(error);
}
int berkeley_rollback(THD *thd, void *trans)
static int berkeley_rollback(THD *thd, bool all)
{
DBUG_ENTER("berkeley_rollback");
DBUG_PRINT("trans",("aborting transaction %s",
trans == thd->transaction.stmt.bdb_tid ? "stmt" : "all"));
int error=txn_abort((DB_TXN*) trans);
DBUG_PRINT("trans",("aborting transaction %s", all ? "all" : "stmt"));
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DB_TXN **txn= all ? &trx->all : &trx->stmt;
int error=txn_abort(*txn);
*txn=0;
DBUG_RETURN(error);
}
......@@ -1842,62 +1872,65 @@ int ha_berkeley::reset(void)
int ha_berkeley::external_lock(THD *thd, int lock_type)
{
int error=0;
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DBUG_ENTER("ha_berkeley::external_lock");
if (!trx)
{
thd->ha_data[berkeley_hton.slot]= trx= (berkeley_trx_data *)
my_malloc(sizeof(*trx), MYF(MY_ZEROFILL));
if (!trx)
DBUG_RETURN(1);
}
if (lock_type != F_UNLCK)
{
if (!thd->transaction.bdb_lock_count++)
if (!trx->bdb_lock_count++)
{
DBUG_ASSERT(thd->transaction.stmt.bdb_tid == 0);
DBUG_ASSERT(trx->stmt == 0);
transaction=0; // Safety
/* First table lock, start transaction */
if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK)) &&
!thd->transaction.all.bdb_tid)
OPTION_TABLE_LOCK)) && !trx->all)
{
/* We have to start a master transaction */
DBUG_PRINT("trans",("starting transaction all: options: 0x%lx",
(ulong) thd->options));
if ((error=txn_begin(db_env, 0,
(DB_TXN**) &thd->transaction.all.bdb_tid,
0)))
if ((error=txn_begin(db_env, 0, &trx->all, 0)))
{
thd->transaction.bdb_lock_count--; // We didn't get the lock /* purecov: inspected */
DBUG_RETURN(error); /* purecov: inspected */
trx->bdb_lock_count--; // We didn't get the lock
DBUG_RETURN(error);
}
trans_register_ha(thd, TRUE, &berkeley_hton);
if (thd->in_lock_tables)
DBUG_RETURN(0); // Don't create stmt trans
}
DBUG_PRINT("trans",("starting transaction stmt"));
if ((error=txn_begin(db_env,
(DB_TXN*) thd->transaction.all.bdb_tid,
(DB_TXN**) &thd->transaction.stmt.bdb_tid,
0)))
if ((error=txn_begin(db_env, trx->all, &trx->stmt, 0)))
{
/* We leave the possible master transaction open */
thd->transaction.bdb_lock_count--; // We didn't get the lock /* purecov: inspected */
DBUG_RETURN(error); /* purecov: inspected */
trx->bdb_lock_count--; // We didn't get the lock
DBUG_RETURN(error);
}
trans_register_ha(thd, FALSE, &berkeley_hton);
}
transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
transaction= trx->stmt;
}
else
{
lock.type=TL_UNLOCK; // Unlocked
thread_safe_add(share->rows, changed_rows, &share->mutex);
changed_rows=0;
if (!--thd->transaction.bdb_lock_count)
if (!--trx->bdb_lock_count)
{
if (thd->transaction.stmt.bdb_tid)
if (trx->stmt)
{
/*
F_UNLOCK is done without a transaction commit / rollback.
F_UNLCK is done without a transaction commit / rollback.
This happens if the thread didn't update any rows
We must in this case commit the work to keep the row locks
*/
DBUG_PRINT("trans",("commiting non-updating transaction"));
error=txn_commit((DB_TXN*) thd->transaction.stmt.bdb_tid,0);
thd->transaction.stmt.bdb_tid=0;
transaction=0;
error= txn_commit(trx->stmt,0);
trx->stmt= transaction= 0;
}
}
}
......@@ -1915,14 +1948,20 @@ int ha_berkeley::start_stmt(THD *thd)
{
int error=0;
DBUG_ENTER("ha_berkeley::start_stmt");
if (!thd->transaction.stmt.bdb_tid)
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DBUG_ASSERT(trx);
/*
note that trx->stmt may have been already initialized as start_stmt()
is called for *each table* not for each storage engine,
and there could be many bdb tables referenced in the query
*/
if (!trx->stmt)
{
DBUG_PRINT("trans",("starting transaction stmt"));
error=txn_begin(db_env, (DB_TXN*) thd->transaction.all.bdb_tid,
(DB_TXN**) &thd->transaction.stmt.bdb_tid,
0);
error=txn_begin(db_env, trx->all, &trx->stmt, 0);
trans_register_ha(thd, FALSE, &berkeley_hton);
}
transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
transaction= trx->stmt;
DBUG_RETURN(error);
}
......@@ -2258,6 +2297,8 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
uint i;
DB_BTREE_STAT *stat=0;
DB_TXN_STAT *txn_stat_ptr= 0;
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DBUG_ASSERT(trx);
/*
Original bdb documentation says:
......@@ -2272,13 +2313,10 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
txn_stat_ptr && txn_stat_ptr->st_nactive>=2)
{
DB_TXN_ACTIVE *atxn_stmt= 0, *atxn_all= 0;
DB_TXN *txn_all= (DB_TXN*) thd->transaction.all.bdb_tid;
u_int32_t all_id= txn_all->id(txn_all);
DB_TXN *txn_stmt= (DB_TXN*) thd->transaction.stmt.bdb_tid;
u_int32_t stmt_id= txn_stmt->id(txn_stmt);
u_int32_t all_id= trx->all->id(trx->all);
u_int32_t stmt_id= trx->stmt->id(trx->stmt);
DB_TXN_ACTIVE *cur= txn_stat_ptr->st_txnarray;
DB_TXN_ACTIVE *end= cur + txn_stat_ptr->st_nactive;
for (; cur!=end && (!atxn_stmt || !atxn_all); cur++)
......@@ -2286,7 +2324,7 @@ int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
if (cur->txnid==all_id) atxn_all= cur;
if (cur->txnid==stmt_id) atxn_stmt= cur;
}
if (atxn_stmt && atxn_all &&
log_compare(&atxn_stmt->lsn,&atxn_all->lsn))
{
......
......@@ -168,9 +168,7 @@ extern char *berkeley_home, *berkeley_tmpdir, *berkeley_logdir;
extern long berkeley_lock_scan_time;
extern TYPELIB berkeley_lock_typelib;
bool berkeley_init(void);
handlerton *berkeley_init(void);
bool berkeley_end(void);
bool berkeley_flush_logs(void);
int berkeley_commit(THD *thd, void *trans);
int berkeley_rollback(THD *thd, void *trans);
int berkeley_show_logs(Protocol *protocol);
This diff is collapsed.
......@@ -245,38 +245,31 @@ extern ulong srv_thread_concurrency;
extern TYPELIB innobase_lock_typelib;
bool innobase_init(void);
handlerton *innobase_init(void);
bool innobase_end(void);
bool innobase_flush_logs(void);
uint innobase_get_free_space(void);
int innobase_commit(THD *thd, void* trx_handle);
/*
don't delete it - it may be re-enabled later
as an optimization for the most common case InnoDB+binlog
*/
#if 0
int innobase_report_binlog_offset_and_commit(
THD* thd,
void* trx_handle,
char* log_file_name,
my_off_t end_offset);
int innobase_commit_complete(
void* trx_handle);
int innobase_rollback(THD *thd, void* trx_handle);
int innobase_rollback_to_savepoint(
THD* thd,
char* savepoint_name,
my_off_t* binlog_cache_pos);
int innobase_savepoint(
THD* thd,
char* savepoint_name,
my_off_t binlog_cache_pos);
int innobase_release_savepoint_name(
THD* thd,
char* savepoint_name);
int innobase_close_connection(THD *thd);
int innobase_commit_complete(void* trx_handle);
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
#endif
int innobase_drop_database(char *path);
bool innodb_show_status(THD* thd);
bool innodb_mutex_show_status(THD* thd);
void innodb_export_status(void);
void innobase_release_temporary_latches(void* innobase_tid);
void innobase_release_temporary_latches(THD *thd);
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
......
This diff is collapsed.
......@@ -93,6 +93,11 @@
#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
#define HA_KEY_SWITCH_ALL_SAVE 3
/*
Note: the following includes binlog and closing 0.
so: innodb+bdb+ndb+binlog+0
*/
#define MAX_HA 5
/*
Bits in index_ddl_flags(KEY *wanted_index)
......@@ -192,16 +197,12 @@ enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
#define HA_CREATE_USED_COMMENT (1L << 16)
#define HA_CREATE_USED_PASSWORD (1L << 17)
typedef struct st_thd_trans {
void *bdb_tid;
void *innobase_tid;
bool innodb_active_trans;
void *ndb_tid;
} THD_TRANS;
#ifndef XIDDATASIZE /* no xa.h included */
typedef ulonglong my_xid;
#define MYSQL_XID_PREFIX "MySQLXid"
#define MYSQL_XID_PREFIX_LEN 8 // must be a multiple of 8
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id))
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))
/* XXX - may be we should disable xa completely in this case ? */
#define XIDDATASIZE 128
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64
......@@ -210,22 +211,106 @@ struct xid_t {
long formatID;
long gtrid_length;
long bqual_length;
char data[XIDDATASIZE];
};
char data[XIDDATASIZE]; // not \0-terminated !
bool eq(LEX_STRING *l) { return eq(l->length, 0, l->str); }
bool eq(long g, long b, const char *d)
{ return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
void set(LEX_STRING *l) { set(l->length, 0, l->str); }
void set(ulonglong l)
{
set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX);
*(ulong*)(data+MYSQL_XID_PREFIX_LEN)=server_id;
*(my_xid*)(data+MYSQL_XID_OFFSET)=l;
gtrid_length=MYSQL_XID_GTRID_LEN;
}
void set(long g, long b, const char *d)
{
formatID=1;
gtrid_length= g;
bqual_length= b;
memcpy(data, d, g+b);
}
bool is_null() { return formatID == -1; }
void null() { formatID= -1; }
my_xid quick_get_my_xid()
{
return *(my_xid*)(data+MYSQL_XID_OFFSET);
}
my_xid get_my_xid()
{
return gtrid_length == MYSQL_XID_GTRID_LEN && bqual_length == 0 &&
*(ulong*)(data+MYSQL_XID_PREFIX_LEN) == server_id &&
!memcmp(data, MYSQL_XID_PREFIX, MYSQL_XID_PREFIX_LEN) ?
quick_get_my_xid() : 0;
}
};
typedef struct xid_t XID;
/* for recover() handlerton call */
#define MIN_XID_LIST_SIZE 128
#define MAX_XID_LIST_SIZE (1024*128)
#endif
/*
handlerton is a singleton structure - one instance per storage engine -
to provide access to storage engine functionality that works on
"global" level (unlike handler class that works on per-table basis)
usually handlerton instance is defined statically in ha_xxx.cc as
static handlerton { ... } xxx_hton;
savepoint_*, prepare, recover, and *_by_xid pointers can be 0.
*/
typedef struct
{
byte slot;
/*
each storage engine has it's own memory area (actually a pointer)
in the thd, for storing per-connection information.
It is accessed as
thd->ha_data[xxx_hton.slot]
slot number is initialized by MySQL after xxx_init() is called.
*/
uint slot;
/*
to store per-savepoint data storage engine is provided with an area
of a requested size (0 is ok here).
savepoint_offset must be initialized statically to the size of
the needed memory to store per-savepoint information.
After xxx_init it is changed to be an offset to savepoint storage
area and need not be used by storage engine.
see binlog_hton and binlog_savepoint_set/rollback for an example.
*/
uint savepoint_offset;
/*
handlerton methods:
close_connection is only called if
thd->ha_data[xxx_hton.slot] is non-zero, so even if you don't need
this storage area - set it to something, so that MySQL would know
this storage engine was accessed in this connection
*/
int (*close_connection)(THD *thd);
/*
sv points to an uninitialized storage area of requested size
(see savepoint_offset description)
*/
int (*savepoint_set)(THD *thd, void *sv);
/*
sv points to a storage area, that was earlier passed
to the savepoint_set call
*/
int (*savepoint_rollback)(THD *thd, void *sv);
int (*savepoint_release)(THD *thd, void *sv);
/*
'all' is true if it's a real commit, that makes persistent changes
'all' is false if it's not in fact a commit but an end of the
statement that is part of the transaction.
NOTE 'all' is also false in auto-commit mode where 'end of statement'
and 'real commit' mean the same event.
*/
int (*commit)(THD *thd, bool all);
int (*rollback)(THD *thd, bool all);
int (*prepare)(THD *thd, bool all);
......@@ -234,6 +319,16 @@ typedef struct
int (*rollback_by_xid)(XID *xid);
} handlerton;
typedef struct st_thd_trans
{
/* number of entries in the ht[] */
uint nht;
/* true is not all entries in the ht[] support 2pc */
bool no_2pc;
/* storage engines that registered themselves for this transaction */
handlerton *ht[MAX_HA];
} THD_TRANS;
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
......@@ -268,6 +363,9 @@ typedef struct st_table TABLE;
struct st_foreign_key_info;
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
typedef struct st_savepoint SAVEPOINT;
extern ulong savepoint_alloc_size;
typedef struct st_ha_check_opt
{
ulong sort_buffer_size;
......@@ -626,57 +724,72 @@ public:
extern struct show_table_type_st sys_table_types[];
extern const char *ha_row_type[];
extern TYPELIB tx_isolation_typelib;
extern handlerton *handlertons[MAX_HA];
extern ulong total_ha, total_ha_2pc;
/* Wrapper functions */
#define ha_commit_stmt(thd) (ha_commit_trans((thd), &((thd)->transaction.stmt)))
#define ha_rollback_stmt(thd) (ha_rollback_trans((thd), &((thd)->transaction.stmt)))
#define ha_commit(thd) (ha_commit_trans((thd), &((thd)->transaction.all)))
#define ha_rollback(thd) (ha_rollback_trans((thd), &((thd)->transaction.all)))
#define ha_commit_stmt(thd) (ha_commit_trans((thd), FALSE))
#define ha_rollback_stmt(thd) (ha_rollback_trans((thd), FALSE))
#define ha_commit(thd) (ha_commit_trans((thd), TRUE))
#define ha_rollback(thd) (ha_rollback_trans((thd), TRUE))
#define ha_supports_generate(T) (T != DB_TYPE_INNODB && \
T != DB_TYPE_BERKELEY_DB && \
T != DB_TYPE_NDBCLUSTER)
/* lookups */
enum db_type ha_resolve_by_name(const char *name, uint namelen);
const char *ha_get_storage_engine(enum db_type db_type);
handler *get_new_handler(TABLE *table, enum db_type db_type);
my_off_t ha_get_ptr(byte *ptr, uint pack_length);
void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos);
enum db_type ha_checktype(enum db_type database_type);
/* basic stuff */
int ha_init(void);
TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
int ha_update_statistics();
void ha_close_connection(THD* thd);
enum db_type ha_checktype(enum db_type database_type);
bool ha_flush_logs(void);
void ha_drop_database(char* path);
int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
bool update_create_info);
int ha_delete_table(enum db_type db_type, const char *path);
/* discovery */
int ha_create_table_from_engine(THD* thd, const char *db, const char *name,
bool create_if_found);
int ha_delete_table(enum db_type db_type, const char *path);
void ha_drop_database(char* path);
int ha_discover(THD* thd, const char* dbname, const char* name,
const void** frmblob, uint* frmlen);
int ha_find_files(THD *thd,const char *db,const char *path,
const char *wild, bool dir,List<char>* files);
int ha_table_exists(THD* thd, const char* db, const char* name);
/* key cache */
int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);
int ha_end_key_cache(KEY_CACHE *key_cache);
int ha_start_stmt(THD *thd);
int ha_report_binlog_offset_and_commit(THD *thd, char *log_file_name,
my_off_t end_offset);
int ha_commit_complete(THD *thd);
/* weird stuff */
int ha_release_temporary_latches(THD *thd);
int ha_update_statistics();
int ha_commit_trans(THD *thd, THD_TRANS *trans);
int ha_rollback_trans(THD *thd, THD_TRANS *trans);
int ha_rollback_to_savepoint(THD *thd, char *savepoint_name);
int ha_savepoint(THD *thd, char *savepoint_name);
int ha_release_savepoint_name(THD *thd, char *savepoint_name);
/* transactions: interface to handlerton functions */
int ha_start_consistent_snapshot(THD *thd);
int ha_commit_or_rollback_by_xid(LEX_STRING *ident, bool commit);
int ha_commit_one_phase(THD *thd, bool all);
int ha_rollback_trans(THD *thd, bool all);
int ha_prepare(THD *thd);
int ha_recover(HASH *commit_list);
/* transactions: these functions never call handlerton functions directly */
int ha_commit_trans(THD *thd, bool all);
int ha_autocommit_or_rollback(THD *thd, int error);
void ha_set_spin_retries(uint retries);
bool ha_flush_logs(void);
int ha_enable_transaction(THD *thd, bool on);
int ha_change_key_cache(KEY_CACHE *old_key_cache,
KEY_CACHE *new_key_cache);
int ha_discover(THD* thd, const char* dbname, const char* name,
const void** frmblob, uint* frmlen);
int ha_find_files(THD *thd,const char *db,const char *path,
const char *wild, bool dir,List<char>* files);
int ha_table_exists(THD* thd, const char* db, const char* name);
TYPELIB *ha_known_exts(void);
int ha_start_consistent_snapshot(THD *thd);
void trans_register_ha(THD *thd, bool all, handlerton *ht);
/* savepoints */
int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv);
int ha_savepoint(THD *thd, SAVEPOINT *sv);
int ha_release_savepoint(THD *thd, SAVEPOINT *sv);
......@@ -2823,7 +2823,7 @@ void item_user_lock_release(User_level_lock *ull)
tmp.copy(command, strlen(command), tmp.charset());
tmp.append(ull->key,ull->key_length);
tmp.append("\")", 2);
Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1, FALSE);
Query_log_event qev(current_thd, tmp.ptr(), tmp.length(), 0, FALSE);
qev.error_code=0; // this query is always safe to run on slave
mysql_bin_log.write(&qev);
}
......
......@@ -19,11 +19,11 @@
#include "lex_symbol.h"
/* We don't want to include sql_yacc.h into gen_lex_hash */
SYM_GROUP sym_group_common= {"", ""};
SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"};
SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
/* We don't want to include sql_yacc.h into gen_lex_hash */
#ifdef NO_YACC_SYMBOLS
#define SYM_OR_NULL(A) 0
#else
......@@ -314,6 +314,7 @@ static SYMBOL symbols[] = {
{ "MERGE", SYM(MERGE_SYM)},
{ "MICROSECOND", SYM(MICROSECOND_SYM)},
{ "MIDDLEINT", SYM(MEDIUMINT)}, /* For powerbuilder */
{ "MIGRATE", SYM(MIGRATE_SYM)},
{ "MINUTE", SYM(MINUTE_SYM)},
{ "MINUTE_MICROSECOND", SYM(MINUTE_MICROSECOND_SYM)},
{ "MINUTE_SECOND", SYM(MINUTE_SECOND_SYM)},
......@@ -346,6 +347,7 @@ static SYMBOL symbols[] = {
{ "OFFSET", SYM(OFFSET_SYM)},
{ "OLD_PASSWORD", SYM(OLD_PASSWORD)},
{ "ON", SYM(ON)},
{ "ONE", SYM(ONE_SYM)},
{ "ONE_SHOT", SYM(ONE_SHOT_SYM)},
{ "OPEN", SYM(OPEN_SYM)},
{ "OPTIMIZE", SYM(OPTIMIZE)},
......@@ -359,6 +361,7 @@ static SYMBOL symbols[] = {
{ "PACK_KEYS", SYM(PACK_KEYS_SYM)},
{ "PARTIAL", SYM(PARTIAL)},
{ "PASSWORD", SYM(PASSWORD)},
{ "PHASE", SYM(PHASE_SYM)},
{ "POINT", SYM(POINT_SYM)},
{ "POLYGON", SYM(POLYGON)},
{ "PRECISION", SYM(PRECISION)},
......@@ -380,6 +383,7 @@ static SYMBOL symbols[] = {
{ "READ", SYM(READ_SYM)},
{ "READS", SYM(READS_SYM)},
{ "REAL", SYM(REAL)},
{ "RECOVER", SYM(RECOVER_SYM)},
{ "REDUNDANT", SYM(REDUNDANT_SYM)},
{ "REFERENCES", SYM(REFERENCES)},
{ "REGEXP", SYM(REGEXP)},
......@@ -398,6 +402,7 @@ static SYMBOL symbols[] = {
{ "RESET", SYM(RESET_SYM)},
{ "RESTORE", SYM(RESTORE_SYM)},
{ "RESTRICT", SYM(RESTRICT)},
{ "RESUME", SYM(RESUME_SYM)},
{ "RETURN", SYM(RETURN_SYM)},
{ "RETURNS", SYM(RETURNS_SYM)},
{ "REVOKE", SYM(REVOKE)},
......@@ -467,6 +472,7 @@ static SYMBOL symbols[] = {
{ "STRIPED", SYM(RAID_STRIPED_SYM)},
{ "SUBJECT", SYM(SUBJECT_SYM)},
{ "SUPER", SYM(SUPER_SYM)},
{ "SUSPEND", SYM(SUSPEND_SYM)},
{ "TABLE", SYM(TABLE_SYM)},
{ "TABLES", SYM(TABLES)},
{ "TABLESPACE", SYM(TABLESPACE)},
......@@ -528,6 +534,7 @@ static SYMBOL symbols[] = {
{ "WRITE", SYM(WRITE_SYM)},
{ "X509", SYM(X509_SYM)},
{ "XOR", SYM(XOR)},
{ "XA", SYM(XA_SYM)},
{ "YEAR", SYM(YEAR_SYM)},
{ "YEAR_MONTH", SYM(YEAR_MONTH_SYM)},
{ "ZEROFILL", SYM(ZEROFILL)},
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -409,9 +409,16 @@ inline THD *_current_thd(void)
}
#define current_thd _current_thd()
/*
External variables
*/
extern ulong server_id, concurrency;
typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
uint key_length,
ulonglong *engine_data);
#include "sql_string.h"
#include "sql_list.h"
#include "sql_map.h"
......@@ -449,6 +456,14 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables);
bool insert_precheck(THD *thd, TABLE_LIST *tables);
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
TABLE_LIST *create_table);
enum enum_mysql_completiontype {
ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7,
COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6
};
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
Item *negate_expression(THD *thd, Item *expr);
#include "sql_class.h"
#include "sql_acl.h"
......@@ -572,6 +587,8 @@ bool mysql_preload_keys(THD* thd, TABLE_LIST* table_list);
int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
KEY_CACHE *dst_cache);
bool mysql_xa_recover(THD *thd);
bool check_simple_select();
SORT_FIELD * make_unireg_sortorder(ORDER *order, uint *length);
......@@ -944,11 +961,9 @@ void sql_print_information(const char *format, ...);
bool fn_format_relative_to_data_home(my_string to, const char *name,
const char *dir, const char *extension);
bool open_log(MYSQL_LOG *log, const char *hostname,
const char *opt_name, const char *extension,
const char *index_file_name,
enum_log_type type, bool read_append,
bool no_auto_events, ulong max_size);
File open_binlog(IO_CACHE *log, const char *log_file_name,
const char **errmsg);
handlerton *binlog_init();
/* mysqld.cc */
extern void yyerror(const char*);
......@@ -1003,7 +1018,7 @@ extern double last_query_cost;
extern double log_10[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulong refresh_version,flush_version, thread_id,query_id;
extern ulong refresh_version,flush_version, thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
......@@ -1013,8 +1028,6 @@ extern ulong delayed_rows_in_use,delayed_insert_errors;
extern ulong slave_open_temp_tables;
extern ulong query_cache_size, query_cache_min_res_unit;
extern ulong thd_startup_options, slow_launch_threads, slow_launch_time;
extern ulong server_id, concurrency;
extern ulong ha_read_count, ha_discover_count;
extern ulong table_cache_size;
extern ulong max_connections,max_connect_errors, connect_timeout;
extern ulong slave_net_timeout;
......@@ -1056,6 +1069,7 @@ extern uint opt_large_page_size;
extern MYSQL_LOG mysql_log,mysql_slow_log,mysql_bin_log;
extern FILE *bootstrap_file;
extern int bootstrap_error;
extern pthread_key(MEM_ROOT**,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
......@@ -1259,6 +1273,14 @@ SQL_CRYPT *get_crypt_for_frm(void);
#include "sql_view.h"
/* query_id */
typedef ulonglong query_id_t;
extern query_id_t query_id;
/* increment query_id and return it. */
inline query_id_t next_query_id() { return query_id++; }
/* Some inline functions for more speed */
inline bool add_item_to_list(THD *thd, Item *item)
......
This diff is collapsed.
......@@ -778,7 +778,7 @@ public:
} save_result;
LEX_STRING base; /* for structs */
set_var(enum_var_type type_arg, sys_var *var_arg, LEX_STRING *base_name_arg,
set_var(enum_var_type type_arg, sys_var *var_arg, const LEX_STRING *base_name_arg,
Item *value_arg)
:var(var_arg), type(type_arg), base(*base_name_arg)
{
......
......@@ -5306,6 +5306,18 @@ ER_CANNOT_USER
eng "Operation %s failed for %.256s"
ger "Das Kommando %s scheiterte fr %.256s"
norwegian-ny "Operation %s failed for '%.256s'"
ER_XAER_NOTA XAE04
eng "XAER_NOTA: Unknown XID"
ER_XAER_INVAL XAE05
eng "XAER_INVAL: Invalid arguments (or unsupported command)"
ER_XAER_RMFAIL XAE07
eng "XAER_RMFAIL: The command cannot be executed in the %.64s state"
ER_XAER_OUTSIDE XAE09
eng "XAER_OUTSIDE: Some work is done outside global transaction"
ER_XAER_RMERR XAE03
eng "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency"
ER_XA_RBROLLBACK XA100
eng "XA_RBROLLBACK: Transaction branch was rolled back"
ER_NONEXISTING_PROC_GRANT 42000
eng "There is no such grant defined for user '%-.32s' on host '%-.64s' on routine '%-.64s'"
ER_PROC_AUTO_GRANT_FAIL
......
This diff is collapsed.
/* Copyright (C) 2000-2003 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; either version 2 of the License, or
(at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
......@@ -392,11 +392,11 @@ typedef struct st_master_info
my_bool ssl; // enables use of SSL connection if true
char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN];
char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN];
my_off_t master_log_pos;
File fd; // we keep the file open, so we need to remember the file pointer
IO_CACHE file;
pthread_mutex_t data_lock,run_lock;
pthread_cond_t data_cond,start_cond,stop_cond;
THD *io_thd;
......@@ -412,7 +412,7 @@ typedef struct st_master_info
volatile bool abort_slave;
volatile uint slave_running;
volatile ulong slave_run_id;
/*
/*
The difference in seconds between the clock of the master and the clock of
the slave (second - first). It must be signed as it may be <0 or >0.
clock_diff_with_master is computed when the I/O thread starts; for this the
......@@ -421,8 +421,8 @@ typedef struct st_master_info
clock_of_slave - last_timestamp_executed_by_SQL_thread - clock_diff_with_master
*/
long clock_diff_with_master;
long clock_diff_with_master;
st_master_info()
:ssl(0), fd(-1), io_thd(0), inited(0),
abort_slave(0),slave_running(0), slave_run_id(0)
......@@ -430,7 +430,7 @@ typedef struct st_master_info
host[0] = 0; user[0] = 0; password[0] = 0;
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
ssl_cipher[0]= 0; ssl_key[0]= 0;
bzero((char*) &file, sizeof(file));
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
......@@ -550,7 +550,6 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
bool abort_if_no_master_info_file,
int thread_mask);
void end_master_info(MASTER_INFO* mi);
int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname);
void end_relay_log_info(RELAY_LOG_INFO* rli);
void lock_slave_threads(MASTER_INFO* mi);
void unlock_slave_threads(MASTER_INFO* mi);
......
......@@ -1243,7 +1243,7 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
thd->free_list= NULL;
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id= query_id++;
thd->query_id= next_query_id();
VOID(pthread_mutex_unlock(&LOCK_thread_count));
reset_stmt_for_execute(thd, lex);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -141,7 +141,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->view_prepare_mode= FALSE;
lex->derived_tables= 0;
lex->lock_option= TL_READ;
lex->found_colon= 0;
lex->found_semicolon= 0;
lex->safe_to_cache_query= 1;
lex->time_zone_tables_used= 0;
lex->leaf_tables_insert= lex->proc_table= lex->query_tables= 0;
......@@ -949,7 +949,7 @@ int yylex(void *arg, void *yythd)
(thd->command != COM_PREPARE))
{
lex->safe_to_cache_query= 0;
lex->found_colon= (char*) lex->ptr;
lex->found_semicolon=(char*) lex->ptr;
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
lex->next_state= MY_LEX_END;
return (END_OF_INPUT);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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