Commit graph

997 commits

Author SHA1 Message Date
Georgi Kodinov
7b4ef910f7 Bug #40877: multi statement execution fails in 5.1.30
Implemented the server infrastructure for the fix:

1. Added a function LEX_STRING *thd_query_string(THD) to return
a LEX_STRING structure instead of char *.
This is the function that must be called in innodb instead of 
thd_query()

2. Did some encapsulation in THD : aggregated thd_query and 
thd_query_length into a LEX_STRING and made accessor and mutator 
methods for easy code updating. 

3. Updated the server code to use the new methods where applicable.
2009-10-16 13:29:42 +03:00
unknown
f9c6730258 Bug#46640: output from mysqlbinlog command in 5.1 breaks replication
The BINLOG statement was sharing too much code with the slave SQL thread, introduced with
the patch for Bug#32407. This caused statements to be logged with the wrong server_id, the
id stored inside the events of the BINLOG statement rather than the id of the running 
server.
      
Fix by rearranging code a bit so that only relevant parts of the code are executed by
the BINLOG statement, and the server_id of the server executing the statements will 
not be overrided by the server_id stored in the 'format description BINLOG statement'.

mysql-test/extra/binlog_tests/binlog.test:
  Added test to verify if the server_id stored in the 'format 
  description BINLOG statement' will override the server_id
  of the server executing the statements.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Test result for bug#46640
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  Test result for bug#46640
sql/log_event.cc:
  Moved rows_event_stmt_clean() call from update_pos() to apply_event(). This in any case
  makes more sense, and is needed as update_pos() is no longer called when executing
  BINLOG statements.
  
  Moved setting of rli->relay_log.description_event_for_exec from 
  Format_description_log_event::do_update_pos() to 
  Format_description_log_event::do_apply_event()
sql/log_event_old.cc:
  Moved rows_event_stmt_clean() call from update_pos() to apply_event(). This in any case
  makes more sense, and is needed as update_pos() is no longer called when executing
  BINLOG statements.
sql/slave.cc:
  The skip flag is no longer needed, as the code path for BINLOG statement has been 
  cleaned up.
sql/sql_binlog.cc:
  Don't invoke the update_pos() code path for the BINLOG statement, as it contains code 
  that is redundant and/or harmful (especially setting thd->server_id).
2009-10-14 09:39:05 +08:00
He Zhenxing
fa4006bc8a Bug#47323 : mysqlbinlog --verbose displays bad output when events contain subset of columns
Commit the non-NDB specific part (originated by frazer) to 5.1 mainline.
2009-10-09 16:54:48 +08:00
Tatiana A. Nurnberg
13e71d2f06 auto-merge 2009-09-29 06:08:18 -07:00
Tatiana A. Nurnberg
4102363f37 Bug#43746: YACC return wrong query string when parse 'load data infile' sql statement
"load data" statements were written to the binlog as a mix of the original statement
and bits recreated from parse-info. This relied on implementation details and broke
with IGNORE_SPACES and versioned comments.

We now completely resynthesize the query for LOAD DATA for binlog (which among other
things normalizes them somewhat with regard to case, spaces, etc.).
We have already parsed the query properly, so we make use of that rather
than mix-and-match string literals and parsed items.
This should make us safe with regard to versioned comments, even those
spanning multiple tokens. Also no longer affected by IGNORE_SPACES.

mysql-test/r/mysqlbinlog.result:
  LOAD DATA INFILE normalized
mysql-test/suite/binlog/r/binlog_killed_simulate.result:
  LOAD DATA INFILE normalized
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  LOAD DATA INFILE normalized
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  LOAD DATA INFILE normalized
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  LOAD DATA INFILE normalized
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
  LOAD DATA INFILE normalized
mysql-test/suite/rpl/r/rpl_loaddata.result:
  LOAD DATA INFILE normalized
mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
  LOAD DATA INFILE normalized; offsets adjusted to reflect that
mysql-test/suite/rpl/r/rpl_loaddata_map.result:
  LOAD DATA INFILE normalized
mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
  test for #43746 - trying to break LOAD DATA part of parser
mysql-test/suite/rpl/r/rpl_stm_log.result:
  LOAD DATA INFILE normalized
