Commit graph

525 commits

Author SHA1 Message Date
Marko Mäkelä
928abd6967 Merge 10.3 into 10.4 2019-11-06 13:44:56 +02:00
Marko Mäkelä
908ca4668d Merge 10.2 into 10.3 2019-11-06 13:14:31 +02:00
Marko Mäkelä
8688ef22c2 Merge 10.1 to 10.2 2019-11-06 10:18:51 +02:00
Marko Mäkelä
4e99e67c4e Merge 5.5 into 10.1 2019-11-06 08:17:03 +02:00
Sergei Golubchik
cd156e2c3e MDEV-20971 ASAN heap-use-after-free in list_delete / heap_close
Don't save/restore HP_INFO as it could be changed by a concurrent thread.
different parts of HP_INFO are protected by different mutexes and
the mutex that protect most of the HP_INFO does not protect its open_list
data.

As a bonus, make heap_check_heap() to take const HP_INFO* and not
make any changes there whatsoever.
2019-11-04 23:14:27 +01:00
Marko Mäkelä
ec40980ddd Merge 10.3 into 10.4 2019-11-01 15:23:18 +02:00
Oleksandr Byelkin
55b2281a5d Merge branch '10.2' into 10.3 2019-10-31 10:58:06 +01:00
Oleksandr Byelkin
36f67a7dff Merge branch '10.1' into 10.2 2019-10-30 21:33:01 +01:00
Oleksandr Byelkin
d671f506b0 Merge branch '5.5' into 10.1 2019-10-30 14:47:35 +01:00
Sergey Vojtovich
afb4878703 MDEV-18783 - Server crash in hp_rb_make_key
In debug build, whenever MEMORY table instance gets closed it performs
consistency check without protection. It may cause server crash if
executed concurrently with DML.

Moved consistency check to ha_heap::external_lock(F_UNLCK), so that it
is protected by THR_LOCK.
2019-10-30 12:52:19 +04:00
Marko Mäkelä
efb8485d85 Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f451d5
introduces DBUG_ASSERT(right_op == r_tbl) in
st_select_lex::add_cross_joined_table(), and that assertion would
fail in several tests that exercise joins. That commit was skipped
in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
2019-08-23 08:06:17 +03:00
Marko Mäkelä
32ec5fb979 Merge 10.2 into 10.3 2019-08-21 15:23:45 +03:00
Sergei Golubchik
6c06defb5f MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
heap_scan() makes info->next_block to be either an integer number
of share->block.records_in_block's or the total number of
records in the table. So when this total number or records changes,
info->next_block needs to be recalculated to take it into account.

This is a different fix for "Fixes a problem with heap when scanning and insert rows at the same time"
2019-08-20 15:37:08 +02:00
Sergei Golubchik
1ad70bf2fe Revert "Fixes a problem with heap when scanning and insert rows at the same time"
This reverts commit 262927a9e5.
2019-08-20 15:37:08 +02:00
Monty
262927a9e5 Fixes a problem with heap when scanning and insert rows at the same time
This causes failures in versioning.update-big in 10.3 and above
2019-08-20 12:57:52 +03:00
Eugene Kosov
c9aa495fb6 MDEV-19955 make argument of handler::ha_write_row() const
MDEV-19486 and one more similar bug appeared because handler::write_row() interface
welcomes to modify buffer by storage engine. But callers are not ready for that
thus bugs are possible in future.

handler::write_row():
handler::ha_write_row(): make argument const
2019-07-05 13:14:19 +03:00
Eugene Kosov
d36c107a6b imporve clang build
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug

Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about
deprecated `register` keyword.

Too much warnings came from Mroonga and I gave up on it.
2019-06-25 13:21:36 +03:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Sergei Golubchik
43623f04a9 MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
handler::write_row() should not destroy the state of the running
index_search/index_next/... or rnd_init/rnd_next/... scan
2019-05-17 13:53:22 +02:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Sachin
d00f19e832 MDEV-371 Unique Index for long columns
This patch implements engine independent unique hash index.

Usage:- Unique HASH index can be created automatically for blob/varchar/test column whose key
 length > handler->max_key_length()
or it can be explicitly specified.

  Automatic Creation:-
   Create TABLE t1 (a blob unique);
  Explicit Creation:-
   Create TABLE t1 (a int , unique(a) using HASH);

Internal KEY_PART Representations:-
 Long unique key_info will have 2 representations.
 (lets understand this with an example create table t1(a blob, b blob , unique(a, b)); )

 1. User Given Representation:- key_info->key_part array will be similar to what user has defined.
 So in case of example it will have 2 key_parts (a, b)

 2. Storage Engine Representation:- In this case there will be only one key_part and it will point to
 HASH_FIELD. This key_part will be always after user defined key_parts.

 So:- User Given Representation          [a] [b] [hash_key_part]
                  key_info->key_part ----^
  Storage Engine Representation          [a] [b] [hash_key_part]
                  key_info->key_part ------------^

 Table->s->key_info will have User Given Representation, While table->key_info will have Storage Engine
 Representation.Representation can be changed into each other by calling re/setup_keyinfo_hash function.

Working:-

1. So when user specifies HASH_INDEX or key_length is > handler->max_key_length(), In mysql_prepare_create_table
One extra vfield is added (for each long unique key). And key_info->algorithm is set to HA_KEY_ALG_LONG_HASH.

