Commit graph

660 commits

Author SHA1 Message Date
Michael Widenius
2d48e9f11c Fixed failing test case 2014-02-11 16:57:28 +02:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Michael Widenius
6cc9f4ac5c Added usage of handler error names to mysqltest
include/CMakeLists.txt:
  Added handler_ername.h
include/handler_ername.h:
  Names of handler error messages
mysql-test/extra/binlog_tests/binlog.test:
  Test using handler error names
mysql-test/r/mysqltest.result:
  Update for new error message
mysql-test/t/auto_increment.test:
  Test using handler error names
mysql-test/t/auto_increment_ranges.inc:
  Test using handler error names
mysql-test/t/replace.test:
  Test using handler error names
2013-11-05 20:30:36 +02:00
Shivji Kumar Jha
d4011a6144 BUG#16580366- MTR TESTS FAILING SPORADICALLY ON PB2 (5.5, 5.6 AND 5.7)
DURING INNODB RECOVERY

Problem:
=======
The connection 'master' is dropped by mysqltest after
rpl_end.inc. At this point, dropping temporary tables
at the connection 'master' are not synced at slave.
So, the temporary tables replicated from master remain
on slave leading to an inconsistent close of the test.
The following test thus complains about the presence of
temporary table(s) left over from the previous test.

Fix:
===
- Put explicit drop commands in replication tests so
  that the temporary tables are dropped at slave as well.
- Added the check for Slave_open_temp_tables in
  mtr_check.sql to warn about the remaining temporary
  table, if any, at the close of a test.
2013-09-27 01:24:16 +05:30
Sergei Golubchik
aca8e7ed6b 5.3 merge 2013-01-15 19:07:46 +01:00
Sergei Golubchik
4f67a14700 5.2->5.3 merge 2013-01-10 15:40:21 +01:00
Sergei Golubchik
bd87fed1dc 5.1 merge 2013-01-10 13:54:04 +01:00
Sergei Golubchik
2e11ca36f2 mysql-5.1.67 merge 2013-01-09 23:51:51 +01:00
Shivji Kumar Jha
96b6bcc6b2 BUG#14659685: main.mysqlbinlog_row_myisam.test main.mysqlbinlog_row_innodb.test are skipped
merge from 5.1 into 5.5
2012-10-30 10:41:25 +05:30
Shivji Kumar Jha
7c7de142a3 BUG#14659685 - main.mysqlbinlog_row_myisam and
main.mysqlbinlog_row_innodb are skipped by mtr

=== Problem ===

The following tests are wrongly placed in main suite and as a
result these are not run with proper binlog format combinations.
Some are always skipped by mtr.
1) mysqlbinlog_row_myisam
2) mysqlbinlog_row_innodb
3) mysqlbinlog_row.test
4) mysqlbinlog_row_trans.test
5) mysqlbinlog-cp932
6) mysqlbinlog2
7) mysqlbinlog_base64

=== Background ===

mtr runs the tests placed in main suite with binlog format=stmt.
Those that need to be tested against binlog format=row or mixed
or more than one binlog format and require only one mysql server
are placed in binlog suite. mtr runs tests in binlog suite with
all three binlog formats(stmt,row and mixed).

=== Fix ===


1) Moved the test listed in problem section above to binlog suite.
2) Added prefix "binlog_" to the name of each test case moved.
   Renamed the coresponding result files and option files accordingly. 


mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc:
  include file for mysqlbinlog_row_myisam.test and 
  mysqlbinlog_row_myisam.test which are being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog-cp932.result:
  result file for mysqlbinlog-cp932.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result:
  result file for mysqlbinlog2.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog_base64.result:
  result file for mysqlbinlog_base64.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result:
  result file for mysqlbinlog_row.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result:
  result file for mysqlbinlog_row_innodb.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result:
  result file for mysqlbinlog_row_myisam.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result:
  result file for mysqlbinlog_row_trans.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932-master.opt:
  option file for mysqlbinlog-cp932.test which is being moved to
  binlog suite.
