Commit graph

180834 commits

Author SHA1 Message Date
Sergei Petrunia
206aba5910 MyRocks: post-merge fixes part #8: make rocksdb.validate_datadic test pass 2018-08-30 21:30:40 +03:00
Sergei Petrunia
d4f3c5c42f MyRocks: post-merge fixes part #7: make rocksdb.check_ignore_unknown_options test pass 2018-08-30 21:18:53 +03:00
Alexey Botchkov
c933970974 MDEV-16665 ed25519 describes itself as 1.0-alpha even though it's not alpha.
Plugin version name fixed.
2018-08-30 15:57:22 +04:00
Alexey Botchkov
2ad51a0bd8 MDEV-17095 pam_user_map module throws syntax error if group name contains backslash.
Let '\\' and '/' symbols to be part of a group name.
2018-08-30 14:51:15 +04:00
Monty
42f09adab6 MDEV-16682 Assertion `(buff[7] & 7) == HEAD_PAGE' failed
Problem was that SQL level tried to read a record with rnd_pos()
that was already deleted by the same statement.
In the case where the page for the record had been deleted, this
caused an assert.
Fixed by extending the assert to also handle empty pages and
return HA_ERR_RECORD_DELETED for reads to deleted pages.
2018-08-30 13:45:27 +03:00
Sergei Petrunia
290368e740 MyRocks: post-merge fixes part #6: make rocksdb.allow_no_primary_key test pass 2018-08-30 12:55:03 +03:00
Igor Babaev
b245023fe0 MDEV-16992 Assertion `table_ref->table || table_ref->view' failed in
Field_iterator_table_ref::set_field_iterator

Several functions that processed different prepare statements missed
the DT_INIT flag in last parameter of the open_normal_and_derived_tables()
calls. It made context analysis of derived tables dependent on the order in
which the derived tables were processed by mysql_handle_derived(). This
order was induced by the order of SELECTs in all_select_list.
In 10.4 the order of SELECTs in all_select_list became different and lack
of the DT_INIT flags in some open_normal_and_derived_tables() call became
critical as some derived tables were not identified as such.
2018-08-30 00:51:39 -07:00
Jan Lindström
104089e182 MDEV-15512 - Fix sh parse error when [sst] config value has spaces.
Merged https://github.com/MariaDB/server/pull/617 authored by
Colin Mollenhour.
2018-08-29 19:30:03 +03:00
Sergei Petrunia
5e4f3af9b7 MyRocks: post-merge fixes part #5: make rocksdb.rocksdb_checksums test pass 2018-08-29 17:25:58 +03:00
Varun Gupta
b3c320bb0b MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
optimizer_use_condition_selectivity>=3

Selectivity analysis should be disabled for Geometrical columns
for the case like geometric_field= string_constant.
2018-08-29 12:48:23 +05:30
Ian Gilfillan
a8bf27c715 MDEV-14927: Missing man pages 2018-08-29 09:57:31 +03:00
Varun Gupta
a9c09c95bd MDEV-15306: Wrong/Unexpected result with the value optimizer_use_condition_selectivity set to 4
Currently for selectivity calculation we perform range analysis for a column even when we don't have any statistics(EITS).
This makes less sense but is used to catch contradiction for WHERE condition.

So the solution is to not perform range analysis for selectivity calculation for columns that do not have statistics.
2018-08-29 02:17:37 +05:30
Sergei Petrunia
3d2c0f61e7 MyRocks: Post-merge testcase fixes part #4 2018-08-28 17:35:52 +03:00
Sergei Petrunia
138605c3b7 MyRocks: Post-merge testcase fixes part #3 2018-08-28 16:30:22 +03:00
Sergei Petrunia
f561e63fdd MyRocks: Post-merge testcase fixes part #2 2018-08-28 16:18:02 +03:00
Sergei Petrunia
a01823a33f MyRocks: Post-merge testcase fixes part #1 2018-08-28 12:43:00 +00:00
Ian Gilfillan
6c588c92a9 MDEV-14927: Missing man pages 2018-08-28 14:12:42 +03:00
Sergei Petrunia
c930afd47e Merge branch 'merge-myrocks' of github.com:MariaDB/mergetrees into bb-10.2-mariarocks-merge
Move up-to this revision in the upstream:

  commit de1e8c7bfe7c875ea284b55040e8f3cd3a56fcc2
  Author: Abhinav Sharma <abhinavsharma@fb.com>
  Date:   Thu Aug 23 14:34:39 2018 -0700

      Log updates to semi-sync whitelist in the error log

      Summary:
      Plugin variable changes are not logged in the error log even when
      log_global_var_changes is enabled. Logging updates to whitelist will help in
      debugging.

      Reviewed By: guokeno0

      Differential Revision: D9483807

      fbshipit-source-id: e111cda773d
