Commit graph

757 commits

Author SHA1 Message Date
Sergei Golubchik
01be663c50 Merge branch 'merge-xtradb-5.6' into 10.0 2015-10-09 18:16:27 +02:00
Sergei Golubchik
6a821d78a6 5.6.26-74.0 2015-10-09 17:20:49 +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
Sergey Vojtovich
bb22eb55db MDEV-8379 - SUSE mariadb patches
Corrected variable name in dead code for consistency.

Patch contributed by Michal Hrusecky.
2015-10-01 13:40:23 +04: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
1610c4285a Merge branch 'bb-10.0-jan' into 10.0
5.5 with our InnoDB changes
2015-08-05 00:02:46 +02:00
Jan Lindström
d71b584069 Fix merge error. 2015-08-04 08:33:31 +03:00
Jan Lindström
9a5787db51 Merge commit '96badb16afcf' into 10.0
Conflicts:
	client/mysql_upgrade.c
	mysql-test/r/func_misc.result
	mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
	mysql-test/suite/innodb/r/innodb-fk.result
	mysql-test/t/subselect_sj_mat.test
	sql/item.cc
	sql/item_func.cc
	sql/log.cc
	sql/log_event.cc
	sql/rpl_utility.cc
	sql/slave.cc
	sql/sql_class.cc
	sql/sql_class.h
	sql/sql_select.cc
	storage/innobase/dict/dict0crea.c
	storage/innobase/dict/dict0dict.c
	storage/innobase/handler/ha_innodb.cc
	storage/xtradb/dict/dict0crea.c
	storage/xtradb/dict/dict0dict.c
	storage/xtradb/handler/ha_innodb.cc
	vio/viosslfactories.c
2015-08-03 23:09:43 +03:00
Sergei Golubchik
4f479fb13f Merge branch 'merge-xtradb-5.6' into 10.0
XtraDB 5.6.25-73.1
2015-08-03 14:03:46 +02: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
0b3eb4559b 5.6.25-73.1 2015-08-01 15:04:20 +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
Jan Lindström
6efdc398ba MDEV-8463: 10.0 tree does not build
Merge error on srv0start.cc
2015-07-14 20:36:23 +03:00
Jan Lindström
a9960ef0ec MDEV-8386: MARIADB creates very big tmp file > 351Gb. Started happening after Version 10.0.16-15
Fixed small size limit and added additional information if we reserve
new pages more then 50 times.
2015-07-14 20:14:48 +03:00
Jan Lindström
0a43236fbe Code cleanup. 2015-07-14 20:14:48 +03:00
josh4trunks
a95be9644a Apply fix for raw devices to XtraDB 2015-07-12 19:53:38 -07:00
josh4trunks
ee5633a39e Apply fix for raw devices to XtraDB 2015-07-12 19:46:29 -07:00
Jan Lindström
1a8cf15d63 MDEV-8392: Couldn't alter field with default value for make it not nullable.
Analysis; Problem is that InnoDB does not have support for generating
CURRENT_TIMESTAMP or constant default.

Fix: Add additional check if column has changed from NULL -> NOT NULL
and column default has changed. If this is is first column definition
whose SQL type is TIMESTAMP and it is defined as NOT NULL and
it has either constant default or function default we must use
"Copy" method for alter table.
2015-06-30 22:24:37 +03:00
Jan Lindström
27f0bd7d95 Fix test case innodb.xa_recovery crash on xtradb. 2015-06-16 17:33:21 +03:00
Jan Lindström
96806025eb Fix test failure on main.partition_innodb. 2015-06-16 16:20:55 +03:00
Jan Lindström
ababe047f8 Fix crash on test innodb.innodb-virtual-columns. We should create
only columns really stored to database.
2015-06-16 15:16:53 +03:00
Sergei Golubchik
5355972b71 after merge fixes: InnoDB and XtraDB 2015-06-16 12:49:00 +02:00
Sergei Golubchik
9859d366b5 Merge branch 'merge-xtradb-5.6' into 10.0 2015-06-16 12:46:14 +02:00
Sergei Golubchik
90849456d7 5.6.24-72.2 2015-06-16 11:04:40 +02:00
Jan Lindström
fc31e3114b MDEV-8179: Absent progress report for operations on InnoDB tables
Add progress info on InnoDB/XtraDB row0merge phase. Note that we
do not know exact number of rounds merge sort needs at start thus
also progress report might not be accurate.
2015-06-14 17:32:21 +03:00
Sergei Golubchik
810cf362ea Merge branch '5.5' into 10.0 2015-06-11 20:20:35 +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
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
Jan Lindström
a99efc00a6 Merge pull request #74 from akopytov/MDEV-7658-10.0
Mdev 7658 10.0
2015-05-27 09:16:24 +03:00
Alexey Kopytov
7f7cee8700 Merge branch 'MDEV-7658-5.5' into MDEV-7658-10.0 2015-05-26 23:58:51 +03: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
Sergei Golubchik
ac286a9bc7 Merge branch '5.5' into 10.0 2015-05-08 11:20:43 +02: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
5dcb111c38 Merge branch 'Buggynours:10.0' into 10.0 2015-05-05 07:50:31 +02:00
Sergei Golubchik
bbcc8e6924 XtraDB-5.6.23-72.1 2015-05-05 00:08:58 +02:00
Sergei Golubchik
a4416abdde 5.6.23-72.1 2015-05-04 22:17:04 +02:00
Sergei Golubchik
49c853fb94 Merge branch '5.5' into 10.0 2015-05-04 22:00:24 +02:00
Sergei Golubchik
14a142fca6 move to storage/xtradb 2015-05-04 19:15:28 +02:00
Jan Lindström
37093eb51e MDEV-8079: Crash when running MariaDB Debug with InnoDB on Windows
Problem was that std::vector was allocated using calloc instead of
new, this caused vector constructor not being called and vector
metadata not initialized.
2015-05-01 14:51:50 +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
Jan Lindström
e9c10f9916 MDEV-7908: assertion in innobase_release_savepoint
Problem was that in XA prepared state we should still be able to
release a savepoint, but assertions were too strict.
2015-04-06 17:38:51 +03:00
Jan Lindström
b53bcd438f MDEV-7367: Updating a virtual column corrupts table which crashes server
Analysis: MySQL table definition contains also virtual columns. Similarly,
index fielnr references MySQL table fields. However, InnoDB table definition
does not contain virtual columns. Therefore, when matching MySQL key fieldnr
we need to use actual column name to find out referenced InnoDB dictionary
column name.