mysql-test/suite/binlog/t/binlog_mysqlbinlog-cp932.test:
  the test requires binlog format=stmt or mixed. Since, it was placed in
  main suite earlier, it was only run with binlog format=stmt, and hence
  this test was never run with binlog format=mixed.
mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test:
  the test requires binlog format=stmt or mixed. Since, it was placed in
  main suite earlier, it was only run with binlog format=stmt, and hence
  this test was never run with binlog format=mixed.
mysql-test/suite/binlog/t/binlog_mysqlbinlog_base64.test:
  the test requires binlog format=row. Since, it was placed in main
  suite earlier, it was only run with binlog format=stmt, and hence
  this test was always skipped by mtr.
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test:
  the test requires binlog format=row. Since, it was placed in main
  suite earlier, it was only run with binlog format=stmt, and hence
  this test was always skipped by mtr.
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_innodb.test:
  the test requires binlog format=row. Since, it was placed in main
  suite earlier, it was only run with binlog format=stmt, and hence
  this test was always skipped by mtr.
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_myisam.test:
  the test requires binlog format=row. Since, it was placed in main
  suite earlier, it was only run with binlog format=stmt, and hence
  this test was always skipped by mtr.
mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test:
  the test requires binlog format=row. Since, it was placed in main
  suite earlier, it was only run with binlog format=stmt, and hence
  this test was always skipped by mtr.
2012-10-30 10:40:07 +05:30
Michael Widenius
ae5bc05988 Fix for MDEV-533: Confusing error code when doing auto-increment insert for out-of-range values
create table t1 (a smallint primary key auto_increment);
insert into t1 values(32767);
insert into t1 values(NULL);
ERROR 1062 (23000): Duplicate entry '32767' for key 'PRIMARY

Now on always gets error HA_ERR_AUTOINC_RANGE=167 "Out of range value for column", independent of
store engine, SQL Mode or number of inserted rows. This is an unique error that is easier to test for in replication.

Another bug fix is that we now get an error when trying to insert a too big auto-generated value, even in non-strict mode.
Before one get insted the max column value inserted.
This patch also fixes some issues with inserting negative numbers in an auto-increment column.
Fixed the ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
Added SQLSTATE errors for handler errors

Smaller bug fixes:
* Added warnings for duplicate key errors when using INSERT IGNORE
* Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
* Allow one to see how cmake is called by using --just-print --just-configure


BUILD/FINISH.sh:
  --just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
cmake/configure.pl:
  --just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
include/CMakeLists.txt:
  Added handler_state.h
include/handler_state.h:
  SQLSTATE for handler error messages.
  Required for HA_ERR_AUTOINC_ERANGE, but solves also some other cases.
mysql-test/extra/binlog_tests/binlog.test:
  Fixed old wrong behaviour
  Added more tests
mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
  Reset binary log to only print what's necessary in show_binlog_events
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
  Update to new error codes
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Ignore warnings as this depends on how the test is run
mysql-test/include/strict_autoinc.inc:
  On now gets an error on overflow
mysql-test/r/auto_increment.result:
  Update results after fixing error message
mysql-test/r/auto_increment_ranges_innodb.result:
  Test new behaviour
mysql-test/r/auto_increment_ranges_myisam.result:
  Test new behaviour
mysql-test/r/commit_1innodb.result:
  Added warnings for duplicate key error
mysql-test/r/create.result:
  Added warnings for duplicate key error
mysql-test/r/insert.result:
  Added warnings for duplicate key error
mysql-test/r/insert_select.result:
  Added warnings for duplicate key error
mysql-test/r/insert_update.result:
  Added warnings for duplicate key error
mysql-test/r/mix2_myisam.result:
  Added warnings for duplicate key error
mysql-test/r/myisam_mrr.result:
  Added warnings for duplicate key error
mysql-test/r/null_key.result:
  Added warnings for duplicate key error
