Commit graph

176104 commits

Author SHA1 Message Date
Igor Babaev
8481c70ede Fixed bug mdev-11867.
If a window function with aggregation is over the result
set of a grouping query then the argument of the aggregate
function from the window function is allowed to be an
aggregate function itself.
2017-02-01 19:15:28 -08:00
Igor Babaev
69114862f2 Adjusted more tests after the fix for mdev-9976. 2017-02-01 13:09:07 -08:00
Nirbhay Choubey
b0ea044d12 Update galera tests to adapt to recent changes in 10.2. 2017-02-01 15:43:40 -05:00
Georg Richter
23628d123b Fix for MDEV-11174:
A GCM encrypted ciphertext must contain an authentication tag with AES_BLOCK_SIZE length, so we need to check that the length of ciphertext is at least AES_BLOCK_SIZE.
2017-02-01 12:14:37 +01:00
Marko Mäkelä
e1977712cc Clean up a test.
Import and adapt the changes from MySQL 5.7.
2017-02-01 09:30:55 +02:00
Marko Mäkelä
81b7fe9d38 Shut down InnoDB after aborted startup.
This fixes memory leaks in tests that cause InnoDB startup to fail.

buf_pool_free_instance(): Also free buf_pool->flush_rbt, which would
normally be freed when crash recovery finishes.

fil_node_close_file(), fil_space_free_low(), fil_close_all_files():
Relax some debug assertions to tolerate !srv_was_started.

innodb_shutdown(): Renamed from innobase_shutdown_for_mysql().
Changed the return type to void. Do not assume that all subsystems
were started.

que_init(), que_close(): Remove (empty functions).

srv_init(), srv_general_init(): Remove as global functions.

srv_free(): Allow srv_sys=NULL.

srv_get_active_thread_type(): Only return SRV_PURGE if purge really
is running.

srv_shutdown_all_bg_threads(): Do not reset srv_start_state. It will
be needed by innodb_shutdown().

innobase_start_or_create_for_mysql(): Always call srv_boot() so that
innodb_shutdown() can assume that it was called. Make more subsystems
dependent on SRV_START_STATE_STAT.

srv_shutdown_bg_undo_sources(): Require SRV_START_STATE_STAT.

trx_sys_close(): Do not assume purge_sys!=NULL. Do not call
buf_dblwr_free(), because the doublewrite buffer can exist while
the transaction system does not.

logs_empty_and_mark_files_at_shutdown(): Do a faster shutdown if
!srv_was_started.

recv_sys_close(): Invoke dblwr.pages.clear() which would normally
be invoked by buf_dblwr_process().

recv_recovery_from_checkpoint_start(): Always release log_sys->mutex.

row_mysql_close(): Allow the subsystem not to exist.
2017-02-01 09:30:55 +02:00
Marko Mäkelä
774056c825 MDEV-11671 Duplicated message for innodb_page_size
Display a NOTE, not a WARNING for non-default page size.
2017-02-01 09:30:55 +02:00
Marko Mäkelä
16bc16f9ba Actually invoke free() in ut_allocator::deallocate().
The necessary call was inadvertently commented out in a
merge of MySQL 5.7.14 to MariaDB 10.2.1
(commit fec844aca8).
2017-02-01 09:30:55 +02:00
Marko Mäkelä
a5d8dc1818 Make the innochecksum tests more robust.
As noted in MDEV-11947, we should disable the InnoDB doublewrite buffer
during the tests, because when rewriting page checksums, innochecksum
would skip the pages that are in the doublewrite buffer area. Because
the doublewrite buffer is emptied on server startup and not shutdown,
we should initially start with the doublewrite buffer disabled, so that
there will be no warning messages for wrong page checksums in the
doublewrite buffer.

Also, correct the obvious typo where restart_options should have been
$restart_parameters, so that InnoDB is actually verifying that the
checksums were rewritten.
2017-02-01 09:30:55 +02:00
Igor Babaev
ba8ab6a79c Adjusted tests after the fix for bug mdev-9976.
Now ROWS is a reserved key word, so cannot be used
as an alias name.
2017-01-31 20:37:26 -08:00
Igor Babaev
9073f9fd7d Fixed bug mdev-9976.
This bug happens due to a conflict in the construct window_spec.
(win_ref conflicts with the non-reserved key word ROWS).
The standard SQL-2003 says that ROWS is a reserved key word.
Made this key word reserved in our grammar and removed
the conflict.
2017-01-31 20:37:26 -08:00
Igor Babaev
81c1abe8cf Fixed bug mdev-10875.
Now, after the implementation of mdev-8646
"Re-engineer the code for post-join operations"
create_sort_index() can be called for subqueries.
2017-01-31 20:37:25 -08:00
Alexander Barkov
1d96b09890 MDEV-9979 Keywords UNBOUNDED, PRECEDING, FOLLOWING, TIES, OTHERS should be non-reserved
Adding keywords the following keywords into the "keyword" rules:
- EXCLUDE
- UNBOUNDED
- PRECEDING
- FOLLOWING
- TIES
- OTHERS