Fix: Add new function to match MySQL index key columns to InnoDB dictionary.
2015-03-31 09:16:48 +03:00
Jan Lindström
0563f49ba3 MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob update
Replace static array of thread sync levels with std::vector.
2015-03-31 09:16:48 +03:00
Jan Lindström
1020d56934 Better and more correct comment. 2015-03-18 15:17:17 +02:00
Jan Lindström
2bdbfd334b Fix assertion failure seen on Buildbot win32-debug
There is a bug in Visual Studio 2010
Visual Studio has a feature "Checked Iterators". In a debug build, every
iterator operation is checked at runtime for errors, e g, out of range.
Disable this "Checked Iterators" for Windows and Debug if defined.
2015-03-18 12:18:39 +02:00
Jan Lindström
c14d9c21f0 Make sure that sync level vector is emptied. 2015-03-18 06:25:10 +02:00
Jan Lindström
99a2c061d7 MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob update
Problem was that static array was used for storing thread mutex sync levels.
Fixed by using std::vector instead.

Does not contain test case to avoid too big memory/disk space usage
on buildbot VMs.
2015-03-17 20:35:05 +02:00
Kristian Nielsen
184f718fef MDEV-7249: Performance problem in parallel replication with multi-level slaves
Parallel replication (in 10.0 / "conservative" mode) relies on binlog group
commits to group transactions that can be safely run in parallel on the
slave. The --binlog-commit-wait-count and --binlog-commit-wait-usec options
exist to increase the number of commits per group. But in case of conflicts
between transactions, this can cause unnecessary delay and reduced througput,
especially on a slave where commit order is fixed.

This patch adds a heuristics to reduce this problem. When transaction T1 goes
to commit, it will first wait for N transactions to queue up for a group
commit. However, if we detect that another transaction T2 is waiting for a row
lock held by T1, then we will skip the wait and let T1 commit immediately,
releasing locks and let T2 continue.

On a slave, this avoids the unfortunate situation where T1 is waiting for T2
to join the group commit, but T2 is waiting for T1 to release locks, causing
no work to be done for the duration of the --binlog-commit-wait-usec timeout.

(The heuristic seems reasonable on the master as well, so it is enabled for
all transactions, not just replication transactions).
2015-03-13 14:01:52 +01:00
Jan Lindström
702fdc52fa MDEV-7714: Make possible to get innodb internal primary key for wrapper
type storage engine.

Authored by: Kentoku Shiba
2015-03-12 18:37:32 +02:00
Jan Lindström
a7fd11b31d MDEV-7685: MariaDB - server crashes when inserting more rows than
available space on disk

Add error handling when disk full situation happens and
intentionally bring server down with stacktrace because
on all cases InnoDB can't continue anyway.
2015-03-09 18:33:25 +02:00
Jan Lindström
040027c888 MDEV-7627 :Some symbols in table name can cause to Error Code: 1050
when created FK

Analysis: Table name is on filename charset but foreign key
identifiers are not. This lead incorrect foreign key
identifier number to be used.

Fix: Convert foreign key identifier to filename charset before
comparing it to table name when largest foreign key identifier
number is resolved.
2015-03-09 09:47:25 +02:00
Sergei Golubchik
5f510a9175 Merge branch '5.5' into 10.0 2015-03-06 18:41:32 +01: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
Sergey Vojtovich
e13459a11e MDEV-7148 - Recurring: InnoDB: Failing assertion: !lock->recursive
Re-applied lost in the merge revision:
commit ed313e8a92
Author: Sergey Vojtovich <svoj@mariadb.org>
Date:   Mon Dec 1 14:58:29 2014 +0400

    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.
