Commit graph

49202 commits

Author SHA1 Message Date
unknown
dc4849576e Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge


sql/field.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/rpl_record.cc:
  Auto merged
sql/rpl_utility.cc:
  Auto merged
sql/rpl_utility.h:
  Auto merged
2007-08-28 11:22:24 +02:00
unknown
413a59a3bc A fix for handling endianess in Field_blob::unpack().
sql/field.cc:
  Changed per Tomas` request.
2007-08-28 10:37:29 +02:00
unknown
0f599d3bfa Merge quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22
into  quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-merge


sql/log_event.cc:
  Manual merge
2007-08-28 10:24:40 +02:00
unknown
8b3d52630f BUG#21842: Exclude Rows_log_event members used in event application if
not compiled as a replication server - a fix from rpl clone now applied
to 5.1.22 tree.


sql/log_event.cc:
  Exclude Rows_log_event members used in event application if 
  not compiled as a replication server.
sql/log_event.h:
  Don't initialize Rows_log_event members used in event application if 
  not compiled as a replication server.
2007-08-28 10:14:45 +02:00
unknown
16f766c7f6 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-08-28 09:01:57 +02:00
unknown
052f5c2c79 correct compile error 2007-08-28 07:55:07 +02:00
unknown
0f950d6c38 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
2007-08-28 07:45:14 +02:00
unknown
9cbc7792e6 Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
sql/field.cc:
  Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
  - correct previous patch
2007-08-28 07:42:43 +02:00
unknown
7ecf5c6322 Fix some Windows compiler warnings.
storage/innobase/dict/dict0mem.c:
  Fix compiler warning with a cast.
storage/innobase/handler/ha_innodb.cc:
  Change type to fix a compiler warning.
2007-08-27 18:18:14 -06:00
unknown
05d3b8d682 Merge quant.(none):/ext/mysql/bkroot/mysql-5.1-target-5.1.22
into  quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-merge
2007-08-27 22:51:13 +02:00
unknown
61e988e712 Bug #30389: connection_id() always return 0 in embedded server
Initialize thd->variables.pseudo_thread_id when a new embedded
thd is created.


libmysqld/lib_sql.cc:
  Add comment regarding duplication of code in create_embedded_thd()
  vs. create_new_thread() and prepare_new_connection_state().  This
  was a cause for not properly initializing the pseudo_thread_id variable.
mysql-test/r/func_misc.result:
  Add test case to ensure connection_id() returns a sane value
mysql-test/t/func_misc.test:
  Add test case to ensure connection_id() returns a sane value
sql/mysqld.cc:
  Add comment warning of the duplication of code between create_new_thread()
  and create_embedded_thd()
sql/sql_connect.cc:
  Add comment warning of the duplication of code between
  prepare_new_connection_state() and create_embedded_thd()
2007-08-27 14:31:27 -06:00
unknown
ad4ee20673 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  ramayana.hindu.god:/home/tsmith/m/bk/51-target22-X


sql/ha_partition.cc:
  Auto merged
2007-08-27 14:23:02 -06:00
unknown
048775df13 Bug #30412 and Bug #30413
Update some tests in the "parts" suite, so they're skipped if the
requisite plugins are not present in the mysqld.


mysql-test/suite/parts/t/partition_char_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/partition_datetime_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/partition_decimal_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/partition_float_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/partition_int_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/partition_special_innodb.test:
  Skip if mysqld doesn't include InnoDB support
mysql-test/suite/parts/t/rpl_partition.test:
  Skip if mysqld doesn't include partition support
2007-08-27 14:12:12 -06:00
unknown
bfed329e17 Fixes for the following bugs:
Bug #30316: Some "parts" tests fail because the server uses "--secure-file-priv"
Bug #30341: Test suite "parts" needs to be adapted to the new rules disallowing many functio
Bug #30408: Suite "parts" needs bug numbers updated
Bug #30411: Suite "parts" needs bug numbers updated: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
Bug #30581: partition_value tests use disallowed CAST() function

Included are some general fixes to allow the "parts" test suite to be run
successfully.  This includes disabling a few tests or parts of tests,
cleaning up the test cases and their results, etc.  Basically, these tests
have not been run for some time, and had suffered some bit rot.

The bugs were fixed as a single changeset, because in some ways they depend
on each other.  I couldn't be sure I'd updated all the error codes (for
bugs 30408 and 30411) without also adapting to the new allowed functions
rules (bug 30341), and vice versa.


mysql-test/include/partition_layout.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc:
  Add ASCII(), ORD() and WEEKOFYEAR() as blocked functions (they depend
  too much on character set, etc.).
  
  Remove DATEDIFF() as a blocked function (it is implemented in terms
  of TO_DAYS() and the minus operator).
mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc:
  Remove ASCII(), ORD() and WEEKOFYEAR(), which are not allowed functions.
  
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING on non-integer fields, due to
  Bug 30577.
  
  Test MOD() with an integer field instead of floating point (it has a
  hybrid result type, like FLOOR() and CEILING(), but makes sense to use
  with an integer field).
  
  Add DATEDIFF() as an allowed function, because it is implemented in
  terms of TO_DAYS() and the minus operator.
mysql-test/suite/parts/inc/partition_alter3.inc:
  Remove use of disallowed CAST() function in partitioning
mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc:
  The blocked functions are actually blocked now, so expect errors.
  
  This is a result of the fix for bug 18198.
mysql-test/suite/parts/inc/partition_date.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
mysql-test/suite/parts/inc/partition_datetime.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
mysql-test/suite/parts/inc/partition_decimal.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_directory.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_double.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_enum.inc:
  Remove use of CAST(), which is disallowed.
  
  Remove test which relies on CAST().
mysql-test/suite/parts/inc/partition_float.inc:
  Remove uses of CAST() in partitioning functions - it is not allowed.
  
  Disable testing of FLOOR() and CEILING(), due to Bug 30577.
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_methods1.inc:
  Ensure that the contents of $MYSQLTEST_VARDIR are not in the result file
mysql-test/suite/parts/inc/partition_set.inc:
  Remove test which relies on CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
  Fix Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir
  
  Move data files into std_data/parts/*, so they can be used with LOAD
  DATA INFILE '../std_data_ln/parts/*' while --secure-file-priv is in
  force.
mysql-test/suite/parts/inc/partition_syntax.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_time.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_timestamp.inc:
  Remove use of CAST(), which is disallowed.
mysql-test/suite/parts/inc/partition_value.inc:
  Disable this entire test file, because it relies on using CAST() as
  a partitioning function, which is disallowed.  See Bug 30581,
  "partition_value tests use disallowed CAST() function".
mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result:
  Update test case results
mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result:
  Update test case results
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
  Update test case results
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_alter3_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_alter3_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_datetime_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_datetime_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_decimal_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_decimal_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_float_myisam.result:
  Update test case results
mysql-test/suite/parts/r/partition_syntax_innodb.result:
  Update test case results
mysql-test/suite/parts/r/partition_syntax_myisam.result:
  Update test case results
mysql-test/suite/parts/t/disabled.def:
  Mark several more tests as disabled: partition_value_myisam,
  partition_value_innodb, part_supported_sql_func_ndb,
  rpl_ndb_dd_partitions, and partition_float_innodb
mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc
mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc:
  Rename: mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc -> mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc
mysql-test/suite/parts/inc/partition_alter_1.inc:
  Correct expected error codes, which changed due to bug 29245.
mysql-test/suite/parts/inc/partition_check.inc:
  Correct expected error codes, which changed due to bug 29245.
mysql-test/suite/parts/inc/partition_syntax_1.inc:
  Correct expected error codes, which changed due to bug 29245.
2007-08-27 14:08:32 -06:00
unknown
76cf8367a6 Merge quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22
into  quant.(none):/ext/mysql/bk/mysql-5.1-bug21842-5.1.22-merge
2007-08-27 21:15:20 +02:00
unknown
d319e12ab7 ndb - bug#30646 fsync on close only if file is open for write
storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp:
  AsyncFile: fsync on close only if file is open for write (for AIX)
storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp:
  AsyncFile: fsync on close only if file is open for write (for AIX)
2007-08-27 21:58:49 +03:00
unknown
cd7d837be6 BUG#21842: There was an inconsistency in the use of table->record[0] and
table->record[1] buffers inside Rows_log_event::find_row() function. 
The patch fixes this.


sql/log_event.cc:
  Use table->record[0] to read records from table and table->record[1] to
  store a copy of the original record for comparisons.
2007-08-27 20:22:04 +02:00
unknown
41c849dde5 Bug #30648: Partition handler may not initialize variable used w/ autoincrement
A local variable may be used uninitialized in 
ha_partition::get_auto_increment().  Initialize it properly.


sql/ha_partition.cc:
  Initialize first_value_part in ha_partition::get_auto_increment() with *first_value before
  it's used in the underlying table handler.  Thanks to Antony for digging up this fix.
2007-08-27 11:46:34 -06:00
unknown
66262046a8 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22


sql/field.cc:
  Auto merged
2007-08-27 15:41:24 +02:00
unknown
2bf5b1aa6c Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
sql/field.cc:
  - always pack in little endian, irrespective of starage engine native format
  - always unpack as if it is atored in little endian, and unpack it to storage engine native format
2007-08-27 15:40:49 +02:00
unknown
75fe12a196 Merge bk-internal:/home/bk/mysql-5.1-target-5.1.22
into  magare.gmz:/home/kgeorge/mysql/work/mysql-5.1-target-5.1.22-joro
2007-08-27 15:08:55 +03:00
unknown
2ed515528f portation fixes for bug 29536 and 29325 in
re-pushing for 5.1.22.


mysql-test/suite/rpl/t/rpl_timezone.test:
  typo fixed in re-pushing bug 29536
sql/mysqld.cc:
  portation fixes ->5.1 for bug 29325
2007-08-27 15:01:29 +03:00
unknown
0e7c970470 Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  trift2.:/MySQL/M51/target-5.1.22
2007-08-27 13:59:32 +02:00
unknown
c749a21abf Merge trift2.:/MySQL/M51/netware3-5.1
into  trift2.:/MySQL/M51/target-5.1.22


configure.in:
  Auto merged
2007-08-27 13:53:23 +02:00
unknown
d777446213 More cleanup / fixing for NetWare:
1) "test_db.sql" is a plaintext file, no binary;
2) do not try to strip the binaries, it will not work.


configure.in:
  For NetWare, we cannot strip the binaries, so there is no use in attempting it.
scripts/make_binary_distribution.sh:
  Get rid of a typing error, introduced when a following file name was deleted.
2007-08-27 13:30:22 +02:00
unknown
b1e78d1343 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
2007-08-27 13:14:37 +02:00
unknown
3abd50cbf9 repair some rpl_ndb test cases
BitKeeper/deleted/.del-rpl_ndb_myisam2ndb-master.opt:
  Delete: mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt
mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
  BitKeeper file /home/tomas/mysql-5.1-target-5.1.22/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
  BitKeeper file /home/tomas/mysql-5.1-target-5.1.22/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
2007-08-27 13:13:00 +02:00
unknown
af9f7a239e re-push of Bug 29536 for 5.1.22: timestamp inconsistent in replication around 1970
MySQL replicates the time zone only when operations that involve
it are performed. This is controlled by a flag. But this flag
is set only on successful operation.
The flag must be set also when there is an error that involves
a timezone (so the master would replicate the error to the slaves).


mysql-test/suite/rpl/r/rpl_timezone.result:
  repush of Bug 29536 for 5.1.22 tree: test case
mysql-test/suite/rpl/t/rpl_timezone.test:
  repush of Bug 29536 for 5.1.22 tree: test case
sql/field.cc:
  re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation
  (so it apples to errors as well).
sql/time.cc:
  re-push of Bug 29536 for 5.1.22: move setting of the flag before the operation
  (so it apples to errors as well).
2007-08-27 12:33:57 +03:00
unknown
9b49c3cb71 recommit of Bug 25228 for 5.1.22: rpl_relayspace.test fails on powermacg5, vm-win2003-32-a
A test case was waiting for a fixed number of seconds for a specific 
  state of the slave IO thread to take place.
  Fixed by waiting in a loop for that specific thread state instead 
  (or timeout).


mysql-test/suite/rpl/t/rpl_relayspace.test:
  recommit of Bug 25228 for 5.1.22: fixed test case
2007-08-27 12:21:47 +03:00
unknown
77808ac95f recommit of Addendum to bug #29325 to 5.1.22 tree
keep_files_on_create made a startup option
2007-08-27 12:15:01 +03:00
unknown
642eda2229 BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134
using TPC-B):
 
Problem: A RBR event can contain incomplete row data (only key value and
fields which have been changed). In that case, when the row is unpacked
into record and written to a table, the missing fields get incorrect NULL
values leading to master-slave inconsistency.
 
Solution: Use values found in slave's table for columns which are not given
in the rows event. The code for writing a single row uses the following 
algorithm: 

1. unpack row_data into table->record[0],
2. try to insert record,
3. if duplicate record found, fetch it into table->record[0],
4. unpack row_data into table->record[0],
5. write table->record[0] into the table.

Where row_data is the row as stored in the data area of a rows event. 
Thus:

a) unpacking of row_data happens at the time when row is written into 
 a table,

b) when unpacking (in step 4), only columns present in row_data are 
 overwritten - all other columns remain as they were found in the table.
 
Since all data needed for the above algorithm is stored inside 
Rows_log_event class, functions which locate and write rows are turned 
into methods of that class.

replace_record()     -> Rows_log_event::write_row()
find_and_fetch_row() -> Rows_log_event::find_row()

Both methods take row data from event's data buffer - the row being 
processed is pointed by m_curr_row. They unpack the data as needed into 
table's record buffers record[0] or record[1]. When row is unpacked, 
m_curr_row_end is set to point at next row in the data buffer.

Other changes introduced in this changeset:

- Change signature of unpack_row(): don't report errors and don't
setup table's rw_set here. Errors can happen only when setting default 
values in prepare_record() function and are detected there.
 
- In Rows_log_event and derived classes, don't pass arguments to
the execution primitives (do_...() member functions) but use class
members instead.

- Move old row handling code into log_event_old.cc to be used by 
*_rows_log_event_old classes.

Also, a new test rpl_ndb_2other is added which tests basic replication 
from master using ndb tables to slave storing the same tables using 
(possibly) different engine (myisam,innodb).
  
Test is based on existing tests rpl_ndb_2myisam and rpl_ndb_2innodb. 
However, these tests doesn't work for various reasons and currently are 
disabled (see BUG#19227).
  
The new test differs from the ones it is based on as follows:
  
1. Single test tests replication with different storage engines on slave 
(myisam, innodb, ndb).
  
2. Include file extra/rpl_tests/rpl_ndb_2multi_eng.test containing 
original tests is replaced by extra/rpl_tests/rpl_ndb_2multi_basic.test 
which doesn't contain tests using partitioned tables as these don't work 
currently. Instead, it tests replication to a slave which has more or 
less columns than master.
  
3. Include file include/rpl_multi_engine3.inc is replaced with 
include/rpl_multi_engine2.inc. The later differs by performing slightly 
different operations (updating more than one row in the table) and 
clearing table with "TRUNCATE TABLE" statement instead of "DELETE FROM" 
as replication of "DELETE" doesn't work well in this setting.
  
4. Slave must use option --log-slave-updates=0 as otherwise execution of 
replication events generated by ndb fails if table uses a different 
storage engine on slave (see BUG#29569).


sql/log_event.cc:
  - Initialization of new Rows_log_event members.
  - Fixing some typos in documentation.
  
  In Rows_log_event::do_apply_event:
  - Set COMPLETE_ROWS_F flag (when master and slave have the same number of 
  columns and all colums are present in the row)
  - Move initialization of tables write/read sets here, outside the rows
  processing loop (and out of unpack_row() function).
  - Remove calls to do_prepare_row() - no longer needed.
  - Add code managing m_curr_row and m_curr_row_end pointers.
  
  - Change signatures of row processing methods of Rows_log_event and it
  descendants - now most arguments are taken from class members.
  - Remove do_prepare_row() methods which are no longer used.
  - The auto_afree_ptr template is moved to rpl_utility.h (so that it can
  be used in log_event_old.cc).
  - Removed copy_extra_fields() function - no longer used.
  
  In Rows_log_event::write_row (former replace_record):
  - The old code is moved to log_event_old.cc.
  - Use prepare_record() and non-destructive unpack_current_row() to fill record
  with data.
  - In case a record being inserted already exists on slave and row data is 
  incomplete use the record found and non-destructive unpack_current_row() to 
  combine new column values with existing ones.
  - More debug info added.
  
  In Rows_log_event::find_row (former find_and_fetch_row function):
  - The old code is moved to log_event_old.cc.
  - Unpacking of the row is moved here.
  - In case of search using PK, the key data is prepared here.
  - More debug info added.
  
  - Remove initialization of Rows_log_event::m_after_image buffer which is no
  longer used. 
  - Use new row unpacking methods in Update_rows_log_event::do_exec_row() to 
  create before and after image.
  
  Note: all existing code used by Rows_log_event::do_apply_event() has been moved
  to log_event_old.cc to be used by *_rows_log_event_old classes.
sql/log_event.h:
  - Add new COMPLETE_ROWS_F flag in Rows_log_event.
  - Add Rows_log_event members describing the row being processed.
  - Add a pointer to key buffer which is used in derived classes.
  - Add new methods: find__row(), write_row() and unpack_current_row().
  - Change signatures of do_...() methods (replace method arguments by
  class members).
  - Remove do_prepare_row() method which is no longer used.
  - Update method documentation.
  - Add Old_rows_log_event class, which contains the old row processing code, as
  a friend of Rows_log_event so that it can access all members of an event 
  instance.
sql/log_event_old.cc:
  Move here old implementation of Rows_log_event::do_apply_event() and 
  helper methods.
sql/log_event_old.h:
  - Define new class Old_rows_log_event encapsulating old version of
  Rows_log_event::do_apply_event() and the helper methods.
  - Add the Old_rows_log_event class as a base for *_old versions of RBR event
  classes, ensure that the old version of do_apply_event() is called.
  - For *_old classes, declare the helper methods used in the old version of
  do_apply_event().
sql/rpl_record.cc:
  - Make unpack_row non-destructive for columns not present in the row.
  - Don't fill read/write set here as it is done outside these functions.
  - Move initialization of a record with default values to a separate
  function prepare_record().
sql/rpl_record.h:
  - Change signature of unpack_row().
  - Declare function prepare_record().
sql/rpl_utility.cc:
  Make tabe_def::calc_field_size() a const method.
sql/rpl_utility.h:
  Make table_def::calc_field_size() a const method.
  
  Move auto_afree_ptr template here so that it can be re-used (currently
  in log_event.cc and log_event_old.cc). Similar with DBUG_PRINT_BITSET 
  macro.
mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test:
  Modification of rpl_ndb_2multi_eng test. Tests with partitioned tables 
  are removed and a setup with slave having different number of columns 
  than master is added.
mysql-test/include/rpl_multi_engine2.inc:
  Modification of rpl_multi_engine3.inc which operates on more rows and
  replaces "DELETE FROM t1" with "TRUNCATE TABLE t1" as the first form
  doesn't replicate in NDB -> non-NDB setting (BUG#28538).
mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result:
  Results of the test.
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt:
  Test options. --log-slave-updates=0 is compulsory as otherwise non-NDB 
  slave applying row events from NDB master will fail when trying to log
  them.
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test:
  Test replication of NDB table to slave using other engine. The main test
  is in extra/rpl_tests/rpl_ndb_2multi_basic.test. It is included here
  several times with different settings of default storage engine on slave.
2007-08-26 14:31:10 +02:00
unknown
a859c59454 Apply InnoDB snapshot innodb-5.1-ss1751.
Bug #16979: AUTO_INC lock in InnoDB works a table level lock
  Add a table level counter that tracks the number of AUTOINC locks that are
  pending and/or granted on a table. We peek at this value to determine whether
  a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
  acquire the AUTOINC lock or not. This change is related to Bug# 16979.
Bug #27950: Duplicate entry error in auto-inc after mysqld restart
  We check whether the AUTOINC sub-system has been initialized (first) by
  holding the AUTOINC mutex and if initialization is required then we
  initialize using our normal procedure.


storage/innobase/dict/dict0boot.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/dict/dict0crea.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/dict/dict0load.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/dict/dict0mem.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1749:
  Add a table level counter that tracks the number of AUTOINC locks that are
  pending and/or granted on a table. We peek at this value to determine whether
  a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
  acquire the AUTOINC lock or not. This change is related to Bug# 16979.
storage/innobase/handler/ha_innodb.cc:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1735:
  Add variable "innodb_autoinc_lock_mode"  to control the behavior of the
  AUTOINC locking. There are three modes, 0 for backward compatibility, 1 for the
  new style locking (default, safe for statement-based replication) and
  2 for no AUTOINC locking (unsafe for statement-based replication).
  
  
  Revision r1750:
  We check whether the AUTOINC sub-system has been initialized (first) by
  holding the AUTOINC mutex and if initialization is required then we
  initialize using our normal procedure. This change is related to Bug#27950.
  
  
  Revision r1746:
  Remove some code from ha_innodb.cc that was already enclosed in #if 0.
  The code was related to replication and group commit, and it was
  unreachable already as of MySQL 5.0.
  
  Approved by Heikki
  
  
  Revision r1749:
  Add a table level counter that tracks the number of AUTOINC locks that are
  pending and/or granted on a table. We peek at this value to determine whether
  a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
  acquire the AUTOINC lock or not. This change is related to Bug# 16979.
storage/innobase/include/dict0mem.h:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1749:
  Add a table level counter that tracks the number of AUTOINC locks that are
  pending and/or granted on a table. We peek at this value to determine whether
  a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
  acquire the AUTOINC lock or not. This change is related to Bug# 16979.
  
  
  
  Revision r1747:
  Correct an outdated comment about dict_table_t:col_names that should have
  been adjusted in r1719, or r1264 in branches/zip.
storage/innobase/include/mem0mem.ic:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1744:
  Merge r1739 from branches/zip:
  
  mem_heap_free_heap_top(): Declare the memory freed with UNIV_MEM_FREE().
  Before this change, the memory freed by mem_heap_empty() was not completely
  flagged free in UNIV_DEBUG_VALGRIND builds.  After this change, Valgrind
  will hopefully catch all errors caught by UNIV_MEM_DEBUG.
storage/innobase/include/sync0rw.ic:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1751:
  rw_lock_s_lock_func(): Correct a typo in a comment.
storage/innobase/include/trx0trx.h:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1742:
  Remove some unused fields of trx_t: mysql_master_log_file_name,
  mysql_master_log_pos, repl_wait_binlog_name, repl_wait_binlog_pos.
  
  Approved by Heikki.
storage/innobase/lock/lock0lock.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1749:
  Add a table level counter that tracks the number of AUTOINC locks that are
  pending and/or granted on a table. We peek at this value to determine whether
  a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to
  acquire the AUTOINC lock or not. This change is related to Bug# 16979.
storage/innobase/mtr/mtr0log.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/pars/pars0pars.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/srv/srv0srv.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
storage/innobase/trx/trx0sys.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1743:
  trx_sys_print_mysql_binlog_offset_from_page(): Enclose the definition
  in #ifdef UNIV_HOTBACKUP, to match the function declaration.
storage/innobase/trx/trx0trx.c:
  Apply InnoDB snapshot innodb-5.1-ss1751.
  
  Revision r1742:
  Remove some unused fields of trx_t: mysql_master_log_file_name,
  mysql_master_log_pos, repl_wait_binlog_name, repl_wait_binlog_pos.
  
  Approved by Heikki.
2007-08-25 03:55:38 -06:00
unknown
6d4b3c5800 Apply InnoDB snapshot innodb-5.1-ss1726.
Bug #16979: AUTO_INC lock in InnoDB works a table level lock
  - this is a major change in InnoDB auto-inc handling.
Bug #27950: Duplicate entry error in auto-inc after mysqld restart
  - Init AUTOINC from delete_row().
Bug #28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE
  - Use value specified by MySQL, in update_row().


mysql-test/r/innodb.result:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1655:
  Fix the innodb.test failure mentioned in r1654.
storage/innobase/dict/dict0dict.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
storage/innobase/dict/dict0mem.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
storage/innobase/handler/ha_innodb.cc:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1718:
  Replace mysql_byte with uchar and remove the #define mysql_byte from
  ha_innodb.cc.  This cleanup was made possible as of r1550:
  
  
  Revision r1658:
  check_trx_exists(): Remove a redundant function call and assignment that
  was added by someone at MySQL.
  
  
  Revision r1656:
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
  
  
  Revision r1654:
  
  One test case in innodb.test fails because of auto-increment
  changes in r1562:1653:
  
  $diff innodb.result innodb.reject
  504c504
  < 3	test2		this will work
  ---
  > 4	test2		this will work
storage/innobase/handler/ha_innodb.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1654:
  
  One test case in innodb.test fails because of auto-increment
  changes in r1562:1653:
  
  $diff innodb.result innodb.reject
  504c504
  < 3	test2		this will work
  ---
  > 4	test2		this will work
storage/innobase/ibuf/ibuf0ibuf.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1715:
  ibuf0ibuf.c: Remove the unused prototype for dict_index_print_low()
  that was inadvertently added in r832.
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
storage/innobase/include/dict0dict.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
storage/innobase/include/dict0mem.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
  
  
  Revision r1719:
  Merge r1264 from branches/zip: Avoid memory fragmentation when
  adding column definitions to tables.
  
  dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
  allocation.  Allow it and "name" to be NULL.  These parameters are NULL
  when creating dummy indexes.
  
  dict_add_col_name(): Remove calls to ut_malloc() and ut_free().
  
  dict_table_get_col_name(): Allow table->col_names to be NULL.
  
  dict_table_add_system_columns(), dict_table_add_to_cache():
  Add the parameter "heap".
  ---
  Additional changes that had to be merged from branches/zip:
  
  dict_table_add_system_columns(): New function, factored out from
  dict_table_add_to_cache().
  
  mlog_parse_index(): Add some consistency checks, and make use of
  dict_table_add_system_columns().
storage/innobase/include/lock0lock.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1664:
  lock_number_of_rows_locked(): Fix a typo in comment, and make the comments
  in lock0lock.c and lock0lock.h identical.  The typo was incorrectly fixed in
  r1623.
storage/innobase/include/row0mysql.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
storage/innobase/include/row0sel.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
storage/innobase/include/trx0trx.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
storage/innobase/include/ut0mem.h:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1713:
  Fix typo in comment.
storage/innobase/log/log0recv.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1657:
  recv_init_crash_recovery(): remove trailing white space
storage/innobase/row/row0mysql.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
storage/innobase/row/row0sel.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
storage/innobase/trx/trx0trx.c:
  Apply InnoDB snapshot innodb-5.1-ss1726.
  
  Revision r1645:
  Fix for bug# 16979, this is a major change in InnoDB auto-inc handling. There
  is one test that fails as of this commit. The updated test case should be
  part of the snapshot from MySQL shortly.
  
  Fix for bug# 27950 - Init AUTOINC from delete_row().
  
  Fix for bug# 28781 - Use value specified by MySQL, in update_row().
  
  Summary of structural changes:
  ==============================
  InnoDB needs to hold a table level lock for AUTOINC allocations to overcome
  the non-determinism inherent in MySQL SBR for INSERT ... SELECT. In this fix 
  for simple INSERT statements (including multi-value inserts), we try and avoid
  acquiring the special AUTOINC table level lock unless another transaction has
  already reserved the AUTOINC table level lock, in which case we fall back
  to the old behavior of acquiring the AUTOINC table level lock.
  
  The max AUTOINC value is now read directly using the low level interface
  of InnoDB.
2007-08-24 19:14:52 -06:00
unknown
ed38c14954 Merge trift2.:/MySQL/M51/netware2-5.1
into  trift2.:/MySQL/M51/target-5.1.22


netware/BUILD/compile-netware-END:
  Auto merged
netware/Makefile.am:
  Auto merged
2007-08-24 23:22:55 +02:00
unknown
454063c5a9 Merge trift2.:/MySQL/M50/netware2-5.0
into  trift2.:/MySQL/M51/netware2-5.1


netware/BUILD/compile-netware-END:
  Auto merged
netware/Makefile.am:
  Manual merge.
2007-08-24 23:12:19 +02:00
unknown
4a801dde7e Fixes for the NetWare builds, discovered during 5.1.21-beta and backported to 5.0:
1) Ensure "init_db.sql" and "test_db-sql" really get built.

2) Ensure the "*.def" files with NetWare linker options get distributed to the proper directories.


netware/BUILD/compile-netware-END:
  Ensure the "*.def" files are built for NetWare.
  
  This is a backport of a 5.1 fix which may not be needed in 5.0 but cannot do any harm:
  the general "link_sources" step might fall victim to a cleanup which would be fatal
  just for NetWare, because of problems in the ordering of SUBDIR entries.
netware/Makefile.am:
  1) The scripts "init_db.sql" and "test_db.sql" must be built in the NetWare phase.
  
  2) Use "basename", not sed.
2007-08-24 23:07:59 +02:00
unknown
98af69e889 ha_partition.cc, ha_partition.h:
bug fixed
partition_pruning.result:
  test fixed


mysql-test/r/partition_pruning.result:
  test fixed
sql/ha_partition.cc:
  bug fixed
sql/ha_partition.h:
  bug fixed
2007-08-24 21:36:51 +05:00
unknown
2bdfe4d7b0 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
2007-08-24 09:51:41 +02:00
unknown
4f8bcc8eda unable to reproduce bug, perhaps pushbuild can give more info 2007-08-24 09:50:54 +02:00
unknown
7cd836b6dc Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  gleb.loc:/home/uchum/work/bk/target-5.1.22/mysql-5.1-target-5.1.22
2007-08-24 02:26:30 +05:00
unknown
d55f22fec2 Fixed bug #30396.
Recommit to 5.1.22.
The bug caused memory corruption for some queries with top OR level
in the WHERE condition if they contained equality predicates and 
other sargable predicates in disjunctive parts of the condition.

The corruption happened because the upper bound of the memory
allocated for KEY_FIELD and SARGABLE_PARAM internal structures
containing info about potential lookup keys was calculated incorrectly
in some cases. In particular it was calculated incorrectly when the
WHERE condition was an OR formula with disjuncts being AND formulas
including equalities and other sargable predicates.


mysql-test/r/select.result:
  Added a test case for bug #30396.
  Recommit to 5.1.22.
mysql-test/t/select.test:
  Added a test case for bug #30396.
  Recommit to 5.1.22.
sql/item_cmpfunc.h:
  Removed max_members from the COND_EQUAL class as not useful anymore. 
  Recommit to 5.1.22.
sql/sql_base.cc:
  Added the max_equal_elems field to the st_select_lex structure.
  Recommit to 5.1.22.
sql/sql_lex.cc:
  Added the max_equal_elems field to the st_select_lex structure.
  Recommit to 5.1.22.
sql/sql_lex.h:
  Added the max_equal_elems field to the st_select_lex structure.
  The field contains the maximal number of elements in multiple equalities
  built for the query conditions.
  Recommit to 5.1.22.
sql/sql_select.cc:
  Fixed bug #30396.
  Recommit to 5.1.22.
  The bug caused memory corruption for some queries with top OR level
  in the WHERE condition if they contained equality predicates and 
  other sargable predicates in disjunctive parts of the condition.
  
  The corruption happened because the upper bound of the memory
  allocated for KEY_FIELD and SARGABLE_PARAM internal structures
  containing info about potential lookup keys was calculated incorrectly
  in some cases. In particular it was calculated incorrectly when the
  WHERE condition was an OR formula with disjuncts being AND formulas
  including equalities and other sargable predicates.
   
  The max_equal_elems field to the st_select_lex structure is used now
  to calculate the above mentioned upper bound. The field contains the
  maximal number of elements in multiple equalities built for the query
  conditions.
2007-08-24 02:23:49 +05:00
unknown
6d409e8f82 Fixed bug #30201.
Recommit to 5.1.22.
Killing a SELECT query with KILL QUERY or KILL CONNECTION
causes a server crash if the query cache is enabled.

Normal evaluation of a query may be interrupted by the
KILL QUERY/CONNECTION statement, in this case the mysql_execute_command
function returns TRUE, and the thd->killed flag has true value.
In this case the result of the query may
be cached incompletely (omitting call to query_cache_insert inside
the net_real_write function), and next call to query_cache_end_of_result
may lead to server crash.
Thus, the query_cache_end_of_result function has been modified to abort
query cache in the case of killed thread.



sql/sql_cache.cc:
  Fixed bug #30201.
  Recommit to 5.1.22.
  The  query_cache_end_of_result function has been modified to abort query
  cache in the case of query execution failure. Also this function has been
  modified to remove incomplete query block.
2007-08-24 01:59:48 +05:00
unknown
380cc93cab Fixed bug #30287.
Recommit to 5.1.22.
The server created temporary tables for filesort in the working directory
instead of the specified tmpdir directory.


sql/item.cc:
  Fixed bug #30287.
  Recommit to 5.1.22.
  The Item_field::set_field method has been modified to reset the any_privileges
  flag to false in case of system temporary table. This modification prevents the
  server from unnecessary checking of user privileges to access system temporary
  tables.
sql/sql_select.cc:
  Fixed bug #30287.
  Recommit to 5.1.22.
  Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
  temporary tables contains full path to table file basename again.
sql/sql_view.cc:
  Fixed bug #30287.
  Recommit to 5.1.22.
  Commentary has been added.
2007-08-24 01:54:18 +05:00
unknown
42bd0a4a6f Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
2007-08-23 16:25:35 +02:00
unknown
f8d1951f81 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge


sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  manual merge
2007-08-23 16:23:55 +02:00
unknown
9e72aacf10 BUG#30017 log-slave-updates incorrect behavior for cluster
- let the receiving injector thread decide what to do
(recommit for 5.1.22 target)


sql/ha_ndbcluster.cc:
  BUG#30017 log-slave-updates incorrect behavior for cluster
  - let the receiving injector thread decide what to do
sql/ha_ndbcluster_binlog.cc:
  BUG#30017 log-slave-updates incorrect behavior for cluster
  - let the receiving injector thread decide what to do
2007-08-23 16:13:21 +02:00
unknown
e81734ce53 Bug#28744, Bug#29363
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
  updated main test for DDL
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
  updated main test for DML
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
  updated result file
mysql-test/suite/rpl/t/disabled.def:
  updated disabled.def
2007-08-23 17:33:06 +04:00
unknown
a59096c554 Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-target-5.1.22
into  mysql.com:/data1/mysql-5.1-target-5.1.22
2007-08-23 15:33:05 +02:00
unknown
5825691710 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-08-23 15:20:52 +02:00
unknown
650e06af70 BUG#30134 restore of backup from different endian can work for timestamp column
(recommit for 5.1.22 target)


storage/ndb/tools/restore/Restore.cpp:
  Convert byte order of timestamp data type
2007-08-23 15:17:44 +02:00