Commit graph

106 commits

Author SHA1 Message Date
vasil
13aa9d0833 Non-functional change: update copyright year to 2010 of the files
that have been modified after 2010-01-01 according to svn.

for f in $(svn log -v -r{2010-01-01}:HEAD |grep "^   M " |cut -b 16- |sort -u) ; do sed -i "" -E 's/(Copyright \(c\) [0-9]{4},) [0-9]{4}, (.*Innobase Oy.+All Rights Reserved)/\1 2010, \2/' $f ; done
2010-02-20 16:45:41 +00:00
sunny
2f3e344a9a branches/zip: Don't print the entire lock bit set if the block was not
found in the buffer pool. Only print the bits that are set and that
information is in the lock and not in the block.

See rb://256 approved by Marko.
2010-02-18 11:44:31 +00:00
marko
c0bccb0510 branches/zip: lock_table_other_has_incompatible():
Return an incompatible lock or NULL instead of TRUE or FALSE.
Approved by Sunny over IM.
2010-02-17 09:48:34 +00:00
marko
26de03fb2c branches/zip: Merge revisions 6538:6613 from branches/5.1:
------------------------------------------------------------------------
  r6545 | jyang | 2010-02-03 03:57:32 +0200 (Wed, 03 Feb 2010) | 8 lines
  Changed paths:
     M /branches/5.1/lock/lock0lock.c

  branches/5.1: Fix bug #49001, "SHOW INNODB STATUS deadlock info
  incorrect when deadlock detection aborts". Print the correct
  lock owner when recursive function lock_deadlock_recursive()
  exceeds its maximum depth LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK.

  rb://217, approved by Marko.
  ------------------------------------------------------------------------
  r6613 | inaam | 2010-02-09 20:23:09 +0200 (Tue, 09 Feb 2010) | 11 lines
  Changed paths:
     M /branches/5.1/buf/buf0buf.c
     M /branches/5.1/buf/buf0rea.c
     M /branches/5.1/include/buf0rea.h

  branches/5.1: Fix Bug #38901
  InnoDB logs error repeatedly when trying to load page into buffer pool

  In buf_page_get_gen() if we are unable to read a page (because of
  corruption or some other reason) we keep on retrying. This fills up
  error log with millions of entries in no time and we'd eventually run
  out of disk space. This patch limits the number of attempts that we
  make (currently set to 100) and after that we abort with a message.

  rb://241 Approved by: Heikki
  ------------------------------------------------------------------------
2010-02-10 08:40:55 +00:00
sunny
010da845ff branches/zip: Remove the additional check introduced in r6534 which tries
to check if the joining transaction has any other transactions waiting on
its locks. This optimization results in excessive deadlocks when running
Sysbench with a large number of threads. The function seems to return
FALSE positives.

rb://250
2010-02-04 14:11:23 +00:00
sunny
cc8530325d branches/zip: Two changes to fix the problem:
1. First scan the joining transaction's locks and check if no other
transaction is waiting for a lock held by the joining transaction.
If no other transaction is waiting then  no deadlock an occur and
we avoid doing an exhaustive search.

2. Change the direction of the lock traversal from backward to forward.
Previously we traversed backward from the lock that has to wait, the function
to that fetched the previous node was very inefficient resulting in O(n^2)
access to the rec lock list.

Fix Bug #49047 InnoDB deadlock detection is CPU intensive with many locks on a single row.

rb://218
2010-01-29 21:42:49 +00:00
marko
53f7a1a6a9 branches/zip: lock_rec_validate_page(): Only validate the record
queues when the thread is not holding a space->latch.

When UNIV_DEBUG is defined while UNIV_SYNC_DEBUG is not,
latching order violations will still occur and deadlocks will be possible.

sync_thread_levels_nonempty_gen(): Renamed from
sync_thread_levels_empty_gen().  Return the violating latch or NULL
instead of FALSE or TRUE, except that there will be a ut_error before
the non-NULL return.

sync_thread_levels_empty_gen(): A macro that negates the return value of
sync_thread_levels_nonempty_gen().

sync_thread_levels_contains(): New function, based on
sync_thread_levels_nonempty_gen().