2015-03-05 15:30:11 +04: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
Buggynours
eb2f763872 Add #include <ostream> in dict0mem.h and change iterator to const_iterator in dic0mem.cc
This fix compiling error when compiled with Visual Studio 9 2008
2015-03-03 12:39:42 +01:00
Sergei Golubchik
6c09a72af5 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-24 20:52:37 +01:00
Jan Lindström
8799f87075 MDEV-7623: Add lock wait time and hold time to every record/table lock in
InnoDB transaction lock printout.
2015-02-24 10:33:49 +02:00
Jan Lindström
90635c6fb5 MDEV-7620: Transaction lock wait is missing number of lock
waits and total wait time.
2015-02-23 11:24:19 +02:00
Sergei Golubchik
f2cb45daf3 Merge remote-tracking branch 'origin/10.0' into 10.0 2015-02-22 21:45:24 +01:00
Sergei Golubchik
174bccd3ff xtradb 5.6.22-72.0 2015-02-18 20:31:40 +01:00
Sergei Golubchik
d7e7862364 Merge branch '5.5' into 10.0 2015-02-18 15:16:27 +01:00
Jan Lindström
a1a32f8f25 Revert file space allocation change on row0merge.cc. 2015-02-18 06:59:28 +02:00
Jan Lindström
454beee5fb MDEV-6288 :Innodb causes server crash after disk full, then can't ALTER TABLE any more
Fix try to avoid unnecessary crashes when disk full situation is reached
on alter table.
2015-02-13 11:49:31 +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
56da6252f7 Improve InnoDB transaction lock output by providing number of table locks
this transaction is currently holding and total number of table locks to
the table where lock is held.
2015-02-10 15:15:27 +02: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
Sergei Golubchik
f2be9c0fea after merge. innodb/xtradb to work on Windows 2015-01-22 08:58:13 +01:00
Sergei Golubchik
78e131d493 XtraDB 5.6.22-71.0 2015-01-21 14:34:58 +01:00
Sergei Golubchik
d854a254b8 remove incorrect asserts in innodb/xtradb. 0 is a valid file handle value. 2015-01-19 16:30:32 +01:00
Jan Lindström
4a3251595c MDEV-7403: should not pass recv_writer_thread_handle to CloseHandle()
Analysis: For some reason actual thread handle is not
returned on Windows instead lpThreadId was returned and
thread handle was closed after thread create. Later
CloseHandle was called for recv_writer_thread_handle
and psort_info->thread_hdl.

Fix: Return thread handle from os_thread_create()
also on Windows and store these thread handles also
in srv0start.cc so that they can be later closed.
2015-01-06 16:08:42 +02:00
Jan Lindström
de09076486 MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled
Patch by James Taylor.
2014-12-28 13:44:30 +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
Jan Lindström
e15a83c0c7 Better comments part 2 with proof and simplified implementation.
Thanks to Daniel Black.
2014-11-26 16:41:28 +02:00
Jan Lindström
f3bdf9d741 MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type)
after Operating system error number 36 in a file operation.

Analysis: os_file_get_status did not handle error ENAMETOOLONG
correctly.

Fix: Add correct handling for error ENAMETOOLONG. Note that on InnoDB
case the error is not passed all the way up to server. That would
be bigger rewamp.
2014-11-25 11:38:01 +02:00
Jan Lindström
b62c4c6586 Better comments and add a test case. 2014-11-25 08:31:03 +02:00
Jan Lindström
ef1ba3b1e6 MDEV-7164: innodb.innodb-alter-table-disk-full fails in buildbot on Windows
Analysis: Test case uses Linux specific error codes.

Fix: Can't run test case with Windows currently because requires
to inject error to system.
2014-11-24 15:26:47 +02:00
Sergei Golubchik
ffc0ef6316 5.5 merge 2014-11-21 20:20:39 +01: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
Sergei Golubchik
32ec8625af XtraDB 5.6.21-70.0 2014-11-20 17:05:13 +01:00
Sergei Golubchik
3c12c27907 5.5 merge 2014-11-20 16:07:34 +01:00
Sergei Golubchik
afca52bb52 5.5 merge 2014-11-20 15:26:31 +01: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
Sergei Golubchik
3495801e2e 5.5 merge 2014-11-19 17:23:39 +01:00
Kristian Nielsen
6ea41f1e84 MDEV-7026: Race in InnoDB/XtraDB mutex implementation can stall or hang the server.
The bug was that full memory barrier was missing in the code that ensures that
a waiter on an InnoDB mutex will not go to sleep unless it is guaranteed to be
woken up again by another thread currently holding the mutex. This made
possible a race where a thread could get stuck waiting for a mutex that is in
fact no longer locked. If that thread was also holding other critical locks,
this could stall the entire server. There is an error monitor thread than can
break the stall, it runs about once per second. But if the error monitor
thread itself got stuck or was not running, then the entire server could hang
infinitely.

This was introduced on i386/amd64 platforms in 5.5.40 and 10.0.13 by an
incorrect patch that tried to fix the similar problem for PowerPC.

This commit reverts the incorrect PowerPC patch, and instead implements a fix
for PowerPC that does not change i386/amd64 behaviour, making PowerPC work
similarly to i386/amd64.
2014-11-19 13:56:46 +01:00
Sergei Golubchik
303eec5774 MDEV-6880 Can't define CURRENT_TIMESTAMP as default value for added column
ALTER TABLE: don't fill default values per row, do it once.
And do it in two places - for copy_data_between_tables() and for online ALTER.

Also, run function_defaults test both for MyISAM and for InnoDB.
2014-11-18 22:25:33 +01:00
Jan Lindström
b7d32e053d MDEV-7083: sys_vars.innodb_sched_priority* tests fail in
buildbot on work-amd64-valgrind