mysql-test/suite/rpl/t/rpl_loaddatalocal.test:
  try to break the LOAD DATA part of the parser (test for #43746)
mysql-test/t/mysqlbinlog.test:
  LOAD DATA INFILE normalized; adjust offsets to reflect that
sql/log_event.cc:
  clean up Load_log_event::print_query and friends so they don't print
  excess spaces. add support for printing charset names to print_query.
sql/log_event.h:
  We already have three places where we synthesize LOAD DATA queries.
  Better use one of those!
sql/sql_lex.h:
  When binlogging LOAD DATA statements, we make up the statement to
  be logged (from the parse-info, rather than substrings of the
  original query) now. Consequently, we no longer need (string-)
  pointers into the original query.
sql/sql_load.cc:
  Completely rewrote write_execute_load_query_log_event() to synthesize the
  LOAD DATA statement wholesale, rather than piece it together from
  synthesized bits and literal excerpts from the original query. This
  will not only give us a nice, normalized statement (all uppercase,
  no excess spaces, etc.), it will also handle comments, including
  versioned comments right, which is certainly more than we can say
  about the previous incarnation.
sql/sql_yacc.yy:
  We're no longer assembling LOAD DATA statements from bodyparts of the
  original query, so some bookkeeping in the parser can go.
2009-09-28 05:41:10 -07:00
Luis Soares
3d211f3981 BUG#47312: RBR: Disabling key on slave breaks replication:
HA_ERR_WRONG_INDEX
      
In RBR, disabling keys on slave table will break replication when
updating or deleting a record. When the slave thread tries to
find the row, by searching in the storage engine, it checks
whether the table has a key or not. If it has one, then the slave
thread uses it to search the record.
      
Nonetheless, the slave only checks whether the key exists or not,
it does not verify if it is active. Should the key be
disabled (eg, DBA has issued an ALTER TABLE ... DISABLE KEYS)
then it will result in error: HA_ERR_WRONG_INDEX.
      
This patch addresses this issue by making the slave thread also
check whether the key is active or not before actually using it.
2009-09-27 22:02:47 +01:00
Mats Kindahl
8249fd6eef BUG#29288: myisam transactions replicated to a transactional
slave leaves slave unstable

Problem: when replicating from non-transactional to
transactional engine with autocommit off, no BEGIN/COMMIT
is written to the binlog. When the slave replicates, it
will start a transaction that never ends.

Fix: Force autocommit=on on slave by always replicating
autocommit=1 from the master.
2009-09-23 11:43:43 +02:00
unknown
e436b8866b BUG#45999 Row based replication fails when auto_increment field = 0
In RBR, There is an inconsistency between slaves and master.
When INSERT statement which includes an auto_increment field is executed,
Store engine of master will check the value of the auto_increment field. 
It will generate a sequence number and then replace the value, if its value is NULL or empty.
if the field's value is 0, the store engine will do like encountering the NULL values 
unless NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.
In contrast, if the field's value is 0, Store engine of slave always generates a new sequence number 
whether or not NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.

SQL MODE of slave sql thread is always consistency with master's.
Another variable is related to this bug.
If generateing a sequence number is decided by the values of
table->auto_increment_field_not_null and SQL_MODE(if includes MODE_NO_AUTO_VALUE_ON_ZERO)
The table->auto_increment_is_not_null is FALSE, which causes this bug to appear. ..
2009-09-10 18:05:53 +08:00
Alfranio Correia
354f5f7bac BUG#46864 Incorrect update of InnoDB table on slave when using trigger with myisam table
Slave does not correctly handle "expected errors" leading to inconsistencies
between the mater and slave. Specifically, when a statement changes both
transactional and non-transactional tables, the transactional changes are
automatically rolled back on the master but the slave ignores the error and
does not roll them back thus leading to inconsistencies.
      
To fix the problem, we automatically roll back a statement that fails on
the slave but note that the transaction is not rolled back unless a "rollback"
command is in the relay log file.

mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
  Enabled item 13.e which was disabled because of the bug fixed by the
  current and removed item 14 which was introduced by mistake.
2009-08-27 13:46:29 +01:00
Alfranio Correia
9a632549da auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-08-24 10:24:52 +01:00
Alfranio Correia
78585a25ff BUG#46130 Slave does not correctly handle "expected errors"
In STATEMENT based replication, a statement that failed on the master but that
updated non-transactional tables is written to binary log with the error code
appended to it. On the slave, the statement is executed and the same error is
expected. However, when an "expected error" did not happen on the slave and was
either ignored or was related to a concurrency issue on the master, the slave
did not rollback the effects of the statement and as such inconsistencies might
happen.

To fix the problem, we automatically rollback a statement that should have
failed on a slave but succeded and whose expected failure is either ignored or
stems from a concurrency issue on the master.
2009-08-13 17:21:01 +01:00
unknown
0d821fafe9 BUG#45516 SQL thread does not use database charset properly
Replication SQL thread does not set database default charset to 
thd->variables.collation_database properly, when executing LOAD DATA binlog.
This bug can be repeated by using "LOAD DATA" command in STATEMENT mode.
        
This patch adds code to find the default character set of the current database 
then assign it to thd->db_charset when slave server begins to execute a relay log.
The test of this bug is added into rpl_loaddata_charset.test
2009-08-12 11:54:05 +08:00
Gleb Shchepa
2bc6b6a800 Merge from 5.0
******
manual merge 5.0-bugteam --> 5.1-bugteam (bug 38816)
2009-07-24 21:04:55 +05:00
Gleb Shchepa
dc0a87fdc2 Bug #38816: kill + flush tables with read lock + stored
procedures causes crashes!

The problem of that bugreport was mostly fixed by the
patch for bug 38691.
However, attached test case focused on another crash or
valgrind warning problem: SHOW PROCESSLIST query accesses
freed memory of SP instruction that run in a parallel
connection.

Changes of thd->query/thd->query_length in dangerous
places have been guarded with the per-thread
LOCK_thd_data mutex (the THD::LOCK_delete mutex has been
renamed to THD::LOCK_thd_data).


sql/ha_myisam.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
  Unnecessary locking with the global LOCK_thread_count
  mutex has been removed.
sql/log_event.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the THD::set_query()) method call/LOCK_thd_data
  mutex.
sql/slave.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the THD::set_query() method call/LOCK_thd_data mutex.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sp_head.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
sql/sql_class.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The new THD::LOCK_thd_data mutex and THD::set_query()
  method has been added to guard modifications of THD::query/
  THD::query_length fields, also the Statement::set_statement()
  method has been overloaded in the THD class.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_class.h:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The new THD::LOCK_thd_data mutex and THD::set_query()
  method has been added to guard modifications of THD::query/
  THD::query_length fields, also the Statement::set_statement()
  method has been overloaded in the THD class.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_insert.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
sql/sql_parse.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data mutex.
sql/sql_repl.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_show.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Inter-thread read of THD::query/query_length field has
  been protected with a new per-thread LOCK_thd_data
  mutex in the mysqld_list_processes function.
2009-07-24 20:58:58 +05:00
unknown
7b8d509b2d Manual Merge 2009-08-12 13:31:56 +08:00
Alfranio Correia
8ba57fa3c9 BUG#44581 Slave stops when transaction with non-transactional table gets lock wait
timeout
            
In STMT and MIXED modes, a statement that changes both non-transactional and
transactional tables must be written to the binary log whenever there are
changes to non-transactional tables. This means that the statement gets into the
binary log even when the changes to the transactional tables fail. In particular
, in the presence of a failure such statement is annotated with the error number
and wrapped in a begin/rollback. On the slave, while applying the statement, it
is expected the same failure and the rollback prevents the transactional changes
to be persisted.
            
