Commit graph

177380 commits

Author SHA1 Message Date
Olivier Bertrand
3e36eb230b Fix gcc compiler warnings reported by Sergei
modified:   storage/connect/array.cpp
  modified:   storage/connect/array.h
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/blkfil.h
  modified:   storage/connect/block.h
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/colblk.h
  modified:   storage/connect/csort.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/global.h
  modified:   storage/connect/json.h
  modified:   storage/connect/plgdbsem.h
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabcol.cpp
  modified:   storage/connect/tabcol.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabdos.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabodbc.h
  modified:   storage/connect/tabsys.h
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h
  modified:   storage/connect/xindex.cpp
  modified:   storage/connect/xindex.h
  modified:   storage/connect/xobject.cpp
  modified:   storage/connect/xobject.h
  modified:   storage/connect/xtable.h

Set values as nullable when retrieving catalog info
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/mysql-test/connect/r/odbc_oracle.result
  modified:   storage/connect/odbconn.cpp

Change format of Jpath
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/mysql-test/connect/r/json.result
  modified:   storage/connect/mysql-test/connect/r/json_udf.result
  modified:   storage/connect/mysql-test/connect/r/json_udf_bin.result
  modified:   storage/connect/mysql-test/connect/r/zip.result
  modified:   storage/connect/mysql-test/connect/t/json.test
  modified:   storage/connect/mysql-test/connect/t/json_udf.test
  modified:   storage/connect/mysql-test/connect/t/json_udf_bin.test
  modified:   storage/connect/mysql-test/connect/t/zip.test
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/tabmgo.cpp

Change null representation from ??? to <null>
  modified:   storage/connect/json.cpp

Change the name of UDF that are equal to a native JSON function name
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/mysql-test/connect/t/json_udf.inc
  modified:   storage/connect/mysql-test/connect/t/json_udf2.inc

Fix bug in making JSON project info
  modified:   storage/connect/mongofam.cpp

Fix COMPUTE when one argument is null
  modified:   storage/connect/value.cpp

Value is null only when nullable
  modified:   storage/connect/value.h
2017-05-23 19:35:50 +02:00
Olivier Bertrand
e8333389c8 .gitignore 2017-05-18 12:57:24 +02:00
Sergei Petrunia
fff61e31ec Fix a compiler warning 2017-05-17 14:44:16 +03:00
Monty
f7dab76aa2 MDEV-12756 rpl.rpl_killed_ddl fails in buildbot with 'Can't find record'
The issue was that my_errno was not set properly when a repair was killed,
which confused the rpl_killed_ddl script.

I also added an extra test line in varchar.inc to ensure we don't give
duplicate error rows.
2017-05-17 00:00:27 +03:00
Elena Stepanova
ca7cf69cb1 Additions to 10.2.6 unstable-tests list 2017-05-15 02:09:28 +03:00
Marko Mäkelä
f9069a3dc0 MDEV-12674 Post-merge fix: Include accidentally omitted changes
In 10.2, the definition of simple_counter resides in the file
sync0types.h, not in the file os0sync.h which has been removed.
2017-05-12 15:44:17 +03:00
Marko Mäkelä
b9474b5d51 Merge 10.1 into 10.2 2017-05-12 13:29:24 +03:00
Marko Mäkelä
03dca7a333 Merge 10.0 into 10.1 2017-05-12 13:12:45 +03:00
Marko Mäkelä
ff16609374 MDEV-12674 Innodb_row_lock_current_waits has overflow
There is a race condition related to the variable
srv_stats.n_lock_wait_current_count, which is only
incremented and decremented by the function lock_wait_suspend_thread(),

The incrementing is protected by lock_sys->wait_mutex, but the
decrementing does not appear to be protected by anything.
This mismatch could allow the counter to be corrupted when a
transactional InnoDB table or record lock wait is terminating
roughly at the same time with the start of a wait on a
(possibly different) lock.