Fixed issue by finding out first the current used priority
for both treads and using that seeing did we really change
the priority or not.
2014-11-14 09:13:13 +02:00
Jan Lindström
0f32299437 MDEV-7035: Remove innodb_io_capacity setting depending on
setting of innodb_io_capacity_max

(a) Changed the behaviour so that if you set innodb_io_capacity to a 
value > innodb_io_capacity_max that the value is accepted AND 
that innodb_io_capacity_max = innodb_io_capacity * 2.

(b) If someone wants to reduce innodb_io_capacity_max and 
reduce it below innodb_io_capacity then innodb_io_capacity 
should be reduced to the same level as innodb_io_capacity_max.

In both cases give a warning to user.
2014-11-13 13:24:26 +02:00
Jan Lindström
bff2d46bf7 MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex
Analysis: InnoDB error monitor is responsible to call every second
sync_arr_wake_threads_if_sema_free() to wake up possible hanging
threads if they are missed in mutex_signal_object. This is not
possible if error monitor itself is on mutex/semaphore wait. We
should avoid all unnecessary mutex/semaphore waits on error monitor.
Currently error monitor calls function buf_flush_stat_update()
that calls log_get_lsn() function and there we will try to get
log_sys mutex. Better, solution for error monitor is that in
buf_flush_stat_update() we will try to get lsn with
mutex_enter_nowait() and if we did not get mutex do not update
the stats.

Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
function. If returned lsn is 0, we do not update flush stats.
log_get_lsn_nowait() will use mutex_enter_nowait() and if
we get mutex we return a correct lsn if not we return 0.
2014-11-13 12:00:57 +02:00
Jan Lindström
84f3f3fa1e MDEV-7083: sys_vars.innodb_sched_priority* tests fail in buildbot
on work-amd64-valgrind.

Fixed issue by finding out first the current used priority
for both treads and using that seeing did we really change
the priority or not.
2014-11-13 11:05:22 +02:00
Jan Lindström
8c7ef99bb2 MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex
Analysis: InnoDB error monitor is responsible to call every second
sync_arr_wake_threads_if_sema_free() to wake up possible hanging 
threads if they are missed in mutex_signal_object. This is not 
possible if error monitor itself is on mutex/semaphore wait. We 
should avoid all unnecessary mutex/semaphore waits on error monitor.
Currently error monitor calls function buf_flush_stat_update() 
that calls log_get_lsn() function and there we will try to get 
log_sys mutex. Better, solution for error monitor is that in 
buf_flush_stat_update() we will try to get lsn with 
mutex_enter_nowait() and if we did not get mutex do not update 
the stats.

Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
function. If returned lsn is 0, we do not update flush stats. 
log_get_lsn_nowait() will use mutex_enter_nowait() and if
we get mutex we return a correct lsn if not we return 0.
2014-11-13 11:24:19 +02:00
Jan Lindström
2da6f7ceba MDEV-7017: Add function to print semaphore waits
Add function to print to stderr all current semaphore 
waits. This function should be able to executed 
inside a gdb/ddd.
2014-11-03 15:43:44 +02:00
Jan Lindström
8777e80151 MDEV-6759: innodb valgrind failures
Fix failure seen on dict_foreign_remove_partial().
2014-10-27 16:58:16 +02:00
Jan Lindström
85c21dbc47 MDEV-6925: Remove bad "" operators.
Merged Facebook commit ec1aac68c74f3c1e558d057c4c9fcfe6edbbea93
authored by Steaphan Greene from https://github.com/facebook/mysql-5.6

In C++11, "" is not parsed as before.  So "A""B" is not the same as "AB".
Instead, whitespace is required, like: "A" "B"
2014-10-26 07:29:37 +02:00
Jan Lindström
caeffc7a7d MDEV-6926: innodb_rows_updated is misleading on slav
Merged Facebook commit dd2d11be7aaf3be270e740fb95cbc4eacb52f4d7
authored by Rongrong Zhong from https://github.com/facebook/mysql-5.6

This fixes MySQL Bug #68220 innodb_rows_updated is misleading on slave
http://bugs.mysql.com/bug.php?id=68220

Added innodb_system_rows_read/inserted/updated/deleted counters
that are the equivalent of innodb_rows_* but that only account for
changes made to system databases (mysql, information_schame and
preformance_schema). These counters will be used on slaves to
differentiated the updates made on system databases from those made on
user databases.

innodb_rows_* status counters are not updated when innodb_system_rows_*
are updated.

dd2d11be7a
2014-10-26 07:22:51 +02:00
Jan Lindström
60e995cfec MDEV-6930: Make innodb_max_dirty_pages_pct my.cnf variable a double
Merged Facebook commit ecff018632c6db49bad73d9233c3cdc9f41430e9
authored by Steaphan Greene from https://github.com/facebook/mysql-5.6

This change is to fix: http://bugs.mysql.com/62534

This makes innodb_max_dirty_pages_pct a double with min,default,max values
0.001, 75, 99.999.

This also makes innodb_max_dirty_pages_pct_lwm and adaptive_flushing_lwm
doubles, as these sysvars are inter-dependent.

Added more to the BUFFER POOL AND MEMORY section of SHOW INNODB STATUS:
Percent pages dirty: X.X
This is all n_dirty_pages / used_pages
Percent all pages dirty: X.X
This is all n_dirty_pages / all-pages
Max dirty pages percent: X.X
This is innodb_max_dirty_pages_pct