Unfortunately, statements that fail due to concurrency issues (e.g. deadlocks,
timeouts) are logged in the same way causing the slave to stop as the statements
are applied sequentially by the SQL Thread. To fix this bug, we automatically
ignore concurrency failures on the slave. Specifically, the following failures
are ignored: ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK and ER_XA_RBDEADLOCK.
2009-07-06 09:02:14 +01:00
Staale Smedseng
300a8721fa Merge from 5.0 2009-06-29 16:00:47 +02:00
Staale Smedseng
6777150883 Merge from 5.0-bt 2009-06-29 15:17:01 +02:00
Alfranio Correia
b71fe23b60 merge mysql-5.0-bugteam --> mysql-5.1-bugteam 2009-06-18 18:58:56 +01:00
Alfranio Correia
dd59815f59 BUG#34687 Error in bin-log after shutdown restart binlog was not closed properly
While reading a binary log that is being used by a master or was not properly
closed, most likely due to a crash, the following warning message is being
printed out: "Warning: this binlog was not closed properly. Most probably mysqld
crashed writing it.". This was scaring our users as the message was not taking
into account the possibility of the file is being just used by the master.

To avoid unnecessarily scaring our users, we replace the original message by the
following one: Warning: "this binlog is either is use or was not closed properly.".
2009-06-11 02:08:40 +01:00
Staale Smedseng
62bb2beb92 Merge from 5.0-bugteam for 43414 2009-06-09 18:44:26 +02:00
Staale Smedseng
a073ee45c2 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
      
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Staale Smedseng
a092ed1afe Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.

This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 14:55:30 +02:00
He Zhenxing
e14191885f Merge BUG#41948 2009-05-31 17:15:35 +08:00
He Zhenxing
e1fb88f2cc Merge BUG#43263 from 5.0-bugteam to 5.1-bugteam 2009-05-31 13:44:41 +08:00
He Zhenxing
5dd1abae7d BUG#43263 BEGIN skipped in some replicate-do-db cases
BEGIN/COMMIT/ROLLBACK was subject to replication db rules, and
caused the boundary of a transaction not recognized correctly 
when these queries were ignored by the rules.

Fixed the problem by skipping replication db rules for these
statements.


sql/log_event.cc:
  Skip checking replication db rules for BEGIN/COMMIT/ROLLBACK statements
2009-05-31 11:26:58 +08:00
He Zhenxing
abf5f8dac2 BUG#41948 Query_log_event constructor needlessly contorted
Make the caller of Query_log_event, Execute_load_log_event
constructors and THD::binlog_query to provide the error code
instead of having the constructors to figure out the error code.

sql/log_event.cc:
  Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument instead of figuring it out by itself
sql/log_event.h:
  Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument
2009-05-30 21:32:28 +08:00
Georgi Kodinov
feef9ed1de merged 5.1-main -> 5.1-bugteam 2009-05-15 16:03:22 +03:00
Luis Soares
e8e8f2faf4 merge: 5.1-bt local bug fix branch --> 5.1-bt up-to-date. 2009-05-14 12:51:03 +01:00
Luis Soares
60a2bbb8dd BUG#42749: infinite loop writing to row based binlog - processlist shows
"freeing items"

The calculation of the table map log event in the event constructor
was one byte shorter than what would be actually written. This would
lead to a mismatch between the number of bytes written and the event
end_log_pos, causing bad event alignment in the binlog (corrupted
binlog) or in the transaction cache while fixing positions
(MYSQL_BIN_LOG::write_cache). This could lead to impossible to read
binlog or even infinite loops in MYSQL_BIN_LOG::write_cache.

This patch addresses this issue by correcting the expected event
length in the Table_map_log_event constructor, when the field metadata
size exceeds 255.

sql/log_event.cc:
  Added the extra byte as net_store_length imposes.
2009-05-12 12:53:46 +01:00
Mats Kindahl
8f95c5e183 Bug #44442: Incident events are silent in mysqlbinlog output
In the output from mysqlbinlog, incident log events were
represented as just a comment. Since the incident log event
represents an incident that could cause the contents of the
database to change without being logged to the binary log,
it means that if the SQL is applied to a server, it could
potentially lead to that the databases are out of sync.

In order to handle that, this patch adds the statement "RELOAD
DATABASE" to the SQL output for the incident log event. This will
require a DBA to edit the file and handle the case as apropriate
before applying the output to a server.

mysql-test/suite/binlog/t/binlog_incident-master.opt:
  Options file to cause server to generate an incident log
  event when executing a REPLACE.
mysql-test/suite/binlog/t/binlog_incident.test:
  Test to check that the incident log event is represented
  correctly in the output from mysqlbinlog.
sql/log_event.cc:
  The incident log event now ouput a "RELOAD DATABASE" instead
  of just a comment. RELOAD DATABASE is not an existing command
  and will generate a syntax error.
2009-05-11 13:32:38 +02:00
Joerg Bruehe
d2fe2a71da Merge main 5.1 into 5.1-build
165 changesets with 23 conflicts:
Text conflict in mysql-test/r/lock_multi.result
Text conflict in mysql-test/t/lock_multi.test
Text conflict in mysql-test/t/mysqldump.test
Text conflict in sql/item_strfunc.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/parse_file.cc
Text conflict in sql/slave.cc
Text conflict in sql/sp.cc
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_acl.cc
Text conflict in sql/sql_base.cc
Text conflict in sql/sql_class.cc
Text conflict in sql/sql_crypt.cc
Text conflict in sql/sql_db.cc
Text conflict in sql/sql_lex.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_view.cc
Text conflict in storage/innobase/handler/ha_innodb.cc
Text conflict in storage/myisam/mi_packrec.c
Text conflict in tests/mysql_client_test.c

