Commit graph

53129 commits

Author SHA1 Message Date
unknown
f56d77dadf BUG#29020 (Event results not correctly replicated to slave in RBR):
The bug allow multiple executing transactions working with non-transactional
to interfere with each others by interleaving the events of different trans-
actions.

Bug is fixed by writing non-transactional events to the transaction cache and
flushing the cache to the binary log at statement commit. To mimic the behavior
of normal statement-based replication, we flush the transaction cache in row-
based mode when there is no committed statements in the transaction cache,
which means we are committing the first one. This means that it will be written
to the binary log as a "mini-transaction" with just the rows for the statement.

Note that the changes here does not take effect when building the server with
HAVE_TRANSACTIONS set to false, but it is not clear if this was possible before
this patch either.

For row-based logging, we also have that when AUTOCOMMIT=1, the code now always
generates a BEGIN/COMMIT pair for single statements, or BEGIN/ROLLBACK pair in the
case of non-transactional changes in a statement that was rolled back. Note that
for the case where changes to a non-transactional table causes a rollback due
to error, the statement will now be logged with a BEGIN/ROLLBACK pair, even
though some changes has been committed to the non-transactional table.


mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test:
  Removing SHOW BINLOG EVENTS causing test to be non-deterministic.
mysql-test/r/ctype_cp932_binlog_row.result:
  Result change.
mysql-test/suite/binlog/r/binlog_base64_flag.result:
  Result change.
mysql-test/suite/binlog/r/binlog_multi_engine.result:
  Result file change.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Result file change.
mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result:
  Result file change.
mysql-test/suite/binlog/r/binlog_row_insert_select.result:
  Result file change.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Result file change.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  Result file change.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
  Removing table that will be used in test to prevent failing if preceeding
  tests forgot to drop the table.
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_create_table.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_delayed_ins.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_log.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_row_until.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_slave_skip.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  Result file change.
mysql-test/suite/rpl/r/rpl_truncate_2myisam.result:
  Result file change.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
  Binlog position change.
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Binlog position change.
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
  Binlog position change. Added stop position to mysqlbinlog argments to prevent
  extreneous output.
mysql-test/suite/rpl/t/rpl_row_until.test:
  Binlog position change.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
  Binlog position change.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Removing extreneous SHOW BINLOG EVENTS causing test to be non-deterministic.
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
  Result change.
sql/log.cc:
  Adding variable at_least_one_stmt to denote that there is at least one
  statement committed to the transaction cache (but there might be more).
  
  Removing duplicate checks from binlog_end_trans(). The transaction cache
  should always be committed or rolled back when this function is called.
  
  Correcting conditions for binlog_rollback() and binlog_commit() and removing
  the previous "invisible commit" in favor of always using explicit commits
  in the binary log.
sql/log_event.cc:
  Marking table map event to be cached. Removing Muted_query_log_event from code.
sql/log_event.h:
  Removing unused class Muted_query_log_event.
sql/sql_insert.cc:
  Adding missing call to ha_autocommit_or_rollback() for delayed thread. Marking
  CREATE-SELECT statements as transactional, since they don't need to be logged.
2008-03-28 13:16:41 +01:00
unknown
41a80039b6 Adding missing drop of view last in test.
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Result change.
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Dropping view created in test.
2008-03-05 14:45:40 +01:00
unknown
cc3bf06878 Updating result file.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Result file change.
2008-03-05 13:59:32 +01:00
unknown
ad1a1a3e97 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
2008-03-05 11:06:17 +01:00
unknown
d9833dc41f Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/log.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/handler.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
2008-03-05 10:16:20 +01:00
unknown
d20bfbbef6 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-03-05 09:42:26 +01:00
unknown
5215beee7b Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


mysql-test/r/mysqldump.result:
  Manual merge.
mysql-test/t/mysqldump.test:
  Manual merge.
2008-03-04 22:19:23 +01:00
unknown
45eab6d350 Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
2008-03-04 13:44:54 +01:00
unknown
adeac5cabe Adding code to ignore warning from error log.
mysql-test/lib/mtr_report.pl:
  Filtering out benign warning that can be generated during server shutdown.