Also changed all of buf from 2 to 3 digits of precision (%.2f -> %.3f).
2014-10-25 09:24:39 +03:00
Jan Lindström
cff0012d28 MDEV-6927: Share more structures
Merge Facebook commit f981a51a47519b0ba527917887f8adc6df9ae147
authored by Steaphan Greene from https://github.com/facebook/mysql-5.6.

This just moves some structure definitions from inside a
single .cc file to a shared .h file, with a few tweaks to
allow these structures to be shared.

On its own, it should have no actual effect. This is needed later.
2014-10-25 08:21:52 +03:00
Jan Lindström
3486135bb5 MDEV-6928: Add trx pointer to struct mtr_t
Merge Facebook commit 25295d003cb0c17aa8fb756523923c77250b3294
authored by Steaphan Greene from https://github.com/facebook/mysql-5.6

This adds a pointer to the trx to each mtr.
This allows the trx to be accessed in parts of the code
where it was otherwise not available. This is needed later.
2014-10-24 22:26:31 +03:00
Jan Lindström
78e31f0a2e MDEV-6931: Page cleaner should do LRU flushing regardless of server activity
Merge Facebook commit 926a077b14b73c14094de7fc7aa913241b801b4d
authored by Inaam Rana from https://github.com/facebook/mysql-5.6.

This is fix for upstream bugs
http://bugs.mysql.com/bug.php?id=71988
http://bugs.mysql.com/bug.php?id=70500

page_cleaner should work whether or not there is server activity.
Its iterations become a noop when there is no work to do but we
should not tie it to the server activity.

The page_cleaner thread does spurious background flushing
because of conditional sleep between iterations. The solution
is not to make sleep dependent on server activity etc.
2014-10-24 18:58:04 +03:00
Jan Lindström
7e71dfa9f5 MDEV-6933: Spurious lock_wait_timeout_thread wakeup in lock_wait_suspend_thread()
Merged Facebooks commit 6e06bbfa315ffb97d713dd6e672d6054036ddc21
authored by Inaam Rana from https://github.com/facebook/mysql-5.6.

Fixes MySQL bug http://bugs.mysql.com/bug.php?id=72123

lock_timeout thread works in a tight loop waking up every second
and checking for lock_wait_timeout. In addition, when a mysql
thread is forced to wait on a lock, it signals the lock_timeout thread
as well. This call is not required. In a heavily contended workload
each thread going to wait will signal the lock_timeout thread making
it work all the time. As lock_timeout thread scans the array of
waiting threads under lock_sys::wait_mutex which is already very
hot in contneded loads, these extra scans can cause significanct
performance regression.

Also, in various codepaths lock_timeout thread is signalled where
actual intention was to signal the innodb monitor thread.
2014-10-24 17:56:04 +03:00
Jan Lindström
f0debf2feb MDEV-6934: os_event_wait_time_low(): wait time calculation is messed up
Merged Facebook commit bdab302a7e3c37da21a1bffe1550cdbe6c906695
by Inaam Rana from https://github.com/facebook/mysql-5.6.

In os_event_wait_time_low() the logic to calculate abs_time
for wait is broken. The bug has been present at least since
5.5. It gets acutely sensitized when sub-second wait intervals
are passed. It is particularly relevant to us because the
page_cleaner thread will mostly request sub-second wait
intervals. This can potentially lead to a near tight loop
behaviour of page_cleaner with much less sleep then what we'd
actually expect.
2014-10-24 17:11:09 +03:00
Kristian Nielsen
4c07b93bdb Fix missing UNIV_INTERN on dict_table_check_foreign_keys().
When UNIV_INTERN is missing in built-in XtraDB, this causes the
innodb_plugin to call the XtraDB version of the function instead
of its own (seen in --embedded-server test failure in Buildbot).
This in turn causes bad things to happen in case of difference
between XtranDB and innodb_plugin.
2014-10-20 10:50:10 +02:00
Sergei Golubchik
1b75bed00f 5.5.40+ merge 2014-10-09 10:30:11 +02:00
Sergei Golubchik
7e6d4bba0c XtraDB 5.5.40-36.1 2014-10-08 00:44:37 +02:00
Sergei Golubchik
0d2cba5df2 XtraDB 5.5.39-36.0 2014-10-06 20:06:39 +02:00
Sergei Golubchik
22f9353bfd xtradb/innodb: fix to compile with VS 2008
and compiler warnings
2014-10-04 15:26:04 +02:00
Sergey Vojtovich
5e1fad8512 MDEV-6533 - MySQL Bug#72718 - CACHE_LINE_SIZE in innodb should be 128 on POWER
This patch is suggested by Stewart Smith.
Define CACHE_LINE_SIZE to 128 on POWER.
2014-10-03 17:38:46 +04:00
Michael Widenius
70823e1d91 MDEV-5120 Test suite test maria-no-logging fails
The reason for the failure was a bug in an include file on debian that causes 'struct stat'
to have different sized depending on the environment.

This patch fixes so that we always include my_global.h or my_config.h before we include any other files.

Other things:
- Removed #include <my_global.h> in some include files; Better to always do this at the top level to have as few
  "always-include-this-file-first' files as possible.
