Commit graph

180154 commits

Author SHA1 Message Date
Marko Mäkelä
145ae15a33 Merge bb-10.2-ext into 10.3 2018-01-04 09:22:59 +02:00
Marko Mäkelä
1a1bda2222 Do not misspell "fall through" 2018-01-03 22:43:41 +02:00
Marko Mäkelä
3fcbeb4a63 Merge 10.2 into bb-10.2-ext 2018-01-03 22:42:27 +02:00
Marko Mäkelä
af0ba43838 Do not misspell "fall through" 2018-01-03 22:22:17 +02:00
Marko Mäkelä
fcde91114d Merge 10.1 into 10.2 2018-01-03 20:42:09 +02:00
Marko Mäkelä
1e89c86dd7 Merge 10.0 into 10.1 2018-01-03 20:41:34 +02:00
Marko Mäkelä
8ac1982fcc Merge 5.5 into 10.0 2018-01-03 20:40:41 +02:00
Marko Mäkelä
acd2862e65 MDEV-14848 MariaDB 10.3 refuses InnoDB crash-upgrade from MariaDB 10.2
While the redo log format was changed in MariaDB 10.3.2 and 10.3.3
due to MDEV-12288 and MDEV-11369, it should be technically possible
to upgrade from a crashed MariaDB 10.2 instance.

On a related note, it should be possible for Mariabackup 10.3
to create a backup from a running MariaDB Server 10.2.

mlog_id_t: Put back the 10.2 specific redo log record types
MLOG_UNDO_INSERT, MLOG_UNDO_ERASE_END, MLOG_UNDO_INIT,
MLOG_UNDO_HDR_REUSE.

trx_undo_parse_add_undo_rec(): Parse or apply MLOG_UNDO_INSERT.

trx_undo_erase_page_end(): Apply MLOG_UNDO_ERASE_END.

trx_undo_parse_page_init(): Parse or apply MLOG_UNDO_INIT.

trx_undo_parse_page_header_reuse(): Parse or apply MLOG_UNDO_HDR_REUSE.

recv_log_recover_10_2(): Remove. Always parse the redo log from 10.2.

recv_find_max_checkpoint(), recv_recovery_from_checkpoint_start():
Always parse the redo log from MariaDB 10.2.

recv_parse_or_apply_log_rec_body(): Parse or apply
MLOG_UNDO_INSERT, MLOG_UNDO_ERASE_END, MLOG_UNDO_INIT.

srv_prepare_to_delete_redo_log_files(),
innobase_start_or_create_for_mysql(): Upgrade from a previous (supported)
redo log format.
2018-01-03 19:08:50 +02:00
Marko Mäkelä
f7fd6ace18 Merge 10.2 into bb-10.2-ext 2018-01-03 15:48:47 +02:00
Marko Mäkelä
84c9c8b2e9 Silence some -Wimplicit-fallthrough by proper spelling 2018-01-03 15:01:17 +02:00
Marko Mäkelä
9eb3fcc9fb Follow-up fix of MDEV-14717 RENAME TABLE in InnoDB is not crash-safe
trx_undo_page_report_rename(): Return a pointer to the start of the
undo log record, not to the start of the (not yet written) next free
record. The wrong return value would sometimes cause ROLLBACK to crash
in an assertion failure (trying to parse garbage from the free area at
the end of the insert_undo log page) if the TRX_UNDO_RENAME_TABLE record
was the very last thing that was written to the insert_undo log. This
would occasionally happen when an ALTER TABLE operation is rolled
back due to invalid FOREIGN KEY constraints in the innodb.innodb test.
In these tests, the error ER_ERROR_ON_RENAME (1025) would be returned
at the end of the ALGORITHM=COPY operation of ALTER TABLE.
2018-01-03 14:54:15 +02:00
Marko Mäkelä
d361401bc2 Merge 10.1 into 10.2, with some MDEV-14799 fixups
trx_undo_page_report_modify(): For SPATIAL INDEX, keep logging
updated off-page columns twice, so that
the minimum bounding rectangle (MBR) will be logged.
Avoiding the redundant logging would require larger changes
to the undo log format.

row_build_index_entry_low(): Handle SPATIAL_UNKNOWN more robustly,
by refusing to purge the record from the spatial index.
We can get this code when processing old undo log from 10.2.10 or
10.2.11 (the releases affected by MDEV-14799, which was a regression
from MDEV-14051).
2018-01-03 11:56:24 +02:00
Marko Mäkelä
7a9fee9853 MDEV-13568 gcol.innodb_virtual_debug_purge failed in buildbot with wrong result
The InnoDB background tasks can modify tables while LOCK TABLES...WRITE
is in effect. The purge of InnoDB history always worked like this in
MariaDB, but in MySQL 5.7 it sometimes yields to LOCK TABLES.

