Commit graph

1384 commits

Author SHA1 Message Date
Sergey Vojtovich
0a534348c7 MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Eliminated last exit() call from libmysqld.
2018-03-16 13:26:52 +04:00
Sergei Golubchik
a04e4f531a Merge branch '10.0' into 10.1 2018-02-22 14:12:02 +01:00
Sergei Golubchik
b728641e86 Merge branch '5.5' into 10.0 2018-02-22 09:22:03 +01:00
Monty
55bc3f1dd9 Fixed performance problem with Aria in find_head()
For some simple benchmarks, a majority of time was
spend in find_head() which tries to find the best
place to put the record.

The result of this patch is a 2x or more speedup for
inserts without keys for format PAGE. All changes
are only related to how rows are stored

Should fix some of the problems mentioned in:
MDEV-8132 Temporary tables using Aria with very poor performance
MDEV-9079 Aria very slow for internal temporary tables
MDEV-5841 Mariadb very poor temporary performance

The following changes where done:
- For rows with a small row length that fits into
  a page (818 bytes with 8192 pages), stop as soon as we
  hit a match.
- Added markers full_head_size and full_tail_size that tells
  us where to start searching on the bitmap page
- Ensure that page->used_size is correctly updated when
  bitmap grows. This allows us to stop searching at used_size
- Added code to check that the bitmap variables are correct.
- Fixed a wrong test where we set "first_bitmap_with_space".
  This shouldn't have caused any notable problems.
2018-02-17 18:04:59 +02:00
Sergei Golubchik
2709380587 MDEV-13748 Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed in virtual THD::~THD after query with INTERSECT
my_safe_alloca()/my_safe_afree() work as alloca() or malloc()/free()
depending on the memory size to allocate, that is, depending on
reclength here. They only work correctly if reclength doesn't
change in the middle.
2018-02-14 18:41:37 +01:00
Sergei Golubchik
d4df7bc9b1 Merge branch 'github/10.0' into 10.1 2018-02-02 10:09:44 +01:00
Vicențiu Ciorbaru
d833bb65d5 Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
Monty
b3c7cf81e3 Fix for MDEV-14141 Crash in print_keydup_error()
May also fix: MDEV-14970 "MariaDB crashed with signal 11 and Aria table"

I am not able to reproduce a crash, however there was no protection in
print_keydup_error() if the storage engine reported the wrong key number.

This patch adds such a protection and should stop any further crashes
in this case.

Other things:
- Added extra protection in Aria to not set errkey to more than number of
  keys. (Don't think this is cause of this crash, but better safe than
  sorry)
- Extend test_if_equal_repl_errors() to handle different cases of
  ER_DUP_ENTRY. This is just mainly precaution for the future.
2018-01-24 00:09:34 +02:00
Sergei Golubchik
f2408e7e6a Free memory in unit tests. Makes ASAN happier. 2018-01-22 11:39:54 +01:00
Sergei Golubchik
d7b84f9413 compiler warning
gcc 6 issues a warning about a suspicious construct

  while(0);
  {
     some code
  }
