Commit graph

177736 commits

Author SHA1 Message Date
Sergei Golubchik
51d457f371 compilation failures
with -DPLUGIN_PARTITION=NO and -DPLUGIN_PERFSCHEMA=NO
2017-07-05 17:15:59 +02:00
Sergei Golubchik
291411c96c MDEV-13132 Information Schema does not show whether column default is expression or literal
Fix INFORMATION_SCHEMA.COLUMNS.COLUMN_DEFAULT to be standard-compliant,
but keep SHOW COLUMNS backward-compatibly unchanged.
2017-07-05 17:15:59 +02:00
Sergei Golubchik
0559f12972 MDEV-13209 Cross-database operation with virtual columns fails
if we don't need to print field's table name,
we surely don't need to print field's db name either
2017-07-05 17:15:59 +02:00
Sergei Golubchik
186075adf2 MDEV-12938 Discrepancy between mysql_config and mariadb_config
Use the correct target name when querying libmariadb.so dependencies.
Filter out linker options (no-undefined and the version script)
2017-07-05 17:15:59 +02:00
Sergei Golubchik
d2d52305b4 MDEV-12755 Replication tests fail in buildbot with ASAN
remove double-initialization of MYSQL structure
2017-07-05 17:15:59 +02:00
Sergei Golubchik
cf9c290563 MDEV-12738 main.default fails with valgrind in buildbot and outside 2017-07-05 17:15:59 +02:00
Sergei Golubchik
48c22a68b1 MDEV-13089 identifier quoting in partitioning
remove ANSI_QUOTES when generating partition syntax for frm
2017-07-05 17:15:59 +02:00
Sergei Golubchik
e1093e2464 cleanup: part_func_string and subpart_func_string
Remove now-unused part_func_string and subpart_func_string
from partition_info.
2017-07-05 17:15:59 +02:00
Sergei Golubchik
785e2248bd MDEV-13089 identifier quoting in partitioning
don't print partitioning expression as it was entered by the user,
use Item::print() according to the sql_mode and sql_quote_show_create
2017-07-05 17:15:59 +02:00
Sergei Golubchik
504eff0ca1 cleanup: generate_partition_syntax()
Don't write to a temporary file, use String.
Remove strange one-liner "helpers", use String methods.
Don't use current_thd, don't allocate memory for 1-byte strings, etc.
2017-07-05 17:15:58 +02:00
Sergei Golubchik
03c52e964f cleanup: move Virtual_column_info::print out of Virtual_column_info 2017-07-05 17:15:58 +02:00
Sergei Golubchik
2bf017c210 MDEV-13060 Server Audit Plugin Crashes with AWS KMS plugin
don't do auditing if thd is NULL.

Collaterals:
* copy-paste bugs server_audit.c
* uninitialized user field when thd in NULL
2017-07-05 17:15:58 +02:00
Sergei Golubchik
47687eef41 MDEV-12936 upgrade to 10.2.6 failed upon tables with virtual columns
when opening 10.1- table that has virtual columns:

1. don't error out if it has vcols over autoinc columns.
   just issue a warning.
2. set vcol type properly
3. in innodb: use table->s->stored_fields instead of table->s->fields,
   because that's what was stored in innodb data dictionary
2017-07-05 17:15:58 +02:00
Sergei Golubchik
75f80004b1 MDEV-12939 A query crashes MariaDB in Item_func_regex::cleanup
and
MDEV-13144 regexp on views - crashed mariadb server

implement Item_func_regex::build_clone()
2017-07-05 17:15:57 +02:00
Sergei Golubchik
7bea860709 MDEV-12923 MyISAM allows CHECK constraint violation in ALTER TABLE
use correct type for Alter_inplace_info flags.
2017-07-05 17:15:57 +02:00
Sergei Golubchik
9edfc00697 MDEV-11930 Unexpected ER_ERROR_EVALUATING_EXPRESSION warning upon dropping database with a bad table
DBUG_EXECUTE_IF was wrong, it used my_error, but didn't do error=1.