Updates to Innobase, taken from main 5.1:
bzr: ERROR: Some change isn't sane:
File mysql-test/r/innodb-semi-consistent.result is owned by Innobase and should not be updated.
File mysql-test/t/innodb-semi-consistent.test is owned by Innobase and should not be updated.
File storage/innobase/handler/ha_innodb.cc is owned by Innobase and should not be updated.
File storage/innobase/ibuf/ibuf0ibuf.c is owned by Innobase and should not be updated.
File storage/innobase/include/row0mysql.h is owned by Innobase and should not be updated.
File storage/innobase/include/srv0srv.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.ic is owned by Innobase and should not be updated.
File storage/innobase/lock/lock0lock.c is owned by Innobase and should not be updated.
File storage/innobase/page/page0cur.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0mysql.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0sel.c is owned by Innobase and should not be updated.
File storage/innobase/srv/srv0srv.c is owned by Innobase and should not be updated.
File storage/innobase/trx/trx0trx.c is owned by Innobase and should not be updated.
(Set env var 'ALLOW_UPDATE_INNOBASE_OWNED' to override.)
2009-05-08 21:04:07 +02:00
Chad MILLER
767501a9b1 Merge community up to enterprise, thus ending the community-server
adventure.
2009-05-06 09:06:32 -04:00
Alfranio Correia
e0526914b6 BUG#44378 rpl_binlog_corruption fails with warning messages in Valgrind
The rpl_binlog_corruption test case was inject failures, specifically,
incidents with invalid numbers to see if the replication was failing
gracefully. However, this test was causing the following warning message
in Valgrind: "Conditional jump or move depends on uninitialised value(s)"
      
The patch fixes the problem by correctly initializing the m_inicident 
number.
2009-04-21 15:31:21 +01:00
Andrei Elkin
19fd076fb1 merge bug#38205 fixes to 5.1-bt 2009-04-21 11:30:40 +03:00
Chad MILLER
14f923c028 Merge 5.0.80 release and 5.0 community. Version left at 5.0.80. 2009-04-14 13:20:13 -04:00
He Zhenxing
a15e25f852 Auto merge 2009-04-09 14:31:09 +08:00
He Zhenxing
caaa8531bd Post fix of BUG#37145
Binlog the CREATE EVENT unless the created event been successfully dropped

Modified Query_log_event constructor to make sure that error_code
is not set to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED errors
when NOT_KILLED

sql/events.cc:
  binlog the create event unless it's been successfully dropped
sql/log_event.cc:
  Modified Query_log_event constructor to make sure that error_code
  is not set to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED errors
  when NOT_KILLED
2009-04-09 14:22:06 +08:00
Alfranio Correia
43e85ecedf merge 5.1-bugteam --> 5.1-bugteam (local) 2009-04-08 11:07:24 +01:00
Alfranio Correia
f9338b318e BUG#39393 slave-skip-errors does not work when using ROW based replication
RBR was not considering the option --slave-skip-errors.
                              
To fix the problem, we are reporting the ignored ERROR(s) as warnings thus avoiding 
stopping the SQL Thread. Besides, it fixes the output of "SHOW VARIABLES LIKE 
'slave_skip_errors'" which was showing nothing when the value "all" was assigned 
to --slave-skip-errors.
                  
@sql/log_event.cc
  skipped rbr errors when the option skip-slave-errors is set.
@sql/slave.cc
  fixed the output of for SHOW VARIABLES LIKE 'slave_skip_errors'"
@test-cases
  fixed the output of rpl.rpl_idempotency
  updated the test case rpl_skip_error
2009-04-05 13:03:04 +01:00
He Zhenxing
51a9116638 BUG#37145 Killing a statement doing DDL may log binlog event with error code 1053
When the thread executing a DDL was killed after finished its
execution but before writing the binlog event, the error code in
the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED.

This patch fixed the problem by ignoring the kill status when
constructing the event for DDL statements.

This patch also included the following changes in order to
provide the test case.

 1) modified mysqltest to support variable for connection command

 2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
    run mysql client against the slave mysqld.
2009-03-27 13:19:50 +08:00
Andrei Elkin
27cf68795e bug#42977
compilation warning fixed
2009-03-26 11:25:43 +02:00
Andrei Elkin
21cc7d5a25 Bug#38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUP
Bug#319  if while a non-transactional slave is replicating a transaction possible problem 

It is impossible to roll back a mixed engines transaction when one of the engine is
non-transaction. In replication that fact is crucial because the slave can not safely
re-apply a transction that was interrupted with STOP SLAVE.

Fixed with making STOP SLAVE not be effective immediately in the case the current
group of replication events has modified a non-transaction table. In order for slave to leave
either the group needs finishing or the user issues KILL QUERY|CONNECTION slave_thread_id.


mysql-test/suite/bugs/r/rpl_bug38205.result:
  bug#38205 non-deterministic part of tests results.
mysql-test/suite/bugs/t/rpl_bug38205.test:
  bug#38205 non-deterministic part of tests.
mysql-test/suite/rpl/r/rpl_start_stop_slave.result:
  bug#38205 deterministic part of tests results.
mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt:
  increasing `innodb_lock_wait_timeout' to make the test pass on slow env w/o
  timeout expired issue.
mysql-test/suite/rpl/t/rpl_start_stop_slave.test:
  bug#38205 deterministic part of tests.
sql/log_event.cc:
  Augmenting row-based events applying with the notion of 
  thd->transaction.{all,stmt}.modified_non_trans_table.
  The pair is set and reset according to its specification
  for the mixed transaction processing.
  Particualry, once `modified_non_trans_table' is set in the row-events
  processing loop, it will remain till the commit of the transaction.