They are non-reserved words in the SQL standard (checked in a SQL-2011 draft),
and they don't cause any conflicts in sql_yacc.yy.
2017-01-31 23:41:10 +04:00
Marko Mäkelä
642077ea5a srv_get_active_thread_type(): Remove a potential race condition.
Call trx_purge_state() only once, to avoid a race condition if the
value changes while the conditions are being evaluated.
2017-01-31 10:23:22 +02:00
Marko Mäkelä
7128328d41 Remove a work-around for MDEV-11689.
Also, work around MDEV-11948 by disabling native asynchronous I/O.
2017-01-31 10:23:21 +02:00
Marko Mäkelä
1293e5e59b Rewrite the innodb.log_file_size test with DBUG_EXECUTE_IF.
Remove the debug parameter innodb_force_recovery_crash that was
introduced into MySQL 5.6 by me in WL#6494 which allowed InnoDB
to resize the redo log on startup.

Let innodb.log_file_size actually start up the server, but ensure
that the InnoDB storage engine refuses to start up in each of the
scenarios.
2017-01-31 10:23:20 +02:00
Sergei Golubchik
9f918b9cf4 take into account scientific notation of floats in regex_replace
this fixes occasional main.cte_recursive failures
2017-01-30 17:57:02 +01:00
Marko Mäkelä
31a9b3f4c8 Fix a suppression that did not work on Windows. 2017-01-30 14:10:17 +02:00
Marko Mäkelä
8ab806d2f1 Do not remove the master error log file. 2017-01-30 11:23:27 +02:00
Sergei Golubchik
2a4881800c InnoDB: don't pthread_join() a thread that wasn't created
this fixes the crash in innodb.101_compatibility test
2017-01-30 10:12:18 +01:00
Sergei Golubchik
9189284ba3 remove a race-condition prone assertion
on shutdown it might happen that
1. the server starts killing THDs
2. it sets thd->killed in srv_purge_coordinator
3. srv_purge_coordinator notices that and tells srv_workers to exit
4. srv_worker will notice that and will start exiting,
    ... assert here ...
5. server sets thd->killed in worker threads

that is, it might happen that the assert is tested before
srv_worker's THD got the kill signal.

this fixes various random crashes (on this assertion) on shutdown
in tests
2017-01-30 10:11:26 +01:00
Sergei Golubchik
3d12587ca4 MDEV-11611 fix Ninja build
ninja doesn't like when a dummy target name matches a generated file name
2017-01-29 23:05:10 +01:00
Sergei Golubchik
78712eb52f MDEV-11708 cmake -DWITH_ASAN no longer works
fix the check (must be have_ not HAVE_)

also remove -O1 and -Wno-error, they aren't not needed for asan
2017-01-29 23:04:54 +01:00
Sergei Golubchik
a7d6271cbf skip innodb.log_corruption test if no unzip executable is found
also move *.zip files from t/ to std_data/
2017-01-29 13:50:30 +01:00
Igor Babaev
abfcdb8fbc Fixed bug mdev-10773.
The temporary tables created for recursive table references
should be closed in close_thread_tables(), because they might
be used in the statements like ANALYZE WITH r AS (...) SELECT * from r
where r is defined through recursion.
2017-01-28 15:47:11 -08:00
Sergei Golubchik
64b5e94236 mysqlbinlog memory leaks
that failed main.mysqlbinlog
2017-01-28 18:04:51 +01:00
Sergei Golubchik
30ba310057 cleanup: thd_destructor_proxy
1. wait for thd_destructor_proxy thread to start after creating it.
   this ensures that the thread is ready to receive a shutdown signal
   whenever we want to send it.
2. join it at shutdown, this guarantees that no innodb THD will exist
   after innobase_end().

this fixes crashes and memory leaks in main.mysqld_option_err
(were innodb was started and then immediately shut down).
2017-01-28 18:03:28 +01:00
Marko Mäkelä
2de0e42af5 Import and adjust the InnoDB redo log tests from MySQL 5.7. 2017-01-27 17:53:02 +02:00
Marko Mäkelä
0f34160d1d Clean up a few tests that kill the server.
As noted in MDEV-8841, any test that kills the server must issue
FLUSH TABLES, so that tables of crash-unsafe storage engines will
not be corrupted. Consistently issue this statement after any
call mtr.add_suppression() calls.

