Commit graph

187815 commits

Author SHA1 Message Date
Eugene Kosov
a7e3008ab3 MDEV-20926 UBSAN: load of value 165, which is not a valid value for type bool
Basicaly it's an uninitialized read. 165 is 0xa5 which comes from TRASH_ALLOC()

Fix by calling a class ctor which initializes problematic
TMP_TABLE_PARAM::force_copy_fields field
2019-10-30 12:53:25 +03:00
Sergey Vojtovich
afb4878703 MDEV-18783 - Server crash in hp_rb_make_key
In debug build, whenever MEMORY table instance gets closed it performs
consistency check without protection. It may cause server crash if
executed concurrently with DML.

Moved consistency check to ha_heap::external_lock(F_UNLCK), so that it
is protected by THR_LOCK.
2019-10-30 12:52:19 +04:00
Daniele Sciascia
f4ba775914 MDEV-17099 Preliminary changes for Galera XA support (#1404)
Redo changes reverted in commit
8f46e3833c, this time without build
issues in wsrep-lib.
2019-10-30 10:45:22 +02:00
Jan Lindström
cd1c10859d Fix test cases that use debug galera library.
Changes to be committed:
	modified:   mysql-test/suite/galera/r/MW-369.result
	modified:   mysql-test/suite/galera/r/MW-402.result
	modified:   mysql-test/suite/galera/r/galera#500.result
	modified:   mysql-test/suite/galera/r/galera_gcs_fragment.result
	modified:   mysql-test/suite/galera/r/mysql-wsrep#332.result
2019-10-30 10:14:56 +02:00
Jan Lindström
36a9694378 MDEV-18562 [ERROR] InnoDB: WSREP: referenced FK check fail: Lock wait index
Lock wait can happen on secondary index when doing FK checks for wsrep.
We should just return error to upper layer and applier will retry
operation when needed.
2019-10-30 10:14:56 +02:00
Alexander Barkov
f2cff12556 MDEV-20924 Unify grammar rules: field_type_string and sp_param_field_type_string
In order to:
- unify sql_yacc.yy and sql_yacc_ora.yy easier
- move more functionality from the parser to Type_handler
  (so plugins can override the behavior)

this patch:
- removes rules sp_param_field_type_string and sp_param_field_type
  from sql_yacc_ora.yy
- adds a new virtial method Type_handler::Column_definition_set_attributes()
2019-10-30 11:58:52 +04:00
Marko Mäkelä
0ccfdc8eff Remove InnoDB wrappers of <string.h> functions
ut_strcmp(), ut_strcpy(), ut_strlen(), ut_memcpy(), ut_memcmp(),
ut_memmove(): Remove. Invoke the standard library functions directly.
2019-10-30 07:31:39 +02:00
Marko Mäkelä
44b0c86971 Clean up ut_strlcpy(), ut_strlcpy_rev()
ut_strlcpy(): Replace with the standard function strncpy().

ut_strlcpy_rev(): Define in the same compilation unit where
the only caller resides. Avoid unnecessary definition
in non-debug builds.
2019-10-30 06:42:51 +02:00
Sergei Golubchik
20b72a3fad compilation fix for Windows 2019-10-30 00:47:50 +01:00
Eugene Kosov
bc8a9ab5f3 remove unused struct members 2019-10-29 23:02:03 +03:00
Eugene Kosov
9ed4d06706 Merge 5.5 into 10.1 2019-10-29 22:10:43 +03:00
Eugene Kosov
7440e61a64 MDEV-18115: Remove the only async write (of redo log)
TODO: do not use fil_* functions for redo log files.

log_t::checkpoint_lock: remove this lock which was used to wait for
async I/O completion.

checkpoint_lock_key
checkpoint_lock: remove now unneeded globals

log_write_checkpoint_info(): remove sync argument because all checkpoint
writes are synchronous now

log_write_checkpoint_info(): remove sync argument

log_group_checkpoint(): merge with the only caller

log_complete_checkpoint(): merge with the only caller

log_t::complete_checkpoint(): remove by merging with the only caller.
2019-10-29 22:03:02 +03:00
Eugene Kosov
84088d9458 add .clang-format file for InnoDB 2019-10-29 21:56:24 +03:00
Marko Mäkelä
576c96a938 MDEV-20917: Fix dict_table_t::instant_column()
This is the only 10.4-specific fix. The remaining known issues
will be fixed by merging commit bef843b97f
from 10.3.
2019-10-29 19:14:05 +02:00
Marko Mäkelä
bef843b97f MDEV-20917 InnoDB is passing NULL to nonnull function parameters
mem_heap_dup(): Avoid mem_heap_alloc() and memcpy() of data=NULL, len=0.

trx_undo_report_insert_virtual(), trx_undo_page_report_insert(),
trx_undo_page_report_modify(): Avoid memcpy(ptr, NULL, 0).

dfield_data_is_binary_equal(): Correctly handle data=NULL, len=0.

rec_init_offsets_temp(): Do allow def_val=NULL in the interface.

This clean-up was motivated by WITH_UBSAN, and no bug related to this
was observed in the wild. It should be noted that undefined behaviour
such as memcpy(ptr, NULL, 0) could allow compilers to perform unsafe
optimizations, like it was the case in
commit fc168c3a5e (MDEV-15587).
2019-10-29 18:20:32 +02:00
Marko Mäkelä
814534745b MDEV-20917 InnoDB is passing NULL to nonnull function parameters
mem_heap_dup(): Avoid mem_heap_alloc() and memcpy() of data=NULL, len=0.

trx_undo_report_insert_virtual(), trx_undo_page_report_insert(),
trx_undo_page_report_modify(): Avoid memcpy(ptr, NULL, 0).

dfield_data_is_binary_equal(): Correctly handle data=NULL, len=0.

This clean-up was motivated by WITH_UBSAN, and no bug related to this
was observed in the wild. It should be noted that undefined behaviour
such as memcpy(ptr, NULL, 0) could allow compilers to perform unsafe
optimizations, like it was the case in
commit fc168c3a5e (MDEV-15587).
2019-10-29 17:26:28 +02:00
Marko Mäkelä
2b710090aa Merge 10.4 into 10.5 2019-10-29 16:31:40 +02:00
Marko Mäkelä
d4e1fa39f0 Use C++11 "range for" in crash recovery code 2019-10-29 11:58:11 +02:00
Alexander Barkov
b62a846642 MDEV-20913 sql_mode=ORACLE: INET6 does not work as a routine parameter type and return type
Adding the missing grammar.
2019-10-29 13:33:38 +04:00
Alexander Barkov
f1e9a0acc8 Cleanups in the two *.yy grammar files
Fixing unintentionally diverged parts:
- syncing indentation
- syncing "unlikely"
- syncyning missing new lines
- fixing typos
2019-10-29 07:23:36 +04:00
Marko Mäkelä
1c022aaf58 MDEV-20487: Fix a test
The test rpl.rpl_failed_drop_tbl_binlog exercises a scenario where
the adaptive hash index is enabled. Try to explicitly enable the
adaptive hash index for this test, and skip the test if it does not
succeed (that is, if the server was not built WITH_INNODB_AHI=ON).
2019-10-28 21:28:21 +02:00
Sergei Golubchik
dadc53ff0b MDEV-19882 pam v2: auth_pam_tool truncates passwords that are not null-terminated
Don't assume that passwords (and other conv replies) are zero-terminated.
If they are, though, strndup() down below will take care of that.
2019-10-28 19:45:43 +01:00
Vladislav Vaintroub
2d82ae5ba3 MDEV-20825 : Innodb does not start if GetDiskFreeSpace() fails.
Ignore GetDiskFreeSpace() errors in os_file_get_status_win32
The call is only used to calculate filesystem block size, and this in
turn is only  shown in information_schema.sys_tablespaces.FS_BLOCK_SIZE.
There is no other use of this field, it does not affect any Innodb
functionality
2019-10-28 17:01:32 +00:00
Marko Mäkelä
613e9e7d4d MDEV-20907 Set innodb_log_files_in_group=1 by default
Historically, InnoDB split the redo log into at least 2 files.
MDEV-12061 allowed the minimum to be innodb_log_files_in_group=1,
but it kept the default at innodb_log_files_in_group=2.

Because performance seems to be slightly better with only one log file,
and because implementing an append-only variant of the log would require
a single file, let us define the default to be 1, and have
innodb_log_file_size=96M, to retain the same default total size.
2019-10-28 17:11:10 +02:00
Marko Mäkelä
3043f38436 Merge 10.4 into 10.5 2019-10-28 17:10:34 +02:00
Marko Mäkelä
658289ca53 MDEV-20844: Add missing override qualifiers
clang warns if only some overridden member functions in a class
are tagged with the C++11 override keyword. Add the missing keywords.
2019-10-28 16:22:48 +02:00
Marko Mäkelä
adae286e35 Amend 3ea51b518b
Remove redundant NULL checks for __attribute__((nonnull)) parameters,
because clang warns about them.
2019-10-28 16:21:42 +02:00
Marko Mäkelä
d67ea8151f Rename LOG_HEADER_FORMAT_ to log_t::FORMAT_ 2019-10-28 16:16:57 +02:00
Marko Mäkelä
8f46e3833c Revert MDEV-17099 Preliminary changes for Galera XA support (#1401)
This reverts commit 2b5f4b3ed6
due to build failures.
2019-10-28 16:16:21 +02:00
Marko Mäkelä
2cc360bdf2 Remove bogus advice
Ever since MariaDB 10.0 (and MySQL 5.6.8), the innodb_log_file_size
and innodb_log_files_in_group can be changed between server restarts,
and the redo log files will be resized on server startup if needed.
2019-10-28 16:03:00 +02:00
Anel Husakovic
396313d301 MDEV-14448: Ctrl-C should not exit the client 2019-10-28 02:29:14 -07:00
Varun Gupta
cb14d2e1a5 Follow up fix for MDEV-16871 2019-10-28 13:29:46 +05:30
Sergei Golubchik
c13519312b MDEV-20799 DROP Virtual Column crashes MariaDB
use the correct table for evaluating virtual columns in the
InnoDB ALTER TABLE.
2019-10-28 08:40:48 +01:00
Sergei Golubchik
8bb6b9c634 gis2 test no longer exists after 3fe38574fb 2019-10-28 08:17:56 +01:00
Sergei Golubchik
c075c7a861 MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tables
switch to definer privileges when populating I_S tables
2019-10-28 08:17:56 +01:00
Sergei Golubchik
be780c0555 fix CONNECT engine to issue the correct error message 2019-10-28 08:17:56 +01:00
Sergei Golubchik
42ada91542 cleanup: RAII helper for swapping of thd->security_ctx 2019-10-28 08:17:56 +01:00
Marko Mäkelä
d752a97ebb Merge 10.1 to 10.2 2019-10-25 17:33:39 +03:00
Thirunarayanan Balathandayuthapani
a41d429765 MDEV-20621 FULLTEXT INDEX activity causes InnoDB hang
- fts_optimize_thread() uses dict_table_t object instead of table id.
So that it doesn't acquire dict_sys->mutex. It leads to remove the
hang of dict_sys->mutex between fts_optimize_thread() and other threads.

- in_queue to indicate whether the table is in fts_optimize_queue. It
is protected by fts_optimize_wq->mutex to avoid any race condition.

- fts_optimize_init() adds the fts table to the fts_optimize_wq
2019-10-25 16:27:41 +03:00
Thirunarayanan Balathandayuthapani
bd22650bbc MDEV-19073 FTS row mismatch after crash recovery
InnoDB stores synced_doc_id + 1 value in FTS_CONFIG table. But
while reading the synced doc id from FTS_CONFIG table after restart,
InnoDB should read synced_doc_id - 1 to get the actual synced
doc id value.
2019-10-25 16:17:59 +03:00
Marko Mäkelä
19ceaf2928 Merge 10.1 into 10.2 2019-10-25 12:57:36 +03:00
Jan Lindström
9afbb1069a Add wait_condition to stabilize. 2019-10-25 12:32:11 +03:00
Marko Mäkelä
7457181ba4 Clean up innodb.innodb_stats_persistent
The test was marked big for no apparent reason.
Usw wait_all_purged.inc in the canonical way, and make use of
the sequence engine.
2019-10-24 21:20:53 +03:00
Daniele Sciascia
2b5f4b3ed6 MDEV-17099 Preliminary changes for Galera XA support (#1401)
Update wsrep-lib, and adapt to wsrep-lib interface changes.
2019-10-24 14:05:32 +03:00
Alexander Barkov
8ba5af7eaf MDEV-20890 Illegal mix of collations with UUID() 2019-10-24 14:00:48 +04:00
Marko Mäkelä
88cdfc5c7d MDEV-20487 Set innodb_adaptive_hash_index=OFF by default
Based on the performance testing that was conducted in MDEV-17492,
the InnoDB adaptive hash index could only help performance in specific,
almost-read-only workloads. It could slow down all kinds of workloads
(especially DROP TABLE, TRUNCATE TABLE, ALTER TABLE, or DROP INDEX
operations), and it can become corrupted, causing crashes (such as
MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore,
the adaptive hash index consumes space from the InnoDB buffer pool,
which could hurt performance when the working set would almost fit
in the buffer pool.

Given all this, it is best to disable the adaptive hash index by default.
2019-10-23 17:43:31 +03:00
Sergei Golubchik
790a74d22b Merge branch 'github/5.5' into 10.1 2019-10-23 15:55:23 +02:00
Jan Lindström
82f22d2f25 MDEV-18590 galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
Ignore warning.
2019-10-23 10:12:53 +03:00
Jan Lindström
1036886b70 Stabilize tests.
Changes to be committed:
	modified:   mysql-test/suite/galera_sr/disabled.def
	modified:   mysql-test/suite/galera_sr/r/GCF-561.result
	modified:   mysql-test/suite/galera_sr/r/galera_sr_ddl_master.result
	modified:   mysql-test/suite/galera_sr/r/galera_sr_kill_query.result
	modified:   mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result
	new file:   mysql-test/suite/galera_sr/suite.pm
	modified:   mysql-test/suite/galera_sr/t/GCF-561.test
	modified:   mysql-test/suite/galera_sr/t/galera_sr_ddl_master.test
	modified:   mysql-test/suite/galera_sr/t/galera_sr_kill_query.test
	modified:   mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test
2019-10-23 10:12:53 +03:00
Sergei Golubchik
803d0521a2 compilation failure on ppc with -DCMAKE_BUILD_TYPE=Debug
if ${CRC32_LIBRARY} target has no COMPILE_FLAGS yet,
GET_TARGET_PROPERTY returns COMPILE_FLAGS-NOTFOUND, which
doesn't work very well when it's later fed back into COMPILE_FLAGS.

GET_PROPERTY() returns an empty string in this case.

Cherry-picked from 10.4 - 13e8f728ec

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2019-10-22 09:45:39 +03:00