Commit graph

41222 commits

Author SHA1 Message Date
unknown
56a0d07628 After merge fix:
Adding "flush log" before running mysqlbinlog.
2006-12-29 17:12:59 +04:00
unknown
08a3b2027a After merge fix 2006-12-29 16:45:10 +04:00
unknown
26ecdbd024 log_event.cc:
After merge fix


sql/log_event.cc:
  After merge fix
2006-12-29 16:42:16 +04:00
unknown
e65169cda1 After merge fix.
Adding "flush logs" to fix test failure.
2006-12-29 16:00:51 +04:00
unknown
12c4def6f7 Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  romeo.(none):/home/bkroot/mysql-5.1-new-rpl
2006-12-22 12:24:07 +01:00
unknown
948804c8aa BUG#22864 (CREATE-SELECT does not work correctly):
Post-merge fixes.


sql/log.cc:
  Removing HAVE_ROW_BASED_REPLICATION from file.
2006-12-22 12:09:44 +01:00
unknown
61c7864ced After merge fix 2006-12-22 11:43:04 +04:00
unknown
517e0d31c4 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  mysql.com:/usr/home/bar/mysql-5.1.b17642


mysql-test/r/mysqlbinlog.result:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  After merge fix
2006-12-22 11:20:55 +04:00
unknown
c3315ccca9 Merge romeo.(none):/home/bk/b22864-mysql-5.1-new-rpl
into  romeo.(none):/home/bk/merge-b22864-myql-5.1-new-rpl


sql/log.h:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/log.cc:
  Merge with mysql-5.1-new-rpl
sql/slave.cc:
  Merge with mysql-5.1-new-rpl
sql/sql_insert.cc:
  Merge with mysql-5.1-new-rpl
2006-12-21 19:36:28 +01:00
unknown
3d68c135d0 BUG#22864 (Rollback following CREATE... SELECT discards 'CREATE TABLE'
from log):
When row-based logging is used, the CREATE-SELECT is written as two
parts: as a CREATE TABLE statement and as the rows for the table. For
both transactional and non-transactional tables, the CREATE TABLE
statement was written to the transaction cache, as were the rows, and
on statement end, the entire transaction cache was written to the binary
log if the table was non-transactional. For transactional tables, the
events were kept in the transaction cache until end of transaction (or
statement that were not part of a transaction).

For the case when AUTOCOMMIT=0 and we are creating a transactional table
using a create select, we would then keep the CREATE TABLE statement and
the rows for the CREATE-SELECT, while executing the following statements.
On a rollback, the transaction cache would then be cleared, which would
also remove the CREATE TABLE statement. Hence no table would be created
on the slave, while there is an empty table on the master.

This relates to BUG#22865 where the table being created exists on the
master, but not on the slave during insertion of rows into the newly
created table. This occurs since the CREATE TABLE statement were still
in the transaction cache until the statement finished executing, and
possibly longer if the table was transactional.

This patch changes the behaviour of the CREATE-SELECT statement by
adding an implicit commit at the end of the statement when creating
non-temporary tables. Hence, non-temporary tables will be written to the
binary log on completion, and in the even of AUTOCOMMIT=0, a new
transaction will be started. Temporary tables do not commit an ongoing
transaction: neither as a pre- not a post-commit.

The events for both transactional and non-transactional tables are
saved in the transaction cache, and written to the binary log at end
of the statement.


mysql-test/r/rpl_row_create_table.result:
  Result change
mysql-test/t/rpl_row_create_table.test:
  Requring InnoDB for slave as well.
  Adding test CREATE-SELECT that is rolled back explicitly.
  Changing binlog positions.
sql/log.cc:
  Adding helper class to handle lock/unlock of mutexes using RAII.
  Factoring out code into write_cache() function to transaction cache
    to binary log.
  Adding function THD::binlog_flush_transaction_cache() to flush the
    transaction cache to the binary log file.
  Factoring out code into binlog_set_stmt_begin() to set the beginning
    of statement savepoint.
  Clearing before statement point when transaction cache is truncated
   so that these points are out of range.
sql/log.h:
  Adding method MYSQL_BIN_LOG::write_cache()
sql/log_event.h:
  Replicating OPTION_NOT_AUTOCOMMIT flag (see changeset comment)
sql/mysql_priv.h:
  Although left-shifting signed integer values is well-defined,
  it has potential for strange errors. Using unsigned long long
  instead of signed long long since this is the type of the options
  flags.
