Commit graph

1369 commits

Author SHA1 Message Date
Sergei Golubchik
c39877071a overlay support for mysql-test-run and mysqltest
mysql-test-run auto-disables all optional plugins.


mysql-test/include/default_client.cnf:
  no @OPT.plugindir anymore
mysql-test/include/default_mysqld.cnf:
  don't disable plugins manually - mtr can do it better
mysql-test/suite/innodb/t/innodb_bug47167.test:
  mtr now uses suite-dir as an include path
mysql-test/suite/innodb/t/innodb_file_format.test:
  mtr now uses suite-dir as an include path
mysql-test/t/partition_binlog.test:
  this test uses partitions
storage/example/mysql-test/mtr/t/source.result:
  update results. as mysqltest includes the correct overlayed include
storage/innobase/handler/ha_innodb.cc:
  the assert is wrong
2012-02-23 07:50:11 +01:00
Michael Widenius
15c5a2686f Merge with MariaDB 5.2 2012-02-21 01:58:50 +02:00
Michael Widenius
ae07ec6cbf Merge with MYSQL 5.1.61
Fixed README with link to source
Merged InnoDB change to XtraDB

README:
  Added information of where to find MariaDB code
storage/archive/ha_archive.cc:
  Removed memset() of rows, a MariaDB checksum's doesn't touch not used data.
2012-02-20 16:23:18 +02:00
Georgi Kodinov
d4c35861e5 merge mysql-5.5->mysql-5.5-security 2012-02-18 10:58:31 +02:00
unknown
abd3c3a9e1 Merge with mysql-5.5 2012-02-17 08:28:28 -06:00
Georgi Kodinov
9f18fc5a06 merged mysql-5.5->mysql-5.5-security 2012-02-17 11:55:36 +02:00
Marko Mäkelä
4ea57c80b2 Merge mysql-5.1 to mysql-5.5. 2012-02-17 11:52:51 +02:00
Georgi Kodinov
387721101c merge mysql-5.1->mysql-5.1-security 2012-02-17 11:52:41 +02:00
Marko Mäkelä
2837fba743 Put back a fix that was reverted when reverting the buggy Bug#12612184 fix in
revision-id inaam.rana@oracle.com-20110930110219-vnpaqghj9hm0grds
(revno 3559).
2012-02-17 09:18:53 +02:00
unknown
971fe347dd Bug#64160, Oracle Bug#13698765
The problem was introduced in 5.5.20 by Bug 13116225.  It tried to
protect against downgrading from a version 5.6.4 database that was
created with a page size other than 16k.  Version 5.6.4 supports
page sizes 4k and 8k and stamps that page size into the header page
of each tablespace file.  Version 5.5.20 attempts to read that page
size in the file header.

But it turns out that only the first system tablespace file has a
reliable flags field in the header. So only ibdata1 can be or needs
to be tested for another page size. Extra system tablespace files
like ibdata2, ibdata3, etc do not and should not be tested since the
flags field is unreliable.
2012-02-16 12:13:08 -06:00
Marko Mäkelä
6ff320e0f6 Merge mysql-5.1 to mysql-5.5. 2012-02-16 12:28:49 +02:00
Marko Mäkelä
4045c9976c Add instrumentation for Bug#13721257 RACE CONDITION IN UPDATES OR INSERTS
OF WIDE RECORDS

row_ins_index_entry_low(), row_upd_clust_rec(): Make a redo log
checkpoint if a DEBUG flag is set. Add DEBUG_SYNC around
btr_store_big_rec_extern_fields().

rb:946 approved by Jimmy Yang
2012-02-16 12:24:11 +02:00
Sunny Bains
ec47cb6034 Merge from mysql-5.1-innodb. 2012-02-10 13:04:10 +11:00
Sergei Golubchik
2682a280c8 allow suite.pm to skip combinations that originate from test/include files.
storage/innobase/handler/handler0alter.cc:
  for NEWDATE key_type says unsigned, thus col->prtype says unsigned,
  but field->flags says signed. Use the same flag for value retrieval
  that was used for value storage.
2012-02-07 16:22:36 +01:00
Georgi Kodinov
91c1c93019 merge mysql-5.5->mysql-5.5-security 2012-02-06 18:26:36 +02:00
Georgi Kodinov
d29ae4918e merged mysql-5.1->mysql-5.1-security 2012-02-06 18:24:51 +02:00
Sergei Golubchik
3f28115e0e 5.3 merge 2012-02-24 14:37:00 +01:00
Vasil Dimov
56e3f68c72 Merge mysql-5.1 -> mysql-5.5
The actual Bug#11754376 does not exist in MySQL 5.5 because at startup
we drop entries for temporary tables from InnoDB dictionary cache (only
if ROW_FORMAT is not REDUNDANT). But nevertheless the bug in
normalize_table_name_low() is present so we fix it.
2012-02-06 13:00:41 +02:00
Vasil Dimov
1c4fd3bb54 Fix Bug#11754376 45976: INNODB LOST FILES FOR TEMPORARY TABLES ON
GRACEFUL SHUTDOWN

During startup mysql picks up .frm files from the tmpdir directory and
tries to drop those tables in the storage engine.

The problem is that when tmpdir ends in / then ha_innobase::delete_table()
is passed a string like "/var/tmp//#sql123", then it wrongly normalizes it
to "/#sql123" and calls row_drop_table_for_mysql() which of course fails
to delete the table entry from the InnoDB dictionary cache.
ha_innobase::delete_table() returns an error but nevertheless mysql wipes
away the .frm file and the entry in the InnoDB dictionary cache remains
orphaned with no easy way to remove it.

The "no easy" way to remove it is to create a similar temporary table again,
copy its .frm file to tmpdir under "#sql123.frm" and restart mysqld with
tmpdir=/var/tmp (no trailing slash) - this way mysql will pick the .frm file
after restart and will try to issue drop table for "/var/tmp/#sql123"
(notice do double slash), ha_innobase::delete_table() will normalize it to
"tmp/#sql123" and row_drop_table_for_mysql() will successfully remove the
table entry from the dictionary cache.

The solution is to fix normalize_table_name_low() to normalize things like
"/var/tmp//table" correctly to "tmp/table".

This patch also adds a test function which invokes
normalize_table_name_low() with various inputs to make sure it works
correctly and a mtr test that calls this test function.

