Commit graph

62599 commits

Author SHA1 Message Date
Marko Makela
74ae1326c9 Reduce the next-key locking of READ UNCOMMITTED to match that of
READ COMMITTED in the InnoDB Plugin. (Bug #48607)
2010-04-29 15:27:43 +02:00
Ramil Kalimullin
0d5dbb166b Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing
Problem: "COM_FIELD_LIST is an old command of the MySQL server, before there was real move to only
SQL. Seems that the data sent to COM_FIELD_LIST( mysql_list_fields() function) is not
checked for sanity. By sending long data for the table a buffer is overflown, which can
be used deliberately to include code that harms".

Fix: check incoming data length.


sql/sql_parse.cc:
  Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing
    - check incoming mysql_list_fields() table name arg length.
2010-04-29 08:42:32 +04:00
Vasil Dimov
6fa8e485e5 Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Followup to vasil.dimov@oracle.com-20100428102033-dt3caf531rs3lidr :

Add more asserions, which I forgot.
2010-04-28 13:34:52 +03:00
Vasil Dimov
b7ef4f178d Revert the fix of Bug#38996 Race condition in ANALYZE TABLE
This is branches/zip@r6032 in SVN and _is part_ of
revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6113
in BZR.

This is being reverted because now the code is serialized directly on
index->stat_n_diff_key_vals[] as the fix for
Bug#53046 dict_update_statistics_low can still be run concurrently on same table
goes.
2010-04-28 13:32:00 +03:00
Vasil Dimov
330f93bc11 Followup to vasil.dimov@oracle.com-20100428084627-wtrmc66wqvjsdgj7:
Address Marko's suggestions wrt the fix of
Bug#53046 dict_update_statistics_low can still be run concurrently
on same table
2010-04-28 13:20:33 +03:00
Vasil Dimov
2b57b0765d Fix Bug#53046 dict_update_statistics_low can still be run concurrently
on same table

Protect dict_index_t::stat_n_diff_key_vals[] with an array of
mutexes.

Testing: tested all code paths under UNIV_SYNC_DEBUG
for the one in dict_print() one has to enable the InnoDB table monitor:
CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
2010-04-28 11:46:27 +03:00
Marko Makela
91702fd313 Merge r6103 from InnoDB Plugin to the built-in InnoDB to fix Bug #53202:
------------------------------------------------------------------------
  r6103 | marko | 2009-10-26 15:46:18 +0200 (Mon, 26 Oct 2009) | 4 lines
  Changed paths:
     M /branches/zip/row/row0ins.c

  branches/zip: row_ins_alloc_sys_fields(): Zero out the system columns
  DB_TRX_ID, DB_ROLL_PTR and DB_ROW_ID, in order to avoid harmless
  Valgrind warnings about uninitialized data.  (The warnings were
  harmless, because the fields would be initialized at a later stage.)
  ------------------------------------------------------------------------
2010-04-28 08:33:25 +02:00
Vasil Dimov
814ac9a7ac Merge mysql-5.1 -> mysql-5.1-innodb, this merge does not change
any files.
2010-04-27 17:45:30 +03:00
Vasil Dimov
a1bdbe8a0c Do not define UNIV_DEBUG_VALGRIND when HAVE_purify because
this results in some valgrind errors.

Bug#53202 valgrind: uninitialized bytes in dtuple_print()
has been opened to track this.
2010-04-27 17:05:41 +03:00
Marko Mäkelä
c2735351b4 Merge 2010-04-27 16:51:54 +03:00
Marko Mäkelä
a5b4285132 row_merge_drop_temp_indexes(): Remove a bogus char-to-ulint cast. 2010-04-27 16:47:38 +03:00
Vasil Dimov
c5ca0da1e8 Merge 3417..3421 from mysql-5.1-innodb 2010-04-27 09:16:45 +03:00
Vasil Dimov
777c194cda Split the innodb.innodb mysql-test.
Extract part of innodb.innodb into innodb.innodb_misc1

This is needed in order to be able to more easily debug this test,
under valgrind, it is too huge.
2010-04-27 09:09:08 +03:00
Alexey Kopytov
6d43510a42 Backport of the fix for bug #50335 to 5.0.
The problem was in an incorrect debug assertion. The expression
used in the failing assertion states that when finding
references matching ORDER BY expressions, there can be only one
reference to a single table. But that does not make any sense,
all test cases for this bug are valid examples with multiple
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list.

Fixed by removing the failing assertion. We also have to take
care of the 'found' counter so that we count multiple
references only once. We rely on this fact later in
eq_ref_table().

mysql-test/r/join.result:
  Added a test case for bug #50335.
mysql-test/t/join.test:
  Added a test case for bug #50335.
sql/sql_select.cc:
  Removing the assertion in eq_ref_table() as it does not make
  any sense. We also have to take care of the 'found' counter so
  that we count multiple references only once. We rely on this
  fact later in eq_ref_table().
2010-04-27 00:06:00 +04:00
Marko Mäkelä
4d646bd16e lock_rec_queue_validate(): Disable a bogus check that
a transaction that holds a lock on a clustered index record
also holds a lock on the secondary index record.
2010-04-26 16:10:29 +03:00
Marko Mäkelä
30d6298442 recv_sys_init(): Skip the red-black tree in Hot Backup. 2010-04-26 14:26:09 +03:00
Marko Mäkelä
bd4a354c29 Add a test case for Bug #52745. 2010-04-26 14:08:56 +03:00
Marko Mäkelä
507c96aa52 Merge Vasil Dimov 2010-04-26 Bump InnoDB Plugin version number after 1.0.7 2010-04-26 13:52:15 +03:00
Marko Mäkelä
063928ba05 row_search_for_mysql(): Never try semi-consistent read in unique searches.
They are only useful in table scans. (Bug #52663)
2010-04-26 13:27:25 +03:00
Vasil Dimov
f0e0c873e3 Bump InnoDB Plugin version number after 1.0.7 has been released
in MySQL 5.1.46.
2010-04-26 11:35:57 +03:00
Marko Mäkelä
410afeaa0b btr_page_split_and_insert(): Silence a compiler warning
about possibly uninitialized variable insert_left.
2010-04-26 10:39:49 +03:00
Calvin Sun
44bac2ea9c mysql-5.1-innodb: add error codes to innodb_bug51920.test
kill of active connection yields different error code
depending on platform.
2010-04-22 14:16:14 -05:00
Marko Mäkelä
e7c9998119 Correct the definition of DICT_SYS_INDEXES_NAME_FIELD.
When row_merge_drop_temp_indexes() was reworked to drop the indexes
via the data dictionary cache, the code was broken because it would
read the index name from the wrong field.
2010-04-22 12:33:42 +03:00
Marko Mäkelä
c24b497399 btr_page_split_and_insert(): Avoid an infinite loop. (Bug #52964)
btr_page_tuple_smaller(): New function, refactored from
btr_page_split_and_insert().

btr_page_get_split_rec(): Renamed from btr_page_get_sure_split_rec().
Note that a NULL return may mean that the tuple is to be inserted into
either the lower or upper page, to be determined by btr_page_tuple_smaller().

btr_page_split_and_insert(): When btr_page_get_split_rec() returns NULL,
invoke btr_page_tuple_smaller() to determine which half-page the tuple
belongs to.

Reviewed by Sunny Bains
2010-04-21 21:53:59 +03:00
Luis Soares
fbe81e3c97 BUG#52868: Wrong handling of NULL value during update, replication out
of sync

In RBR, sometimes the table->s->last_null_bit_pos can be zero. This
has impact at the slave when it compares records fetched from the
storage engine against records in the binary log event. If
last_null_bit_pos is zero the slave, while comparing in
log_event.cc:record_compare function, would set all bits in the last
null_byte to 1 (assumed all 8 were unused) . Thence it would loose the
ability to distinguish records that were similar in contents except
for the fact that some field was null in one record, but not in the
other. Ultimately this would cause wrong matches, and in the specific
case depicted in the bug report the same record would be updated
twice, resulting in a lost update.

Additionally, in the record_compare function the slave was setting the
X bit unconditionally. There are cases that the X bit does not exist
in the record header. This could also lead to wrong matches between
records.

We fix both by conditionally resetting the bits: (i) unused null_bits
are set if last_null_bit_pos > 0; (ii) X bit is set if
HA_OPTION_PACK_RECORD is in use.

mysql-test/extra/rpl_tests/rpl_record_compare.test:
  Shared part of the test case for MyISAM and InnoDB.
mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test:
  InnoDB test case.
mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test:
  MyISAM test case. Added also coverage for Field_bits case.
sql/log_event.cc:
  Deployed conditional setting of unused bits at record_compare.
sql/log_event_old.cc:
  Same change as in log_event.cc.
2010-04-21 13:47:55 +01:00
Marko Mäkelä
66e1700bed dict_create_index_step(): Be strict about DYNAMIC and COMPRESSED tables.
Bug #50495 is about REDUNDANT and COMPACT tables, after all.
2010-04-21 13:27:23 +03:00
Marko Mäkelä
8c65e887a0 ha_innobase::add_index(): Only check for duplicate indexes
when the data dictionary is locked.
This fixes a UNIV_DEBUG assertion failure in innodb-index.test.
2010-04-21 13:00:29 +03:00
Marko Mäkelä
8c828e3afd dtuple_convert_big_rec(): Store locally any fields whose maximum length
is less than 256 bytes. (Bug #52745)
Add related comments and debug assertions to the "offsets"
functions in rem0rec.c.
Approved by Sunny Bains
2010-04-21 12:50:33 +03:00
Marko Mäkelä
b7a6240c41 Adjust tests for the Bug #50495 fix. 2010-04-21 12:40:32 +03:00
Marko Mäkelä
37062fc62f rec_convert_dtuple_to_rec(): Correct the debug check.
The "extern" accessor functions return zero or nonzero, not 0 or 1.
2010-04-21 12:16:11 +03:00
Marko Mäkelä
1ed5fab27b rec_convert_dtuple_to_rec(): Add a debug check. 2010-04-21 09:39:16 +03:00
Marko Makela
0aba4871c9 btr_cur_optimistic_insert(): Remove unused variable "heap". 2010-04-20 23:15:50 +03:00
Kristofer Pettersson
4859951a90 automerge 2010-04-20 20:19:20 +02:00
Kristofer Pettersson
3a626d1027 Bug#50373 --secure-file-priv=""
Correcting a patch misstake. The converted file path is placed in 'buff' not in opt_secure_file_priv.

mysql-test/r/loaddata.result:
  * Updated test case; Since secure_file_priv now is normalized the previous values are changed.
sql/mysqld.cc:
  * Fixed patch misstake
2010-04-20 16:17:34 +02:00
Marko Makela
bac9559ecf dict_create_index_step(): Invoke dict_index_add_to_cache()
in strict mode only if innodb_strict_mode is set. (Bug #50495)

trx_is_strict(): New function, for checking innodb_strict_mode.
2010-04-20 14:42:22 +03:00
Marko Mäkelä
3b7ff90d7e Implement UNIV_BTR_AVOID_COPY, an optimization of page splits. 2010-04-20 11:29:08 +03:00
Staale Smedseng
8b16a2a55b Bug#51591 deadlock in the plugins+status+variables
Unlocking/locking of LOCK_plugin in ha_ndbcluster.cc not 
needed anymore (but missing from the initial patch).
2010-04-19 15:48:37 +02:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
ca85feba83 Enable UNIV_DEBUG_VALGRIND when HAVE_purify is set. 2010-04-19 13:36:03 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
6f58f36846 Enable innodb_plugin tests based on the presence of lib_innodb_plugin. 2010-04-19 12:44:05 +03:00
Marko =?ISO-8859-1?Q?M=E4kel=E4?=
68fcbba604 Do not require innodb for running innodb_plugin tests. 2010-04-19 12:21:13 +03:00
Kristofer Pettersson
95da93d7ac Automerge 2010-04-16 16:56:16 +02:00
Kristofer Pettersson
794a441317 Bug#50373 --secure-file-priv=""
The server variable opt_secure_file_priv wasn't
normalized properly and caused the operations
LOAD DATA INFILE .. INTO TABLE ..
and
SELECT load_file(..)
to do different interpretations of the 
--secure-file-priv option.

The patch moves code to the server initialization
routines so that the path always is normalized
once and only once.

It was also intended that setting the option
to an empty string should be equal to 
lifting all previously set restrictions. This
is also fixed by this patch.


sql/mysqld.cc:
  * If --secure_file_option is an empty string then the option variable
    should be unset.
  * opt_secure_file_option should be normalized once when the server starts.
sql/sql_load.cc:
  * moved variable normalization code to fix_paths()
2010-04-16 16:10:47 +02:00
Staale Smedseng
9743819d36 Bug#51591 deadlock in the plugins+status+variables
Potential deadlock situation involving LOCK_plugin,
LOCK_global_system_variables and LOCK_status.
      
This patch backports the fix from next-mr, unlocking
LOCK_plugin before calling plugin->init() and
add_status_vars().
2010-04-16 15:02:23 +02:00
Sergey Glukhov
649deaa8a1 Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
Arg_comparator initializes 'comparators' array in case of
ROW comparison and does not free this array on destruction.
It leads to memory leaks.
The fix:
-added Arg_comparator::cleanup() method which frees
 'comparators' array.
-added Item_bool_func2::cleanup() method which calls 
 Arg_comparator::cleanup() method


mysql-test/r/ps.result:
  test case
mysql-test/r/row.result:
  test case
mysql-test/t/ps.test:
  test case
mysql-test/t/row.test:
  test case
sql/item_cmpfunc.h:
  -added Arg_comparator::cleanup() method which frees
   'comparators' array.
  -added Item_bool_func2::cleanup() method which calls 
   Arg_comparator::cleanup() method
2010-04-16 16:42:34 +05:00
Georgi Kodinov
16fadb10b5 Bug #52629: memory leak from sys_var_thd_dbug in binlog.binlog_write_error
When re-setting (SET GLOBAL debug='') the GLOBAL debug settings the 
server was not freeing the data elements from the top (initial) frame 
before setting them to 0 without freeing the underlying memory. As these 
are global settings there's a chance that something is there already.
Fixed by :
1. making sure the allocated data are cleaned up before re-setting them
while parsing a debug string
2. making sure the stuff allocated in the global settings is freed on 
shutdown.
2010-04-16 10:30:53 +03:00
Luis Soares
8fa9a5861b automerge: merged bug clone into latest mysql-5.1-bugteam. 2010-04-16 01:59:21 +01:00
Georgi Kodinov
d066fe78e7 merge 2010-04-15 14:00:07 +03:00
Marko Makela
6c354ffc51 storage/innodb_plugin: Relax too strict assertions about prefix
indexed BLOBs for ROW_FORMAT=DYNAMIC and ROW_FORMAT_COMPRESSED tables
(Bug #52746). In these tables, the locally stored prefix of a BLOB can
be as small as 20 bytes (BTR_EXTERN_FIELD_REF_SIZE). ROW_FORMAT=REDUNDANT
and ROW_FORMAT=COMPACT store a prefix of 768 bytes (REC_MAX_INDEX_COL_LEN).

trx_undo_rec_get_col_val(): Relax the ut_ad() assertion and add a
reference to dtuple_convert_big_rec().

trx_undo_rec_get_partial_row(): Relax the ut_a() assertion that
prompted Bug #52746.
2010-04-15 09:01:22 +02:00
Vasil Dimov
e61722f320 Also send emails to innodb_dev_ww@oracle.com 2010-04-14 23:04:13 +03:00
Vasil Dimov
73812d8558 Change the tree name to mysql-5.1-innodb in .bzr-mysql/default.conf 2010-04-14 23:02:47 +03:00