Commit graph

178583 commits

Author SHA1 Message Date
Marko Mäkelä
372dba097d Silence a -Wimplicit-fallthrough warning 2017-09-17 14:13:32 +03:00
Marko Mäkelä
72c838b9fc Null-merge 10.1 into 10.2 2017-09-17 13:54:43 +03:00
Marko Mäkelä
d6baf3d364 MDEV-12634 after-merge test fix: Exercise row_merge_write(), row_merge_read()
MySQL 5.7 introduced some optimizations to avoid file I/O during
ALGORITHM=INPLACE operations. While both innodb-index-online and
innodb-table-online will exercise both the merge sort files and
the online log files in 10.1, in 10.2 they would only exercise the
online log files.

Modify one test case in innodb.innodb-table-online so that
skip_pk_sort will not hold. In this way, this test case will
write and read the merge sort files. The other instrumented tests
in innodb-index-online and innodb-table-online will only write
and read online_log files.
2017-09-17 13:46:51 +03:00
Marko Mäkelä
d9277732d7 Merge 10.1 into 10.2
This should also fix the MariaDB 10.2.2 bug
MDEV-13826 CREATE FULLTEXT INDEX on encrypted table fails.

MDEV-12634 FIXME: Modify innodb-index-online, innodb-table-online
so that they will write and read merge sort files. InnoDB 5.7
introduced some optimizations to avoid using the files for small tables.