sql/slave.cc:
  Consulting `thd->transaction.all.modified_non_trans_table' to decide
  whether to terminate by the sql thread or to continue even though
  the sql thread might have been STOP-ed (rli->abort_slave).
2009-03-26 10:25:06 +02:00
Andrei Elkin
67f9a6d178 Bug#42977 RBR logs for rows with more than 250 column results in corrupt binlog
The issue happened to be two-fold.
The table map event was recorded into binlog having
an incorrect size when number of columns exceeded 251. 
The Row-based event had incorrect recording and restoring m_width member within
the same as above conditions.

Fixed with correcting m_data_size and m_width.


mysql-test/suite/rpl/r/rpl_row_wide_table.result:
  the new test results.
mysql-test/suite/rpl/t/rpl_row_wide_table.test:
  regression test for bug#42977.
sql/log_event.cc:
  0. all buffers that used in net_store_length() are augmented with 1 for safety
  to be able to contain the magic and the content of ulonglong as well;
  1. Rows_log_event::get_data_size() yieled incorrect size |m_width/8| whereas 
     it should be m_width;
  2. Table_map_log_event::Table_map_log_event yieled incorrect value for
     `m_data_size' probably presuming 1-byte integer max for the column number;
sql/rpl_utility.h:
  DBUG_PRINT_BITSET() macro is left 256-cols limited but has made safe and commented.
2009-03-25 12:53:56 +02:00
Alfranio Correia
ef0d5cc5f2 auto-merge 5.1-bugteam (local) --> 5.1-bugteam 2009-03-22 19:46:57 +00:00
Georgi Kodinov
e8cc09dc8d fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
Ignacio Galarza
868db2f21d auto-merge 2009-03-19 09:59:10 -04:00
Ignacio Galarza
675c3ce2bb auto-merge 2009-03-19 09:44:58 -04:00
Alfranio Correia
b97083dfc7 Bug #42861 Assigning invalid directories to --slave-load-tmpdir crashes the slave
Compiling with debug and assigning an invalid directory to --slave-load-tmpdir
was crashing the slave due to the following assertion DBUG_ASSERT(! is_set() ||
can_overwrite_status). This assertion assumes that a thread can change its
state once (i.e. ok,error, etc) before aborting, cleaning/resuming or completing
its execution unless the overwrite flag (i.e. can_overwrite_status) is true.

The Append_block_log_event::do_apply_event which is responsible for creating
temporary file(s) was not cleaning the thread state. Thus a failure while
trying to create a file in an invalid temporary directory was causing the crash.

To fix the problem we check if the temporary directory is valid before starting
the SQL Thread and reset the thread state before creating a file in
Append_block_log_event::do_apply_event.
2009-03-18 10:31:17 +00:00
Ignacio Galarza
0d588edf61 auto-merge 2009-03-17 16:29:24 -04:00
Leonard Zhou
53849a24f9 Merge 2009-03-16 17:06:22 +08:00
Leonard Zhou
b42c29cfe3 BUG#22504 load data infile sql statement in replication architecture get error
The problem is issued because we set wrong start position and stop position of query string into binlog.
That two values are stored as part of head info of query string.
When we parse binlog, we first get position values then get the query string according position values.
But seems that two values are not calculated correctly after the parse of Yacc.

We don't want to touch so much of yacc because it may influence other codes.
So just add one space after 'INTO' key word when parsing.
This can easily resolve the problem.

mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
  Test result
mysql-test/suite/rpl/t/rpl_loaddatalocal.test:
  Test case
sql/log_event.cc:
  Add space after 'INTO'.
2009-03-16 16:21:29 +08:00
He Zhenxing
b4fdb8aec1 BUG#37051 Replication rules not evaluated correctly
Backporting patch to 5.0.
2009-03-05 18:10:44 +08:00
Andrei Elkin
5b0721786e merging bug#37313fixes from 5.0-bt to 5.1-bt 2009-02-24 16:59:46 +02:00
Andrei Elkin
d091deaf89 fixing compilation warning and adding flush logs to test of bug#37313 2009-02-24 16:17:34 +02:00
Alexey Kopytov
144763db0c Manual merge mysql-5.0-bugteam -> mysql-5.1-bugteam. 2009-02-23 17:16:46 +02:00
Alfranio Correia
d822ab8957 BUG#38174 secure-file-priv breaks LOAD DATA INFILE replication in statement mode
If secure-file-priv was set on slave, it became unable to execute
LOAD DATA INFILE statements sent from master using mixed or
statement-based replication.
                  
This patch fixes the issue by ignoring this security restriction
and checking if the files are created and read by the slave in the
--slave-load-tmpdir while executing the SQL Thread.
2009-02-21 09:36:07 +00:00
Andrei Elkin
4712e6b9b8 Bug #37313 BINLOG Contains Incorrect server id
Signed integer format specifier forced to print the binlog header with server_id
negative if the unsigned value sets the sign-bit ON.
  
Fixed with correcting the specifier to correspond to typeof(server_id) == ulong.

mysql-test/r/mysqlbinlog.result:
  results changed.
mysql-test/t/mysqlbinlog.test:
  displaying the expected unsignedly formatted server_id value, bug#37313.
sql/log_event.cc:
  Format specifier is corrected to correspond to typeof(server_id).
2009-02-20 13:55:43 +02:00
Ignacio Galarza
5b7347bda3 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Ignacio Galarza
54fbbf9591 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
Andrei Elkin
5aef51b5d3 Bug #41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
fixing build issue, caused by the previous push.

sql/log_event.cc:
  moving a new declaration out of mysqlbinlog compilation scope.
2009-02-04 13:08:27 +02:00
Andrei Elkin
9b11bc02ae Bug #41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
The bug happened because filtering-out a STMT_END_F-flagged event so that
the transaction COMMIT finds traces of incomplete statement commit.
Such situation is only possible with ndb circular replication. The filtered-out
rows event is one that immediately preceeds the COMMIT query event.
      
Fixed with deploying an the rows-log-event statement commit at executing
of the transaction COMMIT event. 
Resources that were allocated by other than STMT_END_F-flagged event of
the last statement are clean up prior execution of the commit logics.


mysql-test/suite/rpl_ndb/t/disabled.def:
  re-enabling two tests.