It's not clear what it was actually testing, what it was supposed
to be testing, and what it has to do with bug#43138, so I removed it.
2017-07-05 17:15:57 +02:00
Sergei Golubchik
93a95c0a76 cleanup: check_openssl_compatibility()
CRYPTO_set_mem_functions() works only until the first allocation is done:
* remove the second CRYPTO_set_mem_functions() call
* check whether the first CRYPTO_set_mem_functions() call worked
* stricter memory checks (==1, not >1, etc)
* as coc_malloc cannot be removed, make the counter a bit cheaper
* only do the check for OpenSSL 1.1 (because of OpenSSL 1.0 bug)
2017-07-05 17:15:57 +02:00
Sergei Golubchik
a6bef22cda reduce grammar duplication 2017-07-05 17:15:57 +02:00
Sergei Golubchik
c917ba1d51 fix the comparison in st_select_lex::setup_ref_array()
the array only needs to be reallocated if it's smaller
than needed. Being larger is ok.

also: remove a duplicated check (merge error)
2017-07-05 17:15:57 +02:00
Sergei Golubchik
5c30fcfa2f cleanup: C++ comments 2017-07-05 17:15:57 +02:00
Sergei Golubchik
05873ffbf7 MDEV-12795 Possibly orphan mysql-test/t/mysql_plugin-master.opt 2017-07-05 17:15:57 +02:00
Sergei Golubchik
32e3b02234 MDEV-11639 Server crashes in update_virtual_field, gcol.innodb_virtual_basic fails in buildbot
don't use thd->query_id check in background purge threads
(it doesn't work, because thd->query_id is never incremented there)
instead use thd->open_tables directly, there can be only one table
there anyway, and this is the table opened by this purge thread.
2017-07-05 17:15:57 +02:00
Sergei Golubchik
95e6dd443a crashes when errors on early startup
cannot use unireg_abort() until mutexes are initialized.
2017-07-05 17:15:57 +02:00
Sergei Golubchik
0e6c6d61c2 fix main.mdl failure in --embedded 2017-07-05 17:15:57 +02:00
Sergei Golubchik
e022c22ba8 update sysvar_server_embedded.result on 32bit 2017-07-05 17:15:57 +02:00
Marko Mäkelä
10a98a4992 Adjust a test for Windows
On Windows, when tmpdir is not writable, there are only messages
like this:

2017-07-05 14:04:25 3860 [ERROR] InnoDB: Unable to create temporary file; errno: 0

On other platforms, there would be two messages for each failure:

2017-07-05 17:23:02 140436573771648 [ERROR] mysqld: Can't create/write to file '/dev/null/nonexistent/ibaajU4U' (Errcode: 20 "Not a directory")
2017-07-05 17:23:02 140436573771648 [ERROR] InnoDB: Unable to create temporary file; errno: 20
2017-07-05 17:22:53 +03:00
Vicențiu Ciorbaru
4f93c732d5 MDEV-13189: Window functions crash when using INTERVAL
Interval function makes use of Item_row. Item_row did not correctly mark
with_window_func flag according to its arguments. Fix it by making
Item_row aware of this flag.
2017-07-05 15:40:25 +03:00
Marko Mäkelä
e3d3147792 MDEV-13105 InnoDB fails to load a table with PAGE_COMPRESSION_LEVEL after upgrade from 10.1.20
When using innodb_page_size=16k, InnoDB tables
that were created in MariaDB 10.1.0 to 10.1.20 with
PAGE_COMPRESSED=1 and
PAGE_COMPRESSION_LEVEL=2 or PAGE_COMPRESSION_LEVEL=3
would fail to load.

fsp_flags_is_valid(): When using innodb_page_size=16k, use a
more strict check for .ibd files, with the assumption that
nobody would try to use different-page-size files.
2017-07-05 14:35:55 +03:00
Vladislav Vaintroub
f2931b1e3a mariabackup : run tests on buildbot on Windows 2017-07-05 11:34:34 +00:00
Vladislav Vaintroub
c5a525bda2 mariabackup : debian packaging 2017-07-05 11:05:35 +00:00
Marko Mäkelä
e417af2cb8 MDEV-13143 Server crashes in srv_init_abort_low() when started with inaccessible tmpdir
This is a regression caused by
commit bb60a832ed

srv_shutdown_all_bg_threads(): If os_thread_count indicates that
no threads are running, do not bother checking thread status.
This avoids a crash when InnoDB startup is aborted before
os_aio_init() has been invoked. (os_aio_all_slots_free() would
dereference AIO::s_reads even though it is NULL.)
2017-07-05 12:45:15 +03:00
Marko Mäkelä
8c71c6aa8b MDEV-12548 Initial implementation of Mariabackup for MariaDB 10.2
InnoDB I/O and buffer pool interfaces and the redo log format
have been changed between MariaDB 10.1 and 10.2, and the backup
code has to be adjusted accordingly.

The code has been simplified, and many memory leaks have been fixed.
Instead of the file name xtrabackup_logfile, the file name ib_logfile0
is being used for the copy of the redo log. Unnecessary InnoDB startup and
shutdown and some unnecessary threads have been removed.

Some help was provided by Vladislav Vaintroub.

Parameters have been cleaned up and aligned with those of MariaDB 10.2.

The --dbug option has been added, so that in debug builds,
--dbug=d,ib_log can be specified to enable diagnostic messages
for processing redo log entries.

By default, innodb_doublewrite=OFF, so that --prepare works faster.
If more crash-safety for --prepare is needed, double buffering
can be enabled.

The parameter innodb_log_checksums=OFF can be used to ignore redo log
checksums in --backup.

Some messages have been cleaned up.
Unless --export is specified, Mariabackup will not deal with undo log.
The InnoDB mini-transaction redo log is not only about user-level
transactions; it is actually about mini-transactions. To avoid confusion,
call it the redo log, not transaction log.

We disable any undo log processing in --prepare.

Because MariaDB 10.2 supports indexed virtual columns, the
undo log processing would need to be able to evaluate virtual column
expressions. To reduce the amount of code dependencies, we will not
process any undo log in prepare.

This means that the --export option must be disabled for now.

This also means that the following options are redundant
and have been removed:
	xtrabackup --apply-log-only
	innobackupex --redo-only

In addition to disabling any undo log processing, we will disable any
further changes to data pages during --prepare, including the change
buffer merge. This means that restoring incremental backups should
reliably work even when change buffering is being used on the server.
Because of this, preparing a backup will not generate any further
redo log, and the redo log file can be safely deleted. (If the
--export option is enabled in the future, it must generate redo log
when processing undo logs and buffered changes.)

In --prepare, we cannot easily know if a partial backup was used,
especially when restoring a series of incremental backups. So, we
simply warn about any missing files, and ignore the redo log for them.

FIXME: Enable the --export option.

FIXME: Improve the handling of the MLOG_INDEX_LOAD record, and write
a test that initiates a backup while an ALGORITHM=INPLACE operation
is creating indexes or rebuilding a table. An error should be detected
when preparing the backup.

FIXME: In --incremental --prepare, xtrabackup_apply_delta() should
ensure that if FSP_SIZE is modified, the file size will be adjusted
accordingly.
2017-07-05 11:43:28 +03:00
Marko Mäkelä
dc722559cc Correct a message 2017-07-05 10:16:36 +03:00
Marko Mäkelä
15c73c8b4a Flush crash-unsafe tables before killing the server 2017-07-05 10:08:48 +03:00
Marko Mäkelä
6eb1ce048e Adjust a test for tmp_disk_table_size
The parameter was recently introduced in
commit dd8474b1dc
but this test was not adjusted accordingly.
2017-07-05 08:07:16 +03:00
Marko Mäkelä
41a6475b49 InnoDB: Use access() instead of open() 2017-07-05 08:02:55 +03:00
Sachin
06041ade9a Merge pull request #397 from MariaDB/bb-10.2-MDEV-12067
MDEV-12067 flashback does not correcly revert update/replace statements
2017-07-04 16:14:12 +05:30
Marko Mäkelä
ad2d722acd MDEV-13228: Add a comment that clarifies the constants 2017-07-03 13:13:54 +03:00
Marko Mäkelä
d438a448e6 MDEV-13228 Assertion `n < rec_offs_n_fields(offsets)' failed in rec_get_nth_field_offs upon crash recovery with compressed table
In my preparatory patch for MDEV-12288, there was an off-by-one
array initialization error that affected debug builds.
2017-07-03 12:17:10 +03:00
Marko Mäkelä
56ff6f1b0b InnoDB: Remove dead code for DATA_POINT and DATA_VAR_POINT
The POINT data type is being treated just like any other
geometry data type in InnoDB. The fixed-length data type
DATA_POINT had been introduced in WL#6942 based on a
misunderstanding and without appropriate review.
Because of fundamental design problems (such as a
DEFAULT POINT(0 0) value secretly introduced by InnoDB),
the code was disabled in Oracle Bug#20415831 fix.

This patch removes the dead code and definitions that were
left behind by the Oracle Bug#20415831 patch.
2017-07-03 12:17:10 +03:00
Marko Mäkelä
cf2789bf0b ha_innobase::write_row(): Test the cheaper condition first 2017-07-03 12:17:00 +03:00
Lixun Peng
007d3ed905 MDEV-12067 flashback does not correcly revert update/replace statements
Problem
-------
For one-statement contains multiple row events, Flashback didn't reverse the
sequence of row events inside one-statement.

Solution
--------
Using a new array 'events_in_stmt' to store the row events of one-statement,
when parsed the last one event, then print from the last one to the first one.

In the same time, fixed another bug, without -vv will not insert the table_map
into print_event_info->m_table_map, then change_to_flashback_event() will not
execute because of Table_map_log_event is empty.
2017-07-03 14:48:07 +08:00
Monty
92f1837a27 Fixed compilation warnings (while testing 32 bit builds) 2017-07-01 14:26:42 +03:00
Monty
cc8912f223 Fixed failing test on 32 bit systems 2017-07-01 14:26:42 +03:00
Monty
3833097463 Clean up BUILD script
- Removed some not old, not used build scipts
- Removed tokudb and rocksdb from 32 bit builds
  This enables one now to easily build 32 bit binaries
  on 64 bit systems
2017-07-01 14:26:42 +03:00
Monty
2e9b55f763 MDEV-13226 Server crashes when tmpdir runs out of space
There was a missing test in CTE handling if creating a temporary table
failed (in this case as a result of out of space). This caused a table
handler to be used even if it was not allocated.
2017-07-01 14:26:42 +03:00
Marko Mäkelä
c436338d9d Assert that DB_TRX_ID must be set on delete-marked records
This is preparation for MDEV-12288, which would set DB_TRX_ID=0
when purging history. Also with that change in place, delete-marked
records must always refer to an undo log record via a nonzero
DB_TRX_ID column. (The DB_TRX_ID is only present in clustered index
leaf page records.)

btr_cur_parse_del_mark_set_clust_rec(), rec_get_trx_id():
Statically allocate the offsets
(should never use the heap). Add some debug assertions.

Replace some use of rec_get_trx_id() with row_get_rec_trx_id().

trx_undo_report_row_operation(): Add some sanity checks that are
common for all operations that produce undo log.
2017-07-01 11:02:58 +03:00
Jacob Mathew
53235cbb1f Updated spider/bg and spider/handler mtr suites. 2017-06-30 14:58:05 -07:00
Monty
f99b83571a Added submodule updates to BUILD scripts 2017-06-30 22:33:28 +03:00
Monty
a2d5bd96bf Fixed wrong results in show_all_plugins.test
- Crude hack to get it to work. Hope Serg has a better solution at some point..
2017-06-30 22:33:28 +03:00