* don't issue an error for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
* support keyread on vcols
* callback into the server to compute vcol values from mi_check/mi_repair
* DMLs just work. Automatically.
WL#7682 in MySQL 5.7 introduced the possibility to create light-weight
temporary tables in InnoDB. These are called 'intrinsic temporary tables'
in InnoDB, and in MySQL 5.7, they can be created by the optimizer for
sorting or buffering data in query processing.
In MariaDB 10.2, the optimizer temporary tables cannot be created in
InnoDB, so we should remove the dead code and related data structures.
With innodb compressed pages formerly as crc32 changing to the
innodb checksum, optimize for speed by only calcuating the big
endian variant of crc32 after checking that the little endian
doesn't validate the page.
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
innobase_kill_query(): Remove the bogus warning message
(for the valid outcome err==DB_DEADLOCK) that was added in
commit fec844aca8
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Tue Sep 6 09:43:16 2016 +0300
Merge InnoDB 5.7 from mysql-5.7.14.
Also, remove some redundant variables and add a debug assertion for
enforcing the proper outcome of lock_trx_handle_wait().
buffer pool size
The reason for the exception is previous overflow in multiplication of
two 32bit integers (product was 0 rather than expected 8GB, due
to truncation)
crashes server
This bug is the result of merging the Oracle MySQL follow-up fix
BUG#22963169 MYSQL CRASHES ON CREATE FULLTEXT INDEX
without merging the base bug fix:
Bug#79475 Insert a token of 84 4-bytes chars into fts index causes
server crash.
Unlike the above mentioned fixes in MySQL, our fix will not change
the storage format of fulltext indexes in InnoDB or XtraDB
when a character encoding with mbmaxlen=2 or mbmaxlen=3
and the length of a word is between 128 and 84*mbmaxlen bytes.
The Oracle fix would allocate 2 length bytes for these cases.
Compatibility with other MySQL and MariaDB releases is ensured by
persisting the used maximum length in the SYS_COLUMNS table in the
InnoDB data dictionary.
This fix also removes some unnecessary strcmp() calls when checking
for the legacy default collation my_charset_latin1
(my_charset_latin1.name=="latin1_swedish_ci").
fts_create_one_index_table(): Store the actual length in bytes.
This metadata will be written to the SYS_COLUMNS table.
fts_zip_initialize(): Initialize only the first byte of the buffer.
Actually the code should not even care about this first byte, because
the length is set as 0.
FTX_MAX_WORD_LEN: Define as HA_FT_MAXCHARLEN * 4 aka 336 bytes,
not as 254 bytes.
row_merge_create_fts_sort_index(): Set the actual maximum length of the
column in bytes, similar to fts_create_one_index_table().
row_merge_fts_doc_tokenize(): Remove the redundant parameter word_dtype.
Use the actual maximum length of the column. Calculate the extra_size
in the same way as row_merge_buf_encode() does.
There are only 3 logical states for a number. The isfinite is a
single function call rather than multiple leaving scope for compiler
/architecture optimization.
Changed the logic as follows in a few files.
my_isinf(square) || my_isnan(square) -> !isfinite(square)
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
We don't need to drop down to unoptimized crc because of valgrind now.
Valgrind-3.6.1 was released 16 February 2011.
The Power8 ASM instructions seem to be supported in 3.9.0 (31 October 2013).
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
trx_state_eq(): Add the parameter bool relaxed=false, to
allow trx->state==TRX_STATE_NOT_STARTED where a different
state is expected, if an error has been reported.
trx_release_savepoint_for_mysql(): Pass relaxed=true to
trx_state_eq(). That is, allow the transaction to be idle
when ROLLBACK TO SAVEPOINT is attempted after an error
has been reported to the client.
MySQL 5.7 introduced WL#7943: InnoDB: Implement Information_Schema.Files
to provide a long-term alternative for accessing tablespace metadata.
The INFORMATION_SCHEMA.INNODB_* views are considered internal interfaces
that are subject to change or removal between releases. So, users should
refer to I_S.FILES instead of I_S.INNODB_SYS_TABLESPACES to fetch metadata
about CREATE TABLESPACE.
Because MariaDB 10.2 does not support CREATE TABLESPACE or
CREATE TABLE…TABLESPACE for InnoDB, it does not make sense to support
I_S.FILES either. So, let MariaDB 10.2 omit the code that was added in
MySQL 5.7. After this change, I_S.FILES will report the empty result,
unless some other storage engine in MariaDB 10.2 implements the interface.
(The I_S.FILES interface was originally created for the NDB Cluster.)
MariaDB 10.2 incorporates MySQL 5.7. MySQL 5.7.9 (the first GA release
of the series) introduced an informational field to the InnoDB redo log
header, which identifies the server version where the redo log files
were created (initialized, resized or updated), in
WL#8845: InnoDB: Redo log format version identifier.
The informational message would be displayed to the user, for example
if someone tries to start up MySQL 8.0 after killing a MariaDB 10.2 server.
In the current MariaDB 10.2 source code, the identifier string would
misleadingly say "MySQL 5.7.14" (using the hard-coded version number in
univ.i) instead of "MariaDB 10.2.3" (using the contents of the VERSION
file, the build system copies to config.h and my_config.h).
This is only a cosmetic change. The compatibility check is based on a
numeric identifier.
We should probably also change the numeric identifier and some logic
around it. MariaDB 10.2 should refuse to recover from a crashed MySQL 5.7
instance, because the redo log might contain references to shared tablespaces,
which are not supported by MariaDB 10.2. Also, when MariaDB 10.2 creates
an encrypted redo log, there should be a redo log format version tag that
will prevent MySQL 5.7 or 8.0 from starting up.
innodb_buffer_pool_populate has not had an effect since 10.0.23
in commit 1e270d504d when its
functionality was removed.
As we've only just enabled LIBNUMA in MDEV-10829 it isn't logical
to have innodb_buffer_pool_populate aliasing for innodb_numa_interleave
this late in the game.
So the simpliest way is just to remove innodb_buffer_pool_populate.
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
Revert the XtraDB changes, because 10.2 does not currently build with XtraDB.
Also omit some changes that need further investigation.
Ensure that all callers of partition_info::get_clone() are passing this!=NULL.
buf_block_init(): Initialize buf_page_t::flush_type.
For some reason, Valgrind 3.12.0 would seem to flag some
bits in adjacent bitfields as uninitialized, even though only
the two bits of flush_type were left uninitialized. Initialize
the field to get rid of many warnings.
buf_page_init_low(): Initialize buf_page_t::old.
For some reason, Valgrind 3.12.0 would seem to flag all 32
bits uninitialized when buf_page_init_for_read() invokes
buf_LRU_add_block(bpage, TRUE). This would trigger bogus warnings
for buf_page_t::freed_page_clock being uninitialized.
(The V-bits would later claim that only "old" is initialized
in the 32-bit word.) Perhaps recent compilers
(GCC 6.2.1 and clang 4.0.0) generate more optimized x86_64 code
for bitfield operations, confusing Valgrind?
mach_write_to_1(), mach_write_to_2(), mach_write_to_3():
Rewrite the assertions that ensure that the most significant
bits are zero. Apparently, clang 4.0.0 would optimize expressions
of the form ((n | 0xFF) <= 0x100) to (n <= 0x100). The redundant
0xFF was added in the first place in order to suppress a
Valgrind warning. (Valgrind would warn about comparing uninitialized
values even in the case when the uninitialized bits do not affect
the result of the comparison.)
In functions that declare pointer parameters as nonnull,
remove nullness checks, because GCC would optimize them away anyway.
Use #ifdef instead of #if when checking for a configuration flag.
Clang says that left shifts of negative values are undefined.
So, use ~0U instead of ~0 in a number of macros.
Some functions that were defined as UNIV_INLINE were declared as
UNIV_INTERN. Consistently use the same type of linkage.
ibuf_merge_or_delete_for_page() could pass bitmap_page=NULL to
buf_page_print(), conflicting with the __attribute__((nonnull)).
Threads may fall asleep forever while acquiring InnoDB rw-lock on Power8. This
regression was introduced along with InnoDB atomic operations fixes.
The problem was that proper memory order wasn't enforced between "writers"
store and "lock_word" load:
my_atomic_store32((int32*) &lock->waiters, 1);
...
local_lock_word = lock->lock_word;
Locking protocol is such that store to "writers" must be completed before load
of "lock_word". my_atomic_store32() was expected to enforce memory order because
it issues strongest MY_MEMORY_ORDER_SEQ_CST memory barrier.
According to C11:
- any operation with this memory order is both an acquire operation and a
release operation
- for atomic store order must be one of memory_order_relaxed
memory_order_release or memory_order_seq_cst. Otherwise the behavior is
undefined.
That is it doesn't say explicitly that this expectation is wrong, but there are
indications that acquire (which is actually supposed to guarantee memory order
in this case) may not be issued along with MY_MEMORY_ORDER_SEQ_CST.
A good fix for this is to encode waiters into lock_word, but it is a bit too
intrusive. Instead we change atomic store to atomic fetch-and-store, which
does memory load and is guaranteed to issue acquire.
Simplify away recursive flag: it is not necessary for rw-locks to operate
properly. Now writer_thread != 0 means recursive.
As we only need correct value of writer_thread only in writer_thread itself
it is rather safe to load and update it non-atomically.
This patch also fixes potential reorder of "writer_thread" and "recursive"
loads (aka MDEV-7148), which was reopened along with InnoDB thread fences
simplification. Previous versions are unaffected, because they have os_rmb
in rw_lock_lock_word_decr(). It wasn't observed at the moment of writing
though.