2018-08-28 14:09:04 +03:00
Jan Lindström
f4454a35fc
Merge pull request #539 from grooverdan/10.1-wsrep_sst_rsync_read_MYSQL_BASE_VERSION_config
MDEV-14851: galera_recovery to read correct configuration file sections
2018-08-28 13:48:43 +03:00
Sergei Petrunia
faa4d8f8c6 Copy of
commit de1e8c7bfe7c875ea284b55040e8f3cd3a56fcc2
Author: Abhinav Sharma <abhinavsharma@fb.com>
Date:   Thu Aug 23 14:34:39 2018 -0700

    Log updates to semi-sync whitelist in the error log

    Summary:
    Plugin variable changes are not logged in the error log even when
    log_global_var_changes is enabled. Logging updates to whitelist will help in
    debugging.

    Reviewed By: guokeno0

    Differential Revision: D9483807

    fbshipit-source-id: e111cda773d
2018-08-28 08:23:44 +00:00
Monty
cded083a37 MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexes
Problem was that a parallel open of a table, overwrote info->state that
was in used by repair.

Fixed by changing _ma_tmp_disable_logging_for_table() to use
a new state buffer state.no_logging to store the temporary state.

Other things:
- Use original number of rows when retrying repair to get rid of a
  potential warning "Number of rows changed from X to Y"
- Changed maria_commit() to make it easier to merge with 10.4
- If table is not locked (like with show commands), use the global
  number of rows as the local number may not be up to date.
  (Minor not critical fix)
- Added some missing DBUG_RETURN
2018-08-27 22:00:14 +03:00
Julius Goryavsky
c11fb374b5 MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
Current versions of xtrabackup-v2 and mariabackup support the option
--innodb-data-home-dir, but this parameter is not passed to them from
the SST script, since the SST script does not receive this information
from mysqld. The transfer of this information to the SST is already
fixed by the MDEV-10754 patch, but we need to process it in the SST
script. Also, we should take into account that on the joiner side
the corresponding information is not read yet from the configuration
file (at the mysqld side) during the start of SST, so the script must
itself read it.

https://jira.mariadb.org/browse/MDEV-10756
2018-08-27 16:24:29 +02:00
Galina Shalygina
55163ba1bd MDEV-16803: Pushdown Item_func_in item that uses vectors in several SELECTs
The bug appears because of the Item_func_in::build_clone() method.
The 'array' field for the Item_func_in item that can be pushed into
the materialized view/derived table was built in the wrong way.
It becomes lame after the pushdown of the condition into the first
SELECT that defines that view/derived table. The server crashes in
the pushdown into the next SELECT while trying to use already lame
'array' field.

To fix it Item_func_in::build_clone() was changed.
2018-08-27 16:15:05 +02:00
Marko Mäkelä
5fb251642e Commit the MDEV-17023 fix with the correct number 2018-08-27 12:22:27 +03:00
Varun Gupta
69d7bfd970 MDEV-17023: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
No need to read statistics for tables that are not USER tables.
We allocate memory for structures to collect statistics only for USER TABLES.
2018-08-27 12:21:26 +03:00
Ming Lin
2b76f6f61d MDEV-16703: Update AUTO_INCREMENT in the UPDATE statement
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

(cherry picked from commit f7154242b8)
2018-08-26 15:10:32 +03:00
zhzhzoo
2a361ebe1b MDEV-15204: lag/lead function order list mandatory 2018-08-25 18:47:14 +03:00
Vicențiu Ciorbaru
51fb163b6d Fix clang warning of mismatched new[] and delete[]
Warning:
'delete' applied to a pointer that was allocated with 'new[]';
did you mean 'delete[]'?
2018-08-25 18:27:57 +03:00
Daniel Black
6b22cc4ae0 connect engine: GetStringUTFChars takes pointer arg
Avoids compile errors of the form:

/storage/connect/jdbconn.cpp:1473:41: error: cannot initialize a parameter of type 'jboolean *' (aka 'unsigned char *') with an rvalue of type 'jboolean' (aka 'unsigned char')
   name = env->GetStringUTFChars(label, (jboolean)false);
                                        ^~~~~~~~~~~~~~~
/usr/lib/jvm/java-8-oracle/include/jni.h:1616:58: note: passing argument to parameter 'isCopy' here
    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