2018-01-15 15:57:03 +01:00
Oleksandr Byelkin
a5285a8fb7 Fixed misleading voariable names. 2018-01-11 17:24:29 +01:00
Oleksandr Byelkin
abb9e703d2 MDEV-14690: Assertion `page_link == &fake_link' failed in pagecache_write_part
Fix the call to correspond protocoll of pagecache call.
Fix of misleading variables names.
2018-01-11 17:24:29 +01:00
Monty
1f18bd630a MDEV-8200 aria bug with insert select and lock tables
This bug happens when locking the same Aria "transactional" table
(page format) more then once with LOCK TABLES and inserting into one
of them with INSERT ... SELECT when the table is empty.

Fixed by ensuring we don't use fast bulk insert if table is opened
twice with LOCK TABLES (as this changes table->s->state)

Code changes:
- Added use_count to MARIA_USED_TABLES to be able to check if
  table is opened twice for a statement/lock table
- Don't clear history or reset info->start_state if we
  don't have versioning. One reason for the bug was
  was that info->start_state was set to point to different
  states for the two tables.  If there is no versioning
  info->start_state should always point to info->s->state.common.

Other things:
- Fixed also some typos that was noticed while scanning the code
- More DBUG_PRINT
2018-01-11 16:39:29 +02:00
Marko Mäkelä
1e89c86dd7 Merge 10.0 into 10.1 2018-01-03 20:41:34 +02:00
Marko Mäkelä
8ac1982fcc Merge 5.5 into 10.0 2018-01-03 20:40:41 +02:00
Marko Mäkelä
84c9c8b2e9 Silence some -Wimplicit-fallthrough by proper spelling 2018-01-03 15:01:17 +02:00
Marko Mäkelä
ce07d09fd3 Merge 10.0 into 10.1 2017-12-12 19:28:26 +02:00
Marko Mäkelä
c0e10f375a Fix a -Wimplicit-fallthrough warning 2017-11-10 09:07:45 +02:00
Sergei Golubchik
9d2e2d7533 Merge branch '10.0' into 10.1 2017-10-22 13:03:41 +02:00
Sergei Golubchik
da4503e956 Merge branch '5.5' into 10.0 2017-10-18 15:14:39 +02:00
Sergei Golubchik
d76f5774fe MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
2017-10-17 07:37:39 +02:00
Oleksandr Byelkin
bea99275de MDEV-13595: mariadb-10.2.8/storage/maria/ma_loghandler.c:2730]: (style) Array index 'chunk_offset' is used before limits check.
In fact just a cosmetic fix, code was safe because translog_get_first_chunk_offset return offsets inside the page.
2017-10-05 15:07:21 +02:00
Sergei Golubchik
7dc1815d5c cleanup: reduce code duplication
remove copy-pasted code, fix meaningless comparison.
followup for ea2162b6aa
2017-09-27 10:18:06 +02:00
Varun Gupta
ea2162b6aa MDEV-11846: ERROR 1114 (HY000) table full when performing GROUP BY
The problem is there is an overflow for the key_file_length.
Added the maximum limit for the key_file_length
2017-09-24 23:33:44 +05:30
Sergei Golubchik
8e8d42ddf0 Merge branch '10.0' into 10.1 2017-08-08 10:18:43 +02:00
Vicențiu Ciorbaru
786ad0a158 Merge remote-tracking branch 'origin/5.5' into 10.0 2017-07-25 00:41:54 +03:00
Sergei Golubchik
da2a838628 MDEV-12824 GCC 7 warning: this statement may fall through [-Wimplicit-fallthrough=] 2017-07-20 20:13:28 +02:00
Daniel Black
c9883b7591 ma_check/mi_check: maria_repair_parallel initialization for !quick
end_io_call uses uninitialized values from the new_data_cache

As such we the buffer 0 and check this before calling end_io_cache on it.

Thanks Sergey Vojtovich for the review and for this solution.

Found by Coverity (ref 972481).
2017-07-18 10:09:16 +04:00
Sergei Golubchik
6efee22541 change flags as it was done in MyISAM
in ab785bfe5b
2017-07-15 08:44:14 +02:00
Daniel Black
ec4e39558e ma_recovery: unintentional order of operations
Coverity report this as:
CID 971840 (#1 of 1): Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: 4 | (flags & 1) is always true regardless of the values of its operands. This occurs as the logical first operand of "?:".

The C order of precidence has | of higher precidence than ?:. The
intenting implies an | of the 3 terms.

Adjust to intented meaning.
2017-07-15 08:44:14 +02:00
Sergei Golubchik
9e11e055ce Merge branch '10.0' into 10.1 2017-07-07 11:30:03 +02:00
Sergei Golubchik
89dc445a55 Merge branch '5.5' into 10.0 2017-07-06 23:47:33 +02:00
Daniel Black
89b81a9a24 ma_pagecache: release lock in pagecache_read
make_lock_and_pin didn't release the lock so we should.

Found by Coverity (id 972095).
2017-07-03 13:31:09 +04:00
Daniel Black
2328860379 ma_loghandler: translog_set_only_in_buffers failed to release lock
Release the lock for the error path.

Found by Coverity (id 972093).
2017-07-03 13:14:05 +04:00
Daniel Black
051f90a534 ma_loghandler: release file_header_lock on error
translog_stop_writing doesn't release a lock (though
does to a DBUG_ASSERT).

Better to just release the lock.

Found by Coverity id 972092
2017-07-03 13:05:35 +04:00
Marko Mäkelä
b61700c221 Merge 10.0 into 10.1 2017-05-23 08:59:03 +03:00
Sergei Golubchik
725e47bfb5 Merge branch '5.5' into 10.0 2017-05-20 00:59:40 +02:00
Sergei Golubchik
7c03edf2fe MDEV-6262 analyze the coverity report on mariadb
uploaded 10.0, analyzed everything with the Impact=High
(and a couple of Medium)
2017-05-19 20:26:56 +02:00
Oleksandr Byelkin
4a846e018d Make IF clear. 2017-05-18 19:31:44 +02:00
Marko Mäkelä
71cd205956 Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
2017-05-17 08:27:04 +03:00
Marko Mäkelä
7972da8aa1 Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
2017-05-17 08:07:02 +03:00
Sergei Golubchik
d738722eee Merge branch '10.0' into 10.1 2017-05-08 14:58:49 +02:00
Monty
fc25437aff MDEV-10104 Table lock race condition with replication
Problem was two race condtion in Aria page cache:
- find_block() didn't inform free_block() that it had released requests
- free_block() didn't handle pinned blocks, which could happen if
  free_block() was called as part of flush. This is fixed by not freeing
  blocks that are pinned.  This is safe as when maria_close() is called
  when last thread is using a table, there can be no pinned blocks. For
  other flush calls it's safe to ignore pinned blocks.
2017-05-05 18:25:35 +03:00
Sergei Golubchik
4fe65ca33a MDEV-12230 include/my_sys.h:600:43: error: unknown type name ‘PSI_file_key’" when -DWITHOUT_SERVER=1
cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
2017-04-20 16:36:23 +02:00
Sergei Golubchik
09a2107b1b Merge branch '10.0' into 10.1 2017-03-21 19:20:44 +01:00
Sergei Golubchik
2c2bd8c155 MDEV-12261 build failure without P_S
restore mysql_file_delete_with_symlink() but let it use
new my_handler_delete_with_symlink() mysys helper.
2017-03-15 17:48:30 +01:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Golubchik
aa51b559ab typo fixed 2017-03-10 18:21:25 +01:00
Marko Mäkelä
0094b6581d Merge 10.0 into 10.1 2017-03-10 15:16:13 +02:00
Marko Mäkelä
1b2b209519 Use correct integer format with printf-like functions. 2017-03-09 11:28:07 +02:00