Also, do not invoke shutdown_server directly, but use helpers instead.
2017-01-27 17:07:45 +02:00
Jan Lindström
3dd6fca774 Fix test failure on innodb-trim.
Skip test if system can't do trim operation.
2017-01-27 14:18:41 +02:00
Marko Mäkelä
406e113e9a MDEV-11915 Detect InnoDB system tablespace size mismatch early
InnoDB would refuse to start up if there is a mismatch on
the size of the system tablespace files. However, before this
check is conducted, the system tablespace may already have been
heavily modified.

InnoDB should perform the size check as early as possible.

recv_recovery_from_checkpoint_finish():
Move the recv_apply_hashed_log_recs() call to
innobase_start_or_create_for_mysql().

innobase_start_or_create_for_mysql(): Test the mutex functionality
before doing anything else. Use a compile_time_assert() for a
sizeof() constraint. Check the size of the system tablespace as
early as possible.
2017-01-27 13:05:07 +02:00
Marko Mäkelä
3271da11c4 MDEV-11814 Refuse innodb_read_only startup if crash recovery is needed
recv_scan_log_recs(): Remember if redo log apply is needed,
even if starting up in innodb_read_only mode.

recv_recovery_from_checkpoint_start_func(): Refuse
innodb_read_only startup if redo log apply is needed.
2017-01-27 13:01:56 +02:00
Marko Mäkelä
8daa87dc06 Fix a test. 2017-01-27 12:21:31 +02:00
Jan Lindström
4ee7174479 Fix test failure on innodb-trim.
Do wait only if innodb_num_page_compressed_trim_op shows that
we have succeed to do at least few trim operations (and
that will happen on insert if possible).
2017-01-27 11:26:28 +02:00
Jan Lindström
ebdf70db2a Fix test failure on innodb-wl5522
Added flush tables to avoid corruption of mtr/test_suppressions
table.
2017-01-27 09:13:48 +02:00
Jan Lindström
fea4959a0d Fix test failure on gcol.innodb_virtual_basic. 2017-01-27 09:08:15 +02:00
Vladislav Vaintroub
a5f6b4f9fd Fix the code to determine sector size on Windows volume.
DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY) needs volume handle,
not the handle to ordinary file.
2017-01-26 17:39:36 +00:00
Vladislav Vaintroub
def258061b increase default for max threads in the pool to max allowed value (64K) currently 2017-01-26 17:39:36 +00:00
Alexey Botchkov
d96ee168a1 MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.
paths ending on [0]..[0] should be handled in conforming manner.
2017-01-26 16:35:05 +04:00
Jan Lindström
71495a1748 MDEV-11849: Fix storage/innobase/* compile warnings 2017-01-26 08:05:24 +02:00
Jan Lindström
45f451c769 MDEV-11850: Can't create foreign key referencing a virtual column
Both dict_foreign_find_index and dict_foreign_qualify_index
did not consider virtual columns as possible foreign key
columns and there was assertion to disable virtual columns.

Fixed by also looking referencing and referenced column
from virtual columns if needed.
2017-01-26 08:05:23 +02:00
Marko Mäkelä
c6039a11c6 Fix a test. 2017-01-25 16:38:45 +02:00
Marko Mäkelä
e92ee13254 Import and adjust a test from MySQL 5.7. 2017-01-25 16:05:32 +02:00
Marko Mäkelä
0b1a40852c Replace fil_node_t::is_open with fil_node_t::is_open().
This should be a non-functional change (apart from removing the
redundant data field).
2017-01-25 16:00:34 +02:00
Marko Mäkelä
8afe4faab9 Fix fil_ibd_open() on Windows.
In the merge of MDEV-11623 from 10.1 to 10.2, we added a call to
fsp_flags_try_adjust() which causes the data file to be opened
via the buffer pool while fil_ibd_open() is holding another open
handle to the file.
2017-01-25 15:57:21 +02:00
Jan Lindström
8531e19771 buf_page_t is class on 10.2 not struct. 2017-01-25 12:33:39 +02:00
Jan Lindström
4b28798f95 Fix compiler error on x86. 2017-01-25 10:04:14 +02:00
Jan Lindström
17430a802b MDEV-11905: encryption.innodb-discard-import test fails
Problem was that on import with buffered input/output
trim is not possible as we write several pages in
one write.
2017-01-25 08:54:02 +02:00
Jan Lindström
ddc14d8eb7 MDEV-10942: innodb_zip.innochecksum_3, innodb_zip.innochecksum_2
fail in buildbot.

Fixed test results.
2017-01-25 08:54:02 +02:00
Jan Lindström
84895c3cd7 Fix compiler error on x86. 2017-01-25 08:54:02 +02:00