Commit graph

70488 commits

Author SHA1 Message Date
Marko Mäkelä
2e5aea4bab Merge 10.1 into 10.2 2018-12-13 15:47:38 +02:00
Marko Mäkelä
621041b676 Merge 10.0 into 10.1
Also, apply the MDEV-17957 changes to encrypted page checksums,
and remove error message output from the checksum function,
because these messages would be useless noise when mariabackup
is retrying reads of corrupted-looking pages, and not that
useful during normal server operation either.

The error messages in fil_space_verify_crypt_checksum()
should be refactored separately.
2018-12-13 13:37:21 +02:00
Marko Mäkelä
c913cd2b66 MDEV-17885 TRUNCATE on temporary table causes ER_GET_ERRNO
ha_innobase::truncate(): Because CREATE TEMPORARY TABLE
allows invalid table options when innodb_file_per_table=1,
do allow them also in TRUNCATE for temporary tables.
2018-12-12 16:31:34 +02:00
Marko Mäkelä
839cf16bb2 Merge 10.2 into 10.3 2018-12-12 13:46:06 +02:00
Marko Mäkelä
e0aebf5cf1 MDEV-17815 Assertion failed in btr_node_ptr_max_size for CHAR(0)
btr_node_ptr_max_size(): Treat CHAR(0) from SQL as a special case.
The InnoDB internal SQL parser maps the type "CHAR" to DATA_VARCHAR,
but MariaDB does allow CHAR(0) with an empty value, and does enforce
the length limitation.
2018-12-12 13:21:05 +02:00
Marko Mäkelä
db1210f939 Merge 10.1 into 10.2 2018-12-12 12:13:43 +02:00
Sergei Golubchik
56d3a0e73b MDEV-17967 Add a solution of the 8 queens problem to the regression test for CTE 2018-12-12 10:39:17 +01:00
Marko Mäkelä
f77f8f6d1a Merge 10.0 into 10.1 2018-12-12 10:48:53 +02:00
Eugene Kosov
d956709b4b MDEV-17833 ALTER TABLE is not enforcing prefix index size limit
ha_innobase::prepare_inplace_alter_table(): check max column length for every
index in a table, not just added in this particular ALTER TABLE with ADD INDEX ones.
2018-12-11 22:03:44 +03:00
Varun Gupta
8aef7f2bb9 MDEV-17778: Alter table leads to a truncation warning with ANALYZE command
Alter statement changed the THD structure by setting the value to FIELD_CHECK_WARN
and then not resetting it back. This led ANALYZE to throw a warning which previously
it didn't.
2018-12-10 18:27:13 +05:30
Kristian Nielsen
705fd4e943 Fix another random failure in rpl.rpl_gtid_crash 2018-12-08 22:54:34 +01:00
Kristian Nielsen
a02cac47f6 Fix an occational test failure in rpl.rpl_gtid_crash 2018-12-07 17:20:31 +01:00
Varun Gupta
4886d14827 MDEV-17032: Estimates are higher for partitions of a table with @@use_stat_tables= PREFERABLY
The problem here is EITS statistics does not calculate statistics for the partitions of the table.
So a temporary solution would be to not read EITS statistics for partitioned tables.

Also disabling reading of EITS for columns that participate in the partition list of a table.
2018-12-07 19:59:45 +05:30
Marko Mäkelä
21069c528e Merge 10.2 into 10.3 2018-12-07 15:39:34 +02:00
Marko Mäkelä
52778e2e3e After-merge fix 2018-12-07 15:13:39 +02:00
Marko Mäkelä
5e5deabdbc Merge 10.1 into 10.2 2018-12-07 13:41:10 +02:00
Marko Mäkelä
49a50a19a1 MDEV-17923 Assertion failed in trx_undo_page_report_modify after CREATE FULLTEXT INDEX
row_fts_merge_insert(): Correctly initialize DB_ROLL_PTR to a safe value
that will not be dereferenced by MVCC.
2018-12-07 11:54:03 +02:00
Vladislav Vaintroub
2a2e8ea8fe MDEV-17917 MTR: fixed race conditions in perfschema.socket_connect, main.connect 2018-12-06 21:46:14 +01:00
Sergei Golubchik
6491c591b2 Merge branch '10.0' into 10.1 2018-12-06 15:08:42 +01:00
Sergei Golubchik
daca7e70d7 MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
merge_role_db_privileges() was remembering pointers into Dynamic_array
acl_dbs, and later was using them, while pushing more elements into the
array. But pushing can cause realloc, and it can invalidate all pointers.