ib_counter_t: Remove some unused methods. Prevent instantiation for N=1.
Add an inc() method that takes a slot index as a parameter.

single_indexer_t: Remove.

simple_counter<typename Type, bool atomic=false>: A new counter wrapper.
Optionally use atomic memory operations for modifying the counter.
Aligned to the cache line size.

lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>.
These counters are either only incremented (and we do not care about
losing some increment operations), or the increment/decrement operations
are protected by some mutex.

srv_stats_t::os_log_pending_writes: Document that the number is protected
by log_sys->mutex.

srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>,
that is, atomic inc() and dec() operations.

lock_wait_suspend_thread(): Release the mutexes before incrementing
the counters. Avoid acquiring the lock mutex if the lock wait has
already been resolved. Atomically increment and decrement
srv_stats.n_lock_wait_current_count.

row_insert_for_mysql(), row_update_for_mysql(),
row_update_cascade_for_mysql(): Use the inc() method with the trx->id
as the slot index. This is a non-functional change, just using
inc() instead of add(1).

buf_LRU_get_free_block(): Replace the method add(index, n) with inc().
There is no slot index in the simple_counter.
2017-05-12 12:24:53 +03:00
Michael Widenius
9933239956 MDEV-10804 main.stat_tables_par fails sporadically in buildbot
This was because of two issues:
- thr_multi_lock_after_thr_lock needed to be hit 3 times before go2 could
  be signaled, because 2 of these happened before statistics_update_start
  was reached.
- The original code didn't take into accunt that thr_locks can be executed in
  any random order, which caused sporadic failures when waiting for 1 lock
  of 3, as if the locks where in different order, there would be a dead-lock.
  Fixed by introducing thr_multi_lock_before_thr_lock which is deterministic.
- Some of the test failures where not noticed as the DEBUG_SYNC timeout
  would cause the test to pass (after 300 seconds).