2018-08-25 18:27:14 +03:00
Anel Husakovic
4ba6327f95 Fix typo in --srcdir option in echo message status of mysql_install_db 2018-08-25 17:51:15 +03:00
Igor Babaev
c826b6b8da Added a new parameter for the function eq_ranges_exceeds_limit()
introduced in the patch fo MDEV-16934.
2018-08-24 20:53:00 -07:00
Monty
490e220ad2 MDEV-17067 Server crash in write_block_record
Problem was that Create_field::create_length_to_internal_length()
calculated a different pack_length for NEWDECIMAL compared to
Field_new_decimal constructor which lead to some unused bytes
in the middle of the record, which Aria didn't like.
2018-08-24 21:03:22 +03:00
Monty
f195286a3e MDEV-17021 Server crash or assertion `length <= column->length' failure in write_block_record
Problem was that the number of NULL bit's was record wrong in the
.frm file because there could be more fields marked NOT_NULL after the
number of not_null fields where recorded.

Fixed by copying test for virtual fields from prepare_create_field()
The code change, only the test, doesn't have to be merged to 10.3
as this is fixed there.
2018-08-24 18:08:56 +03:00
Marko Mäkelä
8b949d961c MDEV-15511 Use stunnel during rsync SST if available
Merge the 10.2 version, which was created by Vasil Dimov.
2018-08-24 15:11:43 +03:00
benrubson
4c652fc62e
Use stunnel during rsync SST if available
(cherry picked from commit 1adc382c2f)
2018-08-24 13:35:44 +02:00
Rasmus Johansson
e560f2f342
Merge pull request #846 from shinnok/bb-5.5-mtr-shm
MDEV-17022: check if mtr --mem location is writeable
2018-08-24 12:33:05 +03:00
Marko Mäkelä
1b4c5b7327 MDEV-16868 Same query gives different results
An INSERT into a temporary table would fail to set the
index page as modified. If there were no other write operations
(such as UPDATE or DELETE) to the page, and the page was evicted,
we would read back the old contents of the page, causing
corruption or loss of data.

page_cur_insert_rec_write_log(): Call mtr_t::set_modified()
for temporary tables. Normally this is part of the mlog_open()
call, but the mlog_open() call was only present in debug builds.
This regression was caused by
commit 48192f963a
which was preparation for MDEV-11369 and supposed to affect
debug builds only.

Thanks to Thirunarayanan Balathandayuthapani for debugging.
2018-08-24 09:38:52 +03:00
Varun Gupta
0cafc13164 MDEV-17073: Crash during read_histogram_for_table with optimizer_use_condition_selectivity set to 4
No need to read statistics for tables that are not USER tables.
We allocate memory for structures to collect statistics only for USER TABLES.
2018-08-24 01:59:02 +05:30
Marko Mäkelä
c164d0cc62 fil_name_process(): Remove unused return value 2018-08-23 17:02:50 +03:00
Varun Gupta
7d8d37c31d MDEV-17039: Query plan changes when we use GROUP BY optimization with optimizer_use_condition_selectivity=4
and use_stat_tables= PREFERABLY

Currently the code that calculates selectivity for a table does not take into account the case when
we can have GROUP BY optimization (looses index scan).
2018-08-23 16:01:58 +05:30
Marko Mäkelä
9a815401c6 MDEV-17043 Purge of indexed virtual columns may cause hang on table-rebuilding DDL
When a table is renamed to an internal #sql2 or #sql-ib name during
a table-rebuilding DDL operation such as OPTIMIZE TABLE or ALTER TABLE,
and shortly after that a purge operation in an index on virtual columns
is attempted, the operation could fail, but purge would fail to release
the table reference.

innodb_acquire_mdl(): Release the reference if the table name is not
valid for acquiring a meta-data lock (MDL).

innodb_find_table_for_vc(): Add a debug assertion if the table name
is not valid. This code path is for DML execution. The table
should have a valid name for executing DML, and furthermore a MDL
will prevent the table from being renamed.

row_vers_build_clust_v_col(): Add a debug assertion that both indexes
must belong to the same table.
2018-08-23 13:11:11 +03: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
Daniel Black
064ba8cc9f item_cmp_type: simplier for a faster codepath
The common case for this function is that both types are the same.

The Item_result defination from include/mysql.h.pp is the following enum
   enum Item_result
   {
     STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
     TIME_RESULT
   };

The compilers aren't quite smart enough to optimize to this shortcut so
this makes it quicker.

Before the change:

0000000000012730 <item_cmp_type(Item_result, Item_result)>:
   12730:       89 f0                   mov    %esi,%eax
   12732:       09 f8                   or     %edi,%eax
   12734:       74 4c                   je     12782 <item_cmp_type(Item_result, Item_result)+0x52>
   12736:       83 ff 02                cmp    $0x2,%edi
   12739:       75 0a                   jne    12745 <item_cmp_type(Item_result, Item_result)+0x15>
   1273b:       b8 02 00 00 00          mov    $0x2,%eax
   12740:       83 fe 02                cmp    $0x2,%esi
   12743:       74 3c                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   12745:       83 ff 03                cmp    $0x3,%edi
   12748:       b8 03 00 00 00          mov    $0x3,%eax
   1274d:       74 32                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   1274f:       83 fe 03                cmp    $0x3,%esi
   12752:       74 2d                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   12754:       83 ff 05                cmp    $0x5,%edi
   12757:       b8 05 00 00 00          mov    $0x5,%eax
   1275c:       74 23                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   1275e:       83 fe 05                cmp    $0x5,%esi
   12761:       74 1e                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   12763:       83 ff 04                cmp    $0x4,%edi
   12766:       74 05                   je     1276d <item_cmp_type(Item_result, Item_result)+0x3d>
   12768:       83 ff 02                cmp    $0x2,%edi
   1276b:       75 0f                   jne    1277c <item_cmp_type(Item_result, Item_result)+0x4c>
   1276d:       b8 04 00 00 00          mov    $0x4,%eax
   12772:       83 fe 02                cmp    $0x2,%esi
   12775:       74 0a                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   12777:       83 fe 04                cmp    $0x4,%esi
   1277a:       74 05                   je     12781 <item_cmp_type(Item_result, Item_result)+0x51>
   1277c:       b8 01 00 00 00          mov    $0x1,%eax
   12781:       c3                      retq
   12782:       31 c0                   xor    %eax,%eax
   12784:       c3                      retq

After, noting the short cut and the beginning of the function:

0000000000012730 <item_cmp_type(Item_result, Item_result)>:
   12730:       39 f7                   cmp    %esi,%edi
   12732:       75 03                   jne    12737 <item_cmp_type(Item_result, Item_result)+0x7>
   12734:       89 f8                   mov    %edi,%eax
   12736:       c3                      retq
   12737:       83 ff 03                cmp    $0x3,%edi
   1273a:       b8 03 00 00 00          mov    $0x3,%eax
   1273f:       74 32                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   12741:       83 fe 03                cmp    $0x3,%esi
   12744:       74 2d                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   12746:       83 ff 05                cmp    $0x5,%edi
   12749:       b8 05 00 00 00          mov    $0x5,%eax
   1274e:       74 23                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   12750:       83 fe 05                cmp    $0x5,%esi
   12753:       74 1e                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   12755:       83 ff 04                cmp    $0x4,%edi
   12758:       74 05                   je     1275f <item_cmp_type(Item_result, Item_result)+0x2f>
   1275a:       83 ff 02                cmp    $0x2,%edi
   1275d:       75 0f                   jne    1276e <item_cmp_type(Item_result, Item_result)+0x3e>
   1275f:       b8 04 00 00 00          mov    $0x4,%eax
   12764:       83 fe 02                cmp    $0x2,%esi
   12767:       74 0a                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   12769:       83 fe 04                cmp    $0x4,%esi
   1276c:       74 05                   je     12773 <item_cmp_type(Item_result, Item_result)+0x43>
   1276e:       b8 01 00 00 00          mov    $0x1,%eax
   12773:       c3                      retq

Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
2018-08-22 09:39:30 +03:00
Marko Mäkelä
b0ef1b388b After-merge fix: Revert MDEV-15511
My conflict resolution for the script did not work out after all,
and apparently I was testing a wrong version. Revert MDEV-15511
from MariaDB 10.2 for now.
2018-08-21 16:52:59 +03:00
Jan Lindström
b87b8c1344
Merge pull request #828 from tempesta-tech/sysprg/10.1-MDEV-10754
MDEV-10754 wsrep_sst_rsync does not support innodb_data_home_dir
2018-08-21 15:58:09 +03:00
Marko Mäkelä
9258097fa3 Merge 10.1 into 10.2 2018-08-21 15:20:34 +03:00
Marko Mäkelä
dc7c080369 MDEV-17026 Assertion srv_undo_sources || ... failed on slow shutdown
trx_purge_add_update_undo_to_history(): Relax the too strict assertion
by removing the condition on srv_fast_shutdown (innodb_fast_shutdown).
Rollback is allowed during any form of shutdown.
2018-08-21 12:33:41 +03:00
Marko Mäkelä
45dbd47026 MDEV-17003 service_manager_extend_timeout() being called too often
buf_dump(): Only generate the output when shutdown is in progress.

log_write_up_to(): Only generate the output before actually writing
to the redo log files.

srv_purge_should_exit(): Rate-limit the output, and instead of
displaying the work done, indicate the work that remains to be done
until the completion of the slow shutdown.
2018-08-21 12:33:40 +03:00
Marko Mäkelä
cdc8debcaa MDEV-16557 Remove INNOBASE_SHARE 2018-08-21 12:10:21 +03:00
Marko Mäkelä
cccdb176a6 MDEV-16862 build failure for WITH_INNODB_AHI=0
Fix the build, which was broken by MDEV-16515.
2018-08-21 12:10:18 +03:00