- Removed usage of some include files that where already included by my_global.h or by other files.


client/mysql_plugin.c:
  Use my_global.h first
client/mysqlslap.c:
  Remove duplicated include files
extra/comp_err.c:
  Remove duplicated include files
include/m_string.h:
  Remove duplicated include files
include/maria.h:
  Remove duplicated include files
libmysqld/emb_qcache.cc:
  Use my_global.h first
plugin/semisync/semisync.h:
  Use my_pthread.h first
sql/datadict.cc:
  Use my_global.h first
sql/debug_sync.cc:
  Use my_global.h first
sql/derror.cc:
  Use my_global.h first
sql/des_key_file.cc:
  Use my_global.h first
sql/discover.cc:
  Use my_global.h first
sql/event_data_objects.cc:
  Use my_global.h first
sql/event_db_repository.cc:
  Use my_global.h first
sql/event_parse_data.cc:
  Use my_global.h first
sql/event_queue.cc:
  Use my_global.h first
sql/event_scheduler.cc:
  Use my_global.h first
sql/events.cc:
  Use my_global.h first
sql/field.cc:
  Use my_global.h first
  Remove duplicated include files
sql/field_conv.cc:
  Use my_global.h first
sql/filesort.cc:
  Use my_global.h first
  Remove duplicated include files
sql/gstream.cc:
  Use my_global.h first
sql/ha_ndbcluster.cc:
  Use my_global.h first
sql/ha_ndbcluster_binlog.cc:
  Use my_global.h first
sql/ha_ndbcluster_cond.cc:
  Use my_global.h first
sql/ha_partition.cc:
  Use my_global.h first
sql/handler.cc:
  Use my_global.h first
sql/hash_filo.cc:
  Use my_global.h first
sql/hostname.cc:
  Use my_global.h first
sql/init.cc:
  Use my_global.h first
sql/item.cc:
  Use my_global.h first
sql/item_buff.cc:
  Use my_global.h first
sql/item_cmpfunc.cc:
  Use my_global.h first
sql/item_create.cc:
  Use my_global.h first
sql/item_geofunc.cc:
  Use my_global.h first
sql/item_inetfunc.cc:
  Use my_global.h first
sql/item_row.cc:
  Use my_global.h first
sql/item_strfunc.cc:
  Use my_global.h first
sql/item_subselect.cc:
  Use my_global.h first
sql/item_sum.cc:
  Use my_global.h first
sql/item_timefunc.cc:
  Use my_global.h first
sql/item_xmlfunc.cc:
  Use my_global.h first
sql/key.cc:
  Use my_global.h first
sql/lock.cc:
  Use my_global.h first
sql/log.cc:
  Use my_global.h first
sql/log_event.cc:
  Use my_global.h first
sql/log_event_old.cc:
  Use my_global.h first
sql/mf_iocache.cc:
  Use my_global.h first
sql/mysql_install_db.cc:
  Remove duplicated include files
sql/mysqld.cc:
  Remove duplicated include files
sql/net_serv.cc:
  Remove duplicated include files
sql/opt_range.cc:
  Use my_global.h first
sql/opt_subselect.cc:
  Use my_global.h first
sql/opt_sum.cc:
  Use my_global.h first
sql/parse_file.cc:
  Use my_global.h first
sql/partition_info.cc:
  Use my_global.h first
sql/procedure.cc:
  Use my_global.h first
sql/protocol.cc:
  Use my_global.h first
sql/records.cc:
  Use my_global.h first
sql/records.h:
  Don't include my_global.h
  Better to do this at the upper level
sql/repl_failsafe.cc:
  Use my_global.h first
sql/rpl_filter.cc:
  Use my_global.h first
sql/rpl_gtid.cc:
  Use my_global.h first
sql/rpl_handler.cc:
  Use my_global.h first
sql/rpl_injector.cc:
  Use my_global.h first
sql/rpl_record.cc:
  Use my_global.h first
sql/rpl_record_old.cc:
  Use my_global.h first
sql/rpl_reporting.cc:
  Use my_global.h first
sql/rpl_rli.cc:
  Use my_global.h first
sql/rpl_tblmap.cc:
  Use my_global.h first
sql/rpl_utility.cc:
  Use my_global.h first
sql/set_var.cc:
  Added comment
sql/slave.cc:
  Use my_global.h first
sql/sp.cc:
  Use my_global.h first
sql/sp_cache.cc:
  Use my_global.h first
sql/sp_head.cc:
  Use my_global.h first
sql/sp_pcontext.cc:
  Use my_global.h first
sql/sp_rcontext.cc:
  Use my_global.h first
sql/spatial.cc:
  Use my_global.h first
sql/sql_acl.cc:
  Use my_global.h first
sql/sql_admin.cc:
  Use my_global.h first
sql/sql_analyse.cc:
  Use my_global.h first
sql/sql_audit.cc:
  Use my_global.h first
sql/sql_base.cc:
  Use my_global.h first
sql/sql_binlog.cc:
  Use my_global.h first
sql/sql_bootstrap.cc:
  Use my_global.h first
  Use my_global.h first
sql/sql_cache.cc:
  Use my_global.h first
sql/sql_class.cc:
  Use my_global.h first
sql/sql_client.cc:
  Use my_global.h first
sql/sql_connect.cc:
  Use my_global.h first