This should fix Issue #441.
2010-01-13 20:38:53 +00:00
marko
48f17815fb branches/zip: Merge revisions 6206:6350 from branches/5.1,
except r6347, r6349, r6350 which were committed separately
to both branches, and r6310, which was backported from zip to 5.1.

  ------------------------------------------------------------------------
  r6206 | jyang | 2009-11-20 09:38:43 +0200 (Fri, 20 Nov 2009) | 3 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc

  branches/5.1: Non-functional change, fix formatting.
  ------------------------------------------------------------------------
  r6230 | sunny | 2009-11-24 23:52:43 +0200 (Tue, 24 Nov 2009) | 3 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-autoinc.result

  branches/5.1: Fix autoinc failing test results.
  (this should be skipped when merging 5.1 into zip)
  ------------------------------------------------------------------------
  r6231 | sunny | 2009-11-25 10:26:27 +0200 (Wed, 25 Nov 2009) | 7 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test
     M /branches/5.1/row/row0sel.c

  branches/5.1: Fix BUG#49032 - auto_increment field does not initialize to last value in InnoDB Storage Engine.

  We use the appropriate function to read the column value for non-integer
  autoinc column types, namely float and double.

  rb://208. Approved by Marko.
  ------------------------------------------------------------------------
  r6232 | sunny | 2009-11-25 10:27:39 +0200 (Wed, 25 Nov 2009) | 2 lines
  Changed paths:
     M /branches/5.1/row/row0sel.c

  branches/5.1: This is an interim fix, fix white space errors.
  ------------------------------------------------------------------------
  r6233 | sunny | 2009-11-25 10:28:35 +0200 (Wed, 25 Nov 2009) | 2 lines
  Changed paths:
     M /branches/5.1/include/mach0data.h
     M /branches/5.1/include/mach0data.ic
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test
     M /branches/5.1/row/row0sel.c

  branches/5.1: This is an interim fix, fix tests and make read float/double arg const.
  ------------------------------------------------------------------------
  r6234 | sunny | 2009-11-25 10:29:03 +0200 (Wed, 25 Nov 2009) | 2 lines
  Changed paths:
     M /branches/5.1/row/row0sel.c

  branches/5.1: This is an interim fix, fix whitepsace issues.
  ------------------------------------------------------------------------
  r6235 | sunny | 2009-11-26 01:14:42 +0200 (Thu, 26 Nov 2009) | 9 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test

  branches/5.1: Fix Bug#47720 - REPLACE INTO Autoincrement column with negative values.

  This bug is similiar to the negative autoinc filter patch from earlier,
  with the additional handling of filtering out the negative column values
  set explicitly by the user.

  rb://184
  Approved by Heikki.
  ------------------------------------------------------------------------
  r6242 | vasil | 2009-11-27 22:07:12 +0200 (Fri, 27 Nov 2009) | 4 lines
  Changed paths:
     M /branches/5.1/export.sh

  branches/5.1:

  Minor changes to support plugin snapshots.
  ------------------------------------------------------------------------
  r6306 | calvin | 2009-12-14 15:12:46 +0200 (Mon, 14 Dec 2009) | 5 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test

  branches/5.1: fix bug#49267: innodb-autoinc.test fails on windows
  because of different case mode

  There is no change to the InnoDB code, only to fix test case by
  changing "T1" to "t1".
  ------------------------------------------------------------------------
  r6324 | jyang | 2009-12-17 06:54:24 +0200 (Thu, 17 Dec 2009) | 8 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/include/lock0lock.h
     M /branches/5.1/include/srv0srv.h
     M /branches/5.1/lock/lock0lock.c
     M /branches/5.1/log/log0log.c
     M /branches/5.1/srv/srv0srv.c
     M /branches/5.1/srv/srv0start.c

  branches/5.1: Fix bug #47814 - Diagnostics are frequently not
  printed after a long lock wait in InnoDB. Separate out the
  lock wait timeout check thread from monitor information
  printing thread.

  rb://200 Approved by Marko.
  ------------------------------------------------------------------------