2008-03-04 13:21:15 +01:00
unknown
6c2420ed3c Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M51/mysql-5.1


configure.in:
  No propagation of a 5.0 version number change to 5.1
2008-03-03 21:23:19 +01:00
unknown
4d09306dd1 Raise the version number after cloning 5.0.58 2008-03-03 21:19:58 +01:00
unknown
0ab3eab55c Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt
2008-03-03 14:02:36 +03:00
unknown
9ffaa74535 Bug#22438
mysql-test/r/mysqldump.result:
  updated result
mysql-test/t/mysqldump.test:
  hide master_log_pos number
2008-03-02 21:20:36 +03:00
unknown
6c0d316d16 WL#4091, fix for rpl_flushlog_loop for windows platforms
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
  added waiting for CREATE TABLE
2008-03-02 20:17:39 +03:00
unknown
ee10d69714 WL#4091, enable rpl_flushlog_loop.test and fix for rpl_drop_temp.test
mysql-test/suite/rpl/t/disabled.def:
  enable test
mysql-test/suite/rpl/t/rpl_drop_temp.test:
  added sync slave with master
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
  added sync slave with master
2008-03-01 00:05:23 +03:00
unknown
29cfe3161a Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-29 11:18:13 -03:00
unknown
de534f2bc1 Fix for Bug#31947: Declare with a reserved word succeeded.
READ_ONLY token was accidentally placed into wrong place
('ident' rule). The proper place is in the 'keyword_sp' rule.

The manual should be re-generated after this patch, because
the manual depends on the 'keyword_sp' rule.


sql/sql_yacc.yy:
  Move READ_ONLY token to the 'keyword_sp' rule.
2008-02-29 12:21:19 +03:00
unknown
05480a8863 Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/limit.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/item.cc:
  Auto merged
mysql-test/suite/rpl/r/rpl_user_variables.result:
  Manual merge
mysql-test/suite/rpl/t/rpl_user_variables.test:
  Manual merge
sql/sql_yacc.yy:
  Manual merge
2008-02-28 20:22:50 -03:00
unknown
8b77945615 Post-merge fix for Bug 33851. The initialization order of members
must match the order which they were declared in the class definition. 


sql/item.cc:
  Fix initialization order, parameter was the last one declared.
2008-02-28 20:22:11 -03:00
unknown
caf604282f Bug#32663, Bug#33045, Bug#23533, WL#4091
mysql-test/suite/binlog/r/binlog_multi_engine.result:
  updated result
mysql-test/suite/binlog/t/binlog_multi_engine.test:
  fix for bug#32663
mysql-test/suite/binlog/t/disabled.def:
  updated
mysql-test/suite/rpl/r/rpl_invoked_features.result:
  updated result
mysql-test/suite/rpl/t/disabled.def:
  updated
mysql-test/suite/rpl/t/rpl_invoked_features.test:
  fix for bug#33045
mysql-test/suite/bugs/r/rpl_bug23533.result:
  result file
mysql-test/suite/bugs/t/rpl_bug23533.test:
  test case for bug#23533
2008-02-29 00:50:15 +03:00
unknown
33a4e76090 Bug#34655 Compile error
Rename client_last_error to last_error and client_last_errno to last_errno
to not break connectors which use the internal net structure for error handling.


include/mysql_com.h:
  Rename client_last_error to last_error, client_last_errno to last_errno.
include/mysql_h.ic:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/libmysql.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysql/manager.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/lib_sql.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
libmysqld/libmysqld.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
server-tools/instance-manager/mysql_connection.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql-common/client.c:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/log_event_old.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/net_serv.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
sql/repl_failsafe.cc:
  Rename client_last_error to last_error, client_last_errno to last_errno.
2008-02-28 14:55:46 -03:00
unknown
1164e2bc7a Bug#33851 Passing UNSIGNED param to EXECUTE returns ERROR 1210
The problem is that passing anything other than a integer to a limit
clause in a prepared statement would fail. This limitation was introduced
to avoid replication problems (e.g: replicating the statement with a
string argument would cause a parse failure in the slave).

The solution is to convert arguments to the limit clause to a integer
value and use this converted value when persisting the query to the log.


