Commit graph

62716 commits

Author SHA1 Message Date
Vasil Dimov
f87cb707d2 Merge mysql-5.1 -> mysql-5.1-innodb
(innodb_mysql.result needs to be adjusted after this commit)
2010-06-14 12:43:02 +03:00
Inaam Rana
b26db07a18 merge from parent 2010-06-10 10:35:39 -04:00
Inaam Rana
27c1213d55 Add a debug assertion. 2010-06-10 10:31:28 -04:00
Inaam Rana
18011f34fe Formatting changes 2010-06-10 09:58:11 -04:00
Marko Mäkelä
8371438494 Bug #38999: Re-enable innodb_multi_update.test 2010-06-10 15:56:23 +03:00
Sergey Glukhov
58f1c5fef3 Bug#38999 valgrind warnings for update statement in function compare_record()
(InnoDB plugin branch)
2010-06-09 16:17:18 +04:00
Sergey Glukhov
d2db80c8d4 Bug#38999 valgrind warnings for update statement in function compare_record()
Valgrind warning happpens because of uninitialized null bytes.
In row_sel_push_cache_row_for_mysql() function we fill fetch cache
with necessary field values, row_sel_store_mysql_rec() is called
for this and leaves null bytes untouched.
Later row_sel_pop_cached_row_for_mysql() rewrites table record
buffer with uninited null bytes. We can see the problem from the
test case:
At 'SELECT...' we call row_sel_push...->row_sel_store...->row_sel_pop_cached...
chain which rewrites table->record[0] buffer with uninitialized null bytes.
When we call 'UPDATE...' statement, compare_record uses this buffer and
valgrind warning occurs.
The fix is to init null bytes with default values.
2010-06-09 16:07:34 +04:00
Inaam Rana
8a94e69e5b Add call to log_free_check() in the DML code paths that were missing
this before.
2010-06-08 14:14:08 -04:00
Marko Mäkelä
d8aada889e Document Bug#54009 in the InnoDB Plugin ChangeLog. 2010-06-08 15:12:15 +03:00
Marko Mäkelä
0b767082e7 Bug#54009: Server crashes when data is selected from non backed up table
for InnoDB plugin

dict_load_table(): Pass the correct tablespace flags to
fil_open_single_table_tablespace(). For ROW_FORMAT=COMPACT and REDUNDANT,
the tablespace flags are 0. The table flags would be 0 or DICT_TF_COMPACT.
2010-06-08 15:10:41 +03:00
Marko Mäkelä
883b16c7f7 buf_page_get_gen(): Pass file,line to rw_lock_x_lock(). 2010-06-08 14:40:55 +03:00
karen.langford@oracle.com
6d3d61ce2a Raise version number after cloning 5.1.48 2010-06-03 16:03:17 +02:00
Jimmy Yang
c570b479e6 Remove unncessary name comapre in innobase_get_mysql_key_number_for_index()
introduced in bug fix #53592, since dict_table_t can sufficiently unique
identify the the table.
2010-06-03 06:44:48 -07:00
Marko Mäkelä
d38ef4e6c2 Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
Marko Mäkelä
72f68480fc Copy built-in InnoDB tests to mysql-test/suite/innodb_plugin. 2010-06-03 12:48:59 +03:00
Marko Mäkelä
6b15804ce7 Source have_innodb_plugin.inc in the plugin tests. 2010-06-03 12:46:37 +03:00
Marko Mäkelä
1c1dea62fb Add innodb_plugin to mysql-test-run default suites. 2010-06-03 12:45:34 +03:00
Marko Mäkelä
1655656b64 Document the Bug #53674 fix in the InnoDB Plugin 2010-06-02 13:39:03 +03:00
Marko Mäkelä
ac776a69e9 Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record
In semi-consistent read, only unlock freshly locked non-matching records.

lock_rec_lock_fast(): Return LOCK_REC_SUCCESS,
LOCK_REC_SUCCESS_CREATED, or LOCK_REC_FAIL instead of TRUE/FALSE.

enum db_err: Add DB_SUCCESS_LOCKED_REC for indicating a successful
operation where a record lock was created.

lock_sec_rec_read_check_and_lock(),
lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(),
lock_rec_lock_slow(), lock_rec_lock(), row_ins_set_shared_rec_lock(),
row_ins_set_exclusive_rec_lock(), sel_set_rec_lock(),
row_sel_get_clust_rec_for_mysql(): Return DB_SUCCESS_LOCKED_REC if a
new record lock was created. Adjust callers.

row_unlock_for_mysql(): Correct the function documentation.

row_prebuilt_t::new_rec_locks: Correct the documentation.
2010-06-02 13:37:14 +03:00
Marko Mäkelä
4a8aa70eb8 Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record
In semi-consistent read, only unlock freshly locked non-matching records.

Define DB_SUCCESS_LOCKED_REC for indicating a successful operation
where a record lock was created.

