Commit graph

15130 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
64149590c4 MDEV-7526: TokuDB doesn't build on OS X
This patch fixes another compilation error caused by specifying
attribute nonnull for all the parameters of the copyout function. This
is incorrect as the function actually gets called with null parameters
indirectly and thus only the output parameter should be nonnull.
2015-12-19 14:14:10 +02:00
Vicențiu Ciorbaru
f89c9fc4b7 MDEV-7526: TokuDB doesn't build on OS X
This patch fixes one compilation error related to __db_lsn struct. The
struct can not be defined as empty according to the main C standard.
In C++, this is handled by forcing a size of 1. To eliminate the error
we add a dummy char field of size 1. This has no effect on the C++
compiled code, but also removes the compiler error.
2015-12-19 14:14:05 +02:00
Jan Lindström
c19972fc87 MDEV-9251: Fix MySQL Bug#20755615: InnoDB compares column names case sensitively,
while according to Storage Engine API column names should be compared
case insensitively. This can cause FRM and InnoDB data dictionary to
go out of sync.
2015-12-11 14:33:41 +02:00
Sergei Golubchik
d67aacb4fb fix xtradb compilation on windows 2015-12-09 17:11:55 +01:00
Sergei Golubchik
142b725607 Merge branch 'merge/merge-xtradb-5.5' into 5.5
5.5.46-37.6
2015-12-09 12:57:04 +01:00
Sergei Golubchik
9457139e59 5.5.46-37.6 2015-12-09 12:27:04 +01:00
Sergei Golubchik
abf9d35213 Merge branch 'mysql/5.5' into 5.5 2015-12-09 10:00:49 +01:00
Sergei Golubchik
f18599a129 tokudb compilation warnings
5.5 patch only
2015-12-07 15:20:24 +01:00
Sergei Golubchik
18954ff25d MDEV-8313 Got an error writing communication packets
Don't let network errors from mysql_close() leak into THD.

* remove incorrect upstream fix
** table->in_use can be NULL, must use ha_thd()
** clear_error() may remove earlier errors, don't use it
* fix the bug properly in federated and federatedx
2015-12-07 15:20:23 +01:00
Sergei Golubchik
354e567c23 federatedx small cleanup
* reduce code duplication
* change int->void for the function that doesn't return an error
* use ha_thd()
2015-12-07 15:20:23 +01:00
Sergei Golubchik
ef47b62551 MDEV-8827 Duplicate key with auto increment
fix innodb auto-increment handling
three bugs:
1. innobase_next_autoinc treated the case of current<offset incorrectly
2. ha_innobase::get_auto_increment didn't recalculate current when increment changed
3. ha_innobase::get_auto_increment didn't pass offset down to innobase_next_autoinc
2015-12-07 15:20:23 +01:00
Jan Lindström
e528fe79b8 Fix gcc v5.compiler errors. 2015-12-05 12:21:33 +02:00
Jan Lindström
082b859d0d MDEV-9233: Copying MySQL 5.5 data directory to 10.0 with partition tables crashes on insert
Analysis: There were two problems. (1) if partition table was
created using lower_case_tables = 1 on windows we did find the
correct table but we did not set share->ib_table correctly.
(2) we did open table on dictionary but did not increase
mysql_open_tables.

Fix: In xtradb allow access to tables with incorrect
lower case names (warning is printed to error log). If
table is opened increase mysql_open_tables count to avoid
crash on flush tables.
2015-12-04 14:24:03 +02:00
Jan Lindström
33589b25ef MDEV-7762 InnoDB: Failing assertion: block->page.buf_fix_count > 0 in buf0buf.ic line 730
Analysis: debug only assertion I_S function (IS is XtraDB feature) is calling
buf_block_get_frame on any page it reads, which debug-asserts that the page is
buffer-fixed, which is not the case in I_S query.

