Port the previous patch:
- Implement MariaDB's Group Commit API. This is a first
attempt which lacks the expected performance.
To newer MariaDB (which includes newer MyRocks)
based on:
commit f7316aa0c9
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an array of possible comparators is
created. Since NAME_CONST function has NULL_ITEM type, corresponding
array element is empty. Then NAME_CONST is wrapped to ITEM_CACHE.
ITEM_CACHE can not return proper type(NULL_ITEM) in Item_func_in::val_int(),
so the NULL_ITEM is attempted compared with an empty comparator.
The fix is to disable the caching of Item_name_const item.
Partition wasn't setting HA_OPTION_PACK_RECORD on ALTER TABLE
if the row format was PAGE.
(so one bit in the null bitmap was reserved for a deleted bit -
see make_empty_rec - and all actual null bits were one off)
if it's a DROP TABLE, we cannot detect whether a table is
temporary by looking in thd->temporary_tables - because the
table might simply not exist at all.
backport ce6c0e584e
MDEV-8960: Can't refer the same column twice in one ALTER TABLE
Problem was that if column was created in alter table when
it was refered again it was not tried to find from list
of current columns.
mysql_prepare_alter_table:
There is two cases
(1) If alter table adds a new column and then later alter
changes the field definition, there was no check from
list of new columns, instead an incorrect error was given.
(2) If alter table adds a new column and then later alter
changes the default, there was no check from list of
new columns, instead an incorrect error was given.
always search in compile-time specified paths
INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User
can set them to arbitrary values, it's not enough to search only
in their usual values of bin, sbin and libexec, share and share/mysql.
1. detect resolveip location, don' assume it's in $basedir/bin
2. don't guess $scriptdir to (incorrectly) construct the $0 path
3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir
automatically. This allows to use identical path lists in
find_in_dirs and in cannot_find_file.
4. move search path lists to CMakeLists.txt to avoid specifying the
same path list twice (in find_in_dirs and in cannot_find_file).
fts_get_next_doc_id(): Assign the first and subsequent FTS_DOC_ID
in the same way: by post-incrementing the cached value.
If there is a user-specified FTS_DOC_ID, do not touch the internal
sequence.
There are two bugs related to failed ADD INDEX and
the InnoDB table cache eviction.
dict_table_close(): Try dropping failed ADD INDEX when releasing
the last table handle, not when releasing the last-but-one.
dict_table_remove_from_cache_low(): Do not invoke
row_merge_drop_indexes() after freeing all index metadata.
Instead, directly invoke row_merge_drop_indexes_dict() to
remove the metadata from the persistent data dictionary
and to free the index pages.
This was the cause of the bug in CalculateArray
modified: storage/connect/jsonudf.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/value.cpp
- Avoid some compiler warnings
modified: storage/connect/mongo.cpp
modified: storage/connect/tabjmg.cpp
modified: storage/connect/tabtbl.cpp
modified: storage/connect/tabutil.cpp
modified: storage/connect/ha_connect.cc
- Include MONGO in all Java enabled distributions
Mongo will be enabled only for 10.2 and 10.3
modified: storage/connect/CMakeLists.txt
- Change JDBC_SUPPORT to JAVA_SUPPORT which also replaces MONGO_SUPPORT
MONGO_SUPPORT is now just used to enable the MONGO table type
modified: storage/connect/filter.cpp
modified: storage/connect/ha_connect.cc
modified: storage/connect/ha_connect.h
modified: storage/connect/mongo.cpp
modified: storage/connect/mycat.cc
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
- Move MakeSelector function from FILTER to mongo.cpp
modified: storage/connect/filter.cpp
modified: storage/connect/filter.h
modified: storage/connect/cmgoconn.cpp
modified: storage/connect/jmgoconn.cpp
modified: storage/connect/mongo.cpp
- Do mongo_init only on first use of the MongoDB C Driver
This will permit to delay load the mongo lib on Windows
modified: storage/connect/cmgoconn.cpp
modified: storage/connect/cmgoconn.h
modified: storage/connect/ha_connect.cc
- Replace NEW_VAR by a test on MYSQL_VERSION_ID
modified: storage/connect/ha_connect.cc
- Suppress enable_mongo session variable
modified: storage/connect/ha_connect.cc
modified: storage/connect/mycat.cc
- Make some function headers identical in .h and .cc file
(replacing const char* by PCSZ)
modified: storage/connect/ha_connect.cc
modified: storage/connect/ha_connect.h
- Change a parameter type from uchar* to const uchar*
(for ScanRecord and CheckRecord)
modified: storage/connect/ha_connect.cc
modified: storage/connect/ha_connect.h
- Changes on LIKE and NOT LIKE does not fix a bug yet
modified: storage/connect/ha_connect.cc
- Suppress PIVOT_SUPPORT (PIVOT type is unconditionnal)
modified: storage/connect/ha_connect.cc
modified: storage/connect/mycat.cc
- Change the strz function from inline to static
modified: storage/connect/ha_connect.cc
modified: storage/connect/ha_connect.h
- export the JavaConn class and the MgoColumns and IsNum functions
modified: storage/connect/javaconn.h
modified: storage/connect/json.h
modified: storage/connect/mongo.h
- Fix MDEV-13924
modified: storage/connect/jdbconn.cpp
- Make a temporary fix for the compiler bug in CalculateArray
modified: storage/connect/jsonudf.cpp
modified: storage/connect/tabjson.cpp
- Typo
modified: storage/connect/jdbccat.h
modified: storage/connect/reldef.h
modified: storage/connect/tabext.h
modified: storage/connect/tabjmg.cpp
modified: storage/connect/tabxml.h
modified: storage/connect/valblk.h
modified: storage/connect/value.h
modified: storage/connect/xtable.h
- Fix a bug in MONGO tests by changing 'MONGO' to $TYPE
modified: storage/connect/mysql-test/connect/t/mongo_test.inc
- Record test results to reflect all changes
modified: storage/connect/mysql-test/connect/r/json_java_2.result
modified: storage/connect/mysql-test/connect/r/json_java_3.result
modified: storage/connect/mysql-test/connect/r/json_mongo_c.result
modified: storage/connect/mysql-test/connect/r/mongo_c.result
modified: storage/connect/mysql-test/connect/r/mongo_java_2.result
modified: storage/connect/mysql-test/connect/r/mongo_java_3.result
This was a false alarm in a debug check that was introduced in
commit 48192f963a which was a
10.2 code refactoring in preparation for
MDEV-11369 (instant ADD COLUMN) in 10.3.2. The code refactoring
only affected debug builds.
InnoDB B-tree record locks are only supposed to exist on leaf page
records. An assertion failed, because the debug function lock_validate()
was invoking lock_rec_block_validate() on a page for which there were
no locks set in the record lock bitmap. This could happen on a page split.
Especially when the index size grows from a single page to multiple pages,
the root page would transform from a leaf node into an internal node,
and its record lock bitmap would be emptied.
lock_validate(): Skip empty lock bitmaps.
The fix in MDEV-14022 was incomplete. We must adjust some more code
for the fact that SYS_INDEXES records may lack the column MERGE_THRESHOLD
that was "instantly" added in MySQL 5.7 and MariaDB 10.2.2.
dict_boot(): Hard-core SYS_INDEXES.MERGE_THRESHOLD as DEFAULT NULL.
dict_index_t::instant_field_value(), rec_offs_make_valid():
Tolerate the missing SYS_INDEXES.MERGE_THRESHOLD column.
For each SELECT the list sj_nests is built by the
function simplify_joins() when scanning different
join nests. This function may be called several
times for the same join nest. That's why before
adding a new member to sj_nests it is necessary
to check if it's already in the list.
The code of simplify_joins() lacked this check and
as a result it could cause memory overwright for
some queries.
in buildbot
Removed plugin_array_version: it is being checked without mutex protection and
thus is prone to data race and race conditions. In effect plugins are not
protected from concurrent destruction.
Removed state_mask inversion: doesn't seem to make any sense.
When collecting local plugins list, only add plugins that match state_mask.
Use plugin ref counting to protect against concurrent plugin destruction.
Problem was that we could take page latches on different
order than wat is entitled with SX-lock. To follow the
latching order defined in WL#6326, acquire index->lock X-latch.
This entitles us to acquire page latches in any order for the index.
btr0btr.cc
Document latch rules before and after MariaDB 10.2.2
sync0rw.cc
Document latch compatibility rules better.
btr_defragment_merge_pages
Fix parameter value.
btr_defragment_thread
Acquire X-lock to dict_index_t::lock before restoring
cursor position and continuing defragmentation.
ha_innobase::optimize
Restore defragment feature.
Testing
Add GIS-index and FT-index to table being defragmented.
Defragmentation is not done to GIS-indexes and FT auxiliary
tables.
A reference to a CTE may occur not in the master of the CTE
specification. In this case if the reference to the CTE is
the first one the specification should be detached from its
master and attached to the referencing select.
Also fixed the TYPE column in the lines of the EXPLAIN output
created for CTE tables.
in 10.1 innodb was basically ignoring virtual columns. In particular,
information about them was not stored in system tables. To make 10.1
table usable in 10.2 it needs to be rebuilt to have virtual colunm
metadata properly recreated.
See also a followup:
MDEV-14046 Allow ALGORITHM=INPLACE for 10.1 tables that contain virtual columns
During show create procedure we ommited to check the current role, if it
is the actual definer of the procedure. In addition, we should support
indirectly granted roles to the current role. Implemented a recursive
lookup to search the tree of grants if the rolename is present.
SQL Standard 2016, Part 5 Section 53 View I_S.ROUTINES selects
ROUTINE_BODY and its WHERE clause says that the GRANTEE must be
either PUBLIC, or CURRENT_USER or in the ENABLED_ROLES.