lock_rec_lock_fast(): Return LOCK_REC_SUCCESS,
LOCK_REC_SUCCESS_CREATED, or LOCK_REC_FAIL instead of TRUE/FALSE.

lock_sec_rec_read_check_and_lock(),
lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(),
lock_rec_lock_slow(), lock_rec_lock(), row_ins_set_shared_rec_lock(),
row_ins_set_exclusive_rec_lock(), sel_set_rec_lock(),
row_sel_get_clust_rec_for_mysql(): Return DB_SUCCESS_LOCKED_REC if a
new record lock was created. Adjust callers.

row_unlock_for_mysql(): Correct the function documentation.

row_prebuilt_t::new_rec_locks: Correct the documentation.
2010-06-02 13:26:37 +03:00
Marko Mäkelä
9938680e38 fil_print_orphaned_tablespaces(): Unused function, remove. 2010-06-02 13:19:40 +03:00
Georgi Kodinov
def4e63fb3 merge 2010-06-02 11:44:11 +03:00
Georgi Kodinov
a92adf154c changed the tree name 2010-06-02 11:42:37 +03:00
Marko Mäkelä
54e234a2c9 Document Bug #48197 fix 2010-06-01 16:58:02 +03:00
Marko Mäkelä
06a0882d60 Bug#48197: Concurrent rw_lock_free may cause assertion failure
rw_lock_t: Remove magic_n unless UNIV_DEBUG is defined.
rw_lock_free(): Invalidate magic_n only after removing from rw_lock_list.
2010-06-01 16:43:35 +03:00
Georgi Kodinov
6b101d4ffc Bug#40928 : make main.func_str experimental on Solaris 2010-06-01 15:16:35 +03:00
Georgi Kodinov
8cf7586e43 Bug #54138 : making main.sp and rpl.rpl_row_sp011 experimental on solaris 2010-06-01 15:14:38 +03:00
Marko Mäkelä
831e6d9355 Minor cleanup.
lock_rec_unlock(): Cache first_lock and rewrite while() loops as for().

btr_cur_optimistic_update(): Use common error handling return.

row_create_prebuilt(): Add Valgrind instrumentation.
2010-06-01 15:07:51 +03:00
Marko Mäkelä
0ca5b0f6eb Document the Bug #53812 fix. 2010-06-01 15:05:21 +03:00
Georgi Kodinov
87ea07928a merged mysql-5.0-bugteam -> mysql-5.1-bugteam 2010-06-01 14:48:24 +03:00
Georgi Kodinov
0563526ef8 merge mysql-5.1 -> mysql-5.1-bugteam 2010-06-01 14:44:31 +03:00
Georgi Kodinov
f9823c024e merged mysql-5.0 to mysql-5.0-bugteam 2010-06-01 14:28:58 +03:00
Marko Mäkelä
d99be48c2a Bug#53812: assert row/row0umod.c line 660 in txn rollback after crash recovery
row_undo_mod_upd_exist_sec(): Tolerate a failure to build the index entry
for a DYNAMIC or COMPRESSED table during crash recovery.
2010-06-01 13:37:38 +03:00
Sergey Glukhov
d28369b121 test case fix 2010-06-01 11:54:06 +04:00
Mattias Jonsson
79c30dd0d4 post push fix for bug#49161
result file differs on embedded
2010-06-01 09:02:28 +02:00
Vasil Dimov
f5fd8530f6 Merge a change from mysql-trunk-innodb:
------------------------------------------------------------
  revno: 3127
  revision-id: vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1
  parent: vasil.dimov@oracle.com-20100531105923-kpjwl4rbgfpfj13c
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-trunk-innodb
  timestamp: Mon 2010-05-31 18:23:41 +0300
  message:
    Fix Bug #53947 InnoDB: Assertion failure in thread 4224 in file .\sync\sync0sync.c line 324
    
    Destroy the rw-lock object before freeing the memory it is occupying.
    If we do not do this, then the mutex that is contained in the rw-lock
    object btr_search_latch_temp->mutex gets "freed" and subsequently
    mutex_free() from sync_close() hits a mutex whose memory has been
    freed and crashes.
    
    Approved by:	Heikki (via IRC)
    Discussed with:	Calvin
2010-05-31 19:35:40 +03:00
Sergey Glukhov
fe5d54959c Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values
Field_time::get_date method does not initialize MYSQL_TIME::time_type field.
The fix is to init this field.
2010-05-31 13:25:11 +04:00
Vasil Dimov
90f402be2f Merge mysql-5.1-innodb -> mysql-5.1 2010-05-31 11:23:07 +03:00
Jimmy Yang
bba92ac8a4 This is to fix a special case for the fix on bug #53592, where the
err_index could be not a member of the share structure or prebuilt
structure passed from MySQL. For now, we resort to the traditional
way of scanning index->table for the index number.
2010-05-28 06:17:37 -07:00
Mattias Jonsson
6498472b9d merge 2010-05-28 14:49:25 +02:00
5873b972d9 Postfix for BUG#49741
Add code to waiting for a set of errors.
Add code to waiting for an error instead of waiting for io thread to stop, as
after 'START SLAVE', the status of io thread is still not running.
But it doesn't mean slave io thread encounters an error.
2010-05-28 10:57:45 +08:00
Dmitry Lenev
78c6a8ca30 A 5.1-only version of fix for bug #46947 "Embedded SELECT
without FOR UPDATE is causing a lock".