mysql-test/r/limit.result:
  Update test case result.
mysql-test/r/ps.result:
  Add test case result for Bug#33851
mysql-test/r/rpl_user_variables.result:
  Test case result for replication of prepared statement with
  limit clause.
mysql-test/t/limit.test:
  Test parameters to limit clause.
mysql-test/t/ps.test:
  Add test case for Bug#33851
mysql-test/t/rpl_user_variables.test:
  Test replication of a parameter which value is converted.
sql/item.cc:
  Convert value to integer if it's a parameter to a limit clause.
sql/item.h:
  Flag signal that item is a parameter to a limit clause.
sql/item_func.cc:
  Const member functions, object is not mutated.
sql/sql_class.h:
  Const member functions, object is not mutated.
sql/sql_yacc.yy:
  Flag that item is a parameter to a limit clause.
2008-02-28 11:34:08 -03:00
unknown
944f2599fe Disable test case due to Bug#34891: sp_notembedded.test fails
sporadically.


mysql-test/r/sp_notembedded.result:
  Disable test case.
mysql-test/t/sp_notembedded.test:
  Disable test case.
2008-02-28 17:28:33 +03:00
unknown
ce7b8e1248 Fix for Bug#34852: SHOW OPEN TABLES output is not repeatable
(show_check.test fails sporadically).

Fix test case for Bug#12183 to make it stable.


mysql-test/r/show_check.result:
  Fix result file.
mysql-test/t/show_check.test:
  Make test case for Bug#12183 stable.
2008-02-28 15:35:25 +03:00
unknown
5c78f82915 WL#4091, replace sleeps
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
  updated result
mysql-test/suite/rpl/r/rpl_row_view01.result:
  updated result
mysql-test/suite/rpl/t/rpl_change_master.test:
  replace sleep
mysql-test/suite/rpl/t/rpl_drop_temp.test:
  replace sleep
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
  replace sleep
mysql-test/suite/rpl/t/rpl_relayspace.test:
  replace waiting of state to wait_for_slave_param.inc
mysql-test/suite/rpl/t/rpl_row_view01.test:
  replace sleep
mysql-test/suite/rpl/t/rpl_trunc_temp.test:
  replace sleep
mysql-test/include/wait_for_binlog_event.inc:
  New primitive: waiting an event in binlog on master
2008-02-28 14:36:14 +03:00
unknown
ba3112b539 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-27 18:11:15 -03:00
unknown
e9068d0b73 Fix for team tree failure. Synchronously wait for the query state
to reach the desired value.


mysql-test/r/flush_read_lock_kill.result:
  Update test case result.
mysql-test/t/flush_read_lock_kill.test:
  Wait for the debug synchronization point to be reached.
2008-02-27 18:08:29 -03:00
unknown
b3cc07838d Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-build


tests/mysql_client_test.c:
  Manually merged.
2008-02-27 22:58:42 +03:00
unknown
da413e4217 Fix information_schema.test to be case-insensitive. 2008-02-27 22:53:54 +03:00
unknown
b43f8f695c Eliminate compilation warning. 2008-02-27 22:29:58 +03:00
unknown
e78d896c3f Bug#34889 mysql_client_test::test_mysql_insert_id test fails sporadically
Disable the test case.


tests/mysql_client_test.c:
  Disable test case.
2008-02-27 13:05:46 -03:00
unknown
6dd9666d0f Update Bug#12713 test results to take into account fixed bugs (29157, 33846) 2008-02-27 18:38:17 +03:00
unknown
1de652acb2 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
2008-02-27 15:38:16 +01:00
unknown
51a99d70e9 Fix pushbuild errors.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  The test unnecessarily refused to run in non-debug mode. It can safely
  run in non-debug mode and produces the same result, so I removed the
  restriction.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Updated result file. It is a little unclear what the best thing to put in
  the binlog is, but the present results for this particular test are enough
  to replicate. Mats will figure out more as he fixes BUG#29020. After
  BUG#34768 has been fixed, these statements should be marked unsafe and
  not allowed in statement mode.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Updated result file. It is a little unclear what the best thing to put in
  the binlog is, but the present results for this particular test are enough
  to replicate. Mats will figure out more as he fixes BUG#29020. After
  BUG#34768 has been fixed, these statements should be marked unsafe and
  not allowed in statement mode.