Fix: remember and use indexes of elements, not pointers.
2018-12-06 14:22:07 +01:00
Varun Gupta
17e8570285 Added a testcase for mdev-17734 2018-12-05 19:31:25 +05:30
Marko Mäkelä
5ec9b88e11 Disable a frequently failing test 2018-12-04 15:30:04 +02:00
Marko Mäkelä
b6f203984b Merge 10.2 into 10.3 2018-12-04 13:18:14 +02:00
Thirunarayanan Balathandayuthapani
157d3c3bc1 MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- Fixed innodb.table_flags test case in release build.
2018-12-03 15:57:21 +05:30
Thirunarayanan Balathandayuthapani
f2c7972a3d MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- This is a regression of commit b26e603aeb. While dropping
the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one.
2018-12-03 01:12:04 +05:30
Igor Babaev
46960365b1 MDEV-17871 Crash when running explain with CTE
When the with clause of a query contains a recursive CTE that is not used
then processing of EXPLAIN for this query does not require optimization
of the unit specifying this CTE. In this case if 'derived' is the
TABLE_LIST object created for this CTE then derived->derived_result is NULL
and any assignment to derived->derived_result->table causes a crash.
After fixing this problem in the code of st_select_lex_unit::prepare()
EXPLAIN for such a query worked without crashes. Yet an execution
plan for the recursive CTE appeared there. The cause of this problem was
an incorrect condition used in JOIN::save_explain_data_intern() that
determined whether CTE was to be optimized or not. A similar condition was
used in select_describe() and this patch has corrected it as well.
2018-12-01 15:06:04 -08:00
Marko Mäkelä
3e5162d814 Re-disable a failing test 2018-11-30 15:54:21 +02:00
Marko Mäkelä
0abd2766b1 Merge 10.2 into 10.3
Also, related to MDEV-15522, MDEV-17304, MDEV-17835,
remove the Galera xtrabackup tests, because xtrabackup never worked
with MariaDB Server 10.3 due to InnoDB redo log format changes.
2018-11-30 09:38:56 +02:00
Eugene Kosov
e8bb94ccc8 MDEV-16499 [10.1] ER_NO_SUCH_TABLE_IN_ENGINE followed by "Please drop the table and recreate" upon adding FULLTEXT key to table with virtual column
There was an incorrect check for MariaDB and InnoDB
tables fields count. Corruption was reported when there was no corruption.
Also, a warning message had incorrect field numbers for both MariaDB and InnoDB
tables.

ha_innobase::open(): fixed check and message
2018-11-30 01:15:30 +03:00
Jan Lindström
7826b9b983 Fix syntax error on galera/disabled.def file 2018-11-29 17:11:19 +02:00
Jan Lindström
33fdb443ea Fix xtrabackup SST tests by using innodb-safe-truncate=OFF.
Disable tests that do not yet pass.
2018-11-29 17:11:19 +02:00
Marko Mäkelä
35184902db Merge 10.2 into 10.3 2018-11-28 15:23:23 +02:00
Marko Mäkelä
b26e603aeb MDEV-17859 Operating system errors in file operations after failed CREATE
This is a regression due to MDEV-17816.

When creating a table fails, we must roll back the dictionary
transaction. Because the rollback may rename tables, and because
InnoDB lacks proper undo logging for CREATE operations, we must
drop the incompletely created table before rolling back the
transaction, which could include a RENAME operation.
But, we must not blindly drop the table by name; after all,
the operation could have failed because another table by the
same name already existed.

create_table_info_t::m_drop_before_rollback: A flag that is set
if the table needs to be dropped before transaction rollback.

create_table_info_t::create_table(): Remove some duplicated
error handling.

ha_innobase::create(): On error, only drop the table if it was
actually created.
2018-11-28 15:17:56 +02:00
Jan Lindström
4b88d5ee51 MDEV-17771: Add Galera ist and sst tests using mariabackup
Add check that file key management plugin is found.
2018-11-27 15:26:18 +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
Marko Mäkelä
1afed20774 Merge 10.2 into 10.3
The test galera_sst_mariabackup_table_options was disabled,
because the server refuses to start up due to wrong parameters.
2018-11-26 14:05:15 +02:00
Marko Mäkelä
2a31b82831 MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
The error handling in the MDEV-13564 TRUNCATE TABLE was broken
when an error occurred during table creation.

row_create_index_for_mysql(): Do not drop the table on error.

fts_create_one_common_table(), fts_create_one_index_table():
Do drop the table on error.

create_index(), create_table_info_t::create_table():
Let the caller handle the index creation errors.