mysql-test/r/replace.result:
  Update to new error codes
mysql-test/r/strict_autoinc_1myisam.result:
  Update to new error codes
mysql-test/r/strict_autoinc_2innodb.result:
  Update to new error codes
mysql-test/r/strict_autoinc_3heap.result:
  Update to new error codes
mysql-test/r/trigger.result:
  Added warnings for duplicate key error
mysql-test/r/xtradb_mrr.result:
  Added warnings for duplicate key error
mysql-test/suite/binlog/r/binlog_innodb_row.result:
  Updated result
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
  Updated result
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Updated result
mysql-test/suite/innodb/r/innodb-autoinc.result:
  Update to new error codes
mysql-test/suite/innodb/r/innodb-lock.result:
  Updated results
mysql-test/suite/innodb/r/innodb.result:
  Updated results
mysql-test/suite/innodb/r/innodb_bug56947.result:
  Updated results
mysql-test/suite/innodb/r/innodb_mysql.result:
  Updated results
mysql-test/suite/innodb/t/innodb-autoinc.test:
  Update to new error codes
mysql-test/suite/maria/maria3.result:
  Updated result
mysql-test/suite/maria/mrr.result:
  Updated result
mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result:
  Updated result
mysql-test/suite/rpl/r/rpl_auto_increment.result:
  Update to new error codes
mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff:
  Updated results
mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
  Updated results
mysql-test/t/auto_increment.test:
  Update to new error codes
mysql-test/t/auto_increment_ranges.inc:
  Test new behaviour
mysql-test/t/auto_increment_ranges_innodb.test:
  Test new behaviour
mysql-test/t/auto_increment_ranges_myisam.test:
  Test new behaviour
mysql-test/t/replace.test:
  Update to new error codes
mysys/my_getopt.c:
  Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
sql/handler.cc:
  Ignore negative values for signed auto-increment columns
  Always give an error if we get an overflow for an auto-increment-column (instead of inserting the max value)
  Ensure that the row number is correct for the out-of-range-value error message.
  
  
  ******
  Fixed wrong printing of column namn for "Out of range value" errors
  Fixed that INSERT_ID is correctly replicated also for out-of-range autoincrement values
  Fixed that print_keydup_error() can also be used to generate warnings
  ******
  Return HA_ERR_AUTOINC_ERANGE (167) instead of ER_WARN_DATA_OUT_OF_RANGE for auto-increment overflow
sql/handler.h:
  Allow INSERT IGNORE to continue also after out-of-range inserts.
  Fixed that print_keydup_error() can also be used to generate warnings
sql/log_event.cc:
  Added DBUG_PRINT
  Fixed the ER_AUTOINC_READ_FAILED, ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
  This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
sql/sql_insert.cc:
  Add warnings for duplicate key errors when using INSERT IGNORE
sql/sql_state.c:
  Added handler errors
sql/sql_table.cc:
  Update call to print_keydup_error()
storage/innobase/handler/ha_innodb.cc:
  Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
storage/xtradb/handler/ha_innodb.cc:
  Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
2012-09-18 15:14:19 +03:00
Sergei Golubchik
1185420da0 5.3 merge 2012-05-21 20:54:41 +02:00
Sergei Golubchik
431e042b5d c 2012-05-21 15:30:25 +02:00
Sujatha Sivakumar
64e74d484f BUG#12662190:COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS
PROBLEM:

--------

When binary log statements are replayed on the slave, BEGIN is represented

in com_counters but COMMIT is not. Similarly in 'ROW' based replication

'INSERT','UPDATE',and 'DELETE' com_counters are not getting incremented

when the binary log statements are replayed at slave.

ANALYSIS:
---------

In 'ROW' based replication for COMMIT,INSERT,UPDATE and DELETE operations
following special events are invoked.
Xid_log_event,Write_rows_log_event,Update_rows_log_event,Update_rows_log_event.