2009-12-22 10:33:01 +00:00
marko
21be75bf83 branches/zip: Merge a change from MySQL:
------------------------------------------------------------
revno: 3236
committer: Satya B <satya.bn@sun.com>
branch nick: mysql-5.1-bugteam
timestamp: Tue 2009-12-01 17:48:57 +0530
message:
  merge to mysql-5.1-bugteam
    ------------------------------------------------------------
    revno: 3234.1.1
    committer: Gleb Shchepa <gshchepa@mysql.com>
    branch nick: mysql-5.1-bugteam
    timestamp: Tue 2009-12-01 14:38:40 +0400
    message:
      Bug #38883 (reopened): thd_security_context is not thread safe, crashes?

      manual merge 5.0-->5.1, updating InnoDB plugin.
    ------------------------------------------------------------
    revno: 1810.3968.13
    committer: Gleb Shchepa <gshchepa@mysql.com>
    branch nick: mysql-5.0-bugteam
    timestamp: Tue 2009-12-01 14:24:44 +0400
    message:
      Bug #38883 (reopened): thd_security_context is not thread safe, crashes?

      The bug 38816 changed the lock that protects THD::query from
      LOCK_thread_count to LOCK_thd_data, but didn't update the associated
      InnoDB functions.

      1. The innobase_mysql_prepare_print_arbitrary_thd and the
      innobase_mysql_end_print_arbitrary_thd InnoDB functions have been
      removed, since now we have a per-thread mutex: now we don't need to wrap
      several inter-thread access tries to THD::query with a single global
      LOCK_thread_count lock, so we can simplify the code.

      2. The innobase_mysql_print_thd function has been modified to lock
      LOCK_thd_data in direct way.
2009-12-22 09:04:34 +00:00
marko
2a05ead416 branches/zip: lock_rec_insert_check_and_lock(): Avoid casting away constness.
Use page_rec_get_next_const() instead. This silences a gcc 4.2.4 warning.
Reported by Sunny Bains.
2009-12-15 12:05:50 +00:00
marko
0e4ac2bad8 branches/zip: Free all resources at shutdown. Set pointers to NULL, so
that Valgrind will not complain about freed data structures that are
reachable via pointers.  This addresses Bug #45992 and Bug #46656.

This patch is mostly based on changes copied from branches/embedded-1.0,
mainly c5432, c3439, c3134, c2994, c2978, but also some other code was
copied.  Some added cleanup code is specific to MySQL/InnoDB.

rb://199 approved by Sunny Bains
2009-11-02 09:42:56 +00:00
marko
391dedaada branches/zip: Address Issue #350 in comments.
lock_rec_queue_validate(), lock_rec_queue_validate(): Note that
this debug code may violate the latching order and cause deadlocks.
2009-09-28 11:46:02 +00:00
sunny
8b62518d01 branches/zip: Fix a regression introduced by the fix for bug#26316. We check
whether a transaction holds any AUTOINC locks before we acquire the kernel
mutex and release those locks.

Fix for rb://153. Approved by Marko.
2009-09-02 06:05:15 +00:00
marko
9be6b6c704 branches/zip: UNIV_DEBUG_LOCK_VALIDATE: Move the definition to univ.i. 2009-08-26 12:14:59 +00:00
sunny
5e77a1df81 branches/zip: Fix bug# 46650: Innodb assertion autoinc_lock == lock in lock_table_remove_low on INSERT SELECT
We only store the autoinc locks that are granted in the transaction's autoinc
lock vector. A transacton, that has been rolled back due to a deadlock because
of an AUTOINC lock attempt, will not have added that lock to the vector. We
need to check for that when we remove that lock.

rb://145
Approved by Marko.
2009-08-20 07:05:30 +00:00
calvin
0b0aa42cc8 branches/zip: remove duplicate "the" in comments. 2009-08-06 22:04:03 +00:00
marko
50accfee1f branches/zip: lock_rec_validate_page(): Add the parameter zip_size.
This should help track down Mantis Issue #289.
2009-08-05 11:27:30 +00:00
marko
2f799d5659 branches/zip: lock_is_on_table(), lock_table_unlock(): Unused, remove. 2009-06-30 09:45:41 +00:00
marko
fedd0d8134 branches/zip: lock_rec_validate_page(): Add another assertion
to track down Issue #289.
2009-06-29 12:58:07 +00:00
marko
2f800f4f2c branches/zip: lock_print_info_all_transactions(), buf_read_recv_pages():
Tolerate missing tablespaces (zip_size==ULINT_UNDEFINED).
buf_page_get_gen(): Add ut_ad(ut_is_2pow(zip_size)).

Issue #289, rb://136 approved by Sunny Bains
2009-06-29 08:54:53 +00:00
marko
5727d980b6 branches/zip: Add @file comments, and convert decorative
/*********************************
comments to Doxygen /** style like this:
/*****************************//**

This conversion was performed by the following command:

perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) {
s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2}
print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i
2009-05-25 09:52:29 +00:00
marko
5f1c5429d7 branches/zip: Split some long lines that were introduced in r5091. 2009-05-25 08:09:45 +00:00
marko
8ab5601eea branches/zip: Convert the function comments to Doxygen format.
This patch was created by running the following commands:

for i in */*[ch]; do doxygenify.pl $i; done
perl -i -pe 's#\*{3} \*/$#****/#' */*[ch]

where doxygenify.pl is
https://svn.innodb.com/svn/misc/trunk/tools/doxygenify.pl r510

Verified the consistency as follows:

(0) not too many /* in: */ or /* out: */ comments left in the code:
grep -l '/\*\s*\(in\|out\)[,:/]' */*[ch]

(1) no difference when ignoring blank lines, after stripping all
C90-style /* comments */, including multi-line ones, before and after
applying this patch:

