Commit graph

170624 commits

Author SHA1 Message Date
Kristian Nielsen
e8e2ef470c Merge MDEV-8302 into 10.0 2015-08-04 11:53:14 +02:00
Kristian Nielsen
9b9c5e890c MDEV-8302: Duplicate key with parallel replication
This bug is essentially another variant of MDEV-7458.

If a transaction conflict caused a deadlock kill of T2 in record_gtid()
during commit, the code would do a rollback _before_ running
rgi->unmark_start_commit(). This creates a race where following transactions
could start too early (before T2 has completed its transaction retry). This
in turn could lead to replication failure, if there was a conflict that
caused eg. duplicate key error or similar.

The fix is to remove these rollbacks (in Query_log_event::do_apply_event()
and Xid_log_event::do_apply_event(). They seem out-of-place; code in
log_event.cc generally does not roll back on error, this is handled higher
up.

In addition, because of the extreme difficulty of reproducing bugs like
MDEV-7458 and MDEV-8302, this patch adds some extra precations to try to
detect (in debug builds) or prevent (in release builds) similar bugs.
ha_rollback_trans() will now call unmark_start_commit() if needed (and
assert in debug build when a caller does rollback without unmark first).

We also add an extra check for thd->killed() so that we avoid doing
mark_start_commit() if we already have a pending deadlock kill.

And we add a missing unmark_start_commit() call in the error case, found by
the above assertion.
2015-08-04 11:40:19 +02:00
Sergei Petrunia
b74795b00c MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2
The problem was with Materialized_cursor and temporary table it uses.
Temorary table's fields had Field::orig_table pointing to the tables
that were used in the query that produced data for the cursor.
When "FETCH INTO sp_var" statement is executed, those original tables
were already closed.  However, copying from Materialized_cursor's table
into SP variable may cause field_conv() to be invoked which calls
field->type() which may access field->orig_table (for certain field types).

Fixed by setting Materialized_cursor->table->field[i]->orig_table to point
to Materialized_cursor->table.  (this is how it is done for regular base
tables)
2015-08-03 21:02:27 +03:00
Sergei Petrunia
cb925491d4 Merge branch 'tmp' into 10.0 2015-08-03 20:47:43 +03:00
Sergei Petrunia
193faa57e5 MDEV-8554: Server crashes in base_list_iterator::next_fast ...
THD::>save_prep_leaf_list was set to true by multi-table update
statements with mergeable selects and never reset.

Make every statement reset it at start.
2015-08-03 20:46:00 +03:00
Sergei Petrunia
c4456b99b3 MDEV-7971: Assertion `name != __null' failed in ACL_internal_schema_registry::lookup...
[Attempt #] Make the code that handles "Prepare" phase for multi-table
UPDATE statements handle non-merged semijoins. It can encounter them when
a prepared statement is executed for the second time.
2015-07-30 14:02:44 +03:00
Sergey Vojtovich
4188ba9c1e MDEV-7652 - More explanatory ERROR and WARNING messages when loading plugins
with plugin-load-add that are already registered at mysql.plugin

- issue just one error message, without this extra warning
- don't abuse ER_UDF_EXISTS, instead add a proper error message for plugins
- report started initialization for each plugin source
2015-07-29 13:51:22 +04:00
Sergei Golubchik
cf30074c3f MDEV-7968 Virtual column set to NULL using load data infile
Don't forget to set thd->lex->unit.insert_table_with_stored_vcol
in the mysql_load(). Othewise virtual columns will not be updated.
2015-07-27 12:50:51 +02:00
Sergei Golubchik
6f14531b52 CONNECT: compiler warnings
and don't check table privileges in external_lock(F_UNLCK).
2015-07-27 10:52:22 +02:00
Sergei Golubchik
00967e114c CONNECT: clean up a stray variable
(patch originally by Alexander Barkov)
2015-07-27 10:52:21 +02:00
Sergei Golubchik
40a6160f4f MDEV-7574 Security definer views don't work with CONNECT ODBC tables
Instead of checking user's privileges with check_access(),
use the cached value in table->grant.privilege instead -
it is correctly set to the invoker or definer, depending
on SQL SECURITY mode.

Continue to use check_access() for DDLs when
table->grant.privilege may be not set (but these cases are
only possible on tables, never for views).

(patch originally by Alexander Barkov)
2015-07-27 10:52:21 +02:00
Sergei Golubchik
121f3e4c90 MDEV-7429 main.mysqldump fails sporadically in buildbot
prevent concurrent cleanups in multi-threaded mysqlimport
(they can happen if many threads get an error at the same time),
safe_exit() is not thread-safe.
2015-07-27 10:52:21 +02:00
Sergei Golubchik
cd0813e33e MDEV-8534 [PATCH] mysql_secure_installation doesn't pass "socket" to "mysql"
fix the previous patch to pass defaults-file to parse_arguments
2015-07-27 10:52:21 +02:00
Sergei Golubchik
39f5234a6d MDEV-8534 [PATCH] mysql_secure_installation doesn't pass "socket" to "mysql"
backport https://github.com/MariaDB/server/pull/88 to 10.0
2015-07-27 10:52:21 +02:00
Monty
517ef2bd39 Added easy way to assert if another thread has died.
Added some extra safety asserts in MyISAM key cache.

my_thread_var->init is now:
0 at startup
1 at init
2 when thread dies
2015-07-26 14:32:45 +03:00
Monty
f3e578ab30 Fixed MDEV-8428: Mangled DML statements on 2nd level slave when enabling binlog checksums
Fix was to add a test in Query_log_event::Query_log_event() if we are using
CREATE ... SELECT and in this case use trans cache, like we do on the master.
This avoid using (with doesn't have checksum)

Other things:
- Removed dummy call my_checksum(0L, NULL, 0)
- More DBUG_PRINT
- Cleaned up Log_event::need_checksum() to make it more readable (similar as in MySQL 5.6)
- Renamed variable that was hiding another one in create_table_imp()
2015-07-26 14:32:45 +03:00
Elena Stepanova
2ebedfa998 MDEV-8532 MTR cannot run with --embedded on Windows on a source build
Do not attempt to run unix-specific code on Windows
2015-07-25 00:58:36 +03:00
Dmitry Lenev
a6ab8ef9d7 MDEV-5997 - MySQL bug#11759114 - '51401: GRANT TREATS NONEXISTENT
FUNCTIONS/PRIVILEGES DIFFERENTLY'

Fix for bug#11759114 - '51401: GRANT TREATS NONEXISTENT
FUNCTIONS/PRIVILEGES DIFFERENTLY'.

The problem was that attempt to grant EXECUTE or ALTER
ROUTINE privilege on stored procedure which didn't exist
succeed instead of returning an appropriate error like
it happens in similar situation for stored functions or
tables.

The code which handles granting of privileges on individual
routine calls sp_exist_routines() function to check if routine
exists and assumes that the 3rd parameter of the latter
specifies whether it should check for existence of stored
procedure or function. In practice, this parameter had
completely different meaning and, as result, this check was
not done properly for stored procedures.

This fix addresses this problem by bringing sp_exist_routines()
signature and code in line with expectation of its caller.
Conflicts:
	mysql-test/r/grant.result
	mysql-test/t/grant.test
	sql/sp.cc
2015-07-23 16:45:20 +04:00
Sergey Vojtovich
d897015d74 MDEV-8399 - [PATCH] Missing Sanity Checks for memory allocation in MariaDB
- since param is quite small store it on stack
- fixed a few memory leaks
2015-07-23 14:33:22 +04:00
Alexander Barkov
cb3a71d238 Updating the instructions on how to prepare the OS to run
"mtr connect.odbc_postgresql"
2015-07-22 11:17:55 +04:00
Elena Stepanova
83ba48b7c6 MDEV-8506 mroonga/wrapper.performance_schema fails in buildbot on bld-dan-release
The test has performance-schema in the opt file, so it failed when the server was compiled without performance schema.
Make the option loose, then MTR will be able to reach have_perfschema.inc check and will skip the test gracefully.
2015-07-20 20:16:32 +03:00
Jan Lindström
0bb0ace420 MDEV-8443: mysql-test - innodb.innodb_simulate_comp_failures 'innodb_plugin' is failing
Problem was that test just takes too long time in slow I/O and triggers
testcase timeout. Reduced the number of operations and inserts to make
test shorter.
2015-07-20 14:36:30 +03:00
Kristian Nielsen
40215a9e79 Merge MDEV-8496 into 10.0 2015-07-19 09:31:02 +02:00
Kristian Nielsen
44c4b2304b MDEV-8496: gtid_ignore_duplicates treats gtid_seq_no as 32-bit
--gtid-ignore-duplicates was comparing sequence numbers as 32-bit, so
after 2**32 transactions things would start to fail.
2015-07-19 09:28:22 +02:00
Alexander Barkov
12da27da85 MDEV-8472 BINARY, VARBINARY and BLOB return different warnings on CAST to DECIMAL 2015-07-16 16:28:06 +04:00
Sergey Vojtovich
94bc50650e MDEV-8374 - Debian: mysqld_safe Can't log to error log and syslog at the same time
Let mysqld_safe_syslog.cnf force disable error log so that logging to syslog is
not affected by previous log_error setting.

Added handling of --skip-log-error to mysqld_safe.
2015-07-16 14:03:29 +04:00
Jan Lindström
6efdc398ba MDEV-8463: 10.0 tree does not build
Merge error on srv0start.cc
2015-07-14 20:36:23 +03:00
Jan Lindström
a9960ef0ec MDEV-8386: MARIADB creates very big tmp file > 351Gb. Started happening after Version 10.0.16-15
Fixed small size limit and added additional information if we reserve
new pages more then 50 times.
2015-07-14 20:14:48 +03:00
Jan Lindström
0a43236fbe Code cleanup. 2015-07-14 20:14:48 +03:00
Jan Lindström
3bbffc2119 Merge pull request #85 from josh4trunks/10.0
Apply fixes for raw devices to XtraDB in MariaDB 10.0
2015-07-13 19:29:09 +03:00
josh4trunks
a95be9644a Apply fix for raw devices to XtraDB 2015-07-12 19:53:38 -07:00
josh4trunks
ee5633a39e Apply fix for raw devices to XtraDB 2015-07-12 19:46:29 -07:00
Monty
d9835658e0 Updated fill_help_tables for MariaDB
- References changed from mysql.com to mariadb.com/kb
- NDB specfic things removed
- Changed other MySQL related things to MariaDB
2015-07-10 14:03:39 +03:00
Jan Lindström
1a8cf15d63 MDEV-8392: Couldn't alter field with default value for make it not nullable.
Analysis; Problem is that InnoDB does not have support for generating
CURRENT_TIMESTAMP or constant default.

Fix: Add additional check if column has changed from NULL -> NOT NULL
and column default has changed. If this is is first column definition
whose SQL type is TIMESTAMP and it is defined as NOT NULL and
it has either constant default or function default we must use
"Copy" method for alter table.
2015-06-30 22:24:37 +03:00
Kristian Nielsen
8af5ab405a Merge MDEV-8354 into 10.0 2015-06-24 16:53:41 +02:00
Kristian Nielsen
b89de2b2ce MDEV-8354: out-of-order error with --gtid-ignore-duplicates and row-based replication
The --gtid-ignore-duplicates option was not working correctly with row-based
replication. When a row event was completed, but before committing, there
was a small window where another multi-source SQL thread could wrongly try
to re-execute the same transaction, without properly ignoring the duplicate
GTID. This would lead to duplicate key error or out-of-order GTID error or
similar.

Thanks to Matt Neth for reporting this and giving an easy way to reproduce
the issue.
2015-06-24 16:52:50 +02:00
Sergei Golubchik
a6087e7dc1 MDEV-5309 - RENAME TABLE does not check for existence of the table's engine
fix the test case for ps-protocol
2015-06-17 16:13:02 +02:00
Sergei Golubchik
5a4c5fa211 MDEV-5977 MariaDB 10.0 is not installable on Trusty when "trusty-updates universe" is in sources.list
fix upgrade[2] tests on trusty and utopic: add missing
conflicts/replaces, client-10.0 should conflict/replace client-5.5.

reformat other conflicts/replaces lines to make them easier
to read and merge
2015-06-17 14:18:16 +02:00
Sergei Golubchik
b56ad494b4 MDEV-8287 DROP TABLE suppresses all engine errors
in ha_delete_table()
* only convert ENOENT and HA_ERR_NO_SUCH_TABLE to warnings
* only return real error codes (that is, not ENOENT and
  not HA_ERR_NO_SUCH_TABLE)
* intercept HA_ERR_ROW_IS_REFERENCED to generate backward
  compatible ER_ROW_IS_REFERENCED

in mysql_rm_table_no_locks()
* no special code to handle HA_ERR_ROW_IS_REFERENCED
* no special code to handle ENOENT and HA_ERR_NO_SUCH_TABLE
* return multi-table error ER_BAD_TABLE_ERROR <table list> only
  when there were many errors, not when there were many
  tables to drop (but only one table generated an error)
2015-06-16 23:58:40 +02:00
Sergei Golubchik
66fd45afce MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4
in cmake tests let's treat clang like gcc (same options,
same builtins) in many cases.

* don't check the compiler when
  * testing for -fvisibility=hidden support
  * testing for HAVE_ABI_CXA_DEMANGLE
  * testing for HAVE_GCC_ATOMIC_BUILTINS
  * when removing options with string(replace)
  * when running ${CC} --version (ignore the error instead)
* run ABI checks for clang
* use "canonical" gcc flags for clang
* fix groonga too

Also:

* add cmake detection for gcc __atomic_* builtins. they might be
  supported (__ATOMIC_SEQ_CST is defined), but not for all operand
  sizes. In particular, 64-bit atomic load is problematic on i386
* cache check results for Windows
* remove the test for HAVE_CXXABI_H (HAVE_ABI_CXA_DEMANGLE is
  suffifient)
2015-06-16 23:58:21 +02:00
Sergei Golubchik
7bfda275a1 MDEV-8128 cmake fails to detect boost libraries 2015-06-16 23:58:14 +02:00
Sergei Golubchik
26b0cf4d3f MDEV-8183 Adding option mysqldump --no-data-med
* new mysqldump option
* add more engines to the "external data engines" list
* redo the check to be able to print the list of engines in --help
2015-06-16 23:58:05 +02:00
Sergei Golubchik
569d2f8154 Merge branch 'connect-10.0' into 10.0 2015-06-16 23:57:49 +02:00
Sergei Golubchik
985e430c0f after-merge fixes
in innobase: compilation error on windows
other changes: perfschema merge followup
2015-06-16 23:55:56 +02:00
Jan Lindström
27f0bd7d95 Fix test case innodb.xa_recovery crash on xtradb. 2015-06-16 17:33:21 +03:00
Jan Lindström
96806025eb Fix test failure on main.partition_innodb. 2015-06-16 16:20:55 +03:00
Jan Lindström
ababe047f8 Fix crash on test innodb.innodb-virtual-columns. We should create
only columns really stored to database.
2015-06-16 15:16:53 +03:00
Jan Lindström
b83855a1c7 Fix innochecksum build failure. 2015-06-16 14:55:21 +03:00
Sergei Golubchik
5355972b71 after merge fixes: InnoDB and XtraDB 2015-06-16 12:49:00 +02:00
Sergei Golubchik
ede08808e9 Merge branch 'merge-perfschema-5.6' into 10.0 2015-06-16 12:47:58 +02:00