2017-05-11 17:28:47 +03:00
Michael Widenius
1fbf1c6d7c Build MyRocks as a plugin (as static compilation doesn't work) 2017-05-11 17:08:40 +03:00
Jan Lindström
f4df8c00c9 MDEV-11197: TrxInInnoDB::is_aborted(const trx_t*): Assertion `srv_read_only_mode || trx->in_depth > 0' failed
TrxInInnoDB should be constructed to track if a transaction is executing
inside InnoDB code i.e. it is like a gate between Server and InnoDB
::rnd_next() is called from Server and thus construct TrxInInnoDB
also there.

Applied suggested clean-up to TrxInInnoDB class functions enter()
and exit(). Note that exactly original did not work for enter().
2017-05-10 23:13:06 +03:00
Marko Mäkelä
00821c3825 MDEV-12776 Do not create the InnoDB temporary tablespace in innodb_read_only mode
The InnoDB temporary tablespace is only usable if innodb_read_only=OFF.
It is useless to create the tablespace in read-only mode, because
CREATE TEMPORARY TABLE is disallowed if innodb_read_only, and nothing
can we written to the temporary tablespace if no temporary tables
can be created.
2017-05-10 20:23:01 +03:00
Sergei Golubchik
fee8d39ecb MDEV-12754 innodb.truncate_debug fails in buildbot with embedded due to semaphore wait
fix sporadic innodb.truncate_purge_debug failures
2017-05-10 18:11:03 +02:00
Oleksandr Byelkin
2819133711 fix 32 bit platform test 2017-05-10 17:57:40 +02:00
Sergei Golubchik
535f489210 update to the latest C/C to fix failures on Windows 2017-05-10 14:03:59 +02:00
Sergei Golubchik
8cec525644 skip innodb.innodb_xtradb_compat on Windows
because it tests for variables that aren't compiled for Windows,
like --innodb-priority-cleaner
2017-05-10 13:42:27 +02:00
Marko Mäkelä
3a906ca982 MDEV-12708 innodb.truncate_purge_debug fails sporadically in buildbot
The latest attempted fix for
MDEV-11802 InnoDB purge fails to start when there is work to do
is not complete.

For now, work around the issue by making SHOW ENGINE INNODB STATUS
call srv_wake_purge_thread_if_not_active() to wake up the purge.
2017-05-10 14:31:57 +03:00
Marko Mäkelä
e3a7f75aef MDEV-12679 purge_sys_t::~purge_sys_t(): Assertion `latch.magic_n == 0' failed on --bootstrap (CMAKE_BUILD_TYPE=Debug)
rw_lock_free_func(): Assign lock->magic_n = 0 in debug builds,
because sometimes, the assignment in the explicit destructor call
is being optimized away.
This was verified when using GCC 6.3.0 with -O3 -g -mtune=native
on a Debian GNU/Linux 9.0 system on AMD64.
2017-05-10 14:14:50 +03:00
Marko Mäkelä
021d636551 Fix some integer type mismatch.
Use uint32_t for the encryption key_id.

When filling unsigned integer values into INFORMATION_SCHEMA tables,
use the method Field::store(longlong, bool unsigned)
instead of using Field::store(double).

Fix also some miscellanous type mismatch related to ulint (size_t).
2017-05-10 12:45:46 +03:00
Oleksandr Byelkin
2e41259bfc Fix of emulated variables comments to reflect reality. 2017-05-10 11:08:33 +02:00
Marko Mäkelä
069d0472b3 MDEV-12762 Some files in current 10.2 tree seem to be reverted to an old state
The issue was a bad merge of MDEV-12253 from 10.1 to 10.2
in commit f9cc391863.
In that merge, I wrongly assumed that all test file conflicts
for mysql-test/suite/encryption had been properly resolved in
bb-10.2-MDEV-12253 (commit 76aa6be77635c7017459ce33b41c837c9acb606d)
while in fact, some files there had been copied from the 10.1 branch.

This commit is based on a manually done conflict resolution of
the mysql-test/suite/encryption on the same merge, applied to
the current 10.2 branch.

As part of this commit, the test encryption.innodb-bad-key-change4
which was shortly disabled due to MDEV-11336 will be re-enabled again.
(While the test enables innodb_defragment, it does not fail even though
enabling innodb_defragment currently has no effect.)
2017-05-10 09:06:57 +03:00
Sergei Golubchik
2980b0c348 fix crashes with openssl fips builds
Apparently openssl ignores CRYPTO_set_mem_functions() in fips mode,
so we cannot detect structure sizes. Don't freak out when
no mallocs were detected.
2017-05-10 01:33:03 +02:00
Elena Stepanova
bde397b3eb List of unstable tests for 10.2.6 (initial 10.2 version for GA) 2017-05-10 01:57:54 +03:00
Elena Stepanova
001e54af70 Disable RocksDB tests that fail regularly on buildbot (MDEV-12474)
Tests which fail on Xenial fulltest
2017-05-10 01:56:23 +03:00
Vladislav Vaintroub
b5b7874186 Update C/C (fix build on Windows) 2017-05-10 00:46:09 +02:00
Marko Mäkelä
588a6a186a MDEV-12750 Fix crash recovery of key rotation
When MySQL 5.7.9 was merged to MariaDB 10.2.2, an important
debug assertion was omitted from mlog_write_initial_log_record_low().

mlog_write_initial_log_record_low(): Put back the assertion
mtr_t::is_named_space().

fil_crypt_start_encrypting_space(), fil_crypt_rotate_page():
Call mtr_t::set_named_space() before modifying any pages.

fsp_flags_try_adjust(): Call mtr_t::set_named_space(). This additional
breakage was introduced in the merge of MDEV-11623 from 10.1. It was
not caught because of the missing debug assertion in
mlog_write_initial_log_record_low().

Remove some suppressions from the encryption.innodb-redo-badkey test.
2017-05-09 21:03:27 +03:00
Jan Lindström
6322913339 MDEV-12472: InnoDB should accept XtraDB parameters, warning that they are ignored
Added a new file ha_xtradb.h where XtraDB parameters are defined. This
file is included in two places to avoid too intrusive change to
ha_innodb.cc that would make future merges harder.

innodb_show_locks_held and innodb_show_verbose_locks should be
implemented (but on different commit).
2017-05-09 19:44:10 +02:00
Jan Lindström
96987cb4e9 Added tests for MDEV-11724, MDEV-11725, MDEV-11726. 2017-05-09 19:44:10 +02:00
Sergei Golubchik
ccca4f43c9 MDEV-10332 support for OpenSSL 1.1 and LibreSSL
post-review fixes:
* move all ssl implementation related ifdefs/defines to one file
  (ssl_compat.h)
* work around OpenSSL-1.1 desire to malloc every EVP context by
  run-time checking that context allocated on the stack is big enough
  (openssl.c)
* use newer version of the AWS SDK for OpenSSL 1.1
* use get_dh2048() function as generated by openssl 1.1
  (viosslfactories.c)
2017-05-09 18:53:10 +02:00
Georg Richter
f8866f8f66 MDEV-10332 support for OpenSSL 1.1 and LibreSSL
Initial support

tested against OpenSSL 1.0.1, 1.0.2, 1.1.0, Yassl and LibreSSL
not working on Windows with native SChannel support, due to wrong cipher
mapping: Latter one requires push of CONC-241 fixes.
Please note that OpenSSL 0.9.8 and OpenSSL 1.1.0 will not work: Even if
the build succeeds, test cases will fail with various errors, especially
when using different tls libraries or versions for client and server.
2017-05-09 18:53:10 +02:00
Sergei Golubchik
eb2b7ff623 update C/C 2017-05-09 18:49:44 +02:00
Jan Lindström
0ca2be92e6 Fix test failure on Windows.
In windows error message contains .exe.
2017-05-09 17:33:51 +03:00
Sachin Setiya
2e2e0d9105 MDEV-12019 FLASHBACK: Server crashes in bitmap_bits_set / pack_row / ...
Reason for this crash is that table->rpl_write_set is NULL. In
Rows_log_event::do_apply_event we set table->rpl_write_set equal to
table->write_set. But we do not set table->rpl_write_set in
Old_rows_log_event::do_apply_event.
2017-05-09 18:10:15 +05:30
Marko Mäkelä
d7cfe2c4f3 MDEV-12253 post-fix: Do not leak memory in crash recovery
This is a backport from 10.2 where it fixes the
cmake -DWITH_ASAN test failure that was mentioned
in commit f9cc391863
(merging MDEV-12253 from 10.1 to 10.2).

fil_parse_write_crypt_data(): If the tablespace is not found,
invoke fil_space_destroy_crypt_data(&crypt_data) to properly
free the created object.
2017-05-09 14:36:17 +03:00
Marko Mäkelä
9d2c1d09aa MDEV-12253 post-push fix: buf_read_page_low() can return DB_ERROR
The function buf_read_page_low() invokes fil_io(), which can return
DB_ERROR when the requested page is out of bounds (such as when
restoring a buffer pool dump). The callers should be handling that.
2017-05-09 14:36:15 +03:00
Sergei Golubchik
c91ecf9e9b Merge branch '10.1' into 10.2
Revert commit db0917f68f, because the fix for MDEV-12696
is coming from 5.5 and 10.1 in this merge.
2017-05-09 13:24:52 +02:00
Marko Mäkelä
2645bda5f2 MDEV-12253 post-fix: Do not leak memory in crash recovery
This fixes the cmake -DWITH_ASAN test failure that was mentioned
in commit f9cc391863 (merging
MDEV-12253 from 10.1 to 10.2).

fil_parse_write_crypt_data(): If the tablespace is not found,
invoke fil_space_destroy_crypt_data(&crypt_data) to properly
free the created object.

With this, the test encryption.innodb-redo-badkey still reports
"Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT"
but does not fail. The misleading message should be corrected,
maybe as part of MDEV-12699.
2017-05-09 13:40:42 +03:00
Jan Lindström
c92168fcd2 Merge pull request #389 from iangilfillan/10.1
galera_new_cluster man page and sh typo
2017-05-09 12:40:48 +03:00
=Ian Gilfillan
44eca0f512 galera_new_cluster man page and sh typo 2017-05-09 11:24:22 +02:00
Sachin Setiya
56b3bcc812 MDEV-12290 Wrong timestamps in binary log causes replication issues
Binlog_background_thread does not make a call to set_time(), And when
we call binlog_checkpoint_log_event->write() , we write the wrong timestamp.
In this patch we correct this by calling thd->set_time().
2017-05-09 14:32:34 +05:30
Marko Mäkelä
b3939a35aa MDEV-12720 recovery fails with "Generic error" for ROW_FORMAT=compressed
This bug was introduced in the fix of MDEV-12123, which invoked
page_zip_write_header() in the wrong way.

page_zip_write_header(): Assert that the length is not zero, to
be compatible with page_zip_parse_write_header().

btr_root_raise_and_insert(): Update the uncompressed page and then
invoke page_zip_write_header() with the correct length.
2017-05-09 11:41:35 +03:00
Jan Lindström
d0ce870466 MDEV-12735: Accidental revert of MDEV-6933 2017-05-09 10:55:17 +03:00
Marko Mäkelä
e8889c8002 MDEV-12745 InnoDB Assertion `0' failed at row0umod.cc:1181
row_undo_mod_parse_undo_rec(): Relax the too strict assertion and
correct the comment.

innodb.innodb-blob: Force a flush of the redo log right before
killing the server, to ensure that the code path gets exercised.
(The bogus debug assertion failed on the rollback of the statement
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2 which did not modify
any indexes before the server was killed.)
2017-05-09 10:00:49 +03:00
Jan Lindström
9a73af0152 Merge pull request #388 from grooverdan/10.2-MDEV-8684-innobase-remove-maths
MDEV-8684: innodb ut_delay - no maths
2017-05-09 09:35:11 +03:00
Jan Lindström
b246993cfc MDEV-12706: !trx->declared_to_be_inside_innodb with innodb_thread_concurrency during CREATE .. SELECT
There were two calls to innobase_srv_conc_enter_innodb on
::general_fetch() due to incorrect merge of 5.7.14.
2017-05-09 08:25:56 +03:00
Daniel Black
015966d2ce MDEV-8684: innodb ut_delay - no maths
Reintroduce 3d1a7cba71
that removed the maths from ut_delay.

Existing definitions of UT_COMPILE_BARRIER used.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-05-09 13:07:15 +10:00
Sergei Golubchik
fbdf18f86e MDEV-12696 Crash with LOAD XML and non-updatable VIEW column
extend the fix from 5.5 (in read_sep_field()) to apply to read_xml_field()
2017-05-09 00:28:43 +02:00
Marko Mäkelä
0627a0f399 MDEV-12586 ALTER TABLE…ALGORITHM=INPLACE fails with non-constant DEFAULT values
ha_innobase::check_if_supported_inplace_alter(): For now, reject
ALGORITHM=INPLACE when a non-constant DEFAULT expression is specified
for ADD COLUMN or for changing a NULL column to NOT NULL.

Later, we should evaluate the non-constant column values in these cases.
2017-05-08 22:07:52 +03:00
Marko Mäkelä
85ea327727 Disable the innodb_defragment tests until MDEV-11336 is done
These tests were broken by commit 8773f14677
which disabled the innodb_defragment=ON functionality on OPTIMIZE TABLE.
2017-05-08 22:06:32 +03:00