perl -i -e 'undef $/;while(<ARGV>){s#/\*(.*?)\*/##gs;print}' */*[ch]
diff -I'^\s*$' --exclude .svn -ru TREE1 TREE2

(2) after stripping @return comments and !<, generated a diff and omitted
the hunks where /* out: */ function return comments were removed:

perl -i -e'undef $/;while(<ARGV>){s#!<##g;s#\n\@return\t.*?\*/# \*/#gs;print}'\
 */*[ch]
svn diff|
perl -e 'undef $/;$_=<>;s#\n-\s*/\* out[:,]([^\n]*?)(\n-[^\n]*?)*\*/##gs;print'

Some unintended changes were left.  These will be removed in a
subsequent patch.
2009-05-25 05:30:14 +00:00
marko
20a32e3c95 branches/zip: Add missing function comments. 2009-05-20 04:42:12 +00:00
marko
4063077471 branches/zip: Write PAGE_MAX_TRX_ID to the redo log. Otherwise,
transactions that are started before the rollback of incomplete
transactions has finished may have an inconsistent view of the
secondary indexes.

dict_index_is_sec_or_ibuf(): Auxiliary function for controlling
updates and checks of PAGE_MAX_TRX_ID: check whether an index is a
secondary index or the insert buffer tree.

page_set_max_trx_id(), page_update_max_trx_id(),
lock_rec_insert_check_and_lock(),
lock_sec_rec_modify_check_and_lock(), btr_cur_ins_lock_and_undo(),
btr_cur_upd_lock_and_undo(): Add the parameter mtr.

page_set_max_trx_id(): Allow mtr to be NULL.  When mtr==NULL, do not
attempt to write to the redo log.  This only occurs when creating a
page or reorganizing a compressed page.  In these cases, the
PAGE_MAX_TRX_ID will be set correctly during the application of redo
log records, even though there is no explicit log record about it.

btr_discard_only_page_on_level(): Preserve PAGE_MAX_TRX_ID.  This
function should be unreachable, though.

btr_cur_pessimistic_update(): Update PAGE_MAX_TRX_ID.

Add some assertions for checking that PAGE_MAX_TRX_ID is set on all
secondary index leaf pages.

rb://115 tested by Michael, fixes Issue #211
2009-05-19 18:59:07 +00:00
marko
6bcd59e3b2 branches/zip: Introduce the logical type names trx_id_t, roll_ptr_t,
and undo_no_t. Each type is still defined as dulint.

This is an initial step towards replacing dulint with a 64-bit data type.
Because modern compilers have no trouble supporting 64-bit arithmetics
even on 32-bit targets, the dulint struct is a relic that should go.

The last remaining major use of dulint is dictionary IDs
(table, index, and row ids).