sql/slave.cc:
  Adding printout of transaction-critical thread flags.
sql/sql_class.h:
  Adding function THD::binlog_flush_transaction_cache()
  Adding function THD::binlog_set_stmt_begin()
sql/sql_insert.cc:
  Adding code to cache events for a CREATE-SELECT statement.
  Disabling binlog for SBR (but not RBR) when sending error for select part
  of CREATE-SELECT statement.
  Adding implicit commit at end of statement for non-temporary tables.
mysql-test/t/rpl_row_create_table-slave.opt:
  New BitKeeper file ``mysql-test/t/rpl_row_create_table-slave.opt''
2006-12-21 09:29:02 +01:00
unknown
6d310813ba After merge fix for Bug N22645 2006-12-14 17:48:32 +04:00
unknown
e3ce6c4d6b Merge mysql.com:/usr/home/bar/mysql-5.0.b22645
into  mysql.com:/usr/home/bar/mysql-5.1.b22645


mysql-test/t/mysqlbinlog.test:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
mysql-test/t/disabled.def:
  SCCS merged
2006-12-14 16:45:48 +04:00
unknown
76bd00a993 After merge fix for bug N22645
mysql-test/t/mysqlbinlog.test:
  After merge fix
sql/log_event.cc:
  Fixing comment, thanks to Andrei for suggestion
2006-12-14 16:31:23 +04:00
unknown
c8b678ac08 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b22645


mysql-test/t/disabled.def:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
mysql-test/r/mysqlbinlog.result:
  After merge fix
mysql-test/t/mysqlbinlog.test:
  After merge fix
2006-12-14 14:19:30 +04:00
unknown
e653222d30 Bug#17642 mysqlbinlog: Restore from row-based binlog fails
Problem: mysqlbinlog_base64 failed sporadically.

Reason: Missing "flush logs" before running $MYSQL_BINLOG,
which could start dumping the log file before server
has finished writting into it.
Fix:
- implementing --force-if-open option to "mysqlbinlog"
- adding --disable-force-if-open to make $MYSQL_BINLOG
  fail on non-closed log files, to garantee that nobody
  will forget "flush logs" in the future.
- adding "flush logs" into all affected tests.


client/mysqlbinlog.cc:
  Implementing --force-if-open option with TRUE by default
mysql-test/mysql-test-run.pl:
  Using --disable-force-if-open for all tests to avoid
  sporadic test failures because of running "mysqlbinlog"
  on a non-flushed binlog files.
mysql-test/r/binlog_row_mix_innodb_myisam.result:
  FLush log before running dumping.
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  FLush log before running dumping.
mysql-test/r/mysqlbinlog.result:
  FLush log before running dumping.
mysql-test/r/mysqlbinlog2.result:
  FLush log before running dumping.
mysql-test/r/mysqlbinlog_base64.result:
  FLush log before running dumping.
mysql-test/r/user_var-binlog.result:
  FLush log before running dumping.
mysql-test/t/binlog_row_mix_innodb_myisam.test:
  FLush log before running dumping.
mysql-test/t/binlog_stm_mix_innodb_myisam.test:
  FLush log before running dumping.
mysql-test/t/mysqlbinlog.test:
  FLush log before running dumping.
  
  Adding new tests:
  - checking that $MYSQL_BINLOG returns an error on a non-closed binlog
  file because of --disable-force-if-open
  - checking that it does not return an error with --force-if-open
mysql-test/t/mysqlbinlog2.test:
  FLush log before running dumping.
mysql-test/t/mysqlbinlog_base64.test:
  FLush log before running dumping.
mysql-test/t/user_var-binlog.test:
  FLush log before running dumping.
2006-12-14 14:05:25 +04:00
unknown
9ef60daf78 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  mysql.com:/usr/home/bar/mysql-5.1.b20396v2
2006-12-11 17:13:53 +04:00
unknown
8d2b5f13a1 after merge fix for bug N20396 2006-12-11 17:08:10 +04:00
unknown
0bcf78df8a Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  romeo.(none):/home/bkroot/mysql-5.1-new-rpl
2006-12-11 13:05:11 +01:00
unknown
6a39c9e6b8 Merging with mysql-5.1-new-rpl 2006-12-11 12:22:21 +01:00
unknown
d9993548a9 After merge fix for bug N20396 2006-12-11 15:08:04 +04:00
unknown
009c88db20 Merge mysql.com:/home/bk/MERGE/mysql-5.0-merge
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge


client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/rpl_timezone.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
include/my_pthread.h:
  Manual merge
2006-12-08 23:54:45 +01:00
unknown
750dd5ed04 Merge mysql.com:/home/bk/MERGE/mysql-4.1-merge
into  mysql.com:/home/bk/MERGE/mysql-5.0-merge


sql/item_timefunc.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
2006-12-08 23:51:21 +01:00
unknown
26b6dc4291 Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.1-merge


client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
config/ac-macros/ha_ndbcluster.m4:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/rpl_timezone.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/rpl_injector.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/t/mysqldump.test:
  Manual merge
sql/log_event.cc:
  manual merge
2006-12-08 23:41:29 +01:00
unknown
cacaef6e44 Merge mysql.com:/home/bkroot/mysql-5.0-rpl
into  mysql.com:/home/bk/MERGE/mysql-5.0-merge


client/mysqldump.c:
  Auto merged
include/my_pthread.h:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/rpl_timezone.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-12-08 23:33:39 +01:00
unknown
5aa8705ab6 Merge mysql.com:/home/bkroot/mysql-4.1-rpl
into  mysql.com:/home/bk/MERGE/mysql-4.1-merge


sql/item_timefunc.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
2006-12-08 23:33:15 +01:00
unknown
a79858049e Minor fix
include/my_pthread.h:
  Fixed missing \ in #if directive.
2006-12-08 19:23:12 +01:00
unknown
42b2cb8613 Merge quant.(none):/ext/mysql/bkroot/mysql-5.0-rpl
into  quant.(none):/ext/mysql/bk/mysql-5.0-bug24507


sql/sql_acl.cc:
  Auto merged
2006-12-08 16:50:06 +01:00
unknown
b8ff601ebf Merge mysql.com:/usr/home/bar/mysql-5.0.b24158
into  mysql.com:/usr/home/bar/mysql-5.1.b20396


mysql-test/r/rpl_do_grant.result:
  Auto merged
mysql-test/t/rpl_do_grant.test:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2006-12-08 16:15:43 +04:00
unknown
6aa09b4c23 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b24158
2006-12-08 15:18:03 +04:00
unknown
55c10a09ee After merge fix 2006-12-08 15:13:12 +04:00
unknown
df2af6cdf0 Merge quant.(none):/ext/mysql/bkroot/mysql-5.0-rpl
into  quant.(none):/ext/mysql/bk/mysql-5.0-bug24507


client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-12-08 11:47:48 +01:00
unknown
9f37ea459c BUG#24507 (rpl_log.test crash slave):
The problem was located to lie inside current NPTL pthread_exit() 
implementation. Race conditions in this code can lead to segmentation
fault. Hovewer, this can happen only in a race between first thread 
calling pthread_exit() and other threads. 

Workaround implemented in this patch spawns a dummy thread, which
exits immediately, during thread lib initialization. This will exclude
segment violations when further threads exit.
 


include/my_pthread.h:
  define macro NPTL_PTHREAD_EXIT_BUG which controls whether workaround
  in my_thread_global_init() is included or not.
mysys/my_thr_init.c:
  Spawn a dummy thread in my_thread_global_init() to initialize pthread 
  lib internal variables.
2006-12-08 11:41:12 +01:00
unknown
75127a6921 After merge fix
client/mysqlbinlog.cc:
  Auto merged
mysql-test/r/user_var-binlog.result:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
BitKeeper/deleted/.del-ctype_ucs_binlog.result~280d136b1a0bcf17:
  Auto merged
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/r/rpl_stm_charset.result:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  after merge fix.
2006-12-08 10:33:05 +04:00
unknown
b93baf4832 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/usr/home/bar/mysql-5.0.b20396
2006-12-08 09:48:46 +04:00
unknown
9eb9f25fc0 WL#3618 Minor correction to configure script to remove the replication.m4 script. 2006-12-07 15:00:01 -05:00
unknown
f88f71a241 Merge suse.vabb.com:/home/Chuck/development/mysql-5.1-new-rpl
into  suse.vabb.com:/home/Chuck/development/mysql-5.1_WL_3618


sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/table.cc:
  Auto merged
2006-12-07 09:19:56 -05:00
unknown
85a8f7c7a9 WL#3618 - Remove HAVE_ROW_BASED_REPLICATION from source code.
Please see worklog for details on files changed.


BitKeeper/deleted/.del-have_row_based.require:
  Delete: mysql-test/r/have_row_based.require