The above mentioned events doesn't go through the parser where the
'COM_COUNTERS' are incremented.


FIX:
-----
Increment statements are added at appropriate events.
Respective functions are listed below.

'Xid_log_event::do_apply_event'
'Write_rows_log_event::do_before_row_operations'
'Update_rows_log_event::do_before_row_operations'
'Delete_rows_log_event::do_before_row_operations' 

sql/log_event.cc:
  Added code to increment counts for 'COM_INSERT','COM_UPDATE',
  'COM_DELETE' and 'COM_COMMIT'during ROW based replicaiton
2012-04-12 11:07:39 +05:30
Sergei Golubchik
a3073ecd96 merge 2012-04-05 23:07:18 +02:00
Sergei Golubchik
cbd52a42ee merge 2012-04-05 12:01:52 +02:00
Sergei Golubchik
dea3544b2d mysql-5.1.62 merge 2012-04-05 10:49:38 +02:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
Sergei Golubchik
4933d21e5d merge with mysql-5.5.21 2012-03-09 08:06:59 +01:00
Rohit Kalhans
31c990ca57 BUG#11758263 50440: MARK UNORDERED UPDATE WITH AUTOINC UNSAFE
Problem: Statements that write to tables with auto_increment columns
         based on the selection from another table, may lead to master
         and slave going out of sync, as the order in which the rows
         are retrieved from the table may differ on master and slave.
            
Solution: We mark writing to a table with auto_increment table
          based on the rows selected from another table as unsafe. This
          will cause the execution of such statements to throw a warning
          and forces the statement to be logged in ROW if the logging
          format is mixed. 
            
Changes:
       1. All the statements that writes to a table with auto_increment 
          column(s) based on the rows fetched from another table, will now
          be unsafe.
       2. CREATE TABLE with SELECT will now be unsafe.

sql/share/errmsg-utf8.txt:
  Added new warning messages.
sql/sql_base.cc:
  -Created function to check statements that write to 
   tables with auto_increment column and has select.
  -Marked all the statements that write to a table
   with auto_increment column based on rows fetched
   from other table(s) as unsafe.
sql/sql_table.cc:
  mark CREATE TABLE[with auto_increment column] as unsafe.
2012-02-09 23:28:33 +05:30
Rohit Kalhans
b7430d73e4 Backout the patch for bug#11758263. 2012-02-08 12:10:55 +05:30
Rohit Kalhans
de85a60049 BUG#11758263 50440: MARK UNORDERED UPDATE WITH AUTOINC UNSAFE
Problem: Statements that write to tables with auto_increment columns
      based on the selection from another table, may lead to master
      and slave going out of sync, as the order in which the rows
      are retrived from the table may differ on master and slave.
      
      Solution: We mark writing to a table with auto_increment table
      as unsafe. This will cause the execution of such statements to
      throw a warning and forces the statement to be logged in ROW if
      the logging format is mixed. 
      
      Changes: 
      1. All the statements that writes to a table with auto_increment 
      column(s) based on the rows fetched from another table, will now
      be unsafe.
      2. CREATE TABLE with SELECT will now be unsafe.


sql/share/errmsg-utf8.txt:
  Added new Warning messages
sql/sql_base.cc:
  created a new function that checks for select + write on a autoinc table
  made all such statements to be unsafe.
sql/sql_parse.cc:
  made create autoincremnet tabble + select unsafe
2012-02-08 00:33:08 +05:30
Sergei Golubchik
3320a4bffb per-combination result files 2012-02-06 22:55:17 +01:00
Andrei Elkin
f0167f8082 merge from 5.5 repo. 2012-01-31 17:07:44 +02:00
Nuno Carvalho
37fce0ece4 BUG#13050593 - BACKSLASH SWALLOWED BY INCLUDE/SHOW_SLAVE_STATUS.INC
If an error message contains '\' backslash it is displayed correctly
through show-slave-status or
query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);. But when
SELECT REPLACE(...) is applied backslash is escaped resulting in a
different test output.

