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.
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.
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.
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.
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.
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.
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.
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
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.
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).
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.
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.
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.
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).
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.
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.