ha_innobase::create(): If create_table_info_t::create_table()
fails, drop the incomplete table, roll back the transaction,
and finally return an error to the caller.
2018-11-26 12:50:27 +02:00
Jan Lindström
328d7779bc Fortify galera_sst_mariabackup_table_options test. 2018-11-26 08:58:38 +02:00
Jan Lindström
1037edcb11 MDEV-17804: Galera tests cause mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
Do not do end of statement logic if thd is already killed as
socket is already closed.
2018-11-26 08:12:30 +02:00
Jan Lindström
244cc35e7b MDEV-17801: Galera test failure on galera_var_reject_queries
Problem was that controlling connection i.e. connection that
executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL;
was also killed but server would try to send result from that
query to controlling connection resulting a assertion
mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
as socket was closed when controlling connection was closed.

wsrep_close_client_connections()
	Do not close controlling connection and instead of
	wsrep_close_thread() we do now soft kill by THD::awake

wsrep_reject_queries_update()
	Call wsrep_close_client_connections using current thd.
2018-11-26 08:11:56 +02:00
Jan Lindström
3728b11f87 MDEV-17804: Galera tests cause mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
Do not do end of statement logic if thd is already killed as
socket is already closed.
2018-11-22 16:36:16 +02:00
Jan Lindström
dde0a83fff MDEV-17801: Galera test failure on galera_var_reject_queries
Problem was that controlling connection i.e. connection that
executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL;
was also killed but server would try to send result from that
query to controlling connection resulting a assertion
mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
as socket was closed when controlling connection was closed.

wsrep_close_client_connections()
	Do not close controlling connection and instead of
	wsrep_close_thread() we do now soft kill by THD::awake

wsrep_reject_queries_update()
	Call wsrep_close_client_connections using current thd.
2018-11-22 16:36:16 +02:00
Jan Lindström
2b49e15686 MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup
Disable galera_3nodes tests using xtrabackup.
2018-11-22 16:36:16 +02:00
Jan Lindström
00c88a7122 MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup
Disable galera tests using xtrabackup.
2018-11-22 16:36:16 +02:00
Jan Lindström
4b1b4b3920 MDEV-17771: Add Galera ist and sst tests using mariabackup
Record result files for 10.2.
2018-11-22 16:36:09 +02:00
Jan Lindström
06063e8a41 Merge remote-tracking branch 'origin/10.1' into 10.2 2018-11-21 16:59:11 +02:00
Jan Lindström
8324e5e84d MDEV-17771: Add Galera ist and sst tests using mariabackup
Add test case for encrypted and page compressed tables.
2018-11-21 09:05:47 +02:00
Oleksandr Byelkin
d07a6e33dd Check that default() do not see invisible field. 2018-11-20 17:31:07 +01:00
Marko Mäkelä
4210e7bf6f Merge 10.2 into 10.3 2018-11-20 15:08:41 +02:00
Marko Mäkelä
92996c9aa9 Merge bb-10.3-release into 10.3 2018-11-20 15:08:30 +02:00
Jan Lindström
41fa9a5986 Add missing .rdiff file to test galera_sst_xtrabackup-v2_data_dir
for debug build.
2018-11-20 07:49:46 +02:00
Elena Stepanova
ae96b47f9e MDEV-17507 Make MTR tests work for builds without Aria for temporary tables
Skip tests which expectedly fail when Aria is not used for temporary tables
2018-11-20 01:50:59 +02:00
Marko Mäkelä
fd58bb71e2 Merge 10.2 into 10.3 2018-11-19 18:45:53 +02:00
Jan Lindström
6fad15d02a MDEV-17771: Add Galera ist and sst tests using mariabackup
Remove unnecessary have_debug requirement, record results using
release build and create .rdiff file for debug builds where
needed.
2018-11-19 17:34:22 +02:00
zdrav1
ea03eac5d7 fiexed debug build failure of galera_ist_mariabackup_innodb_flush_logs 2018-11-19 15:06:34 +02:00
zdrav1
0529c9e93e fiexed debug build failure of galera_ist_mariabackup test 2018-11-19 15:06:30 +02:00
zdrav1
c85912c8c6 added galera_ist_mariabackup_innodb_flush_logs test 2018-11-19 15:06:27 +02:00
zdrav1
2160e075dc fixed the test comments of galera_sst_mariabackup_encrypt_with_key test 2018-11-19 15:06:23 +02:00
zdrav1
ace0b7215e added test galera_sst_mariabackup_encrypt_with_key; corrected path to galera_ist_mariabackup test 2018-11-19 15:06:20 +02:00
zdrav1
92e99775e9 added test case galera_ist_mariabackup 2018-11-19 15:06:16 +02:00
zdrav1
bae7c1ebd4 added galera_autoinc_sst_mariabackup test 2018-11-19 15:06:14 +02:00
Jan Lindström
de0eeb800e MDEV-16890: Galera test failure on galera_sst_mysqldump_with_key
Record .rdiff file for debug build and record .result file using
product build.
2018-11-19 11:00:56 +02:00
Jan Lindström
ae0361ab39 MDEV-13881: galera.partition failed in buildbot with wrong result
Add proper wait conditions to second node before continuing test.
2018-11-17 08:11:52 +02:00
Elena Stepanova
fe0e65dbe2 Updated list of unstable tests for 10.3.11 release 2018-11-16 19:58:52 +02:00
Varun Gupta
705abdebaf MDEV-13170: Database service (MySQL) stops after update with trigger
For prepare statemtent/stored procedures we rollback the items to original
ones after prepare execution in the function reinit_stmt_before_use.
This rollback is done for group by, order by clauses but is not done for
the window specification containing the order by and partition by clause of the
window function.
2018-11-16 10:43:53 +05:30
Oleksandr Byelkin
49a91a6cf8 Merge branch '10.2' into 10.3 2018-11-15 21:14:52 +01:00
Oleksandr Byelkin
f74649b522 Merge branch '10.1' into 10.2 2018-11-15 19:21:40 +01:00
Vladislav Vaintroub
efc235d84d Fix test result.
in 10.3, AWS encryption key was loaded during recovery, by the innodb purge
thread, therefore no note "loaded key" was written by the foreground
thread.
2018-11-15 18:03:30 +01:00
Oleksandr Byelkin
a77f80b79e Merge branch '10.0' into 10.1 2018-11-15 17:20:26 +01:00
Oleksandr Byelkin
a84d87fde8 Merge branch '5.5' into 10.0 2018-11-15 13:57:35 +01:00
Alexander Barkov
1956695c69 MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
The fix for "MDEV-17698 MEMORY engine performance regression"
previously fixed this problem.