Disabled backslash escape on show_slave_status.inc and replaced '\' for
'/' using replace_regex function in order to achieve the same test
output when different path separators are used.
2012-01-19 16:56:43 +00:00
Andrei Elkin
f91c2d33f4 bug#3593869-64035
A follow-up patch corrects max sizes of printed strings and changes llstr() to %lld.
Credits go to Davi who provided a great feedback.


sql/share/errmsg-utf8.txt:
  Max size for the whole message is 512 so a part of - like '%-.512s' should be less,
  reduction to 320 is safe and with good chances won't cut off a part of a rather log
  message in Last_IO_Error = 'Got fatal error 1236 ...'
sql/sql_repl.cc:
  llstr() is replaced by %lld.
2012-01-19 16:44:09 +02:00
Andrei Elkin
7cdd7a7493 BUG#13593869 - 64035: SEVERAL ERRORS IN COM_BINLOG_DUMP/MYSQL_BINLOG_SEND CRASH THE SERVER
The server crashes when receiving a COM_BINLOG_DUMP command with a position of 0 or
larger than the file size.
The execution proceeds to an error block having the last read replication coordinates 
pointer be NULL and its dereferencing crashed the server.

Fixed with making "public" previously used only for heartbeat coordinates.


mysql-test/extra/rpl_tests/rpl_start_stop_slave.test:
  regression test for bug#3593869-64035 is added.
mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result:
  results updated (error mess format is changed).
mysql-test/suite/rpl/r/rpl_log_pos.result:
  results updated (error mess format is changed).
mysql-test/suite/rpl/r/rpl_manual_change_index_file.result:
  results updated (error mess format is changed).
mysql-test/suite/rpl/r/rpl_packet.result:
  results updated (error mess format is changed).
mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result:
  results updated (error mess format is changed).
mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test:
  Slave is stopped by bug#3593869-64035 tests so 
  -let $rpl_only_running_threads= 1 is set prior to rpl_end.
sql/share/errmsg-utf8.txt:
  Increasing the max length of explanatory message to 512.