sql/sql_crypt.cc:
  Use my_global.h first
sql/sql_cursor.cc:
  Use my_global.h first
sql/sql_db.cc:
  Use my_global.h first
sql/sql_delete.cc:
  Use my_global.h first
sql/sql_derived.cc:
  Use my_global.h first
sql/sql_do.cc:
  Use my_global.h first
sql/sql_error.cc:
  Use my_global.h first
sql/sql_explain.cc:
  Use my_global.h first
sql/sql_expression_cache.cc:
  Use my_global.h first
sql/sql_handler.cc:
  Use my_global.h first
sql/sql_help.cc:
  Use my_global.h first
sql/sql_insert.cc:
  Use my_global.h first
sql/sql_lex.cc:
  Use my_global.h first
sql/sql_load.cc:
  Use my_global.h first
sql/sql_locale.cc:
  Use my_global.h first
sql/sql_manager.cc:
  Use my_global.h first
sql/sql_parse.cc:
  Use my_global.h first
sql/sql_partition.cc:
  Use my_global.h first
sql/sql_plugin.cc:
  Added comment
sql/sql_prepare.cc:
  Use my_global.h first
sql/sql_priv.h:
  Added error if we use this before including my_global.h
  This check is here becasue so many files includes sql_priv.h first.
sql/sql_profile.cc:
  Use my_global.h first
sql/sql_reload.cc:
  Use my_global.h first
sql/sql_rename.cc:
  Use my_global.h first
sql/sql_repl.cc:
  Use my_global.h first
sql/sql_select.cc:
  Use my_global.h first
sql/sql_servers.cc:
  Use my_global.h first
sql/sql_show.cc:
  Added comment
sql/sql_signal.cc:
  Use my_global.h first
sql/sql_statistics.cc:
  Use my_global.h first
sql/sql_table.cc:
  Use my_global.h first
sql/sql_tablespace.cc:
  Use my_global.h first
sql/sql_test.cc:
  Use my_global.h first
sql/sql_time.cc:
  Use my_global.h first
sql/sql_trigger.cc:
  Use my_global.h first
sql/sql_udf.cc:
  Use my_global.h first
sql/sql_union.cc:
  Use my_global.h first
sql/sql_update.cc:
  Use my_global.h first
sql/sql_view.cc:
  Use my_global.h first
sql/sys_vars.cc:
  Added comment
sql/table.cc:
  Use my_global.h first
sql/thr_malloc.cc:
  Use my_global.h first
sql/transaction.cc:
  Use my_global.h first
sql/uniques.cc:
  Use my_global.h first
sql/unireg.cc:
  Use my_global.h first
sql/unireg.h:
  Removed inclusion of my_global.h
storage/archive/ha_archive.cc:
  Added comment
storage/blackhole/ha_blackhole.cc:
  Use my_global.h first
storage/csv/ha_tina.cc:
  Use my_global.h first
storage/csv/transparent_file.cc:
  Use my_global.h first
storage/federated/ha_federated.cc:
  Use my_global.h first
storage/federatedx/federatedx_io.cc:
  Use my_global.h first
storage/federatedx/federatedx_io_mysql.cc:
  Use my_global.h first
storage/federatedx/federatedx_io_null.cc:
  Use my_global.h first
storage/federatedx/federatedx_txn.cc:
  Use my_global.h first
storage/heap/ha_heap.cc:
  Use my_global.h first
storage/innobase/handler/handler0alter.cc:
  Use my_global.h first
storage/maria/ha_maria.cc:
  Use my_global.h first
storage/maria/unittest/ma_maria_log_cleanup.c:
  Remove duplicated include files
storage/maria/unittest/test_file.c:
  Added comment
storage/myisam/ha_myisam.cc:
  Move sql_plugin.h first as this includes my_global.h
storage/myisammrg/ha_myisammrg.cc:
  Use my_global.h first