- Adding the test for MDEV-17724
- Re-recording wrong results for tests:
  * engines/iuds/r/insert_number
  * engines/iuds/r/update_delete_number
  which started to fail since MDEV-17698
2018-11-15 16:45:43 +04:00
Oleksandr Byelkin
7e75643778 Merge branch '10.1' into 10.2 2018-11-14 18:40:09 +01:00
Oleksandr Byelkin
9e23171c70 Merge branch '10.0' into 10.1 2018-11-14 16:58:33 +01:00
Oleksandr Byelkin
47274d902e fix of test suite 2018-11-14 15:46:53 +01:00
Alexander Barkov
13cd4cf436 MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)
sp_instr_cursor_copy_struct::exec_core() created TYPELIBs on a wrong mem_root,
the one which is initialized in sp_head::execute(), this code:

  /* init per-instruction memroot */
  init_sql_alloc(&execute_mem_root, "per_instruction_memroot",
                 MEM_ROOT_BLOCK_SIZE, 0, MYF(0));

This memory root cleans up after every sp_instr_xxx executed, so later
sp_instr_cfetch::execute() tried to use already freed and trashed memory.

Changing sp_instr_cursor_copy_struct::exec_core() to call tmp.export_structure()
inside this block (not outside of it):
  thd->set_n_backup_active_arena(thd->spcont->callers_arena, &current_arena);
  ...
  thd->restore_active_arena(thd->spcont->callers_arena, &current_arena);

So now TYPELIBs created by sp_instr_cursor_copy_struct::exec_core() are
still available and valid when sp_instr_cfetch::execute() is called.
They are freed at the end of dispatch_command() corresponding to
the "CALL p1" statement.
2018-11-14 14:23:43 +04:00
Oleksandr Byelkin
01d3e40197 MDEV-16217: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_num::get_date
- clean up DEFAULT() to work only with default value and correctly print
  itself.
- fix of DBUG_ASSERT about fields read/write
- fix of field marking for write based really on the thd->mark_used_columns flag
2018-11-14 10:27:41 +01:00
Alexander Barkov
2a0b6de41b MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves incorrectly 2018-11-13 18:03:14 +04:00
Sergei Golubchik
34a3972497 MDEV-14429 sql_safe_updates in my.cnf not work
update test results for embedded