Many collation test results have been adjusted for MDEV-10191.
2017-09-17 11:05:33 +03:00
Vladislav Vaintroub
d1253e19a1 Fix compilation in mariabackup
Compilation got confused  about 2 wsrep.h headers in include path
Rename backup's wsrep.h to backup_wsrep.h to fixO
2017-09-16 22:19:16 +02:00
Marko Mäkelä
836d4e74d9 Write proper tests for MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes
Introduce innodb_encrypt_log.combinations and prove that
the encryption and decryption take place during both
online ADD INDEX (WL#5266) and online table-rebuilding ALTER (WL#6625).
2017-09-16 21:15:38 +03:00
Marko Mäkelä
f24d36ae1e Clean up a directory to avoid a failure of another test 2017-09-16 21:15:38 +03:00
Marko Mäkelä
75dd3bcb4c Clean up after commit 93087d5fe7
Apply the same changes to both InnoDB and XtraDB.
2017-09-16 15:05:22 +03:00
Vladislav Vaintroub
1d7bc3b582 Innodb : do not call fflush() in os_get_last_error_low(), if no error
message was written.
2017-09-16 09:45:38 +00:00
Vladislav Vaintroub
ad17e8e518 MDEV-13821 : mariabackup sometimes could lose ib_logf(FATAL) messages,
The messages are getting lost because they are written with fprintf()
but without fflush(), so abort() would lose buffered text.

Applied fix from 10.2, which makes in_logf() use
sql_print_information(), which in turn does proper flush after each message
2017-09-16 09:45:38 +00:00
Vladislav Vaintroub
93087d5fe7 Fix some warnings 2017-09-16 09:45:38 +00:00
Marko Mäkelä
8c4df595b8 MDEV-13807 mariabackup --apply-log-only does generate redo log by performing rollback and possibly other tasks
Skip rollback and other redo-log-generating tasks if
srv_apply_log_only is set.

Instead of assigning the debug variable recv_no_log_write = FALSE,
assign it to srv_apply_log_only, so that any unwanted writes are caught.
2017-09-16 09:55:49 +03:00
Vladislav Vaintroub
c2815c7c2c add updated result file for MDEV-13802 test. 2017-09-15 20:44:03 +00:00
Marko Mäkelä
a07b537b39 Field_varstring: Declare get_data() and get_length() as public
The underlying data members are declared public, so there is no
point in hiding these const accessors.
2017-09-15 20:09:41 +03:00
Marko Mäkelä
a449f72a4c Remove the redundant function row_table_got_default_clust_index()
Use dict_index_is_auto_gen_clust() instead.
2017-09-15 20:06:26 +03:00
Alexander Barkov
65d26d1f31 MDEV-10191 non convertible chars convert() resulted in Null instead "?" on Windows
The problem was introduced by the patch for MDEV-7661,
which (in addition to the fix itself) included an attempt to make
CONVERT/CAST work in the same way with fields
(i.e. return NULL in strict mode if a non-convertable character found).
It appeared to be a bad idea and some users were affected by this
behavior change. Changing CONVERT/CAST not depend on sql_mode
(restoring pre-10.1.4 behavior).
2017-09-15 20:59:04 +04:00
Vladislav Vaintroub
a870099817 Windows : support vsjitdebugger in MTR's --debugger. 2017-09-15 16:20:38 +00:00
Vladislav Vaintroub
a73b55a9f8 Windows : fix a warning in popular header file 2017-09-15 16:20:38 +00:00
Vladislav Vaintroub
74f677fcc2 MDEV-13802 mariabackup --lock-ddl-per-table fails when table names contain backticks
use ut_get_name() for formatting database/table names.
2017-09-15 15:49:53 +00:00
Vladislav Vaintroub
bb7ab40521 mariabackup : Fix enumerate_ibd_files() to include .isl 2017-09-15 15:49:53 +00:00
Alexander Barkov
434e283507 MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat' 2017-09-15 12:25:06 +04:00
sjaakola
a8b3c603c6 MW-394
* recorded new result file, original was copied from MariaDB
  which produces syntactically a bit different result
* semantics are same in MariaDB and ours result file
2017-09-15 09:45:55 +03:00
sjaakola
ed9f68f6ad MW-394
* changed thd_binlog_format to return configured binlog format in wsrep execution,
  regardless of binlogging setting (i.e. with or without binlogging)
* thd_binlog_format is used in innobase::write_row(), and would return confusing
  result there when log_bin==OFF
2017-09-15 09:22:54 +03:00
sjaakola
f3435fc37e MW-394
* ported the partition.test from MariaDB 10.3 code tree
* fix to TOI replicate ALTER TABLE EXCHANGE PARTITION statement
2017-09-15 09:09:26 +03:00
Marko Mäkelä
e9d2f37abd MDEV-13626 Merge InnoDB test cases from MySQL 5.7 (part 2)
Import the changes to innodb.innodb-index innodb.innodb-index-debug

Note: As noted in MDEV-13613, due to the behaviour change in MDEV-11114,
DROP COLUMN will not imply DROP/ADD PRIMARY/UNIQUE KEY, like it does
in MySQL. The tests have been adjusted accordingly.
2017-09-14 16:07:10 +03:00
Alexey Botchkov
e2b9f6762c Make compiler happy with the 'fall through' comments. 2017-09-14 14:30:24 +04:00
Alexey Botchkov
c94fb7b7c1 Compiler warning avoided. 2017-09-14 11:16:40 +04:00
Jan Lindström
fa2701c6f7 MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes written to tem…
…porary file

Fixed by removing writing key version to start of every block that
was encrypted. Instead we will use single key version from log_sys
crypt info.

After this MDEV also blocks writen to row log are encrypted and blocks
read from row log aren decrypted if encryption is configured for the
table.

innodb_status_variables[], struct srv_stats_t
	Added status variables for merge block and row log block
	encryption and decryption amounts.

Removed ROW_MERGE_RESERVE_SIZE define.

row_merge_fts_doc_tokenize
	Remove ROW_MERGE_RESERVE_SIZE

row_log_t
	Add index, crypt_tail, crypt_head to be used in case of
	encryption.

row_log_online_op, row_log_table_close_func
	Before writing a block encrypt it if encryption is enabled

row_log_table_apply_ops, row_log_apply_ops
	After reading a block decrypt it if encryption is enabled

row_log_allocate
	Allocate temporary buffers crypt_head and crypt_tail
	if needed.

row_log_free
	Free temporary buffers crypt_head and crypt_tail if they
	exist.

row_merge_encrypt_buf, row_merge_decrypt_buf
	Removed.

row_merge_buf_create, row_merge_buf_write
	Remove ROW_MERGE_RESERVE_SIZE

row_merge_build_indexes
	Allocate temporary buffer used in decryption and encryption
	if needed.

log_tmp_blocks_crypt, log_tmp_block_encrypt, log_temp_block_decrypt
	New functions used in block encryption and decryption

log_tmp_is_encrypted
	New function to check is encryption enabled.

Added test case innodb-rowlog to force creating a row log and
verify that operations are done using introduced status
variables.
2017-09-14 09:23:20 +03:00
Marko Mäkelä
3f17f51132 Follow-up to MDEV-13563 mariabackup --lock-ddl-per-table
Fix memory leaks, and add a missing newline to a message.
2017-09-14 08:58:31 +03:00
Marko Mäkelä
cfd51c01e1 Fix one more warning for page_header_get_field() 2017-09-14 08:06:40 +03:00
Marko Mäkelä
126a581b45 Fix warnings for page_header_get_field() comparisons
The type uint16_t is apparently promoted to int in a comparison,
causing a sign mismatch when comparing to ulint. Convert to ulint
before comparison.
2017-09-14 08:00:28 +03:00
Marko Mäkelä
88106ef352 Fix a warning for a debug assertion
The type uint16_t is apparently promoted to int in a comparison,
causing a sign mismatch when comparing to ulint.
Convert both operands to uint16_t.
2017-09-14 07:52:32 +03:00
Vincent Milum Jr
7f2fab0106 Fixes Galera on FreeBSD
Corrects the following error with rsync sst on FreeBSD:
WSREP_SST: [ERROR] rsync daemon port '4444' has been taken

The FreeBSD version of grep doesn't play nicely with the -w parameter mixed with [[:space:]] and ends up matching nothing. This causes the script to loop and attempt to spawn more than one instance of rsync, which fails with the initial instance already having the port open. Because of this, the entire script fails and no sst occurs resulting in the error message listed above appearing in the log file.
2017-09-13 10:48:10 -07:00
Marko Mäkelä
f5a833c3e0 Clean up the logging of virtual column values in table-rebuilding online ALTER
In online table-rebuilding ALTER TABLE (LOCK=NONE), virtual column values
are being written to the online_log. WL#8149 in MySQL 5.7 changed some
low-level functions that are also being used outside row0log.cc, causing
performance penalty to other code.

We revert those changes, and introduce separate functions for writing
the virtual column values.

The only functional change should be the one that is mentioned in
MDEV-13795: row_log_table_low_redundant() will no longer write
virtual column values along with old_pk, just like row_log_table_low().

As noted in MDEV-13795, some forms of table-rebuilding ALTER with
virtual columns is broken. At least DROP PRIMARY KEY, ADD PRIMARY KEY
is broken.

rec_get_converted_size_temp(), rec_convert_dtuple_to_temp():
Remove the parameter for passing virtual column values.

rec_get_converted_size_temp_v(), rec_convert_dtuple_to_temp_v():
New functions for appending virtual column values to the online_log.

rec_get_converted_size_comp_prefix_low(),
rec_convert_dtuple_to_rec_comp(): Remove the v_entry parameter,
and do not allow n_fields=0.
2017-09-13 16:14:37 +03:00
Marko Mäkelä
24062fed70 Remove the debug variables innodb_purge_stop_now, innodb_purge_run_now
The InnoDB purge subsystem can be best stopped by opening a read view,
for example by START TRANSACTION WITH CONSISTENT SNAPSHOT.

To ensure that everything is purged, use wait_all_purged.inc,
which waits for the History list length in SHOW ENGINE INNODB STATUS
to reach 0. Setting innodb_purge_run_now never guaranteed this.
2017-09-13 16:02:32 +03:00
Marko Mäkelä
d06e4fc6a3 Do not require a debug non-embedded server in the test
This also avoids hitting the hang at server shutdown.
That hang should be fixed, of course.
2017-09-13 16:02:31 +03:00
Marko Mäkelä
dd35fb35fa Return uint16_t instead of ulint 2017-09-13 16:02:31 +03:00
Alexander Barkov
250ca1c1d2 MDEV-13707 Server in ORACLE mode crashes on ALTER with wrong DEFAULT clause 2017-09-13 16:45:42 +04:00
Alexey Botchkov
dc82f70e9f MDEV-13633 JSON_ARRAY() - bad output with some UTF8 characters.
set_charset() calls added for Item_func_json_arran
        and Item_func_json_object::val_str-s.
2017-09-13 15:17:28 +04:00
Alexey Botchkov
a237a92099 MDEV-12877 Wrong result from JSON native function.
Set default charset for temporary paths so UDF call don't crash.
2017-09-13 00:36:09 +04:00
Alexey Botchkov
80a3837283 MDEV-12877 Wrong result from JSON native function.
JSON_QUOTE return type set to be JSON.
2017-09-12 19:15:31 +04:00
Alexey Botchkov
825c8d793d MDEV-12774 JSON_EXTRACT fails with some escaped unicode as key.
Tests added.
2017-09-12 17:30:46 +04:00
Alexey Botchkov
30db4e1fc7 MDEV-13786 compiler complains about uninitialized variable.
'=0' added to meke the compiler happy.
2017-09-12 15:33:30 +04:00
Alexey Botchkov
0cd731864e MDEV-13104 Json functions.
An extra ',' added to the JSON_MERGE result making it invalid.
2017-09-12 15:21:53 +04:00
Alexey Botchkov
467acc2119 MDEV-13324 JSON_SET returns NULL instead of object.
Superfluous ',' was added to the JSON_SET result so it became
        invalid.
2017-09-12 14:40:18 +04:00
Sergei Petrunia
49878be331 MDEV-13602: rocksdb.index_merge_rocksdb2 failed in buildbot
Part#2: stabilize the test output
2017-09-12 13:32:09 +03:00
Alexey Botchkov
594c6b37f3 MDEV-13138 JSON_OBJECT returns null with strings containing backticks.
Condition was fixed.
2017-09-12 13:26:03 +04:00
Marko Mäkelä
66a09bd6ab MDEV-13318 Crash recovery failure after the server is killed during innodb_encrypt_log startup
This fixes several InnoDB bugs related to innodb_encrypt_log and
two Mariabackup --backup bugs.

log_crypt(): Properly derive the initialization vector from the
start LSN of each block. Add a debug assertion.

log_crypt_init(): Note that the function should only be used when
creating redo log files and that the information is persisted in
the checkpoint pages.

xtrabackup_copy_log(): Validate data_len.

xtrabackup_backup_func(): Always use the chosen checkpoint buffer.

log_group_write_buf(), log_write_up_to(): Only log_crypt() the redo
log payload, not the padding bytes.

innobase_start_or_create_for_mysql(): Do not invoke log_crypt_init()
or initiate a redo log checkpoint.

recv_find_max_checkpoint(): Return the contents of LOG_CHECKPOINT_NO
to xtrabackup_backup_func() in log_sys->next_checkpoint_no.
2017-09-12 11:32:49 +03:00
Marko Mäkelä
8ee4b414ae Relax a too strict debug assertion for Mariabackup --prepare 2017-09-12 11:30:50 +03:00
Alexey Botchkov
ea876b39f3 MDEV-13716 point_big test fails in 10.2.
Implementation for the reverse spatial predicates was lost
        somehow.
2017-09-12 11:58:49 +04:00