2. In init_from_binary_frm_image values for hash_keypart is set (like fieldnr , field and flags)

3. In parse_vcol_defs, HASH_FIELD->vcol_info is created. Item_func_hash is used with list of Item_fields,
   When Explicit length is given by user then Item_left is used to concatenate Item_field values.

4. In ha_write_row/ha_update_row check_duplicate_long_entry_key is called which will create the hash key from
table->record[0] and then call ha_index_read_map , if we found duplicated hash , we will compare the result
field by field.
2019-02-22 00:35:40 +01:00
Marko Mäkelä
2b921845ac Merge 10.3 into 10.4 2019-02-15 12:30:43 +02:00
Daniel Black
ce0678f6cb hash (storage): hp_hashnr is local
Remove 'register' quantifer from args too.
2019-02-13 23:15:55 +04:00
Daniel Black
7fa67e391f heap: remove NEW_HASH_FUNCTION
This was added in 29fa72526a (in 2000) and nothing defines
NEW_HASH_FUNCTION. A low collision is the wrong tradeoff,
it should be focused on throughput.

d405bee058 shows the existing function
is pretty cpu intensive and needs to be improved as well.
2019-02-13 23:15:55 +04:00
Monty
965311ee8b Added new MDL_BACKUP locks for all backup stages
Part of MDEV-5336 Implement LOCK FOR BACKUP

- Added new locks to MDL_BACKUP for all stages of backup locks and
  a new MDL lock needed for backup stages.
- Renamed MDL_BACKUP_STMT to MDL_BACKUP_DDL
- flush_tables() takes a new parameter that decides what should be flushed.
- InnoDB, Aria (transactional tables with checksums), Blackhole, Federated
  and Federatedx tables are marked to be safe for online backup. We are
  using MDL_BACKUP_TRANS_DML instead of MDL_BACKUP_DML locks for these
  which allows any DML's to proceed for these tables during the whole
  backup process until BACKUP STAGE COMMIT which will block the final
  commit.
2018-12-09 22:12:27 +02:00
Marko Mäkelä
df563e0c03 Merge 10.2 into 10.3
main.derived_cond_pushdown: Move all 10.3 tests to the end,
trim trailing white space, and add an "End of 10.3 tests" marker.
Add --sorted_result to tests where the ordering is not deterministic.

main.win_percentile: Add --sorted_result to tests where the
ordering is no longer deterministic.
2018-11-06 09:40:39 +02:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Sergei Golubchik
44f6f44593 Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
Sergei Golubchik
37ab7e4596 Merge branch '5.5' into 10.0 2018-10-27 20:46:38 +02:00
Sergei Golubchik
f9e5195b40 Merge branch 'mysql/5.5' into 5.5 2018-10-23 15:59:24 +02:00
Sergei Golubchik
36e59752e7 Merge branch '10.2' into 10.3 2018-06-30 16:39:20 +02:00
Arun Kuruvila
22e99fcb34 Bug#27799513: POTENTIAL DOUBLE FREE OR CORRUPTION OF HEAP
INFO (HP_INFO)

Description:- Server crashes due to memory overflow.

Analysis:- Bytes for storing key length is wrongly set
for HEAP tables.

Fix:- Bytes used to store the key length is properly set
inside "heap_create()".
2018-06-29 12:09:18 +05:30
Sergei Golubchik
b942aa34c1 Merge branch '10.1' into 10.2 2018-06-21 23:47:39 +02:00
Alexander Barkov
4b821e02f6 Merge remote-tracking branch 'origin/10.0' into 10.1 2018-06-20 16:57:21 +04:00
Alexander Barkov
6c08ff3eb7 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-06-20 16:55:24 +04:00
Alexander Barkov
170b43c156 MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment columns in HEAP, MyISAM, ARIA 2018-06-20 16:36:46 +04:00
Sergey Vojtovich
7ffd7fe962 Cleanup isnan() portability checks 2018-05-26 13:26:32 +04:00
Marko Mäkelä
7396dfcca7 Merge 10.2 into 10.3 2018-04-24 20:59:57 +03:00
Marko Mäkelä
39a4985520 Remove most 'register' use in C++
Modern compilers (such as GCC 8) emit warnings that the
'register' keyword is deprecated and not valid C++17.

Let us remove most use of the 'register' keyword.
Code in 'extra/' is not touched.
2018-04-24 12:48:27 +03:00
Sergei Golubchik
2732fcc608 Merge branch 'bb-10.2-ext' into 10.3 2018-02-23 08:43:34 +01:00
Sergei Golubchik
b8af22af15 Merge branch '10.2' into bb-10.2-ext 2018-02-22 19:29:52 +01:00
Sergei Golubchik
e4a73acc63 Merge branch '10.1' into 10.2 2018-02-22 16:46:02 +01: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
Marko Mäkelä
b006d2ead4 Merge bb-10.2-ext into 10.3 2018-02-15 10:22:03 +02:00
Sergei Golubchik
7c6cf7fefe bug: ha_heap was unilaterally increasing reclength
proper fix replacing the hack from b80fa4000d

don't confuse length of the data area (reclength) with the
offset to the "deleted" mark.
2018-02-11 18:36:54 +01:00
Alexander Barkov
3cad31f2a7 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-08 19:06:25 +04:00