sql/log_event.cc:
  Adding the statement cleanup to execute at the transaction commit time.
  The statement might not be ended with execution of STMT_END_F-flagged event because of
  the event was filtered out by SERVER_ID rules.
  Small refactoring for Rows_log_event::do_update_pos() to be split on two parts:
  the statement commit that releases its execution time allocated resources, and
  the relay log update.
2009-02-04 12:13:54 +02:00
Georgi Kodinov
87eb2cb938 merged 5.1-main -> 5.1-bugteam 2009-01-30 15:44:49 +02:00
Luis Soares
df8543868d merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in client/mysqltest.cc
  Text conflict in mysql-test/include/wait_until_connected_again.inc
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
  Text conflict in mysql-test/r/events_bugs.result
  Text conflict in mysql-test/r/log_state.result
  Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
  Text conflict in mysql-test/r/mysqlcheck.result
  Text conflict in mysql-test/r/query_cache.result
  Text conflict in mysql-test/r/status.result
  Text conflict in mysql-test/suite/binlog/r/binlog_index.result
  Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
  Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
  Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
  Text conflict in mysql-test/t/disabled.def
  Text conflict in mysql-test/t/events_bugs.test
  Text conflict in mysql-test/t/log_state.test
  Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
  Text conflict in mysql-test/t/mysqlcheck.test
  Text conflict in mysql-test/t/query_cache.test
  Text conflict in mysql-test/t/rpl_init_slave_func.test
  Text conflict in mysql-test/t/status.test
2009-01-23 13:22:05 +01:00
Andrei Elkin
8c3389f386 Bug #31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
It's a regression issue.
The reason of the bug appeared to be an error introduced into 5.1 source code.
A piece of code in Create_file_log_event::do_apply_event() did not have test
coverage which made make test and pb unaware.
      
