Commit graph

449 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Sergey
6bd76f8b7e Merge pull request #73 from akopytov/MDEV-7658-5.5
Fixes MDEV-7658: MDEV-7026 fix reintroduces MDEV-6615 on AArch64
2015-05-27 10:27:18 +04:00
Alexey Kopytov
70bc0a3ef4 Fixes MDEV-7658: MDEV-7026 fix reintroduces MDEV-6615 on AArch64
This is an addendum to the fix for MDEV-7026. The ARM memory model is
similar to that of PowerPC and thus needs the same semantics with
respect to memory barriers. That is, os_atomic_test_and_set_*_release()
must be a store with a release barrier followed by a full
barrier. Unlike x86 using __sync_lock_test_and_set() which is
implemented as “exclusive load with acquire barriers + exclusive store”
is insufficient in contexts where os_atomic_test_and_set_*_release()
macros are used.
2015-05-26 23:56:00 +03:00
Jan Lindström
8350ea0514 Fix compiler error if compiler does not support c99 style
initializers.
2015-05-07 13:04:03 +03:00
Jan Lindström
f704b3335f Merge pull request #52 from openquery/MDEV-8053-c99-style-for-structure-members
c99 style for assigning structure members
2015-05-06 16:47:23 +03:00
Sergei Golubchik
4c87f72773 Merge branch '5.5' into bb-5.5-serg 2015-04-29 16:24:52 +02:00
Sergei Golubchik
67a3ddf17a Merge branch 'merge-xtradb-5.5' into 5.5 2015-04-28 13:54:37 +02:00
Sergei Golubchik
40e95608d9 percona-server-5.5.42-37.1.tar.gz 2015-04-28 13:42:58 +02:00
Jan Lindström
4c174fcb4a MDEV-8020: innodb.innodb-mdev-7055 produces valgrind warnings in buildbot
Fixed by reverting incorrect fix of MDEC-7055 (reopened) and removing the
test case (because it now crashes).
2015-04-28 15:29:46 +03:00
Sergei Golubchik
fd39c56eff move to storage/xtradb/ 2015-04-27 23:37:51 +02:00
Sergei Golubchik
245cc73452 MDEV-7434 XtraDB does not build on Solaris 2015-04-27 15:42:12 +02:00
Daniel Black
4d606cb955 c99 style for assigning structure members 2015-04-25 22:57:33 +10:00
Sergei Golubchik
17a37796e1 after innodb/xtradb merge: use the correct visibility for internal functions
otherwise innodb plugin might invoke xtradb function with the same name,
and that might crash (./mtr --emb innodb.strict_mode)
2015-03-06 18:13:06 +01:00
Jan Lindström
206b111b11 MDEV-7672: Crash creating an InnoDB table with foreign keys
Analysis: after a red-black-tree lookup we use node withouth
checking did lookup succeed or not. This lead to situation
where NULL-pointer was used.

Fix: Add additional check that found node from red-back-tree
is valid.
2015-03-06 11:19:23 +02:00
Jan Lindström
f66fbe8ce0 MDEV-7578 :Slave is ~10x slower to execute set of statements compared to master when using RBR
Analysis: On master when executing (single/multi) row INSERTs/REPLACEs
InnoDB fallback to old style autoinc locks (table locks)
only if another transaction has already acquired the AUTOINC lock.
Instead on slave as we are executing log_events and sql_command
is not correctly set, InnoDB does not use new style autoinc
locks when it could.

Fix: Use new style autoinc locks also when
thd_sql_command(user_thd) == SQLCOM_END i.e. this is RBR event.
2015-03-05 12:05:59 +02:00
Sergei Golubchik
5dce6aa1fe Merge remote-tracking branch 'bzr/5.5' into bb-5.5-merge 2015-02-12 13:14:55 +01:00
Sergei Golubchik
2a1be9cdf8 XtraDB 5.5.41-37.0 2015-02-11 20:40:56 +01:00
Jan Lindström
44a9e3f7b4 MDEV-7139: Sporadic failure in innodb.innodb_corrupt_bit on P8
The testcase fails randomly due to ibuf merge happening in the background.
Fix not to do any merges with ibuf_debug enabled.
2015-02-09 16:14:27 +02:00
Jan Lindström
8cc9751165 MDEV-7538: Wrong constraint (TINYINT or MEDIUMINT and INT)
causes server crash