SELECT statements with subqueries referencing InnoDB tables
were acquiring shared locks on rows in these tables when they
were executed in REPEATABLE-READ mode and with statement or
mixed mode binary logging turned on.

This was a regression which were introduced when fixing
bug 39843.

The problem was that for tables belonging to subqueries
parser set TL_READ_DEFAULT as a lock type. In cases when
statement/mixed binary logging at open_tables() time this
type of lock was converted to TL_READ_NO_INSERT lock at
open_tables() time and caused InnoDB engine to acquire
shared locks on reads from these tables. Although in some
cases such behavior was correct (e.g. for subqueries in
DELETE) in case of SELECT it has caused unnecessary locking.

This patch implements minimal version of the fix for the
specific problem described in the bug-report which supposed
to be not too risky for pushing into 5.1 tree.
The 5.5 tree already contains a more appropriate solution
which also addresses other related issues like bug 53921
"Wrong locks for SELECTs used stored functions may lead
to broken SBR".

This patch tries to solve the problem by ensuring that
TL_READ_DEFAULT lock which is set in the parser for
tables participating in subqueries at open_tables()
time is interpreted as TL_READ_NO_INSERT or TL_READ.
TL_READ is used only if we know that this is a SELECT
and that this particular table is not used by a stored
function.

Test coverage is added for both InnoDB and MyISAM.

This patch introduces an "incompatible" change in locking
scheme for subqueries used in SELECT ... FOR UPDATE and
SELECT .. IN SHARE MODE.

In 4.1 (as well as in 5.0 and 5.1 before fix for bug 39843)
the server would use a snapshot InnoDB read for subqueries
in SELECT FOR UPDATE and SELECT .. IN SHARE MODE statements,
regardless of whether the binary log is on or off.

If the user required a different type of read (i.e. locking
read), he/she could request so explicitly by providing FOR
UPDATE/IN SHARE MODE clause for each individual subquery.

The patch for bug 39843 broke this behaviour (which was not
documented or tested), and started to use locking reads for
all subqueries in SELECT ... FOR UPDATE/IN SHARE MODE.
This patch restores 4.1 behaviour.

This patch should be mostly null-merged into 5.5 tree.
2010-05-28 00:07:40 +04:00
Inaam Rana
063574c379 Fix the printout in for long semaphore waits to not
list a thread doing a wait_ex as an s-lock waiter.
2010-05-27 12:31:00 -04:00
Sergey Glukhov
fa3570f96a Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins
There are two problems:
1. In simplify_joins function we calculate table dependencies. If STRAIGHT_JOIN hint
is used for whole SELECT we do not count it and as result some dependendecies
might be lost. It leads to incorrect table order which is returned by
join_tab_cmp_straight() function.
2. make_join_statistics() calculate the transitive closure for relations a particular
JOIN_TAB is 'dependent on'.
We aggregate the dependent table_map of a JOIN_TAB by adding dependencies from other
tables which we depend on. However, this may also cause new dependencies to be
available after we have completed processing a certain JOIN_TAB.
Both these problems affect condition pushdown and as result condition might be pushed
into wrong table which leads to crash or even omitted which leads to wrong result.
The fix:
1. Use modified 'transitive closure' algorithm provided by Ole John Aske
2. Update table dependences in simplify_joins according to 
   global STRAIGHT_JOIN hint.
Note: the patch also fixes bugs 46091 & 51492
2010-05-27 19:13:53 +04:00
Alexey Kopytov
54a006fa0f Automerge. 2010-05-27 14:14:27 +04:00
Kristofer Pettersson
fd75f56fd5 automerge 2010-05-26 17:17:33 +02:00
Kristofer Pettersson
0ffa3863c7 Bug#52107 Comment in sql/net_serv.cc still makes "GPL protocol" claim
Removed misleading comments.
2010-05-26 17:13:02 +02:00
Jimmy Yang
1ecfadf83b Update ChangeLog for bug fix regarding 53582. 2010-05-25 22:38:14 -07:00
Jimmy Yang
0aed1f061e Fix Bug #53592 in plugin code, "crash replacing duplicates into table
after fast alter table added unique key". Look up MySQL index number should
go through index translation table.

rb://347, approved by Marko
2010-05-25 22:31:27 -07:00
Ramil Kalimullin
442e0f01f2 Manual merge. 2010-05-25 22:30:08 +04:00