Fixed with inverting the old value of the return value from 
Create_file_log_event::do_apply_event().
The rpl test suite is extended with `rpl_cross_version' the file to hold 
regression cases similar to the current.


mysql-test/suite/rpl/r/rpl_cross_version.result:
  new results file
mysql-test/suite/rpl/t/rpl_cross_version-master.opt:
  options to the server to be able to start replication to itself
mysql-test/suite/rpl/t/rpl_cross_version.test:
  regression test for bug#31240.
sql/log_event.cc:
  Correcting the return value from  Create_file_log_event::do_apply_event()
2009-01-22 16:55:14 +02:00
He Zhenxing
45140a8ea3 Auto merge 2009-01-14 17:32:25 +08:00
He Zhenxing
f2c122bf90 BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
The next number (AUTO_INCREMENT) field of the table for write
rows events are not initialized, and cause some engines (innodb)
not correctly update the tables's auto_increment value.

This patch fixed this problem by honor next number fields if present.

mysql-test/extra/rpl_tests/rpl_auto_increment.test:
  Add test code for BUG#41986
mysql-test/suite/rpl/r/rpl_auto_increment.result:
  update test result file for BUG#41986
sql/log_event.cc:
  set next_number_field before writing rows, and reset next_number_field after finished writing rows
2009-01-14 16:27:32 +08:00
Sven Sandberg
b0fadb57ec merge fix of BUG#41961 in 5.1-bugteam with recent changes in 5.1-bugteam 2009-01-09 11:35:26 +01:00
Sven Sandberg
5c92f27f63 BUG#41961: Some log_event types do not skip post-header when reading
Problem: when the server reads a log_event from file, it should read
the post-header lengths from the format_description_log_event. Some
event types which currently have post-header length 0 did not do this,
and instead had a hard-coded zero length for the post-header. That
means the current server version will not be able to read future
versions of these events.
Fix: make the reader functions read the post-header.


sql/log_event.cc:
   - Made Format_description_log_event constructor initialize all
     post-header lengths explicitly, to make it easier to find them
     in the source code.
   - After this, it is no longer necessary to pass the MY_ZEROFILL
     flag to my_malloc. I removed the flag and added a sanity-check
     that will be executed only in debug-mode.
   - Made INTVAR, RAND, USER_VAR, and XID events skip post_header_len
     when reading from file.
sql/log_event.h:
  Added explicit defines for the lengths of all event types.
2009-01-09 10:48:01 +01:00
Luis Soares
b2cdc3b6cb merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
2009-01-08 19:03:56 +00:00
Georgi Kodinov
f97ef7a40e merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
Sven Sandberg
ba835f89ba BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
Problem: When an Incident_log_event contains a bad incident number on disk,
the server crashes with an assertion.
Fix: Don't validate input with assertions. Use errors.

mysql-test/include/cleanup_fake_relay_log.inc:
  Added auxiliary file to restore things that setup_fake_relay_log.inc did.
mysql-test/include/setup_fake_relay_log.inc:
  Added auxiliary file to setup replication from an existing relay log.
mysql-test/std_data/bug40482-bin.000001:
  Binlog file for rpl.rpl_binlog_corruption
mysql-test/suite/rpl/t/rpl_binlog_corruption.test:
  New test file.
sql/log_event.cc:
  Check that the incident number is correct at the time the event is constructed.
  Do not assert it at the time it is printed.
sql/log_event.h:
  Incident_log_event::is_valid() should verify that the incident number is valid.
sql/rpl_constants.h:
  Incident numbers should be hard-coded, since they may appear in files.
2008-12-29 17:04:10 +01:00
Davi Arnaut
3ce026ec2f Fix warnings and bug spotted by gcc-4.3.
Related to operator precedence and associativity.
Make the expressions as explicit as possible.

sql/field.h:
  Silence gcc-4.3 warning: be more explicit.
sql/item.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/item_sum.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/log_event.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/spatial.h:
  Silence gcc-4.3 warning: be more explicit.
sql/sql_lex.cc:
  Silence gcc-4.3 warning: be more explicit.
sql/table.h:
  Silence gcc-4.3 warning: be more explicit.
storage/federated/ha_federated.cc:
  Fix operator precedence bug.
storage/heap/ha_heap.cc:
  Silence gcc-4.3 warning: be more explicit.
2008-12-16 10:12:22 -02:00
Andrei Elkin
ca2d184695 merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
2008-11-12 19:51:47 +02:00
Build Team
e85fe79430 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Mats Kindahl
32c161f3ea Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Mats Kindahl
2019f17276 Bug #40004 Replication failure with no PK + no indexes
In certain situations, a scan of the table will return the error
code HA_ERR_RECORD_DELETED, and this error code is not 
correctly caught in the Rows_log_event::find_row() function, which
causes an error to be returned for this case.

This patch fixes the problem by adding code to either ignore the
record and continuing with the next one, the the event of a table
scan, or change the error code to HA_ERR_KEY_NOT_FOUND, in the event
that a key lookup is attempted.
2008-10-20 20:50:08 +02:00
Ramil Kalimullin
b4c5cafeb0 Fix for bug#38269: pushbuild gives valgrind error in
ha_statistic_increment for rpl_temporary

Problem: in some cases master send a special event to reconnecting
slave to keep slave's temporary tables (see #17284) and they still 
have references to the "old" SQL slave thread and use them to access
thread's data.

Fix: set temporary tables thread references to the actual SQL slave
thread in such cases.


mysql-test/suite/rpl/t/disabled.def:
  Fix for bug#38269: pushbuild gives valgrind error in 
  ha_statistic_increment for rpl_temporary
    - rpl_temporary test enabled.
sql/log_event.cc:
  Fix for bug#38269: pushbuild gives valgrind error in 
  ha_statistic_increment for rpl_temporary
    - if we keep slave's temporary tables after reconnect,
  set their thread pointers (->in_use) to the current SQL thread.
2008-10-07 18:21:17 +05:00
Mats Kindahl
bcaf5e0cf5 Merging 5.1 main into 5.1-rpl. 2008-10-06 10:27:36 +02:00
Mats Kindahl
f2a7af7b5f Merging with 5.1-5.1.29-rc. 2008-10-03 09:36:22 +02:00
Mats Kindahl
8d9cf89e96 Bug #38360: BLACKHOLE replication with RBR is broken
The Blackhole engine did not support row-based replication
since the delete_row(), update_row(), and the index and range
searching functions were not implemented.

This patch adds row-based replication support for the
Blackhole engine by implementing the two functions mentioned
above, and making the engine pretend that it has found the
correct row to delete or update when executed from the slave
SQL thread by implementing index and range searching functions.

It is necessary to only pretend this for the SQL thread, since
a SELECT executed on the Blackhole engine will otherwise never
return EOF, causing a livelock.


mysql-test/extra/binlog_tests/blackhole.test:
  Blackhole now handles row-based replication.
mysql-test/extra/rpl_tests/rpl_blackhole.test:
  Test helper file for testing that blackhole actually
  writes something to the binary log on the slave.
mysql-test/suite/binlog/t/binlog_multi_engine.test:
  Replication now handles row-based replcation.
mysql-test/suite/rpl/t/rpl_blackhole.test:
  Test that Blackhole works with primary key, index, or none.
sql/log_event.cc:
  Correcting code to only touch filler bits and leave
  all other bits alone. It is necessary since there is
  no guarantee that the engine will be able to fill in
  the bits correctly (e.g., the blackhole engine).
storage/blackhole/ha_blackhole.cc:
  Adding definitions for update_row() and delete_row() to return OK
  when executed from the slave SQL thread with thd->query == NULL
  (indicating that row-based replication events are being processed).
  
  Changing rnd_next(), index_read(), index_read_idx(), and
  index_read_last() to return OK when executed from the slave SQL
  thread (faking that the row has been found so that processing
  proceeds to update/delete the row).
storage/blackhole/ha_blackhole.h:
  Enabling row capabilities for engine.
  Defining write_row(), update_row(), and delete_row().
  Making write_row() private (as it should be).
2008-10-02 11:02:38 +02:00
He Zhenxing
08399602a6 Auto Merge 2008-09-29 13:36:42 +08:00
He Zhenxing
bd35cfe22e BUG#38734 rpl_server_id2 sync_with_master failed
Rotate event is automatically generated and written when rotating binary
log or relay log. Rotate events for relay logs are usually ignored by slave
SQL thread becuase they have the same server id as that of the slave.
However, if --replicate-same-server-id is enabled, rotate event
for relay log would be treated as if it's a rotate event from master, and
would be executed by slave to update the rli->group_master_log_name and
rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
function to fail and return NULL.

This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
in the event to tell the SQL thread to ignore these Rotate events generated
for relay logs.

This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
to distinquish faked events, the method used before this was by checking if
log_pos was zero.


sql/log.h:
  Add a member to MYSQL_BIN_LOG to distinguish binary log from relay log.
sql/log_event.cc:
  Change artificial_event member to LOG_EVENT_ARTIFICIAL_F flag
  
  If LOG_EVENT_RELAY_LOG_F is set in the event flags for a rotate event, ignore it when updating position
  
  Refactored the code in Rotate_log_event::do_update_pos
sql/log_event.h:
  Add LOG_EVENT_RELAY_LOG_F flag to Log_event flags
  Add RELAY_LOG flag to Rotate_log_event flags
sql/sql_repl.cc:
  Set LOG_EVENT_ARTIFICIAL_F for fake rotate events
2008-09-28 15:34:25 +08:00
He Zhenxing
a2841cf1c1 BUG#35843 Slow replication slave when using partitioned myisam table
In order to improve the performance when replicating to partitioned
myisam tables with row-based format, the number of rows of current 
rows log event is estimated and used to setup storage engine for bulk
inserts.
2008-09-26 17:39:47 +08:00
He Zhenxing
b17458dcc1 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
Andrei Elkin
2f8c0a1675 Bug#36099 replicate-do-db affects replaying RBR events with mysqlbinlog
The replication filtering rules were inappropiately applied when
executing BINLOG pseudo-query.  The rules are supposed to be active
only at times when the slave's sql thread executes an event.
            
Fixed with correcting a condition to call replication rules only if
the slave sql thread executes the event.

mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result:
  new result file
mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt:
  a filtering option that would refuse to replicate a row event of the main test on
  slave
mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test:
  a regression test for the bug
sql/log_event.cc:
  avoiding to call the filtering rules if the execution thread is not a slave.
2008-09-03 13:01:18 +03:00
Mats Kindahl
84b81e6c95 Merging 5.1 into 5.1-rpl-merge 2008-08-27 20:52:44 +02:00
He Zhenxing
923f61039e Cherry picking patch for BUG#37051 2008-08-26 18:01:49 +08:00
Alexander Barkov
8706222b33 Additional ffix for bug#31455
- fixing double problem on big endian machines
- modifying regex_replace to replace negative numbers
  Previously only positive numbers where replaced.
2008-08-25 12:58:29 +05:00
Alexander Barkov
1f61af5ad1 Additional fix for bug#31455.
Exchanging "m_cols" and "m_cols_ai".

Very confusing variable naming :(
2008-08-22 10:17:52 +05:00
Alexander Barkov
762df2d05c Additional fix for bug#31455 (rpl decoder)
- Implementing --base64-format=decode-rows, to display
  SQL-alike decoded row events without their BINLOG statements.
- Adding --base64-format=decode-rows into tests when
  calling mysqlbinlog to avoid non-deterministic results
- Removing resetting of last_table_id in "RESET MASTER",
  which appeared to be dangerous.
2008-08-21 16:47:23 +05:00
Alexander Barkov
0c5bc2eafc Bug#31455 mysqlbinlog don't print user readable info about RBR events
Implementing -v command line parameter to mysqlbinlog
to decode and print row events.

mysql-test/include/mysqlbinlog_row_engine.inc
mysql-test/r/mysqlbinlog_row.result
mysql-test/r/mysqlbinlog_row_big.result
mysql-test/r/mysqlbinlog_row_innodb.result
mysql-test/r/mysqlbinlog_row_myisam.result
mysql-test/r/mysqlbinlog_row_trans.result
mysql-test/t/mysqlbinlog_row.test
mysql-test/t/mysqlbinlog_row_big.test
mysql-test/t/mysqlbinlog_row_innodb.test
mysql-test/t/mysqlbinlog_row_myisam.test
mysql-test/t/mysqlbinlog_row_trans.test
  Adding tests 

client/Makefile.am
  Adding new files to symlink
  
client/mysqlbinlog.cc
  Adding -v option

sql/log_event.cc
  Impelentations of the new methods

sql/log_event.h
  Declaration of the new methods and member

sql/mysql_priv.h
  Adding new function prototype

sql/rpl_tblmap.cc
  Adding pre-processor conditions 

sql/rpl_tblmap.h
  Adding pre-processor conditions 

sql/rpl_utility.h
  Adding pre-processor conditions 

sql/sql_base.cc
  Adding reset_table_id_sequence() function.

sql/sql_repl.cc
  Resetting table_id on "RESET MASTER"
  
.bzrignore
  Ignoring new symlinked files
2008-08-20 19:06:31 +05:00
He Zhenxing
bca856c5b3 Auto merge 2008-08-06 18:41:27 +08:00
Sven Sandberg
4cf30d44ef merged 5.1 main to 5.1-rpl
manually resolved conflicts:
Text conflict in client/mysqltest.c
Contents conflict in mysql-test/include/have_bug25714.inc
Text conflict in mysql-test/include/have_ndbapi_examples.inc
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/suite/parts/inc/partition_check_drop.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check1.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check2.inc
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_basic_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_engine_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_syntax_myisam.result
Text conflict in mysql-test/suite/rpl_ndb/t/disabled.def
Text conflict in mysql-test/t/disabled.def
2008-08-04 07:04:47 +02:00
He Zhenxing
a018e98cba BUG#37051 Replication rules not evaluated correctly
The problem of this bug is that we need to get the list of tables
to be updated for a multi-table update statement, which requires to
open all the tables referenced by the statement and resolve all
the fields involved in update in order to figure out the list of
tables for update. However if there are replicate filter rules,
some tables might not exist on slave and result in a failure
before we could examine the filter rules.

I think the whole problem can not be solved on slave alone,
the master must record and send the information of tables
involved for update to slave, so that the slave do not need to
open all the tables referenced by the multi-table update statement to
figure out which tables are involved for update.

So a status variable is added to Query_log event to store the
value of table map for update on master. And on slave, it will
try to get the value of this variable and use it to examine
filter rules without opening any tables on slave, if this values
is not available, the old approach is used and thus the bug will
still occur for when replicating from old masters.


sql/sql_class.h:
  add member table_map_for_update to THD
sql/sql_parse.cc:
  check filter rules by using table_map_for_update value
sql/sql_update.cc:
  save the value of table_map_for_update
2008-07-31 14:24:27 +08:00
Jonathan Perkin
a07bb6c47a Merge from mysql-5.0.66-release 2008-07-17 17:35:05 +02:00
Chad MILLER
c425bf421d Merge chunk from trunk. 2008-07-10 14:50:07 -04:00
Chad MILLER
6a6e77eeff Merge chunk from trunk. 2008-07-10 14:47:53 -04:00
Mats Kindahl
40e095e7de Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam 2008-07-08 13:18:34 +02:00
Mats Kindahl
914cae3a2d Bug #37150 Risk for crash in User_var_log_event::exec_event()
On certain kinds of errors (e.g., out of stack), a call to Item_func_
set_user_var::fix_fields() might fail.  Since the return value of this
call was not checked inside User_var_log_event::exec_event(), continuing
execution after this will cause a crash inside Item_func_set_user_var::
update_hash().

The bug is fixed by aborting execution of the event with an error if
fix_fields() fails, since it is not possible to continue execution anyway.


sql/log_event.cc:
  Aborting execution of event if fix_fields() fails since execution
  of update_hash() might cause a crash.
2008-07-07 09:58:27 +02:00