followup for 564a63b5a3 and 89a87e8e42
2018-11-13 10:30:27 +01:00
Aleksey Midenkov
50bc55d462 MDEV-16241 Assertion `inited==RND' failed in handler::ha_rnd_end()
Discrepancy in open indexes due to overwritten `read_partitions` upon
`ha_open()` in `ha_partition::clone()`.

[Fixes tempesta-tech/mariadb#551]
2018-11-13 10:30:27 +01:00
Alexander Barkov
c29c39a7dc MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the option_value_no_option_type grammar 2018-11-13 09:54:21 +04:00
Elena Stepanova
32bebfeefb Updated list of unstable tests for 10.2.19 2018-11-12 18:19:31 +02:00
Sergei Golubchik
85baa03c60 update results after CONC-351 fix 2018-11-12 11:46:13 +01:00
Vladislav Vaintroub
4f9c44ed39 adjust MTR code after C/C changed the location of plugin libraries 2018-11-12 11:46:13 +01:00
Alexey Botchkov
b290ef8c76 MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1.
Produce syntax error when '{...]'.
2018-11-12 01:50:07 +04:00
Alexander Barkov
7f4aee2233 MDEV-17666 sql_mode=ORACLE: Keyword ELSEIF should not be reserved 2018-11-12 00:01:12 +04:00
Alexander Barkov
8e6f10335d A join patch for MDEV-17660 and MDEV-17661
MDEV-17660 sql_mode=ORACLE: Some keywords do not work as label names: history, system, versioning, without
MDEV-17661 Add sql_mode specific tokens for the keyword DECODE
2018-11-10 23:11:34 +04:00
Varun Gupta
a12b8ac8e9 MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free or Invalid write in JOIN::make_aggr_tables_info
During the optimize state of a query, we come know that the result set
would atmost contain one row, then for such a query we don't need
to compute GROUP BY, ORDER BY and DISTINCT.
2018-11-10 13:13:26 +05:30
Alexey Botchkov
5cfb043d29 MDEV-16174 Assertion `0' failed in Type_handler_string_result::make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)
maybe_null should be always set to TRUE in
Item_func_json_array_append::fix_length_and_dec()
2018-11-09 22:55:34 +04:00
Marko Mäkelä
aa4772e75b MDEV-13134: Remove an orphan .inc file 2018-11-09 12:07:55 +02:00
Igor Babaev
2d7d19a3cd MDEV-17574 SIGSEGV or Assertion `producing_item != __null' in
Item_direct_view_ref::derived_field_transformer_for_where
           upon updating a view

The condition pushed into a materialized derived / view mast be adjusted
for the new context: its column references must be substituted for
references to the columns of the underlying tables if the condition
is pushed into WHERE. The substitution is performed by the 'transform'
method. If the materialized derived is used in a mergeable view then
the references to the columns of the view are represented by
Item_direct_view_ref objects. The transform method first processes
the item wrapped in such an object and only after this it transforms
the object itself.
The transformation procedure of an Item_direct_view_ref object has
to know whether the item it wraps has been substituted. If so the
procedure does not have to do anything. In the code before this patch
it was not possible for the transformation procedure used by an
Item_direct_view_ref object to find out whether a substitution for
the wrapped item had happened.
2018-11-08 22:55:26 -08:00
Alexander Barkov
3074beaad6 MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
Changing the way how a cursor is opened to fetch its structure only,
e.g. for a cursor FOR loop record variable.

The old methods with setting thd->lex->limit_rows_examined to an Item_uint(0)
was not reliable and could push these messages into diagnostics area:

  The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0)

The new method should be more reliable, as it completely prevents the call
of do_select() in JOIN::exec_inner() during the cursor structure discovery,
so the execution of the cursor SELECT query returns immediately after the
preparation step (when the result row structure becomes known),
without even entering the code that fetches the result rows.
2018-11-09 09:56:02 +04:00
Marko Mäkelä
3fbee66499 MDEV-17645 innodb.log_file_name_debug does not clean up after itself
The test innodb.log_file_name_debug failed to ensure that
the bogus redo log record that its debug injection emitted
would be consumed by a redo log checkpoint before running a
subsequent test, which could perform crash recovery.

Add an extra shutdown to ensure that a redo log checkpoint is
generated. In this way, the following will succeed:

./mtr --no-reorder innodb.log_file_name_debug innodb.read_only_recovery
2018-11-08 14:50:32 +02:00
Marko Mäkelä
2767cb76d4 Merge 10.2 into 10.3 2018-11-08 09:39:37 +02:00
Igor Babaev
4142589207 MDEV-17635 Server hangs after the query with recursive CTE
This bug in the code of the function With_element::check_unrestricted_recursive()
could force a recursive CTE to be executed in a non-standard compliant mode
in which recursive UNION ALL could lead to an infinite execution. This
problem could occur only in the case when this CTE was used by another
recursive CTE at least twice.
2018-11-07 12:08:15 -08:00
Andrei Elkin
c565622c6c MDEV-14528 followup.
There was a failure in rpl_delayed_slave after recent MDEV-14528 commit.
The parallel applier should not set its
Relay_log::last_master_timestamp from Format-descriptor log event.
The latter may reflect a deep past so Seconds-behind-master will be
computed through it and displayed all time while the first possibly
"slow" group of events is executed.

The main MDEV-14528 is refined, rpl_delayed_slave now passes also
in the parallel mode.
2018-11-07 21:13:50 +02:00
Marko Mäkelä
a91109846c Merge an .inc file to .test 2018-11-07 20:21:12 +02:00
Marko Mäkelä
6567a94c71 MDEV-13134: Merge tests to innodb.alter_algorithm
Remove the separate test innodb.alter_instant, because
it can be easily mistaken for innodb.instant_alter, which
in turn is covering various instant ALTER TABLE operations.
2018-11-07 17:42:41 +02:00
Marko Mäkelä
862af4d255 Merge 10.2 into 10.3 2018-11-07 13:11:04 +02:00
Marko Mäkelä
e82ebb8f06 MDEV-14528: Disable a failing test 2018-11-07 13:08:00 +02:00
Oleksandr Byelkin
54b2e1c1be MDEV-16697: Fix difference between 32bit/windows and 64bit systems in allowed select nest level 2018-11-07 09:43:12 +01:00
Oleksandr Byelkin
6cecb10a2f MDEV-11167: InnoDB: Warning: using a partial-field key prefix in search, results in assertion failure or "Can't find record" error
Fix ha_rnd_init() argument (we do not doing scan but use rnd_pos)
2018-11-07 09:25:12 +01:00
Marko Mäkelä
89f948c766 Merge 10.1 into 10.2 2018-11-07 08:17:47 +02:00
Marko Mäkelä
59c82dde09 Merge 10.0 into 10.1 2018-11-07 08:08:45 +02:00
Marko Mäkelä
5f29fdecc0 Merge 5.5 into 10.0 2018-11-07 08:02:18 +02:00
Igor Mazur
54b8856b87 MDEV-14528 Track master timestamp in case rolling back to serial replication
When replicated events are from Master unaware of MariaDB GTID their handling by
the Parallel slave misses Seconds_Behind_Master updating.

In the bug condition the Show-Slave-Status' field remains unchanged.

Because in such case event execution is sequential the bug
is fixed with deploying the same logics as in the explicit single-threaded mode
with is to set

  Relay_log_event::last_master_timestamp

member early at the end of event reading from the relay log.
2018-11-06 21:11:49 +02:00
Sergei Golubchik
89a87e8e42 MDEV-14429 sql_safe_updates in my.cnf not work
add a test case
2018-11-06 13:36:50 +01:00
Vladislav Vaintroub
564a63b5a3 MDEV-14429 sql_safe_updates in my.cnf not work 2018-11-06 13:36:50 +01:00
Jan Lindström
ef40018535 MDEV-17230: encryption_key_id from alter is ignored by encryption threads
Background: Used encryption key_id is stored to encryption metadata
i.e. crypt_data that is stored on page 0 of the tablespace of the
table. crypt_data is created only if implicit encryption/not encryption
is requested i.e. ENCRYPTED=[YES|NO] table option is used
fil_create_new_single_table_tablespace on fil0fil.cc.

Later if encryption is enabled all tables that use default encryption
mode (i.e. no encryption table option is set) are encrypted with
default encryption key_id that is 1. See fil_crypt_start_encrypting_space on
fil0crypt.cc.

ha_innobase::check_table_options()
	If default encryption is used and encryption is disabled, you may
        not use nondefault encryption_key_id as it is not stored anywhere.
2018-11-06 10:22:25 +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ä
bdfe2784d5 Unify a test with the 10.3 version
Remove trailing white space, and use lower case for "eval" and "let".
Add an "End of 10.2 tests" marker to ease future merges.
2018-11-06 08:42:30 +02:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Sergei Petrunia
e058a251c1 MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
Part#2: take into account that join nest that we are marking as constant
might already have constant tables in it. Don't count these tables twice.
2018-11-05 21:10:15 +03:00
Sergei Petrunia
f0cf85fd15 MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
Update .result files after the previous patch
2018-11-05 21:10:15 +03:00
Sergei Petrunia
14b62b1578 MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
Continuation of the fix: Make condition selectivity estimate use the
right estimate, too.
2018-11-05 21:10:15 +03:00
Sergei Petrunia
3b6d903852 MDEV-17493: Partition pruning doesn't work for nested outer joins
Reuse the fix for MDEV-17518 here, too.
2018-11-05 21:10:15 +03:00
Sergei Petrunia
03680a9b4f MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins 2018-11-05 21:10:15 +03:00
Marko Mäkelä
d63e198061 Merge 10.0 into 10.1 2018-11-05 12:15:17 +02:00
Eugene Kosov
03977e8273 MDEV-13671 InnoDB should use case-insensitive column name comparisons like the rest of the server
Problem affects INPLACE ALTER rename columns.

innobase_rename_column_try(): some strcmp() was replaced with my_strcasecmp(),
queries to update data dictionary was updated to not match column name case.
2018-11-05 11:59:59 +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
Alexey Botchkov
6472c5c015 MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>.
LOCK view WRITE shouldn't block FLUSH view.
So we set the view's mdl_request type to it's tables.
2018-11-03 14:24:15 +04:00
Marko Mäkelä
8a346f31b9 MDEV-17073 INSERT…ON DUPLICATE KEY UPDATE became more deadlock-prone
thd_rpl_stmt_based(): A new predicate to check if statement-based
replication is active. (This can also hold when replication is not
in use, but binlog is.)

que_thr_stop(), row_ins_duplicate_error_in_clust(),
row_ins_sec_index_entry_low(), row_ins(): On a duplicate key error,
only lock all index records when statement-based replication is in use.
2018-11-02 18:52:39 +02:00
Vicențiu Ciorbaru
1c6b982e02 MDEV-12779 Oracle/DB2 Compatibility Implicit Ordering for ROW_NUMBER OVER
Users expect window functions to produce a certain ordering of rows in
the final result set. Although the standard does not require this, we
already have the filesort result done for when we computed the window
function. If there is no ORDER BY attached to the query, just keep it
till the SELECT is completely evaluated and use that to print the
result.

Update test cases as many did not take care to guarantee a stable
result.
2018-11-01 21:15:55 +02:00
Sergei Golubchik
b7eca63620 fix the test to clean after itself
followup for c32f7ed235
2018-11-01 18:47:53 +01:00
Sergei Golubchik
c32f7ed235 MDEV-17377 invalid gap in auto-increment values after LOAD DATA
reset lex->many_values for LOAD DATA, as it's used for
auto-inc range size estimation.
2018-11-01 16:18:17 +01:00
Sergei Golubchik
dd6e74c62a MDEV-16774 SET PASSWORD and ALTER USER with slightly different results
set both `password` and `authentication_string` columns in `mysql`.`user`
table for now.

Suppress the "password was ignored" warning if the password is
the same as the authentication string
2018-11-01 15:48:15 +01:00
Aleksey Midenkov
4acfc6ecd9 MDEV-17038 ALTER TABLE CHANGE COLUMN c1 c1 bigint NOT NULL - generates error if table uses SYSTEM VERSIONING
* Fine-grained inplace skipping by INNOBASE_ALTER_VERSIONED_REBUILD;
* Fixed column WITHOUT SYSTEM VERSIONING + ADD COLUMN;
* Fixed instant field change (MDEV-16330);
* Revisited test versioning.online;
* Merged the test versioning.trx_id_versioning_attribute_persistence
  to versioning.online;
* Renamed some versioning functions:
** change_fields_versioning_cache() -> vers_change_fields_cache()
** change_field_versioning_try() -> vers_change_field_try()
Skip condition moved out of func.

Closes tempesta-tech/mariadb#414
Closes tempesta-tech/mariadb#540
Related to tempesta-tech/mariadb#281
2018-11-01 16:42:06 +02:00
Varun Gupta
38b3e52c3c MDEV-16695: Estimate for rows of derived tables is very high when we are using index_merge union
For index merge union[or sort union], the estimates are not taken into account while calculating the selectivity of
a condition. So instead of showing the estimates of the index merge union[or sort union], it shows estimates equal to
all the records of the table.
The fix for the issue is to include the selectivity of index merge
union[or sort union] while calculating the selectivity of a condition.
2018-11-01 13:20:26 +05:30
Takashi Sasaki
9ff9d2303d test framework manual is moved 2018-11-01 02:22:18 +04:00
Elena Stepanova
8d834cd0f3 Updated list of unstable tests for 10.1.37 release 2018-10-31 23:48:29 +02:00
Sergei Golubchik
bf28ba67b6 update rdiffs for 32bit 2018-10-31 22:06:15 +01:00
Alexander Barkov
75ceb6ff13 MDEV-17298 ASAN unknown-crash / READ of size 1 in my_strntoul_8bit upon INSERT .. SELECT 2018-10-31 14:25:26 +04:00
Marko Mäkelä
a5cbdd63bc Fix innodb.table_flags,debug 2018-10-31 12:09:08 +02:00
Sergei Golubchik
b92ff45089 disabling a crashing test 2018-10-31 10:53:37 +01:00
Sergei Golubchik
a6e0000494 Merge branch '10.0' into 10.1 2018-10-31 10:53:22 +01:00
Sergei Golubchik
09e97299ba Merge branch '5.5' into 10.0 2018-10-31 00:25:26 +01:00
Sergei Golubchik
250c5aa02c ./mtr --gdb='b mysql_parse;r'
--gdb now accepts an argument, it will be passed to gdb as a command.
multiple commands can be separated by a (non-standard and not escapable)
delimiter - semicolon (;).

Old usage with a bare --gdb continues to work too, of course.

Cherry-picked c47c0ca50c 5441bbd3b1 339b905579
2018-10-30 22:42:22 +01:00
Elena Stepanova
a737135ae3 List of unstable tests for 10.0.37 release 2018-10-30 18:15:58 +02:00
Alexey Botchkov
57898316b6 MDEV-17256 Decimal field multiplication bug.
We should clear trailing zeroes in frac part. Otherwise
that tail is growing quickly and forces unnecessary truncating of
arguments.
2018-10-30 18:15:41 +04:00
Sergei Golubchik
44f6f44593 Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
Marko Mäkelä
dc91ea5bb7 MDEV-12023 Assertion failure sym_node->table != NULL on startup
row_drop_table_for_mysql(): Avoid accessing non-existing dictionary tables.

dict_create_or_check_foreign_constraint_tables(): Add debug instrumentation
for creating and dropping a table before the creation of any non-core
dictionary tables.

trx_purge_add_update_undo_to_history(): Adjust a debug assertion, so that
it will not fail due to the test instrumentation.
2018-10-30 15:53:55 +02:00
Daniel Black
3859273d04 MDEV-14267: correct FSF address 2018-10-30 19:45:09 +08:00
Marko Mäkelä
6ced789186 MDEV-12023 Assertion failure sym_node->table != NULL on startup
row_drop_table_for_mysql(): Avoid accessing non-existing dictionary tables.

dict_create_or_check_foreign_constraint_tables(): Add debug instrumentation
for creating and dropping a table before the creation of any non-core
dictionary tables.

trx_purge_add_update_undo_to_history(): Adjust a debug assertion, so that
it will not fail due to the test instrumentation.
2018-10-30 13:29:19 +02:00
Sergei Golubchik
f4b8b6b9a3 MDEV-15919 lower_case_table_names does not behave as expected
followup for e31e697f17

Fix the test not to fail on Mac OS X
(lower_case_table_names=0 prevents mysqld from starting on case insensitive
filesystem)
2018-10-29 21:44:38 +01:00
Monty
d30124e844 MDEV-17503 CREATE SEQUENCE failed with innodb_force_primary_key =1
Fixed by adding table flag HA_WANTS_PRIMARY_KEY, which is like
HA_REQUIRE_PRIMARY_KEY but tells SQL upper layer that the storage engine
internally can handle tables without primary keys (for example for
sequences or trough user variables)
2018-10-29 16:12:52 +02:00
Sergei Golubchik
37ab7e4596 Merge branch '5.5' into 10.0 2018-10-27 20:46:38 +02:00
Varun Gupta
76318d55aa MDEV-17525: Window functions not working in ONLY_FULL_GROUP_BY mode
The ONLY_FULL_GROUP_BY mode states that for SELECT ... GROUP BY queries,
disallow SELECTing columns which are not referred to in the GROUP BY clause,
unless they are passed to an aggregate function like COUNT() or MAX().
This holds only for the GROUP BY clause of the query.
The code also checks this for the partition clause of the window function which is
incorrect.
2018-10-26 06:51:40 +02:00
Marko Mäkelä
2abf2648a6 MDEV-17536 Merge new release of InnoDB 5.7.24 to 10.2
Update the InnoDB version number to 5.7.24.
2018-10-25 17:09:54 +03:00
Marko Mäkelä
31366c6c93 MDEV-17548 Incorrect access to off-page column for indexed virtual column
row_build_index_entry_low(): ext does not contain virtual columns.

row_upd_store_v_row(): Copy virtual column values

This is based on the following fix in MySQL 5.7.24:

commit 4ec2158bec73f1582501c4b3e3de250fed9edc9a
Author: Sachin Agarwal <sachin.z.agarwal@oracle.com>
Date:   Fri Aug 24 14:44:13 2018 +0530

    Bug #27968952 INNODB CRASH/CORRUPTION WITH TEXT PREFIX INDEXES

    Problem:
    There are two problems:
      1. If there is one secondary index on extenally
    stored column and another seconday index on virtual column (whose
    base column is not externally stored). then while updating seconday
    index on vitrual column, virtual column data is replaced by
    externally stoared column.
      2. In row update operation, node->row contains
    shallow copy of virtual data fields. While building an update vector
    containing all the fields to be modified, compute virtual column.
    which may causes change in virtual data fields in node->row.

    In both the above cases, while updating seconday index on virtual
    column, couldn't find the row and hit an explicite assert inside
    ROW_NOT_FOUND.

    Fix:
    1. Added check if column is virtual then its ext flag should be ZERO
    and virtual column data will not be replaced by offset column data.
    2. Deep copy of virtual data fields for node->row.

    RB: #20382
    Reviewed by : Jimmy.Yang@oracle.com
2018-10-25 17:08:36 +03:00
Marko Mäkelä
8c9c583aff Remove a deprecation warning 2018-10-25 15:31:13 +03:00