BitKeeper/deleted/.del-not_row_based.require:
  Delete: mysql-test/r/not_row_based.require
BitKeeper/deleted/.del-have_row_based.inc:
  Delete: mysql-test/include/have_row_based.inc
BitKeeper/deleted/.del-not_row_based.inc:
  Delete: mysql-test/include/not_row_based.inc
BitKeeper/deleted/.del-replication.m4:
  Delete: config/ac-macros/replication.m4
2006-12-07 09:18:35 -05:00
unknown
e54bbaa3fb Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  example.com:/work/mysql-5.1-maint
2006-12-07 13:58:56 +01:00
unknown
0a22a1b915 Additional fix for bug#22369
mysql-test/t/events_bugs.test:
  let events_bugs not fail because of timing
sql/sql_table.cc:
  if the db or name has been changed ALTER_RENAME,
  then fix table_list
  Solution by having the second table added in the parser to the
  list of used tables, won't work because checking of rights of merge
  tables goes over table_list->next_local and checks the rights, so
  we will fail there.
sql/sql_yacc.yy:
  fix name - prevents ddd from correct working
2006-12-07 13:57:39 +01:00
unknown
c423ecc0a7 Bug#22645 LC_TIME_NAMES: Statement not replicated
Implementing event based replication of LC_TIME_NAMES for 5.0
(as a replacement of previously made ONE_SHOT replication)


mysql-test/r/mysqlbinlog.result:
  Fixing results
mysql-test/r/rpl_locale.result:
  Fixing results
mysql-test/t/disabled.def:
  Enabling rpl_locale
mysql-test/t/mysqlbinlog.test:
  Check "mysqlbinlog | mysql" reproduces lc_time_names correctly.
mysql-test/t/rpl_locale.test:
  Adding new test: that setting lc_time_names back to en_US works fine.
sql/log_event.cc:
  Implementing event based replication of LC_TIME_NAMES for 5.0
  (as a replacement of previously made ONE_SHOT replication)
sql/log_event.h:
  Adding new Q_*_CODE
  Adding "lc_time_names_number" members into Query_log_event and PRINT_EVENT_INFO
2006-12-07 09:31:53 +04:00
unknown
1fb5bd3727 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint


client/mysqltest.c:
  Auto merged
mysys/my_getopt.c:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/t/disabled.def:
  Manual merge
2006-12-06 23:45:09 +01:00
unknown
d5e094d798 Only call mysql_server_end if mysql_server_init has been called.
Remove DBUG_ENTER in my_end


client/mysqltest.c:
  Call 'mysql_server_end' as last function in 'free_used_memory'
  Don't use DBUG_VOID_RETURN after mysql_server_end in free_used_memory
  Only call mysql_server_end if mysql_server_init has been called
2006-12-06 23:43:36 +01:00
unknown
ca7ee3755f Flush stderr after print of error message to get predictable output 2006-12-06 22:03:56 +01:00
unknown
c0efc71780 Adjust replace to mask win paths 2006-12-06 16:44:31 +01:00
unknown
1963159f70 Initialize guarded_instance to NULL in constuctor. Avoid looping over
uninitialized list of guarded instances.


server-tools/instance-manager/guardian.cc:
  Initialize guarded_instance to NULL in constuctor. Avoid looping over
  uninitialized list of guarded instances
2006-12-06 11:25:18 +01:00
unknown
e669bcd6a9 Merge bk-internal:/home/bk/mysql-5.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-12-05 20:46:18 +01:00
unknown
8ef1be3de8 Merge bk-internal:/home/bk/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-12-05 19:56:49 +01:00
unknown
64f5ce7ec3 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint


client/mysqltest.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/ndb_update.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
storage/ndb/src/common/util/socket_io.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
storage/ndb/src/kernel/vm/SimulatedBlock.cpp:
  Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
  Auto merged
storage/ndb/src/ndbapi/NdbTransaction.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndberror.c:
  Auto merged
storage/ndb/test/run-test/daily-basic-tests.txt:
  Auto merged
storage/ndb/tools/ndb_condig.cpp:
  Auto merged
storage/ndb/src/common/util/File.cpp:
  Manual merge
storage/ndb/src/common/util/InputStream.cpp:
  Manual merge
2006-12-05 19:19:58 +01:00
unknown
429cf98807 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint


mysql-test/mysql-test-run.pl:
  Auto merged
2006-12-05 19:14:09 +01:00
unknown
b121562b38 Remove hack that removes vardir 2006-12-05 19:13:31 +01:00