sql/sql_repl.cc:
  Making `coord' to carry the last read from binlog event coordinates
  regardless of heartbeat.
  Renaming, small cleanup and simplifying the code after if (coord) becomes unnecessary.
  Adding yet another 3rd pair of coordinates - the starting replication - 
  into error text.
2012-01-18 00:16:19 +02:00
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Nuno Carvalho
09319cde93 Automerge from mysql-5.1 to mysql-5.5. 2012-01-16 10:02:29 +00:00
Nuno Carvalho
9b0fdd650f BUG#11893288 60542: RPL.RPL_EXTRA_COL_MASTER_* DOESN'T TEST WHAT WAS INTENDED
Test extra/rpl_tests/rpl_extra_col_master.test (used by
rpl_extra_col_master_*) ends with the active connection pointing to the
slave. Thus, the two last tests never succeed in changing the binlog
format of the master away from 'row'. With correct active connection
(master) tests fail for binlog 'statement' and 'mixed' formats.

Tests rpl_extra_col_master_* only run when binary log format is
row.  Statement and mix replication do not make sense in this
tests since it will try to execute statements on columns that do
not exist.  This fix is basically a backport from mysql-5.5, see
changes done as part of BUG 39934.
2012-01-16 09:17:40 +00:00
Sergei Golubchik
1efdd5a572 rename debug variable to debug_dbug, to make test pass in release builds
(and to follow the naming conventons).
keep old debug variable, but mark it as deprecated.
2011-12-15 22:07:58 +01:00
Sergei Golubchik
d2755a2c9c 5.3->5.5 merge 2011-11-22 18:04:38 +01:00
Bjorn Munch
ef97f0ae46 Followup test fix after 13055685:
Un-needed replace_result accidentally messed up a variable used
  *if* not running parallel.
  Removed the bogus --replace_result
2011-11-09 09:58:18 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Rohit Kalhans
586c0c0ef6 BUG#11758262 - 50439: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE...SEL,CREATE...[IGN|REPL] SEL
Problem: The following statements can cause the slave to go out of sync 
if logged in statement format: 
INSERT IGNORE...SELECT 
INSERT ... SELECT ... ON DUPLICATE KEY UPDATE 
REPLACE ... SELECT 
UPDATE IGNORE :
CREATE ... IGNORE SELECT 
CREATE ... REPLACE SELECT  
           
Background: Since the order of the rows returned by the SELECT 
statement or otherwise may differ on master and slave, therefore
the above statements may cuase the salve to go out of sync with
the master. 
      
Fix:
Issue a warning when statements like the above are exectued and 
the bin-logging format is statement. If the logging format is mixed,
use row based logging. Marking a statement as unsafe has been 
done in the sql/sql_parse.cc instead of sql/sql_yacc.cc, because while
parsing for a token has been done we cannot be sure if the parsing
of the other tokens has been done as well.
      
Six new warning  messages has been added for each unsafe statement. 
      
binlog.binlog_unsafe.test has been updated to incoporate these additional unsafe statments.


******
BUG#11758262 - 50439: MARK INSERT...SEL...ON DUP KEY UPD,REPLACE...SEL,CREATE...[IGN|REPL] SEL 
Problem: The following statements can cause the slave to go out of sync 
if logged in statement format: 
INSERT IGNORE...SELECT 
INSERT ... SELECT ... ON DUPLICATE KEY UPDATE 
REPLACE ... SELECT 
UPDATE IGNORE :
CREATE ... IGNORE SELECT 
CREATE ... REPLACE SELECT  
           
Background: Since the order of the rows returned by the SELECT 
statement or otherwise may differ on master and slave, therefore
the above statements may cuase the salve to go out of sync with
the master. 
      
Fix:
Issue a warning when statements like the above are exectued and 
the bin-logging format is statement. If the logging format is mixed,
use row based logging. Marking a statement as unsafe has been 
done in the sql/sql_parse.cc instead of sql/sql_yacc.cc, because while
parsing for a token has been done we cannot be sure if the parsing
of the other tokens has been done as well.
      
Six new warning  messages has been added for each unsafe statement. 
      
binlog.binlog_unsafe.test has been updated to incoporate these additional unsafe statments.



mysql-test/extra/rpl_tests/rpl_insert_duplicate.test:
  Test removed: Added the test to rpl.rpl_insert_ignore.test
  
  
  
  ******
  Test removed: the test is redundant as the same is being tested in rpl.rpl_insert_ignore.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
  Warnings disabled for the unsafe statements.
mysql-test/extra/rpl_tests/rpl_insert_ignore.test:
  1. Disabled warnings while  for unsafe statements
  2. As INSERT...IGNORE is an unsafe statement, an insert ignore not changing any rows, 
  will not be logged in the binary log, in the ROW and MIXED modes. It will however be logged
  in STATEMENT mode.
mysql-test/r/commit_1innodb.result:
  updated result file
  
  
  
  ******
  updated result file
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  Updated result file.
mysql-test/suite/binlog/r/binlog_unsafe.result:
  updated result file
mysql-test/suite/binlog/t/binlog_unsafe.test:
   added tests for the statements marked as unsafe.
mysql-test/suite/rpl/r/rpl_insert_duplicate.result:
  File Removed :Result file of rpl_insert_duplicate, which has been removed.
mysql-test/suite/rpl/r/rpl_insert_ignore.result:
  Added the content of rpl.rpl_insert_duplicate here.
mysql-test/suite/rpl/r/rpl_insert_select.result:
  Result file removed as the corresponding test has beenn removed.
mysql-test/suite/rpl/r/rpl_known_bugs_detection.result:
  Updated result file.
mysql-test/suite/rpl/t/rpl_insert_duplicate.test:
  File Removed: this was a wrapper for rpl.rpl_insert_duplicate.test, which has been removed.
mysql-test/suite/rpl/t/rpl_insert_select.test:
  File Removed: This test became redundant after this fix, This test showed how INSERT IGNORE...SELECT break replication, which has been handled in this fix.
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test:
  Since all the tests are statement based bugs are being tested, having mixed format
  forces the event to be written in row format. When the statement and causes the
  test to fail as certain known bugs do not occur when the even is logged in row format.
sql/share/errmsg-utf8.txt:
  added 6 new Warning messages.
  
  
  
  ******
  added 6 new Warning messages.
sql/sql_lex.cc:
  Added 6 new error Identifier [ER_BINLOG_STMT_UNSAFEE_*]
sql/sql_lex.h:
  Added 6 new BINLOG_STMT_UNSAFE_* enums to identify the type of unsafe statement dealt with in this bug.
  
  
  ******
  Added 6 new BINLOG_STMT_UNSAFE_* enums to identify the type of unsafe statement dealt with in this bug.
sql/sql_parse.cc:
  added check for specific queries and marked them as unsafe.
  
  
  ******
  added check for specific queries and marked them as unsafe.
2011-09-29 14:47:27 +05:30
Sergei Golubchik
14c767ca48 fix typo: binlog_annotate_rows_events -> binlog_annotate_row_events 2011-09-23 12:00:52 +02:00
Michael Widenius
574e51e5fd Merge with 5.2 2011-09-15 17:25:37 +03:00
Michael Widenius
dcce428640 Fixed race condition that could cause diff to fail.
(Code taken from 5.5)
2011-09-15 16:56:06 +03:00
Alfranio Correia
e94de17f95 BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
Before BUG#28796, an empty host was used to identify that an instance was no
longer a slave. However, BUG#28796 changed this behavior and one cannot set
an empty host. Besides, a RESET SLAVE only cleans up information on the next
event to retrieve from the master, disables ssl and resets heartbeat period.
So a call to SHOW SLAVE STATUS after issuing a RESET SLAVE still returns some
valid information, such as host, port, user and password.

To fix this problem, we have introduced the command RESET SLAVE ALL that does
what a regular RESET SLAVE does and also clears host, port, user and password
information thus allowing users to identify when an instance is no longer a
slave.
2011-07-18 18:18:03 +01:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Magnus Blåudd
46c08b9459 Bug#12384993 EXTRA/RPL_TEST/CHECK_TYPE.INC NEED SUPPORT FOR SPECIFIC ENGINE
- add support for choosing the engine of test
    table(t1) with $engine_type
 - add primary key to the test table(t1) to support
   replication of BLOB/TEXT (also with ENGINE=ndb)
 - change the suppression since the warning printed to error log
  now says "Column 1"
2011-05-11 09:49:23 +02:00
Michael Widenius
f34be18938 Merge with MariaDB 5.2 2011-05-10 18:17:43 +03:00
unknown
014b8e7f43 Backport MySQL WL#2540 into MariaDB.
Patch backported:

bzr diff
'-rrevid:alfranio.correia@oracle.com-20101121143257-se3vpqus73l4mum0
..revid:luis.soares@oracle.com-20101124111752-9b8260bd1qak87hr'
--old=lp:mysql-server --new=lp:mysql-server
2011-05-03 14:01:11 +02:00
Michael Widenius
e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Magnus Blåudd
f73eb618ca BUG#47741 rpl_ndb_extraCol fails in next-mr (mysql-5.1-rep+2) in RBR
- fix the fix to properly detect when engine is NDB and
   also don't drop the table t9 if it hasn't been created
2011-04-27 11:02:34 +02:00
unknown
c677fea7d0 Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl. 2011-04-01 15:07:10 +02:00
Bjorn Munch
fc7a12c05d One more test suppression for rpl_extra_col_master tests 2011-03-31 15:48:05 +02:00