2008-02-27 15:18:27 +01:00
unknown
c7db565fc8 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


sql/handler.cc:
  Auto merged
2008-02-27 11:00:43 +01:00
unknown
b66e0f7524 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
2008-02-27 10:57:48 +01:00
unknown
fe7035a73a Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt


mysql-test/r/view.result:
  Auto merged
2008-02-26 19:37:34 +03:00
unknown
336f2c7e51 Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqltest.c:
  Auto merged
mysql-test/r/view.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
  Manually merged.
mysql-test/t/disabled.def:
  Manually merged.
2008-02-26 19:34:02 +03:00
unknown
a86e504f59 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0
into  quad.:/mnt/raid/alik/MySQL/devel/5.0-rt-merged


mysql-test/r/view.result:
  Auto merged
2008-02-26 19:23:37 +03:00
unknown
fb3f8bdbb6 Merge mysql.com:/Users/davi/mysql/bugs/34424-5.1
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-26 12:12:57 -03:00
unknown
2aa0927d9c Fix the remaining memory leaks (mysql_client_test).
tests/mysql_client_test.c:
  Fix the remaining memory leaks.
2008-02-26 18:07:11 +03:00
unknown
bf9bb656a6 Bug#34424 query_cache_debug.test leads to valgrind warnings
Bug#34678 @@debug variable's incremental mode

The problem is that the per-thread debugging settings stack wasn't
being deallocated before the thread termination, leaking the stack
memory. The chosen solution is to push a new state if the current
is set to the initial settings and pop it (free) once the thread
finishes.


dbug/dbug.c:
  Move dbug parser out of _db_set_ to a separate function and
  make _db_set_ push a new stack if the corrent one is set to
  the initial settings.
dbug/user.r:
  Update DBUG_SET description.
mysql-test/t/disabled.def:
  Re-enable test case which triggered the leak.
mysys/my_thr_init.c:
  Pop a pushed state, nop if stack is empty.
sql/set_var.cc:
  Handle incremental debug settings.
mysql-test/r/variables_debug.result:
  Add new test case result for Bug#34678
mysql-test/t/variables_debug.test:
  Add new test case for Bug#34678
2008-02-26 12:03:59 -03:00
unknown
6b9db6d213 Valgrind errors in mysql_client_test.
tests/mysql_client_test.c:
  Fix a memory leak.
  Run the test for Bug#28386 only if logging to tables is enabled.
2008-02-26 17:25:21 +03:00
unknown
0a1c0059df Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime
2008-02-26 16:22:42 +03:00
unknown
226e682139 We never check the return value of mysql_frm_type for an error. Do
not try to push an error into the error stack as it will be ignored anyway.
2008-02-26 16:19:23 +03:00
unknown
fd31753387 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


tests/mysql_client_test.c:
  Auto merged
2008-02-26 10:12:26 -03:00
unknown
1f3c170662 Merge dipika.(none):/opt/local/work/mysql-5.0-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime


tests/mysql_client_test.c:
  Manual merge.
2008-02-26 15:32:32 +03:00
unknown
24039016f0 Fix memory leaks (valgrind) 2008-02-26 15:27:46 +03:00
unknown
2967e4e104 Use an API instead of looking into stmt internals to fetch fields
(Test for Bug#32265)


tests/mysql_client_test.c:
  Use an API instead of looking into stmt internals to fetch fields.
2008-02-26 13:55:46 +03:00
unknown
b2e879cbe8 Bug#28386 the general log is incomplete
The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET,
COM_STMT_SEND_LONG_DATA weren't being logged to the general log.

The solution is to log the general log the aforementioned commands.


mysql-test/t/mysql_client_test-master.opt:
  Also log to table.
sql/sql_prepare.cc:
  Log COM_STMT_CLOSE, COM_STMT_RESET and COM_STMT_SEND_LONG_DATA.
tests/mysql_client_test.c:
  Add test case for Bug#28386
2008-02-25 07:48:02 -03:00