storage/oqgraph/oqgraph_thunk.cc:
  Use my_config.h and my_global.h first
  One could not include my_global.h before oqgraph_thunk.h (don't know why)
storage/spider/ha_spider.cc:
  Use my_global.h first
storage/spider/hs_client/config.cpp:
  Use my_global.h first
storage/spider/hs_client/escape.cpp:
  Use my_global.h first
storage/spider/hs_client/fatal.cpp:
  Use my_global.h first
storage/spider/hs_client/hstcpcli.cpp:
  Use my_global.h first
storage/spider/hs_client/socket.cpp:
  Use my_global.h first
storage/spider/hs_client/string_util.cpp:
  Use my_global.h first
storage/spider/spd_conn.cc:
  Use my_global.h first
storage/spider/spd_copy_tables.cc:
  Use my_global.h first
storage/spider/spd_db_conn.cc:
  Use my_global.h first
storage/spider/spd_db_handlersocket.cc:
  Use my_global.h first
storage/spider/spd_db_mysql.cc:
  Use my_global.h first
storage/spider/spd_db_oracle.cc:
  Use my_global.h first
storage/spider/spd_direct_sql.cc:
  Use my_global.h first
storage/spider/spd_i_s.cc:
  Use my_global.h first
storage/spider/spd_malloc.cc:
  Use my_global.h first
storage/spider/spd_param.cc:
  Use my_global.h first
storage/spider/spd_ping_table.cc:
  Use my_global.h first
storage/spider/spd_sys_table.cc:
  Use my_global.h first
storage/spider/spd_table.cc:
  Use my_global.h first
storage/spider/spd_trx.cc:
  Use my_global.h first
storage/xtradb/handler/handler0alter.cc:
  Use my_global.h first
storage/xtradb/handler/i_s.cc:
  Use my_global.h first
2014-09-30 20:31:14 +03:00
Michael Widenius
caca6b9907 Fixed warnings
storage/oqgraph/ha_oqgraph.cc:
  Fixed compiler warning
storage/xtradb/handler/ha_innodb.cc:
  Ifdef:ed note used function
2014-09-30 20:12:59 +03:00
Sergei Golubchik
a006813fb1 merge 2014-09-16 14:08:05 +02:00
Sergei Golubchik
7e29c1b539 5.5 merge 2014-09-16 14:03:17 +02:00
Jan Lindström
ec46381990 Avoid using log_sys mutex when printing out show engine innodb status,
instead peek (maybe) old data.
2014-09-16 07:37:00 +03:00
Elena Stepanova
b41d5aebcf Changes in storage_engine test suite:
- added more logic for ON DUPICATE KEY UPDATE upon Monty's request;
  - added an overlay for XtraDB
2014-09-15 20:33:11 +04:00
Sergei Golubchik
4a68817d8d XtraDB 5.6.20-68.0 2014-09-11 16:44:16 +02:00
Jan Lindström
c30a8442e8 MDEV-6729: InnoDB: Failing assertion: state == TRX_STATE_NOT_STARTED in
file trx0trx.ic line 60 

Problem was that trx might have not been started when we enter release
savepoint, this can happen when trx with savepoint is already aborted 
or when we try to release non-existing savepoint.
2014-09-11 15:41:30 +03:00
Sergei Golubchik
8deb9066e2 fix compilation on windows - wrong include file 2014-09-08 17:10:48 +02:00
Sergei Golubchik
695781a53e MDEV-6595 [PATCH] HPPA: storage/xtradb/os/os0stacktrace.c:88:54: error: invalid operands to binary & (have 'void *' and 'long unsigned int')
fix precedence as in the patch from Brian Evans
2014-09-06 09:51:34 +02:00
Sergey Vojtovich
c01c819209 Backport from 10.0:
MDEV-6483 - Deadlock around rw_lock_debug_mutex on PPC64

This problem affects only debug builds on PPC64.

There are at least two race conditions around
rw_lock_debug_mutex_enter and rw_lock_debug_mutex_exit:

- rw_lock_debug_waiters was loaded/stored without setting
  appropriate locks/memory barriers.
- there is a gap between calls to os_event_reset() and
  os_event_wait() and in such case we're supposed to pass
  return value of the former to the latter.

Fixed by replacing self-cooked spinlocks with system mutexes.
These days system mutexes offer much better performance. OTOH
performance is not that critical for debug builds.
2014-08-29 16:14:11 +04:00
Sergey Vojtovich
40497577ff Backport from 10.0:
MDEV-6450 - MariaDB crash on Power8 when built with advance tool
            chain

InnoDB mutex_exit() function calls __sync_test_and_set() to release
the lock. According to manual this function is supposed to create
"acquire" memory barrier whereas in fact we need "release" memory
barrier at mutex_exit().

The problem isn't repeatable with gcc because it creates
"acquire-release" memory barrier for __sync_test_and_set().
ATC creates just "acquire" barrier.

Fixed by creating proper barrier at mutex_exit() by using
__sync_lock_release() instead of __sync_test_and_set().
2014-08-29 16:02:46 +04:00
Jan Lindström
18b307a7d2 MDEV-6590: InnoDB recover ends in signal 11
Analysis: When database is migrated from 5.5 or earlier and
database needs crash recovery, there is possibility that
SYS_DATAFILES system table does not exists, but
crash recovery in function dict_check_tablespaces_and_store_max_id()
assumes that SYS_DATAFILES exists.

Fix: If SYS_DATAFILES does not exists, create it before
we end up to function dict_check_tablespaces_and_store_max_id()
on crash recovery.
2014-08-25 13:35:33 +03:00
Michael Widenius
5569132ffe MDEV-6450 - MariaDB crash on Power8 when built with advance tool chain
Part of this work is based on Stewart Smitch's memory barrier and lower priori
patches for power8.

- Added memory syncronization for innodb & xtradb for power8.
- Added HAVE_WINDOWS_MM_FENCE to CMakeList.txt
- Added os_isync to fix a syncronization problem on power
- Added log_get_lsn_nowait which is now used srv_error_monitor_thread to ensur
  if log mutex is locked.

All changes done both for InnoDB and Xtradb
2014-08-19 19:28:35 +03:00
Sergei Golubchik
359d764b79 fix xtradb on windows (again) 2014-08-03 07:38:41 +02:00
Jan Lindström
27d23c020a Merged percona-server-5.5.38-35.2. 2014-08-01 12:54:56 +03:00
Michael Widenius
a1c1700b89 Fixed some compiler warnings 2014-07-30 10:05:01 +03:00
Sergei Golubchik
6ef139780d MDEV-6497 InnoDB deadlocks on UNINSTALL PLUGIN
Free the trx of the current thd (if any) in innobase_end()
2014-07-29 09:09:52 +02:00