Analysis: If wrong data types used on foreign constraint there
was possibility that foreign->id is NULL when incorrect
foreign constraint was removed from the dictionary cache.

Fix: Add guard foreign->id != NULL before trying to lookup
or remove the foreign constraint from dictionary cache.

Tested using user database where problem was repeatable.
2015-02-04 14:40:46 +02:00
Jan Lindström
f32091532d MDEV-7055: MySQL#74664 - InnoDB: Failing assertion: len <= col->len || col->mtype == 5 || (col->len == 0 && col->mtype == 1) in file rem0rec.cc line 845
Debug assertion maybe too strict.
2015-02-04 10:50:16 +02:00
Jan Lindström
5fafc3ce42 MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled
Patch by James Taylor.
2014-12-28 13:24:53 +02:00
Sergey Vojtovich
094640c036 Fixed a couple of compiler warnings. 2014-12-19 23:17:59 +04:00
Sergey Vojtovich
ed313e8a92 MDEV-7148 - Recurring: InnoDB: Failing assertion: !lock->recursive
On PPC64 high-loaded server may crash due to assertion failure in InnoDB
rwlocks code.

This happened because load order between "recursive" and "writer_thread"
wasn't properly enforced.
2014-12-01 14:58:29 +04:00
Jan Lindström
89a3628b0b Better comments part 2 with proof and simplified implementation.
Thanks to Daniel Black.
2014-11-25 12:04:32 +02:00
Jan Lindström
e5802c38f9 Better comments and add a test case. 2014-11-25 08:06:41 +02:00
Sergey Vojtovich
4472a0ef95 MDEV-7026 - Race in InnoDB/XtraDB mutex implementation can stall or hang the
server

This is an addition to original patch. Added full memory barrier to ensure
proper StoreLoad order between waiters and lock_word on PPC64.
2014-11-21 15:23:18 +04:00
Jan Lindström
b0febdb66e MDEV-7084: innodb index stats inadequate using constant innodb_stats_sample_pages
Use traditional statistics estimation by default (innodb-stats-traditional=true).
There could be performance regression for customers if there is a lot of
open table operations.
2014-11-21 13:27:36 +02:00
Jan Lindström
8bc5eabea8 MDEV-7084: innodb index stats inadequate using constant
innodb_stats_sample_pages

Analysis: If you set the number of analyzed pages 
to very low number compared to actual pages on 
that table/index it randomly pics those pages 
(default 8 pages), this leads to fact that query 
after analyze table returns different results. If 
the index tree is small, smaller than 10 * 
n_sample_pages + total_external_size, then the 
estimate is ok. For bigger index trees it is 
common that we do not see any borders between 
key values in the few pages we pick. But still 
there may be n_sample_pages different key values, 
or even more. And it just tries to 
approximate to n_sample_pages (8).

Fix: (1) Introduced new dynamic configuration variable
innodb_stats_sample_traditional  that retains
the current design. Default false.

(2) If traditional sample is not used we use
n_sample_pages = max(min(srv_stats_sample_pages,
                         index->stat_index_size),
                     log2(index->stat_index_size)*
                          srv_stats_sample_pages);

(3) Introduced new dynamic configuration variable
stat_modified_counter (default = 0) if set
sets lower bound for row updates when statistics is re-estimated.

If user has provided upper bound for how many rows needs to be updated
before we calculate new statistics we use minimum of provided value
and 1/16 of table every 16th round. If no upper bound is provided
(srv_stats_modified_counter = 0, default) then calculate new statistics
if 1 / 16 of table has been modified
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often.
@param t table
@return true if the table has changed too much and stats need to be
recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
	((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
	ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
		16 + (t)->stat_n_rows / 16))
2014-11-19 20:27:34 +02:00