Fixed by holding the buffer page mutex while the fields are read directly.
2015-12-03 13:18:10 +02:00
Jan Lindström
5d754fce95 MDEV-8854: New warning messages are unreadable
Improved warning messages by quote marks.
2015-11-09 09:24:52 +02:00
Sreeharsha Ramanavarapu
5e9a50efc3 Bug #22023218: MYSQL 5.5: MAIN.FULLTEXT HAS VALGRIND ISSUES.
Issue
-----
This problem occurs when varchar columns are used in a
internal temporary table. The type of the field is set
incorrectly to the generic FIELD_NORMAL type. This in turn
results in an inaccurate calculation of the record length.
Valgrind issues will occur since initialization has not
happend for some bytes.

Fix
----
While creating the temporary table, the type of the field
needs to be to set FIELD_VARCHAR. This will allow myisam
to calculate the record length accurately.

This fix is a backport of BUG#13350136.
2015-11-03 07:43:54 +05:30
Sergei Golubchik
16c4b3c68b fixes for buildbot:
* OSX (mysqlimport freeing unallocated memory)
* Windows (didn't compile MSI)
* fulltest2 (innodb crashes in --embedded --big)
2015-10-09 16:43:59 +02:00
Sergei Golubchik
f41a41fd91 Merge branch 'merge-xtradb-5.5' into 5.5 2015-10-09 00:06:16 +02:00
Sergei Golubchik
db79f4cf61 5.5.45-37.4 2015-10-08 23:02:43 +02:00
Sergei Golubchik
82e9f6d948 Merge remote-tracking branch 'mysql/5.5' into 5.5 2015-10-08 22:54:24 +02:00
Jan Lindström
a95711e45d MDEV-8855: innodb.innodb-fk-warnings fails on Windows
Fixed incorrect access to freed memory.
2015-09-29 08:39:54 +03:00
Annamalai Gurusami
8ea80ecfeb Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
Note: Backporting the patch from mysql-5.6.

Problem:

A CREATE TABLE with an invalid table name is detected
at SQL layer. So the table name is reset to an empty
string.  But the storage engine is called with this
empty table name.  The table name is specified as
"database/table".  So, in the given scenario we get
only "database/".

Solution:

Within InnoDB, detect this error and report it to
higher layer.

rb#9274 approved by jimmy.
2015-09-22 06:21:13 +02:00
Marko Mäkelä
adf12e6e17 Adapt to WL#8845 Implement an InnoDB redo log format version identifier
recv_find_max_checkpoint(): Amend the error message to give advice
about downgrading. The 5.7.9 redo log format was intentionally changed
so that older MySQL versions will not find a valid redo log checkpoint.
2015-09-11 12:06:51 +03:00
Aditya A
608efca4c4 Bug #21025880 DUPLICATE UK VALUES IN READ-COMMITTED (AGAIN)
PROBLEM

Whenever we insert in unique secondary index we take shared
locks on all possible duplicate record present in the table.
But while during a replace on the unique secondary index ,
we take exclusive and locks on the all duplicate record.
When the records are deleted, they are first delete marked
and later purged by the purge thread. While purging the
record we call the lock_update_delete() which in turn calls
lock_rec_inherit_to_gap() to inherit locks of the deleted
records. In repeatable read mode we inherit all the locks
from the record to the next record  but in the read commited
mode we skip inherting them as gap type locks. We make a
exception here if the lock on the records is  in shared mode
,we assume that it is set during insert for unique secondary
index and needs to be inherited to stop constraint violation.
We didnt handle the case when exclusive locks are set during
replace, we skip inheriting locks of these records and hence
causing constraint violation.

FIX

While inheriting the locks,check whether the transaction is
allowed to do TRX_DUP_REPLACE/TRX_DUP_IGNORE, if true
inherit the locks.

[ Revewied by Jimmy #rb9709]
2015-08-12 19:17:26 +05:30
Shaohua Wang
f59d68eeae BUG#21102971 data corruption on arm64
The root cause is that x86 has a stronger memory model than the ARM
processors. And the GCC builtins didn't issue the correct fences when
setting/unsetting the lock word. In particular during the mutex release.

The solution is rewriting atomic TAS operations: replace '__sync_' by
'__atomic_' if possible.

Reviewed-by: Sunny Bains      <sunny.bains@oracle.com>
Reviewed-by: Bin Su           <bin.x.su@oracle.com>
Reviewed-by: Debarun Banerjee <debarun.banerjee@oracle.com>
Reviewed-by: Krunal Bauskar   <krunal.bauskar@oracle.com>
RB: 9782
RB: 9665
RB: 9783
2015-08-10 16:31:05 +08:00
Sergei Golubchik
17a4a39c15 Merge branch 'merge-xtradb-5.5' into 5.5
5.5.44-37.3
2015-08-01 15:08:33 +02:00
Sergei Golubchik
1b0c81c917 5.5.44-37.3 2015-08-01 15:02:14 +02:00
Sergei Golubchik
6300f2f274 Merge tag 'mysql-5.5.45' into 5.5 2015-08-01 14:56:18 +02:00
Jan Lindström
360e597c3c Make sure name buffer has string end marker on correct place. 2015-07-31 12:07:23 +03:00
Jan Lindström
fa765a4525 MDEV-6697: Improve foreign keys warnings/errors
There is several different ways to incorrectly define
foreign key constraint. In many cases earlier MariaDB
versions the error messages produced by these cases
are not very clear and helpful. This patch improves
the warning messages produced by foreign key parsing.
2015-07-31 08:59:13 +03:00
Jan Lindström
e05cd97b8a MDEV-8524: Improve error messaging when there is duplicate key or foreign key names
Added better error message that will be printed when foreign key
constraint name in create table is not unique in database.
2015-07-31 08:59:13 +03:00
Thirunarayanan Balathandayuthapani
18b2c77780 Merge branch 'mysql-5.1' into mysql-5.5 2015-07-29 18:27:39 +05:30
Thirunarayanan Balathandayuthapani
641ab6f368 Bug #20796566 ERROR: INSERT BUFFER INSERT FAIL CANNOT
INSERT INDEX RECORD

Problem:
=======

IBUF_BITMAP_FREE bit in ibuf bitmap array is used to indicate the free
space available in leaf page. IBUF_BITMAP_FREE bit indicates free
space more than actual existing free space for the leaf page.

Solution:
=========

Ibuf_bitmap_array is not updated for the secondary index leaf page when
insert operation is done by updating a delete marked existing
record in the index.

Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com>
RB: 9544
2015-07-29 18:24:20 +05:30
Jan Lindström
7a9670218b MDEV-8474: InnoDB sets per-connection data unsafely
Analysis: At check_trx_exists function InnoDB allocates
a new trx if no trx is found from thd but this newly
allocated trx is not registered to thd. This is unsafe,
because nothing prevents InnoDB plugin from being uninstalled
while there's active transaction. This can cause crashes, hang
and any other odd behavior. It may also corrupt stack, as
functions pointers are not available after dlclose.

Fix: The fix is to use thd_set_ha_data() when
manipulating per-connection handler data. It does appropriate
plugin locking.
2015-07-21 12:12:58 +03:00
Christopher Powers
49667f0441 Bug#21374104 SETUP_TIMERS INITIALIZATION ASSUMES CYCLE TIMER IS ALWAYS AVAILABLE
For WAIT events, fall back to other timers if CYCLE is not available.
2015-07-10 20:42:33 +02:00
Annamalai Gurusami
92b4683d59 Bug #19138298 RECORD IN INDEX WAS NOT FOUND ON ROLLBACK, TRYING TO INSERT
Post push fix.  The function cmp_dtuple_rec() was used without a prototype
in the file row0purge.c.  Adding the include file rem0cmp.h to row0purge.c
to resolve this issue.

approved by Krunal over IM.
2015-06-22 12:49:32 +05:30
Annamalai Gurusami
db2ed27e0e Bug #20762798 FK DDL: CRASH IN DICT_FOREIGN_REMOVE_FROM_CACHE
Problem:

If we add a referential integrity constraint with a duplicate
name, an error occurs.  The foreign key object would not have
been added to the dictionary cache.  In the error path, there
is an attempt to remove this foreign key object. Since this
object is not there, the search returns a NULL result.
De-referencing the null object results in this crash.

Solution:

If the search to the foreign key object failed, then don't
attempt to access it.

rb#9309 approved by Marko.
2015-06-19 10:17:52 +05:30
Sergei Golubchik
d199a0ffb0 more renames after tokudb merge 2015-06-11 17:47:52 +02:00
Sergei Golubchik
7c98e8a31b fix after the tokudb ft-index merge 2015-06-11 16:43:56 +02:00
Sergey Vojtovich
80f6b22593 MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with disabled
keys

Fixed that OPTIMIZE TABLE against MyISAM/Aria table may write uninitialized key
root position for disabled keys.
2015-06-09 23:24:03 +04:00
Sergei Golubchik
b41ad55265 update tokudb version 2015-06-08 21:48:19 +02:00
Sergei Golubchik
9a3b975da6 Merge branch '5.5' into bb-5.5-serg 2015-06-05 09:51:17 +02:00
Sergei Golubchik
ae0c576d46 Merge branch 'merge/merge-xtradb-5.5' into bb-5.5-serg
update tests
2015-06-05 02:14:49 +02:00
Sergei Golubchik
f84f577aa1 Merge tag 'mysql-5.5.44' into bb-5.5-serg 2015-06-05 02:06:51 +02:00
Sergei Golubchik
750aa8b09d 5.5.43-37.2 2015-06-04 18:58:12 +02:00
Jan Lindström
a8b8544a03 MDEV-7906: InnoDB: Failing assertion: prebuilt->sql_stat_start || trx->state == 1 on concurrent multi-table update
Analysis: Problem is that SQL-layer calls handler API after storage
engine has already returned error state. InnoDB does internal
rollback when it notices transaction error (e.g. lock wait timeout,
deadlock, etc.) and after this transaction is not naturally in
correct state to continue.

Fix: Do not continue fetch operations if transaction is not started.
2015-06-04 15:02:24 +03:00
Sergei Golubchik
7b05650c7d Merge tag 'tokudb-engine/tokudb-7.5.7' into 5.5 2015-06-03 20:24:51 +02:00
Sergei Golubchik
e500c471d7 Merge tag 'tokudb-ft-index/tokudb-7.5.7' into 5.5 2015-06-03 19:47:46 +02:00
Debarun Banerjee
e59914034a BUG#21065746 RQG_PARTN_PRUNING_VALGRIND FAILED IN REM0REC.CC
Problem :
---------
This is a regression of Bug#19138298. In purge_node_t::validate_pcur
we are trying to get offsets for all columns of clustered index from
stored record in persistent cursor. This would fail when stored record
is not having all fields of the index. The stored record stores only
fields that are needed to uniquely identify the entry.

Solution :
----------
1. Use pcur.old_n_fields to get fields that are stored
2. Add comment to note dependency between stored fields in purge node
ref and stored cursor.
3. Return if the cursor record is not already stored as it is not safe
to access cursor record directly without latch.

Reviewed-by: Marko Makela <marko.makela@oracle.com>

RB: 9139
2015-06-03 11:43:12 +05:30
Debarun Banerjee
4b8304a9a4 BUG#21126772 VALGRIND FAILURE IN ENGINES/FUNCS SUITE
Problem :
---------
This is a regression of bug-19138298. During purge, if
btr_pcur_restore_position fails, we set found_clust to FALSE
so that it can find a possible clustered index record in future
calls for the same undo entry. This, however, overwrites the
old_rec_buf while initializing pcur again in next call.

The leak is reproducible in local environment and with the
test provided along with bug-19138298.

Solution :
----------
If btr_pcur_restore_position() fails close the cursor.

Reviewed-by: Marko Makela <Marko.Makela@oracle.com>
Reviewed-by: Annamalai Gurusami <Annamalai.Gurusami@oracle.com>

RB: 9074
2015-06-03 11:27:38 +05:30