Reviewed by:	Marko (http://bur03.no.oracle.com/rb/r/929/)
2012-02-06 12:44:59 +02:00
Vladislav Vaintroub
24e7faa54f Various fixes for Solaris compiler.
Also, restrict symbol visibility in statically
built plugins, to minimize the chance for symbol 
name clashes with dynamic plugins.
2012-02-03 11:46:40 +01:00
Vladislav Vaintroub
d8751d283c MDEV-100 : innodb_plugin tests fail on Solaris.
The reason for the failure is that the loaded library has the same exported symbols
as the builtin one. So the plugin uses innodb functions e.g srv_boot from mysqld
rather than plugin's own. This causes the crash.

On Unix systems with gcc4 later this error was so far worked around using GCC's
visibility attribute. However, in our case, we're using gcc3.

See related MySQL bug http://bugs.mysql.com/bug.php?id=48524 and
http://bugs.mysql.com/bug.php?id=52263

The fix is to restrict symbol visibility in the plugin using version script 
(called map file on Solaris).
2012-02-02 21:12:49 +01:00
Marko Mäkelä
1fbbacfea5 ha_innobase::records_in_range(): Remove a debug assertion
that prohibits an open range (full table).
This assertion catches unnecessary calls to this method, but such calls
are not harming correctness.
2012-02-02 13:54:27 +02:00
Marko Mäkelä
567a422cf9 Merge mysql-5.1 to mysql-5.5. 2012-02-02 13:50:54 +02:00
Marko Mäkelä
39100cd984 Bug #13651627 Move ut_ad(0) from the beginning to the end of buf_page_print(),
print page dump

buf_page_print(): Remove the ut_ad(0) from the beginning. Add two flags
(enum buf_page_print_flags) that can be bitwise-ORed together:

BUF_PAGE_PRINT_NO_CRASH:
  Do not crash debug builds at the end of buf_page_print().
BUF_PAGE_PRINT_NO_FULL:
  Do not print the full page dump. This can be useful when adding
  diagnostic printout to flushing or to the doublewrite buffer.

trx_sys_doublewrite_init_or_restore_page(): Replace exit(1) with ut_error,
so that we can get a core dump if this extraordinary condition happens.

rb:924 approved by Sunny Bains
2012-02-02 12:31:57 +02:00
Inaam Rana
43108b2c2b bug#13636122: mysql-5.1 => mysql-5.5 2012-01-31 09:50:17 -05:00
Inaam Rana
63769afc52 Bug#13636122 THE ORIGINAL TABLE MISSING WHILE EXECUTE THE DDL 'ALTER TABLE ADD COLUMN
rb://914
approved by: Marko Makela

Poll in fil_rename_tablespace() after setting ::stop_ios flag can
result in a hang because the other thread actually dispatching the IO
won't wake IO helper threads or flush the tablespace before starting
wait in fil_mutex_enter_and_prepare_for_io().
2012-01-31 09:31:31 -05:00
Inaam Rana
40bab62acf Bug#11836233 MISLEADING SUGGESTION REGARDING LINUX NATIVE AIO IN INNODB
ERROR LOG

Fixed error meesage
2012-01-30 09:24:09 -05:00
Yasufumi Kinoshita
636a7f79e8 Fix for build break introduced at rev 3711
asked by Calvin
2012-01-27 13:07:24 +09:00
Jorgen Loland
705a65e901 BUG 13413535 followup: Fix gcc warning
storage/innobase/ibuf/ibuf0ibuf.c:
  Cast to avoid gcc warning
2012-01-26 13:30:11 +01:00
Marko Mäkelä
d84c95579b Bug #13413535 61104: INNODB: FAILING ASSERTION: PAGE_GET_N_RECS(PAGE) > 1
This fix does not remove the underlying cause of the assertion
failure. It just works around the problem, allowing a corrupted
secondary index to be fixed by DROP INDEX and CREATE INDEX (or in the
worst case, by re-creating the table).

ibuf_delete(): If the record to be purged is the last one in the page
or it is not delete-marked, refuse to purge it. Instead, write an
error message to the error log and let a debug assertion fail.

ibuf_set_del_mark(): If the record to be delete-marked is not found,
display some more information in the error log and let a debug
assertion fail.

row_undo_mod_del_unmark_sec_and_undo_update(),
row_upd_sec_index_entry(): Let a debug assertion fail when the record
to be delete-marked is not found.

buf_page_print(): Add ut_ad(0) so that corruption will be more
prominent in stress testing with debug binaries. Add ut_ad(0) here and
there where corruption is noticed.

btr_corruption_report(): Display some data on page_is_comp() mismatch.

btr_assert_not_corrupted(): A wrapper around btr_corruption_report().
Assert that page_is_comp() agrees with the table flags.

rb:911 approved by Inaam Rana
2012-01-26 13:24:00 +02:00
Vladislav Vaintroub
7ffa6f4d06 Always define UT_DBG_ABORT in innodb/xtradb, also on Windows. This will avoid endless hangs inside ut_dgb_stop_thread 2012-01-25 21:23:14 +01:00
Marko Mäkelä
82fec153b7 Merge mysql-5.1 to mysql-5.5. 2012-01-25 10:18:14 +02:00
Marko Mäkelä
a5d2554db0 btr_cur_search_to_nth_level(): Add a debug assertion
and some Valgrind instrumentation.
2012-01-25 10:15:27 +02:00
Inaam Rana
9cb16ec55b Bug#13612811 VALGRIND ERROR IN OS_AIO_INIT
Fix valgrind warning introduced by fix for bug 11765450.
2012-01-20 10:47:01 -05:00
Inaam Rana
efddb7acb9 Bug#11765450 58421: INNODB TEMPORARY TABLE CRASH WHEN TMPDIR ON LINUX TMPFS
rb://898
approved by: Marko Makela

On some kernel versions native aio operations are not supported on
tmpfs. Check this during start up and fall back to simulated aio.
2012-01-19 09:10:30 -05:00
Sergei Golubchik
baca1a40e9 enable test cases for bugs fixed in xtradb.
disable test cases for bugs not fixed in xtradb.

mysql-test/suite/innodb/t/innodb-lock.test:
  instead of disabling the test in disabled.def
  (hoping that somebody someday will enable it),
  skip it only for xtradb (not for innodb), and
  only for the current xtradb version. the test
  will enable itself automatically on the next
  xtradb merge
mysql-test/suite/innodb/t/innodb_cmp_drop_table.test:
  instead of disabling the test in disabled.def
  (hoping that somebody someday will enable it),
  skip it only for xtradb (not for innodb), and
  only for the current xtradb version. the test
  will enable itself automatically on the next
  xtradb merge
mysql-test/suite/innodb/t/innodb_corrupt_bit.test:
  fix the error number
storage/innobase/handler/ha_innodb.cc:
  fix the error number
storage/xtradb/handler/ha_innodb.cc:
  fix the error number
2012-01-16 21:02:43 +01:00
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Marko Mäkelä
ae3962d142 Merge mysql-5.1 to mysql-5.5. 2012-01-16 14:26:42 +02:00
Marko Mäkelä
97e83eae2d Bug#13496818 ASSERTION: REC_PAGE_NO > 4 IN IBUF CONTRACTION
Relax a bogus debug assertion.
Approved by Jimmy Yang on IM.
2012-01-16 14:22:03 +02:00
Marko Mäkelä
b9692a96be Merge mysql-5.1 to mysql-5.5. 2012-01-16 09:58:02 +02:00
Annamalai Gurusami
d9aeddf76a Merging from mysql-5.1 to mysql-5.5. 2012-01-16 10:30:51 +05:30
Annamalai Gurusami
020f3914a2 Bug #11765438 58406:
ISSUES WITH COPYING PARTITIONED INNODB TABLES FROM LINUX TO WINDOWS

This problem was already fixed in mysql-trunk as part of bug #11755924.  I am 
backporting the fix to mysql-5.1.
2012-01-16 09:58:31 +05:30
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Georgi Kodinov
b8cbc736d0 weave merge mysql-5.5->mysql-5.5-security 2012-01-12 16:44:37 +02:00
Georgi Kodinov
8aa1e57941 weave merge mysql-5.1->mysql-5.1-security 2012-01-12 16:42:23 +02:00
Yasufumi Kinoshita
ad6a4986eb Bug#12400341 INNODB CAN LEAVE ORPHAN IBD FILES AROUND
If we meet DB_TOO_MANY_CONCURRENT_TRXS during the execution tab_create_graph from row_create_table_for_mysql(), .ibd file for the table should be created already but was not deleted for the error handling.

rb:875 approved by Jimmy Yang
2012-01-10 14:23:20 +09:00
Yasufumi Kinoshita
115f5e8551 Bug#12400341 INNODB CAN LEAVE ORPHAN IBD FILES AROUND
If we meet DB_TOO_MANY_CONCURRENT_TRXS during the execution tab_create_graph from row_create_table_for_mysql(), .ibd file for the table should be created already but was not deleted for the error handling.

rb:875 approved by Jimmy Yang
2012-01-10 14:18:58 +09:00
Vasil Dimov
cb80ad09da Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205083046-jtgi1emlvtfnjatt from mysql-trunk
2011-12-29 16:19:33 +02:00
Vasil Dimov
a4fa485f5f Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205082900-lx9om1joscejr25e from mysql-trunk
2011-12-29 16:14:45 +02:00
Vasil Dimov
93ab1d547d Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205082831-7v1qu50hvd9hjr3g from mysql-trunk
2011-12-29 16:12:55 +02:00
Vasil Dimov
b7b9a4e810 Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205082756-wtlg8isyn4yohyny from mysql-trunk
2011-12-29 16:11:07 +02:00
Vasil Dimov
841e8ddbc5 Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205082626-87j5f48dq1ouk86r from mysql-trunk
2011-12-29 16:05:08 +02:00
Marko Mäkelä
1b6cb0128a Merge mysql-5.1 to mysql-5.5. 2011-12-28 12:31:18 +02:00
Marko Mäkelä
e498a1bf65 Bug#13418934 REMOVE HAVE_PURIFY DEPENDENCES FROM INNODB
InnoDB: Remove HAVE_purify, UNIV_INIT_MEM_TO_ZERO, UNIV_SET_MEM_TO_ZERO.

The compile-time setting HAVE_purify can mask potential bugs.
It is being set in PB2 Valgrind runs. We should simply get rid of it,
and replace it with UNIV_MEM_INVALID() to declare uninitialized memory
as such in Valgrind-instrumented binaries.

os_mem_alloc_large(), ut_malloc_low(): Remove the parameter set_to_zero.

ut_malloc(): Define as a macro that invokes ut_malloc_low().

buf_pool_init(): Never initialize the buffer pool frames. All pages
must be initialized before flushing them to disk.

mem_heap_alloc(): Never initialize the allocated memory block.

os_mem_alloc_nocache(), ut_test_malloc(): Unused function, remove.

rb:813 approved by Jimmy Yang
2011-12-28 12:19:30 +02:00
Vasil Dimov
dfc75197f9 Merge mysql-5.1-security -> mysql-5.5-security 2011-12-22 13:05:33 +02:00
Vasil Dimov
86505c3c54 Fix Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD.
CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB;
INSERT INTO bug13510739 VALUES (1), (2), (3), (4);
DELETE FROM bug13510739 WHERE c=2;
HANDLER bug13510739 OPEN;
HANDLER bug13510739 READ `primary` = (2);
HANDLER bug13510739 READ `primary` NEXT;  <-- crash

The bug is that in the particular testcase row_search_for_mysql() picked up
a delete-marked record and quit, leaving the cursor non-positioned state and
on the subsequent 'get next' call the code crashed because of the
non-positioned cursor.

In row0sel.cc (line numbers from mysql-trunk):

4653         if (rec_get_deleted_flag(rec, comp)) {
...
4679                 if (index == clust_index && unique_search) {
4680 
4681                         err = DB_RECORD_NOT_FOUND;
4682                         
4683                         goto normal_return;
4684                 }       

it quit from here, not storing the cursor position.

In contrast, if the record=2 is not found at all (e.g. sleep(1) after DELETE
to let the purge wipe it away completely) then 'get = 2' does find record=3
and quits from here:

4366                 if (0 != cmp_dtuple_rec(search_tuple, rec, offsets)) {
...
4394                         btr_pcur_store_position(pcur, &mtr);
4395 
4396                         err = DB_RECORD_NOT_FOUND;
4397 #if 0
4398                         ut_print_name(stderr, trx, FALSE, index->name);
4399                         fputs(" record not found 3\n", stderr);
4400 #endif
4401 
4402                         goto normal_return;

Another fix could be to extend the condition on line 4366 to hold only if
seach_tuple matches rec AND if rec is not delete marked.

Notice that in the above test case if we wait about 1 second somewhere after
DELETE and before 'get = 2', then the testcase does not crash and returns 4
instead. Not sure if this is the correct behavior, but this bugfix removes
the crash and makes the code return what it also returns in the non-crashing
case (if rec=2 is not found during 'get = 2', e.g. we have sleep(1) there).

Approved by:	Marko (http://bur03.no.oracle.com/rb/r/863/)
2011-12-22 12:55:44 +02:00
Inaam Rana
c225712f41 merge from mysql-5.1 2011-12-21 21:40:35 -05:00
Inaam Rana
3953b48971 Bug#11866367 FPE WHEN SETTING INNODB_SPIN_WAIT_DELAY
rb://865
approved by: Jimmy

Integer overflow causes division by zero.
2011-12-21 21:33:13 -05:00
Annamalai Gurusami
76383243b2 Merging from mysql-5.1 to mysql-5.5. 2011-12-13 17:10:09 +05:30
Annamalai Gurusami
ad84fb5c37 Bug #13117023: Innodb increments handler_read_key when it should not
The counter handler_read_key (SSV::ha_read_key_count) is incremented 
incorrectly.

The mysql server maintains a per thread system_status_var (SSV)
object.  This object contains among other things the counter
SSV::ha_read_key_count. The purpose of this counter is to measure the
number of requests to read a row based on a key (or the number of
index lookups).

This counter was wrongly incremented in the
ha_innobase::innobase_get_index(). The fix removes
this increment statement (for both innodb and innodb_plugin).

The various callers of the innobase_get_index() was checked to
determine if anybody must increment this counter (if they first call
innobase_get_index() and then perform an index lookup).  It was found
that no caller of innobase_get_index() needs to worry about the
SSV::ha_read_key_count counter.
2011-12-13 14:26:12 +05:30
Marko Mäkelä
091a2e3b0b Merge mysql-5.1 to mysql-5.5. 2011-12-12 13:53:18 +02:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
unknown
7532976dd9 Bug #13116225 LIVE DOWNGRADE CRASHES WITH INNODB_PAGE_SIZE=4K
This bug ensures that a live downgrade from an InnoDB 5.6 with WL5756 and
a database created with innodb-page-size=8k or 4k will make a version 5.5
installation politely refuse to start. Instead of crashing or giving some
indication about a corrupted database, it will indicate the page size
difference. 

This patch takes only that part of the Wl5756 patch that is needed to
protect against opening a tablespace that is stamped with a different
page size.

It also contains the change in dict_index_find_on_id_low() just in case
a database with another page size is created by recompiling a pre-WL5756
InnoDB.
2011-12-08 13:32:19 -06:00
Jimmy Yang
8bb893f5c3 Fix Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
WITH FOREIGN KEY CONSTRAI

rb://844 approved by marko
2011-12-07 18:44:52 -08:00
Inaam Rana
358a31df43 Bug#11759044 - 51325: DROPPING AN EMPTY INNODB TABLE TAKES A LONG TIME
WITH LARGE BUFFER POOL

(Note: this a backport of revno:3472 from mysql-trunk)

rb://845
approved by: Marko

  When dropping a table (with an .ibd file i.e.: with
  innodb_file_per_table set) we scan entire LRU to invalidate pages from
  that table. This can be painful in case of large buffer pools as we hold
  the buf_pool->mutex for the scan. Note that gravity of the problem does
  not depend on the size of the table. Even with an empty table but a
  large and filled up buffer pool we'll end up scanning a very long LRU
  list.
  
  The fix is to scan flush_list and just remove the blocks belonging to
  the table from the flush_list, marking them as non-dirty. The blocks
  are left in the LRU list for eventual eviction due to aging. The
  flush_list is typically much smaller than the LRU list but for cases
  where it is very long we have the solution of releasing the
  buf_pool->mutex after scanning 1K pages.
  
  buf_page_[set|unset]_sticky(): Use new IO-state BUF_IO_PIN to ensure
  that a block stays in the flush_list and LRU list when we release
  buf_pool->mutex. Previously we have been abusing BUF_IO_READ to achieve
  this.
2011-12-07 09:12:53 -05:00
Inaam Rana
8e6d41e278 merge from mysql-5.1 2011-12-01 09:47:12 -05:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Vasil Dimov
de479ab3b6 Followup to vasil.dimov@oracle.com-20111118115710-1xlezv0nbjz6s2ps
Fix merge issues after discussing with Marko.
2011-11-21 15:26:24 +02:00
Marko Mäkelä
7a48b3df7f Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER() - cleanup
Remove btr_cur_t::ibuf_cnt. The only dependence on cursor->ibuf_cnt
was ibuf_set_entry_counter(). That code path was removed in the
original bug fix (marko.makela@oracle.com-20111107072802-dgwagejlpub0rjkd).

rb:819 approved by Jimmy Yang
2011-11-22 13:14:55 +02:00
Jimmy Yang
5f3d3cdbf5 Fix Bug #13405367 - 60212 SERVER CRASH WITH CORRUPT FETCH BUFFER
rb://608 approved by Sunny Bains
2011-11-20 18:21:20 -08:00
Inaam Rana
a8e291cca8 merge bug#13390506 from mysql-5.1 2011-11-18 11:20:17 -05:00
Vasil Dimov
63e381e98d Merge mysql-5.1 -> mysql-5.5
I manually checked that all the conflicting InnoDB changes are in 5.5 already.
Two things I am not sure about - I commented them with XXX in this patch.
I will further check with the authors of the changesets whether these things
should be present or not.
2011-11-18 13:57:10 +02:00
unknown
93773656e8 Merge from mysql-5.5.18-release 2011-11-17 09:00:58 +01:00
Karen Langford
e1df69f75a Merge from mysql-5.1.60-release 2011-11-17 00:26:16 +01:00
Marko Mäkelä
1f746cb03c Merge mysql-5.1 to mysql-5.5. 2011-11-10 13:08:42 +02:00
Marko Mäkelä
a0a51251e4 Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
a.k.a. Bug#7975 deadlock without any locking, simple select and update

Bug#7975 was reintroduced when the storage engine API was made
pluggable in MySQL 5.1. Instead of looking at thd->lex directly, we
rely on handler::extra(). But, we were looking at the wrong extra()
flag, and we were ignoring the TRX_DUP_REPLACE flag in places where we
should obey it.

innodb_replace.test: Add tests for hopefully all affected statement
types, so that bug should never ever resurface. This kind of tests
should have been added when fixing Bug#7975 in MySQL 5.0.3 in the
first place.

rb:806 approved by Sunny Bains
2011-11-10 12:49:31 +02:00
Marko Mäkelä
0dc19044ec Merge mysql-5.1 to mysql-5.5. 2011-11-08 14:30:58 +02:00
Marko Mäkelä
941a6640aa Replace void pointer arithmetics with byte pointer arithmetics. 2011-11-08 08:54:52 +02:00
Marko Mäkelä
19b9de6bd5 Merge mysql-5.1 to mysql-5.5. 2011-11-07 13:51:11 +02:00
Marko Mäkelä
b003b6294c Add debug assertions to catch Bug#13345378 earlier.
In all callers of row_sel_convert_mysql_key_to_innobase(), assert
that the converted key is empty or nonempty when it should be.
2011-11-07 13:37:19 +02:00
Marko Mäkelä
6852a32642 Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER()
ibuf_insert_low(), the only caller of ibuf_set_entry_counter(), will
have latched an insert buffer bitmap page in bitmap_mtr before
invoking ibuf_set_entry_counter(). The latching order forbids any
further pages to be latched.

ibuf_set_entry_counter(): Renamed to ibuf_get_entry_counter(),
simplified the code and added comments.

Added the following symbols for predefined field numbers in change
buffer records:

#define IBUF_REC_FIELD_SPACE	0	/*!< in the pre-4.1 format,
					the page number. later, the space_id */
#define IBUF_REC_FIELD_MARKER	1	/*!< starting with 4.1, a marker
					consisting of 1 byte that is 0 */
#define IBUF_REC_FIELD_PAGE	2	/*!< starting with 4.1, the
					page number */
#define IBUF_REC_FIELD_METADATA	3	/* the metadata field */
#define IBUF_REC_FIELD_USER	4	/* first user field */

rb:802 approved by Sunny Bains
2011-11-07 09:28:02 +02:00
Sergei Golubchik
6edd76785c merge 2011-11-03 23:39:53 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Jimmy Yang
d0250efa7c Fix Bug #12941439 - WITH UNIV_SYNC_DEBUG, PERF SCHEMA, INITIALIZATION
OF 16G BUFFER POOL TAKES HOURS

rb://787 approved by Sunny
2011-11-03 04:07:00 -07:00
Marko Mäkelä
bd71cfc4fa Merge mysql-5.1 to mysql-5.5. 2011-10-27 15:23:58 +03:00
Jimmy Yang
93da33309f Fix Bug #11835889 - INNODB ASSERTS ON BAD FILE READ, INDEX TRANSLATION
TABLE ERROR, RECOVERY
            
rb://792 approved by Sunny Bains
2011-10-27 00:40:53 -07:00
Marko Mäkelä
2c67d5066d Revert revno:3452.71.32 (Bug#12612184 fix).
Bug#12612184 RACE CONDITION AFTER BTR_CUR_PESSIMISTIC_UPDATE()

The fix introduced potentially more severe crash recovery problems
than the bug causes. Revert the fix for now.
2011-10-26 12:23:57 +03:00
Marko Mäkelä
91b5e9352a Revert most of revno 3560.9.1 (Bug#12704861)
This was an attempt to address problems with the Bug#12612184 fix.
Even with this follow-up fix, crash recovery can be broken.
Let us fix the bug later.
2011-10-26 11:44:28 +03:00
Marko Mäkelä
7ef002e949 Merge mysql-5.1-security to mysql-5.5-security. 2011-10-25 18:06:05 +03:00
Marko Mäkelä
013ba71dfd Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
In the ON UPDATE CASCADE clause of FOREIGN KEY constraints, the
calculated update vector was not fully initialized. This bug was
introduced in the InnoDB Plugin when implementing support for
ROW_FORMAT=DYNAMIC.

Additionally, the data type information was not initialized, but
apparently it has never been needed in this case.  Nevertheless, it is
not good programming practice to pass uninitialized values around.

calc_row_difference(): Declare the update field uninitialized in
Valgrind. Copy the data type information as well, except when the
field is SQL NULL. In the built-in InnoDB, initialize
ufield->extern_storage = FALSE (an initialization bug that had gone
unnoticed this far). The InnoDB Plugin and later have this flag to
dfield_t and have always initialized it properly.

row_ins_cascade_calc_update_vec(): Reduce the scope of some
pointers. Initialize orig_len. (This caused the bug in InnoDB Plugin
and later.)

row_ins_foreign_check_on_constraint(): Simplify a condition. Declare
the update vector uninitialized.

rb:771 approved by Jimmy Yang
2011-10-25 17:33:38 +03:00
Sergei Golubchik
7714adaef8 build on windows 2011-11-02 12:26:30 +01:00
Marko Mäkelä
f6064041d2 Merge mysql-5.1 to mysql-5.5. 2011-10-21 06:54:49 +03:00
Marko Mäkelä
8a0be8a541 Bug#13116045 Compilation failure using GCC 4.6.1 in btr/btr0cur.c
btr_record_not_null_field_in_rec(): Remove the parameter rec.
Use rec_offs_nth_sql_null() instead of rec_get_nth_field().

rb:788 approved by Jimmy Yang
2011-10-21 06:32:16 +03: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
Marko Mäkelä
5dc19b9ce1 Merge mysql-5.1 to mysql-5.5. 2011-10-12 09:21:33 +03:00
Sergei Golubchik
ae63300801 merge 2011-10-11 12:55:42 +02:00
Marko Mäkelä
99b36fe613 Merge mysql-5.1 to mysql-5.5. 2011-10-05 12:07:38 +03:00
Marko Mäkelä
16c919527f Add InnoDB UNIV_SYNC_DEBUG assertions to rw-lock code.
rw_lock_x_lock_func(): Assert that the thread is not already holding
the lock in a conflicting mode (RW_LOCK_SHARED).

rw_lock_s_lock_func(): Assert that the thread is not already holding
the lock in a conflicting mode (RW_LOCK_EX).
2011-10-05 12:01:47 +03:00
unknown
8ea807c6bb Merge from mysql-5.1 to mysql-5.5 2011-10-04 10:10:14 -05:00
unknown
c6d47e6e01 Bug#12980094 and Bug#13034534
Bug 12980094 - ASSERTION IN INNODB DETECTED IN RQG_PARTITION_DDL
Bug 13034534 - RQG TESTS FAIL ON WINDOWS WITH CRASH NEAR RW_LOCK_DEBUG_PRINT

All access to struct rw_lock_debug_struct must be protected by rw_lock_debug_mutex_enter().
2011-10-04 09:21:47 -05:00
Sergei Golubchik
45ee26699e remove redundant declarations 2011-10-04 15:01:26 +02:00
Inaam Rana
c95fdd936e Revert original fix for Bug 12612184 and the follow up fix for
Bug 12704861.

Bug 12704861 fix was revno: 3504.1.1 (rb://693)
Bug 12612184 fix was revno: 3445.1.10 (rb://678)
2011-09-30 07:02:19 -04:00
Marko Mäkelä
cbde5cb883 Merge mysql-5.1 to mysql-5.5. 2011-09-26 10:08:42 +03:00
Marko Mäkelä
7f729cfac4 Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
Replace part of the patch that Kevin apparently forgot to push.
Fix the bug also in the built-in InnoDB of MySQL 5.1.

I cannot explain why the test case was not failing without the
full patch.

This was rb:762, approved by me.
2011-09-22 13:35:02 +03:00
Daniel Fischer
7450044eb7 merge from 5.5.16 2011-09-21 12:40:41 +02:00
unknown
d27d267ee7 Bug 12963823 - Crash in Purge thread under unusual circumstances.
The problem occurred when indexes are added between the time that an
UNDO record is created and the time that the purge thread comes around
and deletes the old secondary index entries.  The purge thread would
hit an assert when trying to build a secondary index entry for
searching.  The problem was that the old value of those fields were not
in the UNDO record since they were not part of an index when the UPDATE
occured. 
A test case was added to innodb-index.test.
2011-09-20 18:17:36 -06:00
unknown
40761a9a73 Merge from mysql-5.1.59-release 2011-09-15 18:48:54 +02:00
Marko Mäkelä
3d6fc1711c Merge mysql-5.1 to mysql-5.5. 2011-09-14 15:44:34 +03:00
Vasil Dimov
3c18c37066 Merge mysql-5.1 -> mysql-5.5 2011-09-13 17:23:02 +03:00
Marko Mäkelä
3312a023b1 Merge mysql-5.1 to mysql-5.5. 2011-09-13 09:21:39 +03:00
Marko Mäkelä
3436169892 Hopefully final fix of Bug#11766591 59733: Possible deadlock
when buffered changes are to be discarded

ibuf_add_free_page(): Lower the latching order of the newly allocated page
to SYNC_IBUF_TREE_NODE_NEW after latching the insert buffer tree root.

This bug always was bogus UNIV_SYNC_DEBUG alarm. The function
buf_block_dbg_add_level() is a no-op unless UNIV_SYNC_DEBUG is defined.
2011-09-13 09:18:34 +03:00
Marko Mäkelä
3819529d01 Merge mysql-5.1 to mysql-5.5. 2011-09-12 10:25:17 +03:00
Vasil Dimov
fa60b162c2 Merge mysql-5.1 -> mysql-5.5 2011-09-09 10:12:54 +03:00
Marko Mäkelä
109185f1ef Merge mysql-5.1 to mysql-5.5. 2011-09-08 16:25:45 +03:00
Marko Mäkelä
132f023b08 Bug#11766591 59733: POSSIBLE DEADLOCK WHEN BUFFERED CHANGES ARE DISCARDED
Tweak the faulty UNIV_SYNC_DEBUG diagnostics a little bit more.

ibuf_add_free_page(): Lower the latching order of the newly allocated page
only after acquiring the ibuf_mutex.
2011-09-08 15:54:15 +03:00
Jimmy Yang
d1a80e6ad7 Fix Bug #12885783 - BLOCK LOADING TABLE WITH LARGE COLLATION NUMBER
FROM 5.6 SERVER

rb://747 approved by Marko
2011-09-07 21:42:14 -07:00
Vasil Dimov
f8d8832d69 Merge mysql-5.1 -> mysql-5.5 2011-09-07 18:24:18 +03:00
Marko Mäkelä
006a6dc3cc Bug#11766305 - 59392: Remove thr0loc.c and ibuf_inside() - cleanup
Remove the unused debug constants for the latching order level SYNC_THR_LOCAL.
2011-09-06 10:18:03 +03:00
Marko Mäkelä
9aeb3309af Merge mysql-5.1 to mysql-5.5. 2011-09-06 10:14:45 +03:00
Marko Mäkelä
247ada63af Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
This fix was accidentally pushed to mysql-5.1 after the 5.1.59 clone-off in
bzr revision id marko.makela@oracle.com-20110829081642-z0w992a0mrc62s6w
with the fix of Bug#12704861 Corruption after a crash during BLOB update
but not merged to mysql-5.5 and upwards.

In the Barracuda formats, the clustered index record no longer
contains a prefix of off-page columns. Because of this, the undo log
must contain these prefixes, so that purge and multi-versioning will
continue to work. However, this also means that an undo log record can
become too big to fit in an undo log page. (It is a limitation of the
undo log that undo records cannot span across multiple pages.)

In case the checks for undo log size fail when CREATE TABLE or CREATE
INDEX is executed, we need a fallback that blocks a modification
operation when the undo log record would exceed the maximum size.

trx_undo_free_last_page_func(): Renamed from trx_undo_free_page_in_rollback().
Define the trx_t parameter only in debug builds.

trx_undo_free_last_page(): Wrapper for trx_undo_free_last_page_func().
Pass the trx_t parameter only in debug builds.

trx_undo_truncate_end_func(): Renamed from trx_undo_truncate_end().
Define the trx_t parameter only in debug builds. Rewrite a for(;;) loop
as a while loop for clarity.

trx_undo_truncate_end(): Wrapper for from trx_undo_truncate_end_func().
Pass the trx_t parameter only in debug builds.

trx_undo_erase_page_end(): Return TRUE if the page was non-empty
to begin with. Refuse to erase empty pages.

trx_undo_report_row_operation(): If the page for which the undo log
was too big was empty, free the undo page and return DB_TOO_BIG_RECORD.

rb:749 approved by Inaam Rana
2011-09-01 21:48:04 +03:00
Jimmy Yang
07770e7e8e Fix Bug 12922077 - SEGV IN DICT_SET_CORRUPTED_INDEX_CACHE_ONLY(), DROP TABLE
rb://752 approved by Sunny Bains
2011-08-29 02:44:28 -07:00
Marko Mäkelä
7295f6ea52 Merge mysql-5.5 to working copy. 2011-08-29 11:55:38 +03:00
Jimmy Yang
d7264adc8a Fix Bug #12882177 - INSTRUMENTATION IN PFS_MUTEX_ENTER_NOWAIT_FUNC IS INCORRECT
Use PSI_MUTEX_TRYLOCK instead of PSI_MUTEX_LOCK when acquire mutex with
"no_wait" option
      
Approved by Sunny Bains
2011-08-29 01:29:57 -07:00
Marko Mäkelä
7c20cd1b5d Merge mysql-5.1 to mysql-5.5. 2011-08-29 11:22:43 +03:00
Marko Mäkelä
41f229cd9e Bug#12704861 Corruption after a crash during BLOB update
The fix of Bug#12612184 broke crash recovery. When a record that
contains off-page columns (BLOBs) is updated, we must first write redo
log about the BLOB page writes, and only after that write the redo log
about the B-tree changes. The buggy fix would log the B-tree changes
first, meaning that after recovery, we could end up having a record
that contains a null BLOB pointer.

Because we will be redo logging the writes off the off-page columns
before the B-tree changes, we must make sure that the pages chosen for
the off-page columns are free both before and after the B-tree
changes. In this way, the worst thing that can happen in crash
recovery is that the BLOBs are written to free pages, but the B-tree
changes are not applied. The BLOB pages would correctly remain free in
this case. To achieve this, we must allocate the BLOB pages in the
mini-transaction of the B-tree operation. A further quirk is that BLOB
pages are allocated from the same file segment as leaf pages. Because
of this, we must temporarily "hide" any leaf pages that were freed
during the B-tree operation by "fake allocating" them prior to writing
the BLOBs, and freeing them again before the mtr_commit() of the
B-tree operation, in btr_mark_freed_leaves().

btr_cur_mtr_commit_and_start(): Remove this faulty function that was
introduced in the Bug#12612184 fix. The problem that this function was
trying to address was that when we did mtr_commit() the BLOB writes
before the mtr_commit() of the update, the new BLOB pages could have
overwritten clustered index B-tree leaf pages that were freed during
the update. If recovery applied the redo log of the BLOB writes but
did not see the log of the record update, the index tree would be
corrupted. The correct solution is to make the freed clustered index
pages unavailable to the BLOB allocation. This function is also a
likely culprit of InnoDB hangs that were observed when testing the
Bug#12612184 fix.

btr_mark_freed_leaves(): Mark all freed clustered index leaf pages of
a mini-transaction allocated (nonfree=TRUE) before storing the BLOBs,
or freed (nonfree=FALSE) before committing the mini-transaction.

btr_freed_leaves_validate(): A debug function for checking that all
clustered index leaf pages that have been marked free in the
mini-transaction are consistent (have not been zeroed out).

btr_page_alloc_low(): Refactored from btr_page_alloc(). Return the
number of the allocated page, or FIL_NULL if out of space. Add the
parameter "mtr_t* init_mtr" for specifying the mini-transaction where
the page should be initialized, or if this is a "fake allocation"
(init_mtr=NULL) by btr_mark_freed_leaves(nonfree=TRUE).

btr_page_alloc(): Add the parameter init_mtr, allowing the page to be
initialized and X-latched in a different mini-transaction than the one
that is used for the allocation. Invoke btr_page_alloc_low(). If a
clustered index leaf page was previously freed in mtr, remove it from
the memo of previously freed pages.

btr_page_free(): Assert that the page is a B-tree page and it has been
X-latched by the mini-transaction. If the freed page was a leaf page
of a clustered index, link it by a MTR_MEMO_FREE_CLUST_LEAF marker to
the mini-transaction.

btr_store_big_rec_extern_fields_func(): Add the parameter alloc_mtr,
which is NULL (old behaviour in inserts) and the same as local_mtr in
updates. If alloc_mtr!=NULL, the BLOB pages will be allocated from it
instead of the mini-transaction that is used for writing the BLOBs.

fsp_alloc_from_free_frag(): Refactored from
fsp_alloc_free_page(). Allocate the specified page from a partially
free extent.

fseg_alloc_free_page_low(), fseg_alloc_free_page_general(): Add the
parameter "mtr_t* init_mtr" for specifying the mini-transaction where
the page should be initialized, or NULL if this is a "fake allocation"
that prevents the reuse of a previously freed B-tree page for BLOB
storage. If init_mtr==NULL, try harder to reallocate the specified page
and assert that it succeeded.

fsp_alloc_free_page(): Add the parameter "mtr_t* init_mtr" for
specifying the mini-transaction where the page should be initialized.
Do not allow init_mtr == NULL, because this function is never to be
used for "fake allocations".

mtr_t: Add the operation MTR_MEMO_FREE_CLUST_LEAF and the flag
mtr->freed_clust_leaf for quickly determining if any
MTR_MEMO_FREE_CLUST_LEAF operations have been posted.

row_ins_index_entry_low(): When columns are being made off-page in
insert-by-update, invoke btr_mark_freed_leaves(nonfree=TRUE) and pass
the mini-transaction as the alloc_mtr to
btr_store_big_rec_extern_fields(). Finally, invoke
btr_mark_freed_leaves(nonfree=FALSE) to avoid leaking pages.

row_build(): Correct a comment, and add a debug assertion that a
record that contains NULL BLOB pointers must be a fresh insert.

row_upd_clust_rec(): When columns are being moved off-page, invoke
btr_mark_freed_leaves(nonfree=TRUE) and pass the mini-transaction as
the alloc_mtr to btr_store_big_rec_extern_fields(). Finally, invoke
btr_mark_freed_leaves(nonfree=FALSE) to avoid leaking pages.

buf_reset_check_index_page_at_flush(): Remove. The function
fsp_init_file_page_low() already sets
bpage->check_index_page_at_flush=FALSE.

There is a known issue in tablespace extension. If the request to
allocate a BLOB page leads to the tablespace being extended, crash
recovery could see BLOB writes to pages that are off the tablespace
file bounds. This should trigger an assertion failure in fil_io() at
crash recovery. The safe thing would be to write redo log about the
tablespace extension to the mini-transaction of the BLOB write, not to
the mini-transaction of the record update. However, there is no redo
log record for file extension in the current redo log format.

rb:693 approved by Sunny Bains
2011-08-29 11:16:42 +03:00
Marko Mäkelä
42ff786cf9 Merge mysql-5.1 to mysql-5.5. 2011-08-22 17:12:27 +03:00
Jimmy Yang
d9c3d35437 In innobase_format_name() we should call innobase_convert_name() with
"!is_index_name" instead of "is_index_name", so the table name in the
error message would not be formated as index name.
2011-08-17 02:39:55 -07:00
Jimmy Yang
7abcb1dd08 Add two tests for "innodb_large_prefix" and "innodb_force_load_corrupted" in
sys_vars test suite.
2011-08-16 20:51:40 -07:00
Jimmy Yang
95fa7fab3b Fix bug #11830883, SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES.
Also addressed issues in bug #11745133, where we could mark a table
corrupted instead of crashing the server when found a corrupted buffer/page
if the table created with innodb_file_per_table on.
2011-08-16 18:07:59 -07:00
Mats Kindahl
cf5e5f837a Merging into mysql-5.5.16-release. 2011-08-15 20:12:11 +02:00
Marko Mäkelä
7f03063418 Merge mysql-5.1 to mysql-5.5. Add a test case. 2011-08-15 12:18:34 +03:00
Marko Mäkelä
c8163a16fa Merge mysql-5.1-security to mysql-5.5-security. 2011-08-10 15:03:33 +03:00
Marko Mäkelä
f2f4b19678 Bug#12626794 61240: UNUSED FUNCTIONS ... 2011-08-10 14:56:14 +03:00
Marko Mäkelä
79aa9c177b Merge mysql-5.1 to mysql-5.5. 2011-08-10 12:58:22 +03:00
Marko Mäkelä
7645c5ee90 Bug#12835650 VARCHAR maximum length performance impact
row_sel_field_store_in_mysql_format(): Do not pad the unused part of
the buffer reserved for a True VARCHAR column (introduced in 5.0.3).
Add Valgrind instrumentation ensuring that the unused part will be
flagged uninitialized.

row_sel_copy_cached_field_for_mysql(): New function: Copy a field
that is in the MySQL row format, not copying the unused tail of
VARCHAR columns.

row_sel_pop_cached_row_for_mysql(): Invoke
row_sel_copy_cached_field_for_mysql() for copying fields.
When the row is long, copy it field-by-field.

rb:715 approved by Inaam Rana
2011-08-10 12:25:24 +03:00
Marko Mäkelä
5962cadcfa Merge mysql-5.1 to mysql-5.5. 2011-08-08 12:16:15 +03:00
Inaam Rana
fce189fadb Merge from 5.1 the fix for Bug 12356373 2011-07-19 10:54:59 -04:00
unknown
438d21189c Null Merge from mysql-5.1 with second fix for Bug#12637786
Bug#12637786 was fixed with rb:692 by marko.  But that fix has a remaining
bug.  It added this assert;
    ut_ad(ind_field->prefix_len);
before a section of code that assumes there is a prefix_len.  

The patch replaced code that explicitly avoided this with a check for
prefix_len.  It turns out that the purge thread can get to that assert
without a prefix_len because it does not use a row_ext_t* .
When UNIV_DEBUG is not defined, the affect of this is that the purge thread
sets the dfield->len to zero and then cannot find the entry in the index to
purge.  So secondary index entries remain unpurged.

This patch does not do the assert.  Instead, it uses
    'if (ind_field->prefix_len) {...}'
around the section of code that assumes a prefix_len.  This is the way the
patch I provided to Marko did it.

The test case is simply modified to do a sleep(10) in order to give the
purge thread a chance to run. Without the code change to row0row.c, this
modified testcase will assert if InnoDB was compiled with UNIV_DEBUG.
I tried to sleep(5), but it did not always assert.
2011-07-08 08:16:23 -05:00
Davi Arnaut
71e0ff64f0 Bug#12727287: Maintainer mode compilation fails with gcc 4.6
GCC 4.6 has new -Wunused-but-set-variable flag, which is enabled
by -Wall, that causes GCC to emit a warning whenever a local variable
is assigned to, but otherwise unused (aside from its declaration).

Since the maintainer mode uses -Wall and -Werror, source code which
triggers these warnings will be rejected. That is, these warnings
become hard errors.

The solution is to fix the code which triggers these specific warnings.
In most of the cases, this is a welcome cleanup as code which triggers
this warning is probably dead anyway.

dbug/dbug.c:
  Unused but set.
libmysqld/lib_sql.cc:
  Length is not necessary as the converted error message is always
  null-terminated.
sql/item_func.cc:
  Make get_var_with_binlog private to this compilation unit.
  If a error was raised, do not attempt to evaluate the user
  variable as the statement execution will be interrupted
  anyway.
sql/mysqld.cc:
  Use a void expression to silence the warning. Avoids the use of
  macros that would make the code more unreadable than it already is.
sql/protocol.cc:
  Length is not necessary as the converted error message is always
  null-terminated. Remove unnecessary casts and assignment.
sql/sql_class.h:
  Function is only used in a single compilation unit.
sql/sql_load.cc:
  Only use the variable outside of EMBEDDED_LIBRARY.
storage/innobase/btr/btr0cur.c:
  Do not retrieve field, only the record length is being used.
storage/perfschema/pfs.cc:
  Use a void expression to silence the warning.
tests/mysql_client_test.c:
  Unused but set.
unittest/mysys/lf-t.c:
  Unused but set.
2011-07-07 08:22:43 -03:00
Vladislav Vaintroub
f9cb1467b8 merge Windows performance patches into 5.3 2011-07-05 21:46:53 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Marko Mäkelä
d5d2c4fa74 Merge mysql-5.1 to mysql-5.5. 2011-06-15 10:30:19 +03:00
Marko Mäkelä
a862937699 Introduce UNIV_BLOB_NULL_DEBUG for temporarily hiding Bug#12650861.
Some ut_a(!rec_offs_any_null_extern()) assertion failures are indicating
genuine BLOB bugs, others are bogus failures when rolling back incomplete
transactions at crash recovery. This needs more work, and until I get a
chance to work on it, other testing must not be disrupted by this.
2011-06-15 10:16:59 +03:00
Vladislav Vaintroub
4171483b53 Backport Fix for Bug#24509 - 2048 file descriptor limit on windows needs increasing.
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with 
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
 file is stored in the my_file_info struct, along with a flag for append mode 
(because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.

Noteworthy benefit of this patch is that it removes limits from the table_cache size - 
allowing for more simultaneus users
2011-06-12 15:52:07 +02:00
Marko Mäkelä
ca84a75e44 Merge mysql-5.1 to mysql-5.5. 2011-06-09 22:03:16 +03:00
Marko Mäkelä
4412b5dab6 Disable a debug assertion that was added to track down Bug#12612184.
row_build(): The record may contain null BLOB pointers when the server
is rolling back an insert that was interrupted by a server crash.
2011-06-09 21:50:41 +03:00
Marko Mäkelä
34baff7743 Merge mysql-5.1 to mysql-5.5. 2011-06-09 13:59:02 +03:00
Marko Mäkelä
6348b7375a BLOB instrumentation for Bug#12612184 Race condition in row_upd_clust_rec()
If UNIV_DEBUG or UNIV_BLOB_LIGHT_DEBUG is enabled, add
!rec_offs_any_null_extern() assertions, ensuring that records do not
contain null pointers to externally stored columns in inappropriate
places.

btr_cur_optimistic_update(): Assert !rec_offs_any_null_extern().
Incomplete records must never be updated or deleted. This assertion
will cover also the pessimistic route.

row_build(): Assert !rec_offs_any_null_extern(). Search tuples must
never be built from incomplete index entries.

row_rec_to_index_entry(): Assert !rec_offs_any_null_extern() unless
ROW_COPY_DATA is requested. ROW_COPY_DATA is used for
multi-versioning, and therefore it might be valid to copy the most
recent (uncommitted) version while it contains a null pointer to
off-page columns.

row_vers_build_for_consistent_read(),
row_vers_build_for_semi_consistent_read(): Assert !rec_offs_any_null_extern()
on all versions except the most recent one.

trx_undo_prev_version_build(): Assert !rec_offs_any_null_extern() on
the previous version.

rb:682 approved by Sunny Bains
2011-06-09 13:31:15 +03:00
Sergei Golubchik
9b98cae4cc merge with 5.1-micro 2011-06-07 18:13:02 +02:00