ha_partition::init_record_priority_queue()
Cherry-pick rev.6b0ee0c795499cee7f9deb649fb010801e0be4c2 from mysql-5.6.
Bug #18305270 BACKPORT BUG#18694052 FIX
FOR ASSERTION `!M_ORDERED_REC_BUFFER'
FAILED TO 5.6
PROBLEM
-------
Missed to remove record priority queue if
init_index failed for a partition which
was causing the crash.
FIX
---
Remove priority queue if init_index fails
for partition.
Analysis: Current implementation will write and read at least one block
(sort_buffer_size bytes) from disk / index even if that block does not
contain any records.
Fix: Avoid writing / reading empty blocks to temporary files (disk).
Since MariaDB packages have absolute paths, they are marked as not relocatable
by setting CPACK_RPM_PACKAGE_RELOCATABLE. According to logics of recent CPackRPM
it is not enough: one needs to set CPACK_PACKAGE_RELOCATABLE additionally.
mysql_secure_installation used incorrect path while looking up for "mysql"
client tool: $basedir/$basedir/bin instead of $basedir/bin.
This patch adapts "my_print_defaults" lookup algorithm for "mysql" client tool.
Define O_RDONLY in jsonudf.cpp
Correct wrong deinit function names
Make Locate functions use the variable more
Avoid signed/unsigned warning in ha_connect.cc GetIntegerTableOption
Initialize oom in tabodbc MakeInsert
modified: storage/connect/ha_connect.cc
modified: storage/connect/jsonudf.cpp
modified: storage/connect/tabodbc.cpp
Define O_RDONLY in jsonudf.cpp
Correct wrong deinit function names
Make Locate functions use the variable more
Avoid signed/unsigned warning in ha_connect.cc GetIntegerTableOption
Initialize oom in tabodbc MakeInsert
modified: storage/connect/ha_connect.cc
modified: storage/connect/jsonudf.cpp
modified: storage/connect/tabodbc.cpp
A 64bit counter can overflow within the time of a query
so lets take it that the measurement is the small value
rather than an order 1e12 millisecond query.
tested with:
int main()
{
ulonglong start = ULONGLONG_MAX - 30;
ulonglong end = 600;
ulonglong cycles = 10000;
cycles += end - start;
if (unlikely(end < start))
cycles += ULONGLONG_MAX;
printf("cycles %llu\n", cycles);
}
Assertion `inited==INDEX' failed in int handler::ha_index_first(uchar*)
The crash was because errors from init_read_record_idx() was not taken care of.
new features:
set event_scheduler=ON|OFF will now try to init event scheduler
if it's not enabled
set event_scheduler=default will try to enable it based on
the value of the event_scheduler when mysqld was started
Analysis: We are alreading holing lock_sys mutex when we call thd::awake.
This could lead mutex deadlock if trx->current_lock_mutex_owner is not
correctly set.
Fix: Make sure that trx->current_lock_mutex_owner is correctly set.