rb://114 approved by Sunny Bains
2009-04-23 05:32:36 +00:00
marko
7f51ff1d15 branches/zip: Remove references to UNIV_HOTBACKUP from files that are
not used when building InnoDB Hot Backup.  Declare
innobase_invalidate_query_cache() in ha_prototypes.h.
2009-03-24 12:02:29 +00:00
marko
74013e36b0 branches/zip: Merge revisions 4359:4400 from branches/5.1:
------------------------------------------------------------------------
  r4399 | marko | 2009-03-12 09:38:05 +0200 (Thu, 12 Mar 2009) | 2 lines

  branches/5.1: row_sel_get_clust_rec_for_mysql(): Store the cursor position
  also for unlock_row().  (Bug #39320)
  ------------------------------------------------------------------------
  r4400 | marko | 2009-03-12 10:06:44 +0200 (Thu, 12 Mar 2009) | 5 lines

  branches/5.1: Fix a bug in multi-table semi-consistent reads.
  Remember the acquired record locks per table handle (row_prebuilt_t)
  rather than per transaction (trx_t), so that unlock_row should successfully
  unlock all non-matching rows in multi-table operations.
  This deficiency was found while investigating Bug #39320.
  ------------------------------------------------------------------------

These were submitted as rb://94 and rb://96 and approved by Heikki Tuuri.
2009-03-12 08:26:40 +00:00
vasil
dfc3e641b7 branches/zip:
* Remove old Innobase copyright lines from C source files
* Add a reference to the GPLv2 license as recommended by the lawyers
at Oracle Legal

[Step 22/28]
2009-02-17 09:50:12 +00:00
marko
f7e8f116a3 branches/zip: Merge revisions 3930:4005 from branches/5.1:
------------------------------------------------------------------------
  r4004 | marko | 2009-01-20 16:19:00 +0200 (Tue, 20 Jan 2009) | 12 lines

  branches/5.1: Merge r4003 from branches/5.0:

  rec_set_nth_field(): When the field already is SQL null,
  do nothing when it is being changed to SQL null. (Bug #41571)

  Normally, MySQL does not pass "do-nothing" updates to the storage engine.
  When it does and a column of an InnoDB table that is in ROW_FORMAT=COMPACT
  is being updated from NULL to NULL, the InnoDB buffer pool will be corrupted
  without this fix.

  rb://81 approved by Heikki Tuuri
  ------------------------------------------------------------------------
  r4005 | marko | 2009-01-20 16:22:36 +0200 (Tue, 20 Jan 2009) | 8 lines

  branches/5.1: lock_is_table_exclusive(): Acquire kernel_mutex before
  accessing table->locks and release kernel_mutex before returning from
  the function.  This fixes a portential race condition in the
  "commit every 10,000 rows" in ALTER TABLE, CREATE INDEX, DROP INDEX,
  and OPTIMIZE TABLE. (Bug #42152)

  rb://80 approved by Heikki Tuuri
  ------------------------------------------------------------------------
2009-01-20 14:29:22 +00:00
marko
bdf341a27b branches/zip: Add assertions that the kernel_mutex is being held
while accessing table->locks or un_member.tab_lock.locks.
This is related to Issue #158.  According to static analysis,
the added debug assertions should always hold.

lock_table_has_to_wait_in_queue(), lock_queue_iterator_reset(),
lock_queue_iterator_get_prev(), add_trx_relevant_locks_to_cache(),
fetch_data_into_cache(): Add ut_ad(mutex_own(&kernel_mutex)).
2009-01-16 12:53:40 +00:00
sunny
cb2902016a branches/zip:
1. We add a vector of locks to trx_t. This array contains the autoinc
  locks granted to a transaction. There is one per table.

  2. We enforce releasing of these locks in the reverse order from the
  one in which they are acquired. The assumption is that since the
  AUTOINC locks are statement level locks. Nested statements introduced
  by triggers are stacked it should hold.

There was some cleanup done to the vector code too by adding const and
some new functions. Rename dict_table_t::auto_inc_lock to autoinc_lock.

Fix Bug#26316 Triggers create duplicate entries on auto-increment columns
rb://22
2008-10-31 07:40:29 +00:00
sunny
00189b7aa2 branches/zip: Merge revisions 2702:2722 from branches/5.1:
------------------------------------------------------------------------
  r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1: Since handler::get_auto_increment() doesn't allow us
  to return the cause of failure we have to inform MySQL using the
  sql_print_warning() function to return the cause for autoinc failure.
  Previously we simply printed the error code, this patch prints the
  text string representing the following two error codes:
  
  DB_LOCK_WAIT_TIMEOUT
  DB_DEADLOCK.
  
  Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info
  
  Approved by Marko.
  
  ------------------------------------------------------------------------
  r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines
  Changed paths:
     M /branches/5.1/include/lock0lock.h
     M /branches/5.1/lock/lock0lock.c
     A /branches/5.1/mysql-test/innodb_bug38231.result
     A /branches/5.1/mysql-test/innodb_bug38231.test
     M /branches/5.1/row/row0mysql.c
  
  branches/5.1:
  
  Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
  
  In TRUNCATE TABLE and discard tablespace: do not remove table-level S
  and X locks and do not assert on such locks not being wait locks.
  Leave such locks alone.
  
  Approved by:	Heikki (rb://14)
  
  ------------------------------------------------------------------------
  r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines
  Changed paths:
     M /branches/5.1/include/sync0sync.ic
  
  branches/5.1:
  
  Silence a compilation warning in UNIV_DEBUG.
  
  Approved by:	Marko (via IM)
  
  ------------------------------------------------------------------------
  r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     A /branches/5.1/mysql-test/innodb_bug39438-master.opt
     A /branches/5.1/mysql-test/innodb_bug39438.result
     A /branches/5.1/mysql-test/innodb_bug39438.test
  
  branches/5.1:
  
  Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
  
  In ha_innobase::info() - do not try to get the free space for a tablespace
  which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the
  .ibd file is missing for some other reason.
  
  ibd_file_missing and tablespace_discarded are manipulated only in
  row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql()
  and the manipulation is protected/surrounded by
  row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we
  do the same in ha_innobase::info() when checking the values of those members
  to avoid race conditions. I have tested the code-path with UNIV_DEBUG and
  UNIV_SYNC_DEBUG.
  
  Looks like it is not possible to avoid mysqld printing warnings in the
  mysql-test case and thus this test innodb_bug39438 must be added to the
  list of exceptional test cases that are allowed to print warnings. For this,
  the following patch must be applied to the mysql source tree:
  
    --- cut ---
    === modified file 'mysql-test/lib/mtr_report.pl'
    --- mysql-test/lib/mtr_report.pl	2008-08-12 10:26:23 +0000
    +++ mysql-test/lib/mtr_report.pl	2008-10-01 11:57:41 +0000
    @@ -412,7 +412,10 @@
     
                     # When trying to set lower_case_table_names = 2
                     # on a case sensitive file system. Bug#37402.
    -                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./
    +                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./ or
    +
    +                # this test is expected to print warnings
    +                ($testname eq 'main.innodb_bug39438')
     		)
                 {
                   next;                       # Skip these lines
    
    --- cut ---
  
  The mysql-test is currently somewhat disabled (see inside
  innodb_bug39438.test), after the above patch has been applied to the mysql
  source tree, the test can be enabled.
  
  rb://20
  
  Reviewed by:	Inaam, Calvin
  Approved by:	Heikki
  
  ------------------------------------------------------------------------
  r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1:
  
  Print a warning if an attempt is made to get the free space for a table
  whose .ibd file is missing or the tablespace has been discarded. This is a
  followup to r2719.
  
  Suggested by:	Inaam
  
  ------------------------------------------------------------------------
  r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1: We need to send the messages to the client because
  handler::get_auto_increment() doesn't allow a way to return the
  specific error for why it failed.
  
  rb://18
  
  ------------------------------------------------------------------------
  r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines
  Changed paths:
     M /branches/5.1/dict/dict0mem.c
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/include/dict0mem.h
     M /branches/5.1/include/row0mysql.h
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test
     M /branches/5.1/row/row0mysql.c
  
  branches/5.1: This bug has always existed but was masked by other errors. The
  fix for bug# 38839 triggered this bug. When the offset and increment are > 1
  we need to calculate the next value taking into consideration the two
  variables. Previously we simply assumed they were 1 particularly offset was
  never used. MySQL does its own calculation and that's probably why it seemed
  to work in the past. We would return what we thought was the correct next
  value and then MySQL would recalculate the actual value from that and return
  it to the caller (e.g., handler::write_row()). Several new tests have been
  added that try and catch some edge cases. The tests exposed a wrap around
  error in MySQL next value calculation which was filed as bug#39828. The tests
  will need to be updated once MySQL fix that bug.
  
  One good side effect of this fix is that dict_table_t size has been
  reduced by 8 bytes because we have moved the autoinc_increment field to
  the row_prebuilt_t structure. See review-board for a detailed discussion.
  
  rb://3
  
  ------------------------------------------------------------------------
2008-10-04 03:22:36 +00:00
marko
d87663c9f0 branches/zip: Non-functional change:
buf_block_dbg_add_level(block, level): Define as an empty macro when
UNIV_SYNC_DEBUG is not defined.  Remove #ifdef UNIV_SYNC_DEBUG around
all invocations.
2008-09-22 06:59:58 +00:00
vasil
ab4a89c67f branches/zip: Merge 2489:2524 from branches/5.1:
------------------------------------------------------------------------
  r2519 | sunny | 2008-06-26 16:55:43 +0300 (Thu, 26 Jun 2008) | 5 lines
  
  branches/5.1: Add test cases and fix a bug where the last AUTOINC cached value
  was not reset to 0 when the table was truncated.
  
  Bug #37531 : After truncate, auto_increment behaves incorrectly for InnoDB
  
  ------------------------------------------------------------------------
  r2520 | vasil | 2008-06-26 17:38:02 +0300 (Thu, 26 Jun 2008) | 7 lines
  
  branches/5.1:
   
  Fix Bug#36941 Performance problem in ha_print_info (SHOW INNODB STATUS)
  by disabling some of the code in ha_print_info() in production builds.
   
  Approved by:	Heikki (via IM)
  
  ------------------------------------------------------------------------
  r2521 | vasil | 2008-06-26 17:39:01 +0300 (Thu, 26 Jun 2008) | 8 lines
  
  branches/5.1:
   
  Fix Bug#36942 Performance problem in lock_get_n_rec_locks (SHOW INNODB STATUS)
  by not calling lock_get_n_rec_locks() from lock_print_info_summary() on
  production builds.
   
  Approved by:	Heikki (via IM)
  
  ------------------------------------------------------------------------
  r2524 | vasil | 2008-07-01 10:37:34 +0300 (Tue, 01 Jul 2008) | 29 lines
  
  branches/5.1:
  
  Merge a change from MySQL (this fixes the failing innodb-replace test):
  
    revno: 2659
    committer: Mattias Jonsson <mattiasj@mysql.com>
    branch nick: b31210-51-bugteam
    timestamp: Tue 2008-06-03 13:25:41 +0200
    message:
      Bug#31210: INSERT DELAYED crashes server when used on partitioned tables
        
      Problem was an unclear error message since it could suggest that
      MyISAM did not support INSERT DELAYED.
      Changed the error message to say that DELAYED is not supported by the
      table, instead of the table's storage engine.
      The confusion is that a partitioned table is in somewhat sense using
      the partitioning storage engine, which in turn uses the ordinary
      storage engine. By saying that the table does not support DELAYED we
      do not give any extra informantion about the storage engine or if it
      is partitioned.
    modified:
      mysql-test/r/innodb-replace.result
      mysql-test/t/innodb-replace.test
      mysql-test/t/merge.test
      mysql-test/t/partition_hash.test
      sql/share/errmsg.txt
      sql/sql_insert.cc


------------------------------------------------------------------------
2008-07-01 06:53:40 +00:00
marko
c4605a2807 branches/zip: Fix most MSVC (Windows) compilation warnings.
lock_get_table(), locks_row_eq_lock(), buf_page_get_mutex(): Add return
after ut_error.  On Windows, ut_error is not declared as "noreturn".

Add explicit type casts when assigning ulint to byte to get rid of
"possible loss of precision" warnings.

struct i_s_table_cache_struct: Declare rows_used, rows_allocd as ulint
instead of ullint.  32 bits should be enough.

fill_innodb_trx_from_cache(), i_s_zip_fill_low(): Cast 64-bit unsigned
integers to longlong when calling Field::store(longlong, bool is_unsigned).
Otherwise, the compiler would implicitly convert them to double and
invoke Field::store(double) instead.

recv_truncate_group(), recv_copy_group(), recv_calc_lsn_on_data_add():
Cast ib_uint64_t expressions to ulint to get rid of "possible loss of
precision" warnings.  (There should not be any loss of precision in
these cases.)

log_close(), log_checkpoint_margin(): Declare some variables as ib_uint64_t
instead of ulint, so that there won't be any potential loss of precision.

mach_write_ull(): Cast the second argument of mach_write_to_4() to ulint.

OS_FILE_FROM_FD(): Cast the return value of _get_osfhandle() to HANDLE.

row_merge_dict_table_get_index(): Cast the parameter of mem_free() to (void*)
in order to get rid of the bogus MSVC warning C4090, which has been reported
as MSVC bug 101661:
<http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101661>

row_mysql_read_blob_ref(): To get rid of a bogus MSVC warning C4090,
drop a const qualifier.
2008-03-04 08:57:07 +00:00
marko
9966023451 branches/zip: Minor fixes.
lock_rec_restore_from_page_infimum(): Correct the comment of the parameter rec.

lock_sec_rec_read_check_and_lock(): Add the debug assertion
ut_ad(mode == LOCK_X || mode == LOCK_S).
2008-02-18 15:45:17 +00:00
marko
7a41306bc5 branches/zip: Minor improvements.
lock_update_delete(): Add the debug assertion ut_ad(page == page_align(rec)).

lock_rec_insert_check_and_lock(): Determine next_rec_heap_no before
acquiring the kernel mutex.  Require the table to be at least S-locked
in fast index creation.
2008-02-18 09:53:08 +00:00
marko
9d02d912a7 branches/zip: lock0lock.c: Minor cleanup.
lock_rec_get_first(): Use a simple for loop.

lock_rec_copy(): Use mem_heap_dup().

lock_rec_find_similar_on_page(): Add const qualifier to trx.

lock_move_rec_list_end(), lock_move_rec_list_start(): Simplify the
memcmp() assertion on ROW_FORMAT=REDUNDANT records.
2008-02-15 14:16:27 +00:00
marko
03adfb2fad branches/zip: lock_rec_other_has_expl_req(): Minor cleanup: add const
qualifier to parameter, and fix the formatting of a comment.
2008-02-15 13:03:12 +00:00
marko
b2274cb5e1 branches/zip: lock_rec_add_to_queue(): Improve the debug diagnostics.
Make it easier to display the violating lock request in a debugger.
2008-02-15 11:38:21 +00:00
marko
1d1dc31a06 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
e1e958d444 branches/zip: Fast index creation: Release locks on system tables before
creating indexes.  Lock the user table inside the user transaction.

enum trx_dict_op: Remove TRX_OP_INDEX_MAY_WAIT.

ha_innobase::add_index(): Lock the user tables within prebuilt->trx.
Commit the data dictionary transaction before creating indexes.

ha_innobase::final_drop_index(): Lock the user table within prebuilt->trx.
2008-01-25 14:26:07 +00:00
vasil
1ae59d9e65 branches/zip:
Change the output format of transaction ids from 2 32bit numbers separated
by space to a single hex number.

Suggested by:	Heikki
Approved by:	Heikki
2007-12-20 14:08:16 +00:00
marko
71a4f691b2 branches/zip: Fast index creation: Remove the ROW_PREBUILT_OBSOLETE nonsense.
Active transactions must not switch table or index definitions on the fly,
for several reasons, including the following:

 * copied indexes do not carry any history or locking information;
   that is, rollbacks, read views, and record locking would be broken

 * huge potential for race conditions, inconsistent reads and writes,
   loss of data, and corruption

Instead of trying to track down if the table was changed during a transaction,
acquire appropriate locks that protect the creation and dropping of indexes.

innodb-index.test: Test the locking of CREATE INDEX and DROP INDEX.  Test
that consistent reads work across dropped indexes.

lock_rec_insert_check_and_lock(): Relax the lock_table_has() assertion.
When inserting a record into an index, the table must be at least IX-locked.
However, when an index is being created, an IS-lock on the table is
sufficient.

row_merge_lock_table(): Add the parameter enum lock_mode mode, which must
be LOCK_X or LOCK_S.

row_merge_drop_table(): Assert that n_mysql_handles_opened == 0.
Unconditionally drop the table.

ha_innobase::add_index(): Acquire an X or S lock on the table, as appropriate.
After acquiring an X lock, assert that n_mysql_handles_opened == 1.
Remove the comments about dropping tables in the background.

ha_innobase::final_drop_index(): Acquire an X lock on the table.

dict_table_t: Remove version_number, to_be_dropped, and prebuilts.
ins_node_t: Remove table_version_number.

enum lock_mode: Move the definition from lock0lock.h to lock0types.h.

ROW_PREBUILT_OBSOLETE, row_update_prebuilt(), row_prebuilt_table_obsolete():
Remove.

row_prebuilt_t: Remove the declaration from row0types.h.

row_drop_table_for_mysql_no_commit(): Always print a warning if a table
was added to the background drop queue.
2007-12-17 15:49:59 +00:00
marko
8d54e9e6dd branches/zip: lock_rec_insert_check_and_lock(): Use the cached value
of thr_get_trx(thr).
2007-12-17 14:11:19 +00:00
vasil
dbc6cbe30a branches/zip:
Non-functional change:
 
Move the prototypes of
innobase_mysql_prepare_print_arbitrary_thd() and
innobase_mysql_end_print_arbitrary_thd() from lock0lock.c to
ha_prototypes.h

Suggested by:	Marko
Approved by:	Marko
2007-12-16 16:13:53 +00:00
marko
2bf6fc8f36 branches/zip: lock_sec_rec_some_has_impl_off_kernel(): Make the function
static.  It is only called from lock0lock.c.
2007-11-27 09:20:40 +00:00
vasil
51f09f6447 branches/zip:
Make lock_get_type_str() to also indicate if it is a gap lock.
 
Suggested by:	Heikki
Approved by:	Marko
2007-10-25 11:21:11 +00:00
marko
0938db8f68 branches/zip: lock_sec_rec_read_check_and_lock(): Correct a typo in comment. 2007-10-22 07:49:54 +00:00