Also, make gcol.innodb_virtual_index run the purge for an UPDATE
before DROP TABLE is executed.
2018-01-03 11:39:17 +02:00
Monty
c2c2173727 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-01-03 02:59:32 +02:00
Monty
36ba58cb75 Fixed that sequences and default works with ps-protocol
The bug was that for prepared statments the new TABLE_LIST was
allocated in the wrong arena.
2018-01-03 02:45:02 +02:00
Monty
16cd55a33a Fixed crashing bug in mysqlbinlog
- The fix in mf_iocache2.c was just to fix a compiler warning
2018-01-03 01:05:25 +02:00
Monty
6f28f78429 More output in galera.query_cache.test
This is to be able to better track where things goes wrong
2018-01-03 01:01:53 +02:00
Monty
83a8b0e9d3 Fixed compiler warning 2018-01-03 01:01:53 +02:00
Monty
22b4f469ca MDEV-14813 rpl.rpl_ctype_latin1 fails in buildbot on Mac with wrong result
Make rpl_ctype_latin1 more portable by printing names in hex
Also only run if lower_case_table_names is 0, as this affects the result
2018-01-03 01:01:53 +02:00
Igor Babaev
86cf60a615 Fixed mdev-14845 Server crashes in st_join_table::is_inner_table_of_outer_join
Do not try to apply the splitting optimization to a materialized
derived if it's specified by a select with impossible where
or if all joined tables of this select are constant.
2018-01-02 14:09:16 -08:00
Marko Mäkelä
016caa3d20 Merge 10.0 into 10.1 2018-01-02 21:57:22 +02:00
Marko Mäkelä
51e4650ed0 Merge 5.5 into 10.0 2018-01-02 21:52:46 +02:00
Varun Gupta
b2115ce235 Rocksdb fails to build when the source and build directory are not the same. This is a follow
up fix for MDEV-12458
2018-01-02 21:50:40 +02:00
Marko Mäkelä
20fab71b14 Follow-up to MDEV-14799: Remove bogus debug assertions
trx_undo_rec_get_partial_row(): When the PRIMARY KEY includes a
column prefix of an externally stored column, the already parsed
part of the undo log record may contain a reference to
an off-page column. This is the case in the bug58912 test in
innodb.innodb.
2018-01-02 21:41:39 +02:00
Marko Mäkelä
d384ead0f0 MDEV-14799 After UPDATE of indexed columns, old values will not be purged from secondary indexes
This is a regression caused by MDEV-14051 'Undo log record is too big.'

Purge in the secondary index is wrongly skipped in
row_purge_upd_exist_or_extern() because node->row only does not contain all
indexed columns.

trx_undo_rec_get_partial_row(): Add the parameter for node->update
so that the updated columns will be copied from the initial part
of the undo log record.
2018-01-02 19:11:10 +02:00
Monty
14e01bd868 Fixed simple failures:
- openssl_1 errors where system dependent
- Used not portable UINT32_MAX instead of UINT_MAX32
2018-01-02 02:03:12 +02:00
Monty
fbab79c9b8 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts:
	cmake/make_dist.cmake.in
	mysql-test/r/func_json.result
	mysql-test/r/ps.result
	mysql-test/t/func_json.test
	mysql-test/t/ps.test
	sql/item_cmpfunc.h
2018-01-01 19:39:59 +02:00
Monty
b32b22baba Disable warnings in partion_alter_myisam
Disabled warnings for directory option as this is depending on compilation
options.
2018-01-01 19:38:58 +02:00
Monty
aed2050e40 Ignore generated file rdb_source_revision.h 2018-01-01 15:01:20 +02:00
Monty
7e882a60bf Ensure that table->vcol_set is properly restored if used
Code in QUICK_RANGE_SELECT::init_ror_merged_scan() could theoretically
have caused crashes if this was ever called from an update or delete

This also found a bug in the vcol/range.result. file.
2018-01-01 14:44:20 +02:00
Monty
08ff39dca2 Write location of core when doing core dump 2018-01-01 14:12:18 +02:00
Monty
322c637c1c Fixed compiler warnings about possible uninitialized variables 2018-01-01 14:10:22 +02:00
Varun Gupta
7703095d2e MDEV-12458: Variable and log records to indicate RocksDB version are missing
Added a system variabe rocsdb_git_hash to MyRocks which tell us the version of RocksDB being used
2017-12-31 21:58:50 +02:00
Igor Babaev
c664c48726 Merge branch '10.3' into bb-10.3-igor 2017-12-30 16:19:17 -08:00
Igor Babaev
4f0299f8b3 This is a full cost-based implementation of the optimization that employs
splitting technique for equi-joins of materialized derived tables/views/CTEs.
(see mdev-13369 and mdev-13389).
2017-12-30 12:29:09 -08:00
Varun Gupta
a118c20c81 MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
Currently explain format=json does not show the order direction of fields used during filesort.
This patch would remove this limitation
2017-12-30 10:18:22 +05:30
Vicențiu Ciorbaru
b2a102fb58 Fix double floating point error in dtoa.c
When running an optimized build, compiler optimizations cause loss of
precision unless we force the expression to use a double type.
2017-12-30 00:20:58 +02:00
Vicențiu Ciorbaru
f9f976b217 Fix ssl cmake configuration not checking for symbols properly
Both libraries and includes are required to check for symbols correctly.

