Commit graph

2591 commits

Author SHA1 Message Date
Eugene Kosov
6473641b9a MDEV-18512 using DATETIME(6) as row_start/row_end crashes server
Disallow DATETIME for SYSTEM VERSIONING tables.
2019-05-20 15:19:01 +04:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +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
Oleksandr Byelkin
c51f85f882 Merge branch '10.2' into 10.3 2019-05-12 17:20:23 +02: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
Vladislav Vaintroub
ad36d38024 MDEV-19235 MariaDB Server compiled for 128 Indexes crashes at startup
With MAX_INDEXIES=64(default), key_map=Bitmap<64> is just a wrapper around
ulonglong and thus "trivial" (can be bzero-ed, or memcpy-ed, and stays
valid still)

With MAX_INDEXES=128, key_map = Bitmap<128> is not a "trivial" type
anymore. The implementation uses MY_BITMAP, and MY_BITMAP contains pointers
which make Bitmap invalid, when it is memcpy-ed/bzero-ed.

The problem in 10.4 is that there are many new key_map members, inside TABLE
or KEY, and those are often memcopied and bzeroed

The fix makes Bitmap "trivial", by inlining most of MY_BITMAP functionality.
pointers/heap allocations are not used anymore.
2019-05-09 18:58:16 +02:00
Marko Mäkelä
d3dcec5d65 Merge 10.3 into 10.4 2019-05-05 15:06:44 +03:00
Marko Mäkelä
b132b8895e Merge 10.3 into 10.4 2019-05-05 10:23:14 +03:00
Sachin
27980b0f83 MDEV-19365 Assertion failure in LONG Unique after 10.3 merge
If handler->inited is RND use cloned handler for long unique duplicate search.
2019-05-05 10:19:22 +03:00
Oleksandr Byelkin
8cbb14ef5d Merge branch '10.1' into 10.2 2019-05-04 17:04:55 +02:00
Varun Gupta
cb9fa1a08b MDEV-9959: A serious MariaDB server performance bug
If a derived table has SELECT DISTINCT, provide index statistics for it so that the join optimizer in the
upper select knows that ref access to the table will produce one row.
2019-04-30 21:07:25 +05:30
Marko Mäkelä
4d59f45260 Merge 10.2 into 10.3 2019-04-27 20:41:31 +03:00
Sergei Golubchik
2ce52790ff Merge branch '5.5' into 10.1 2019-04-26 14:02:37 +02:00
Alexander Barkov
5cfc7799a3 MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe 2019-04-26 14:01:21 +04:00
Robert Bindar
e52a4ab693 MDEV-15907 ASAN heap-use-after-free
This patch fixes an invalid read in fill_effective_table_privileges
triggered by a grant_version increase between a PREPARE for a
statement creating a view from I_S and EXECUTE.
A tmp table was created and free'd while preparing the statement,
TABLE_LIST::table_name was set to point to the tmp table
TABLE_SHARE::table_name which no longer existed after preparing was
done.
The grant version increase made fill_effective_table_privileges
called during EXECUTE to try fetch the updated grant info and
this is where the dangling table name was used.
2019-04-24 11:15:38 +02:00
Monty
38f390f549 MDEV-19224 Assertion `marked_for_read()' failed
Problem was that wrong key_info variable was used, which caused UNIQUE
key to be used as a covering key
2019-04-19 13:22:01 +03:00
Monty
c07e346ca6 MDEV-19252 Problem with DBUG_ASSERT_AS_PRINTF and marked_for_write()
Problem was that DBUG_FIX_WRITE_SET was not enabled when using
DBUG_ASSERT_AS_PRINTF
2019-04-19 13:20:15 +03:00
Nikita Malyavin
610ec192ec MDEV-17320 add Feature_application_time_periods status variable
Closes #1225
2019-04-02 11:03:32 +02:00
Sergei Golubchik
79fe17567a gcc 8 warnings 2019-04-02 12:00:04 +03:00
Marko Mäkelä
5c3ff5cb93 Merge 10.3 into 10.4 2019-04-02 11:04:54 +03:00
Nikita Malyavin
e6230e844c MDEV-15951 system versioning by trx id doesn't work with partitioning
Fix partitioning for trx_id-versioned tables.
`partition by hash`, `range` and others now work.
`partition by system_time` is forbidden.
Currently we cannot use row_start and row_end in `partition by`, because
insertion of versioned field is done by engine's handler, as well as
row_start/row_end's value set up, which is a transaction id -- so it's
also forbidden.

The drawback is that it's now impossible to use `partition by key()`
without parameters for such tables, because it references row_start and
row_end implicitly.

* add handler::vers_can_native()
* drop Table_scope_and_contents_source_st::vers_native()
* drop partition_element::find_engine_flag as unused
* forbid versioning partitioning for trx_id as not supported
* adopt vers tests for trx_id partitioning
* forbid any row_end referencing in `partition by` clauses,
  including implicit `by key()`
2019-03-29 12:51:19 +01:00
Aleksey Midenkov
8df04fb894 MDEV-15412 For any non-existing transaction ID, AS OF provides the current table contents without a warning
Fail with error on non-existing TRX_ID.

Closes #832
2019-03-29 12:51:19 +01:00
Marko Mäkelä
8b480df63e Merge 10.3 into 10.4 2019-03-25 17:18:15 +02:00
Marko Mäkelä
c3a6c683e2 Merge 10.2 into 10.3 2019-03-25 11:03:19 +02:00
Sachin
0c567648a4 Revert (MDEV-18888)2b06de8064660c5c, fix it in different way And add test case for MDEV-18953 2019-03-23 18:25:58 +05:30
Chris Calender
2d6e627a9f Fix for MDEV-18276, typo in error message + all other occurrences of refering 2019-03-23 00:10:18 +04:00
Marko Mäkelä
b6a6aa5b5a MDEV-371: Enable a debug function only in debug builds 2019-03-21 11:23:34 +02:00
sachinsetia1001@gmail.com
3943fe5630 MDEV-18888 Server crashes in Item_field::register_field_in_read_map upon...
MODIFY COLUMN

Do Not create prefix field for long unique key
2019-03-17 13:51:46 +05:30
sachinsetia1001@gmail.com
050280ce8b MDEV-18922 Alter on long unique varchar column makes result null
Don't add long key into share->keys_for_keyread
2019-03-15 12:14:33 +05:30
sachin
560598c9b2 MDEV-18799 Long unique does not work after failed alter table
Restore table->key_info after calling setup_keyinfo_hash in
mysql_prepare_alter_table.
2019-03-13 15:09:16 +05:30
Sergei Golubchik
5adf11250a MDEV-18707 Server crash in my_hash_sort_bin, ASAN heap-use-after-free in Field::is_null, server hang, corrupted double-linked list
adjust share->stored_rec_length for LONG_UNIQUE_HASH_FIELD,
just like it's done for normal virtual fields
2019-02-27 23:27:43 -05:00
Sergei Golubchik
8084eeaa66 cleanup: set HA_PART_KEY_SEG properly
do it for all key types uniformly. In particular,
don't give "prefix keyseg" treatment for hash keys where
field->key_length() == key_part->length
2019-02-27 23:15:28 -05:00
Sergei Golubchik
593e869742 cleanup: reserve one keypart for for LONG_UNIQUE_HASH_FIELD 2019-02-27 23:15:28 -05:00
Sergei Golubchik
387b690eab cleanup: cosmetic fixes 2019-02-27 23:15:28 -05:00
Sergei Golubchik
72ee180512 cleanup: set HA_PART_KEY_SEG for HA_KEY_ALG_LONG_HASH prefix keys
because they *are* prefix keys, even if long and hashed
2019-02-27 23:15:28 -05:00
Sergei Golubchik
bd7f7b1416 MDEV-371 Unique Index for long columns
post-merge fixes
2019-02-22 12:33:08 +01: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
Sergei Golubchik
81ecc2b2b5 store string lengths in frm in 1-3 bytes 2019-02-21 14:57:10 +01:00
Sergei Golubchik
81e4b9b3bb misc cleanups 2019-02-21 14:57:10 +01:00
Nikita Malyavin
6294516a56 MDEV-16975 Application-time periods: ALTER TABLE
* implicit period constraint is hidden and cannot be dropped independently
* create...like and create...select support
2019-02-21 14:57:09 +01:00
Nikita Malyavin
b2bd52290a MDEV-16974 Application-time periods: UPDATE 2019-02-21 14:48:04 +01:00
Nikita Malyavin
47e28a94d5 MDEV-16973 Application-time periods: DELETE
* inject portion of time updates into mysql_delete main loop
* triggered case emits delete+insert, no updates
* PORTION OF `SYSTEM_TIME` is forbidden
* `DELETE HISTORY .. FOR PORTION OF ...` is forbidden as well
2019-02-21 14:48:04 +01:00
Nikita Malyavin
073c93b194 MDEV-17082 Application-time periods: CREATE
* add syntax `CREATE TABLE ... PERIOD FOR <apptime>`
* add table period entity
2019-02-21 14:48:04 +01:00
Oleksandr Byelkin
93ac7ae70f Merge branch '10.3' into 10.4 2019-02-21 14:40:52 +01:00
Marko Mäkelä
fc124778ea Merge 10.2 into 10.3 2019-02-19 17:41:13 +02:00
Igor Babaev
98d55b1366 Merge branch '10.4' into bb-10.4-mdev16188 2019-02-14 22:07:33 -08:00
Monty
0f48949439 MDEV-13916 Enforce check constraint on JSON type
When creating a field of type JSON, it will be automatically
converted to TEXT with CHECK (json_valid(`a`)), if there wasn't any
previous check for the column.

Additional things:
- Added two bug fixes that was found while testing JSON. These bug
  fixes has also been pushed to 10.3 (with a test case), but as they
  where minimal and needed to get this task done and tested, the fixes
  are repeated here.
  - CREATE TABLE ... SELECT drops constraints for columns that
    are both in the create and select part.
  - If one has both a default expression and check constraint for a
    column, one can get the error "Expression for field `a` is refering
    to uninitialized field `a`.
- Removed some duplicate MYSQL_PLUGIN_IMPORT symbols
2019-02-13 19:40:26 +02:00
Monty
438811b4b2 Fixed two bugs related to column level constraints
- CREATE TABLE ... SELECT drops constraints for columns that
  are both in the create and select part.
  - Fixed by copying the constraint in
    Column_definiton::redefine_stage1_common()
- If one has both a default expression and check constraint for a
  column, one can get the error "Expression for field `a` is refering
  to uninitialized field `a`.
  - Fixed by ignoring default expressions for current column when checking
    for CHECK constraint
2019-02-13 18:21:19 +02:00
Varun Gupta
be8709eb7b MDEV-6111 Optimizer Trace
This task involves the implementation for the optimizer trace.

This feature produces a trace for any SELECT/UPDATE/DELETE/,
which contains information about decisions taken by the optimizer during
the optimization phase (choice of table access method, various costs,
transformations, etc). This feature would help to tell why some decisions were
taken by the optimizer and why some were rejected.

Trace is session-local, controlled by the @@optimizer_trace variable.
To enable optimizer trace we need to write:
   set @@optimizer_trace variable= 'enabled=on';

To display the trace one can run:
   SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;

This task also involves:
    MDEV-18489: Limit the memory used by the optimizer trace
    introduces a switch optimizer_trace_max_mem_size which limits
    the memory used by the optimizer trace. This was implemented by
    Sergei Petrunia.
2019-02-13 11:52:36 +05:30
Galina Shalygina
3955d2a153 MDEV-18413: Find constraint correlated indexes
Find indexes of one table which parts participate in one constraint.
These indexes are called constraint correlated.

New methods: TABLE::find_constraint_correlated_indexes() and
virtual method check_index_dependence() were added.
For each index it's own constraint correlated index map was created
where all indexes that are constraint correlated with the current are
marked.

The results of this task are used for MDEV-16188 (Use in-memory
PK filters built from range index scans).
2019-02-10 22:36:46 +03:00
Sergei Golubchik
ef4ccb6ce2 MDEV-18083 ASAN heap-use-after-free in Field::set_warning_truncated_wrong_value upon inserting into temporary table
remove TABLE_SHARE::error_table_name() and TABLE_SHARE::orig_table_name
(that was allocated in a wrong memroot in this bug).

instead, simply set TABLE_SHARE::table_name correctly.
2019-02-05 01:34:17 +01:00
Igor Babaev
37deed3f37 Merge branch '10.4' into bb-10.4-mdev16188 2019-02-03 18:41:18 -08:00
Igor Babaev
658128af43 MDEV-16188 Use in-memory PK filters built from range index scans
This patch contains a full implementation of the optimization
that allows to use in-memory rowid / primary filters built for range  
conditions over indexes. In many cases usage of such filters reduce  
the number of disk seeks spent for fetching table rows.

In this implementation the choice of what possible filter to be applied  
(if any) is made purely on cost-based considerations.

This implementation re-achitectured the partial implementation of
the feature pushed by Galina Shalygina in the commit
8d5a11122c.

Besides this patch contains a better implementation of the generic  
handler function handler::multi_range_read_info_const() that
takes into account gaps between ranges when calculating the cost of
range index scans. It also contains some corrections of the
implementation of the handler function records_in_range() for MyISAM.

This patch supports the feature for InnoDB and MyISAM.
2019-02-03 14:56:12 -08:00
Marko Mäkelä
78829a5780 Merge 10.3 into 10.4 2019-01-24 22:42:35 +02:00
Andrei Elkin
f9ac7032cb MDEV-14605 Changes to "ON UPDATE CURRENT_TIMESTAMP" fields are not
always logged properly with binlog_row_image=MINIMAL

There are two issues fixed in this commit.
The first is an observation of a multi-table UPDATE binlogged
in row-format in binlog_row_image=MINIMAL mode. While the UPDATE aims
at a table with an ON-UPDATE attribute its binlog after-image misses
to record also installed default value.
The reason for that turns out missed marking of default-capable fields
in TABLE::write_set.

This is fixed to mark such fields similarly to 10.2's MDEV-10134 patch (db7edfed17)
that introduced it. The marking follows up 93d1e5ce0b841bed's idea
to exploit TABLE:rpl_write_set introduced there though,
and thus does not mess (in 10.1) with the actual MDEV-10134 agenda.
The patch makes formerly arg-less TABLE::mark_default_fields_for_write()
to accept an argument which would be TABLE:rpl_write_set.

The 2nd issue is extra columns in in binlog_row_image=MINIMAL before-image
while merely a packed primary key is enough. The test main.mysqlbinlog_row_minimal
always had a wrong result recorded.
This is fixed to invoke a function that intended for read_set
possible filtering and which is called (supposed to) in all type of MDL, UPDATE
including; the test results have gotten corrected.

At *merging* from 10.1->10.2 the 1st "main" part of the patch is unnecessary
since the bug is not observed in 10.2, so only hunks from

  sql/sql_class.cc

are required.
2019-01-24 20:07:53 +02:00
Marko Mäkelä
947b6b849d Merge 10.2 into 10.3 2019-01-24 16:14:12 +02:00
Marko Mäkelä
25161e6219 Merge 10.1 into 10.2 2019-01-24 14:43:29 +02:00
Brave Galera Crew
36a2a185fe Galera4 2019-01-23 15:30:00 +04:00
Marko Mäkelä
734510a44d Merge 10.3 into 10.4 2019-01-06 17:43:02 +02:00
Sergei Golubchik
6bb11efa4a Merge branch '10.2' into 10.3 2019-01-03 13:09:41 +01:00
Sergei Golubchik
67240858b2 Merge branch '10.1' into 10.2 2018-12-30 18:30:29 +01:00
Sergei Golubchik
aeefd26ecb Merge branch '10.0' into 10.1 2018-12-29 23:44:45 +01:00
Sergey Vojtovich
d2bdd78915 Master_info counters transition to Atomic_counter 2018-12-29 14:09:15 +04:00
Sergei Golubchik
a79183b01e correct table name in CHECK failures during ALTER TABLE 2018-12-20 08:06:55 +01:00
Sergei Golubchik
fca44b7c1f MDEV-17909 Problem by MariaDB Update 10.1.32 -> 10.2.19 (Incorrect information in file: .frm)
use frm_version, not mysql_version when parsing frm

In particular, virtual columns are stored according to
frm_version. And CHECK TABLE will overwrite mysql_version
to the current server version, so it cannot correctly
describe frm format.
2018-12-20 08:06:55 +01:00
Varun Gupta
7e606a2d5c MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
Create a new constant MAX_DATA_LENGTH_FOR_KEY.
Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES
of a field.
2018-12-19 10:38:46 +05:30
Varun Gupta
da4efd56aa Backported MDEV-11196(e4d10e09cf) and MDEV-10360(8a8ba1949b) to 10.0 2018-12-19 10:38:29 +05:30
Sergei Golubchik
9887d2e881 cleanup: simplify opening of priv tables
prepare TABLE_LIST in a loop and just before opening
don't store TABLE_LIST inside Grant_table_base.
2018-12-12 00:31:04 +01: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ä
7dcbc33db5 Merge 10.3 into 10.4 2018-11-26 17:20:07 +02:00
Marko Mäkelä
36359157cf Merge 10.2 into 10.3 2018-11-26 16:49:26 +02:00
Marko Mäkelä
971e1d8677 MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
If a table had a KEY_BLOCK_SIZE attribute, but no ROW_FORMAT,
it would be created as ROW_FORMAT=COMPRESSED in InnoDB.
However, TRUNCATE TABLE would lose the KEY_BLOCK_SIZE attribute
and create the table with the innodb_default_row_format (DYNAMIC).

This is a regression that was introduced by MDEV-13564.

update_create_info_from_table(): Copy also KEY_BLOCK_SIZE.
2018-11-26 16:41:09 +02:00
Igor Babaev
5f46670bd0 Merge branch '10.4' into 10.4-mdev16188 2018-11-10 14:52:57 -08:00
Marko Mäkelä
c761b43451 Merge 10.3 into 10.4 2018-11-08 10:19:55 +02:00
Marko Mäkelä
074c684099 Merge 10.3 into 10.4 2018-11-06 16:24:16 +02:00
Sergei Golubchik
9bf8568c04 fix an old typo 2018-11-06 13:36:50 +01: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
Sergei Golubchik
af9649c722 MDEV-17349 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on concurrent SELECT and DELETE after RENAME from table with index on virtual column
Race condition. field->flags were copied from s->field->flags during
field->clone(), early in open_table_from_share(). But s->field->flags
were getting their PART_INDIRECT_KEY_FLAG bit much later in
TABLE::mark_columns_used_by_virtual_fields() and only once per share.

If two threads were executing the code between field->clone()
and mark_columns_used_by_virtual_fields() at the same time, only
one would get PART_INDIRECT_KEY_FLAG bits in field[].
2018-11-04 08:12:28 +01:00
Marko Mäkelä
444c380ceb Merge 10.3 into 10.4 2018-10-05 08:09:49 +03:00
Eugene Kosov
44016ec0ca MDEV-16211 Contents of transaction_registry not replicated by Galera
Patch fixes two bugs:
1) BEGIN_TIMESTAMP of MYSQL.TRANSACTION_REGISTY is '0-0-0' on replication record insertion
2) BEGIN_TIMESTAMP equals COMMMIT_TIMESTAMP in MYSQL.TRANSACTION_REGISTRY

Fixed by calling THD::set_time() at appropriate places
2018-10-01 17:53:20 +03:00
Galina Shalygina
8d5a11122c MDEV-16188: Use in-memory PK filters built from range index scans
First phase: make optimizer choose to use filter and show it in EXPLAIN.
2018-09-28 23:50:22 +03:00
Sergei Golubchik
556f058ab2 ASAN error when strlen(db) < 6 2018-09-28 18:04:26 +02:00
Sergei Golubchik
57e0da50bb Merge branch '10.2' into 10.3 2018-09-28 16:37:06 +02:00
Alexander Barkov
ad8e02ac45 MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type control to "fuzzydate" 2018-09-28 14:01:17 +04:00
Michael Widenius
bd7c31621f MDEV-17065 Crash on SHOW CREATE TABLE with CHECK CONSTRAINT
The problem was that the original alias was replaced with a new allocated
string, but constraint item's are still pointing to the original alias.

Fixed by storing the original alias used when printing constraint in the
tables mem_root.
2018-09-16 11:23:27 +03:00
Oleksandr Byelkin
28f08d3753 Merge branch '10.1' into 10.2 2018-09-14 08:47:22 +02:00
Marko Mäkelä
1bf3e8ab43 Merge 10.3 into 10.4 2018-09-11 21:31:03 +03:00
Sergey Vojtovich
a0dfefb0f8 Fixed c++11 narrowing error
sql/table.cc:8561:42: error: non-constant-expression cannot be narrowed
                             from type 'uint' (aka 'unsigned int') to
                             '__darwin_suseconds_t' (aka 'int') in
                             initializer list [-Wc++11-narrowing]
  timeval end_time= {thd->query_start(), uint(thd->query_start_sec_part())};
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sql/table.cc:8561:42: note: insert an explicit cast to silence this issue
  timeval end_time= {thd->query_start(), uint(thd->query_start_sec_part())};
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                         static_cast<__darwin_suseconds_t>( )
2018-09-09 12:37:04 +04:00
Sergey Vojtovich
d9613b750c Enable C++11 2018-09-09 10:05:56 +04:00
Oleksandr Byelkin
31081593aa Merge branch '11.0' into 10.1 2018-09-06 22:45:19 +02:00
Sergey Vojtovich
4cf75706b3 MDEV-16757 Memory leak after adding manually min/max statistical data
for blob column

Moved delete_stat_values_for_table_share() call to proper place.
2018-09-05 17:14:20 +04:00
Sergei Golubchik
e81f101dac create a reusable function that tells what FK actions can write
Backport of 794f71cbc4
2018-09-04 09:49:52 +02:00
Sergei Golubchik
22bcfa011a cleanup: FOREIGN_KEY_INFO
instead of returning strings for CASCADE/RESTRICT
from every storage engine, use enum values

Backport of a3614d33e8
2018-09-04 08:37:44 +02:00
Marko Mäkelä
7830fb7f45 Merge 10.2 into 10.3 2018-08-28 12:22:56 +03:00
Igor Babaev
497d86276f MDEV-17017 Explain for query using derived table specified with
a table value constructor shows wrong number of rows

This is another attempt to fix this bug. The previous patch did not take
into account that a transformation for ALL/ANY subqueries could be applied
to the materialized table that wrapped the table value constructor used as
a specification of the subselect used an ALL/ANY subquery. In this case
the result of the derived table used a sink of the class select_subselect
rather than of the class select_unit. Thus the previous fix could cause
memory overwrites when running EXPLAIN for queries with table value
constructors in ALL/ANY subselects.
2018-08-27 08:15:10 -07:00
Sergei Golubchik
5d650d366d MDEV-16961 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed upon concurrent DELETE and DDL with virtual blob column
After iterating all fields and setting PART_INDIRECT_KEY_FLAG as
necessary, TABLE::mark_columns_used_by_virtual_fields() remembers
in TABLE_SHARE that this operation was done and need not be repeated.

But as the flag is set in TABLE_SHARE, PART_INDIRECT_KEY_FLAG must
be set in TABLE_SHARE::field[], not only in TABLE::field[].

Otherwise all new TABLEs opened from this TABLE_SHARE will
never have it.
2018-08-22 22:18:44 +02:00
Marko Mäkelä
734db318ac Merge 10.3 into 10.4 2018-08-16 10:08:30 +03:00
Sergei Golubchik
0aa9b03393 Merge branch '10.2' into 10.3 2018-08-12 12:02:23 +02:00