In addition, we don't use SHA512_DIGEST_LENGTH symbol so remove the
extraneous check.
2017-12-29 19:38:44 +02:00
Vicențiu Ciorbaru
b443c0e056 Lean down compilation when running travis with rpl
Disable tokudb compilation when doing rpl tests. This saves time and
allows us to not timeout on travis.
2017-12-29 19:38:29 +02:00
Elena Stepanova
8bcbcac053 Updated list of unstable tests for 10.2.12 2017-12-29 17:25:21 +02:00
Monty
afbb72b3b6 Made IO_CACHE safe for reading big blocks (> 2G)
The reason for adding this was that while testing mysqlbinlog on
a replication event with 3G event output, Linux failed reading
the whole file in memory with one read (only got 2G on first read
even if file had just been written).

- Don't reset info->error on write error in IO_CACHE.
- In case of write_error in IO_CACHE , always return -1
- Fixed wrong result from my_read when using MY_FULL_IO. Also don't give
  an error in case of retry.
2017-12-29 13:38:55 +02:00
Monty
e64184134a mysqlbinlog now prints "# Number of rows" and stops on errors
Main problem was that no log-event print function checked for disk
full error on the IO_CACHE.
All changes in this patch only affects mysqlbinlog, not the server!

- Changed all log-event print functions to return 1 on error
- Fixed memory usage when not using --flashback.
- Added printing of number of rows in row events. Can be disabled with
  --print-row-count=0
- Print annotated rows when using mysqlbinlog --short-form
- Fixed that mysqlbinlog --debug works
- Fixed create_drop_binlog.test test failure
- Reorganized fields in PRINT_EVENT_INFO to be according to size to
  optimize storage
- Don't change print_row_event_position or print_row_counts if set by user
- Remove some testing of argument to my_free is 0
- base64-output=never is now supported and works in all context
- Updated help information for --base64-output and --short-form
- print_row_count is now on by default. Reset automatically if --short-form
  is used
- Removed obsolote warning for mysql 5.6.0
- More DBUG_PRINT for mysqltest.cc
- my_b_write_byte() now checks for flush failures. This fixed a memory
  overrun on disk full
- my_b_printf() now returns 1 on failure, 0 on ok.  This simplifies code
  and no old code was using the old return value of my_b_printf().
- my_b_Write_backtick_quote() now returns 1 on failure and 0 on ok
- Fixed some error conditions in log printing that was not previously
  handled.
- Slave_rows_error_report() can now handle longlong positions
- Write_on_release_cache() rewritten so that we can detect errors
  on flush. Not depending on automatic release anymore.
- Changed types for Pos and End_log_pos to 64 bit in SHOW BINLOG EVENTS
- Fixed that copy_event_cache_to_string_and_reinit() works with strings
  longer than 4G (Changed to use LEX_STRING instead of String)
- Restricted binlog_rows_event_max_size to UINT32_MAX-1 as String's are
  anyway restricted to UINT32_MAX
- Fixed bug in rpl_binlog_state::write_to_iocache() which hide write
  failures (duplicate variable name)
- Fixed bug in String::append if original string was not allocated
- Stop mysqlbinlog output at once if there is an error.
- Before printing error message, flush result file. This ensures that
  the error message is printed last. (Easier to find)
2017-12-29 13:35:41 +02:00
Sergey Vojtovich
f5c479565d MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
Locked_tables_list::unlock_locked_tables

Similarly to regular DROP TABLE, don't leave locked tables mode if CREATE OR
REPLACE dropped temporary table but failed to cerate new one.

The problem is that there's no track of which temporary table was "locked" by
LOCK TABLES.
2017-12-29 11:40:23 +04:00
Vicențiu Ciorbaru
24774fba65 Update galera_gtid_slave result file post merge 2017-12-29 09:33:30 +02:00
Vicențiu Ciorbaru
6c4cf79d94 MDEV-13683: crash in Item_window_func::update_used_tables
Window definitions are resolved during fix fields. Updating used tables
for window functions must be done after all window functions have had a
chance to be resolved.

There was an additional problem with the implementation: expressions that
contained window functions never updated the expression's used tables.
To fix both these issues, make sure to call "update_used_tables" on all
items that contain window functions after we have passed through all
items.
2017-12-28 20:04:23 +02:00
Vicențiu Ciorbaru
8e9d8ffd1a Update main.innodb test result post-merge 2017-12-28 19:59:04 +02:00
Vicențiu Ciorbaru
1a9728d901 Update Connector/C 2017-12-28 19:27:07 +02:00
Vicențiu Ciorbaru
9aeb5d01d6 Merge remote-tracking branch 'origin/10.1' into bb-10.2-vicentiu 2017-12-28 19:27:00 +02:00
Ian Gilfillan
eef2bc5a5c Update mysqladmin man page 2017-12-28 19:44:42 +04:00
Monty
14de2ad3cb Removed curr_bitmap_pos++ from possible macro 2017-12-28 11:47:03 +02:00