Commit graph

172503 commits

Author SHA1 Message Date
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
Monty
e40bc65933 Fixed memory loss detected on P8. This can happen when we call after_flush but never call after_rollback() or after_commit().
The old code used pthread_setspecific() to store temporary data used by the thread.
This is not safe when used with thread pool, as the thread may change for the transaction.

The fix is to save the data in THD, which is guaranteed to be properly freed.
I also fixed the code so that we don't do a malloc() for every transaction.
2015-07-25 15:15:52 +03:00
Monty
7115341473 Fixed warnings and errors found by buildbot
field.cc
- Fixed warning about overlapping memory copy (backport from 10.0)

Item_subselect.cc
- Fixed core dump in main.view
- Problem was that thd->lex->current_select->master_unit()->item was not set, which caused crash in maxr_as_dependent

sql/mysqld.cc
- Got error on shutdown as we where freeing mutex before all THD objects was freed
  (~THD uses some mutex). Fixed by during shutdown freeing THD inside mutex.

sql/log.cc
- log_space_lock and LOCK_log where locked in inconsistenly. Fixed by not having a log_space_lock around purge_logs.

sql/slave.cc
- Remove unnecessary log_space_lock
- Move cond_broadcast inside lock to ensure we don't miss the signal
2015-07-25 15:15:52 +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
Sergey Vojtovich
35a019837e MDEV-5096 - Wrong error message on attempt to kill somebody else's query ID
Attempting to kill query owned by different user now returns better error:
"You are not owner of query N" instead of "You are not owner of thread N".
2015-07-24 20:59:50 +04:00
Sergei Golubchik
d517886482 Merge branch 'bb-10.1-serg' into 10.1 2015-07-23 15:48:26 +02: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
Sergei Golubchik
26f249f6db compilation failures on Windows 2015-07-23 10:55:24 +02:00
Sergei Golubchik
0ae8bae98f fix for 32-bit tests 2015-07-22 18:46:36 +02:00
Olivier Bertrand
4efcc35a31 Fix (?) retrieving integer arguments in JSON UDF's
modified:   storage/connect/jsonudf.cpp
2015-07-22 13:21:55 +02: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
Jan Lindström
53623d932a MDEV-8522: InnoDB: Assertion failure in file fil0fil.cc line 475
Analysis: In fil_crypt_space_needs_rotation we first make sure that
tablespace is found and then separately that it is normal tablespace.
Thus, tablespace could be dropped between these two functions calls.

Fix: If space is not found from fil_system return tablespace type
ULINT_UNDEFINED and naturally do not continue rotating space.
2015-07-22 08:42:52 +03:00
Jan Lindström
62b5a56191 MDEV-8501: encryption.create_or_replace fails in buildbot on P8 builders
Analysis: There is race between drop table and encryption threads that
could cause encryption thread to enter mutex that has been already
released.

Fix: When destroying crypt_data first enter the mutex and set crypt data
unavailable, then release the memory and clean up the data. This should
make the race more unprobable. Additionally, added big_test for
create_or_replace as it could fail testcase timeout
if you have slow I/O (tested that testcase passes with --mem).
2015-07-21 12:51:14 +03:00
Jan Lindström
7a9670218b MDEV-8474: InnoDB sets per-connection data unsafely
Analysis: At check_trx_exists function InnoDB allocates
a new trx if no trx is found from thd but this newly
allocated trx is not registered to thd. This is unsafe,
because nothing prevents InnoDB plugin from being uninstalled
while there's active transaction. This can cause crashes, hang
and any other odd behavior. It may also corrupt stack, as
functions pointers are not available after dlclose.

Fix: The fix is to use thd_set_ha_data() when
manipulating per-connection handler data. It does appropriate
plugin locking.
2015-07-21 12:12:58 +03:00
Sergei Golubchik
3ff9634b43 MDEV-8508 mroonga fails embedded tests in 10.1
as a workaround until the bug is fixed
don't run mroonga tests in --embedded mode by default
2015-07-20 20:28:32 +02:00
Sergei Golubchik
3d4c69d224 compiler warning
WARN_DEPRECATED_NO_REPLACEMENT(NULL, ...) was causing a warning,
because it expanded into NULL->variables.errmsgs[...]
2015-07-20 19:47:46 +02: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
Sergei Golubchik
82c6b259a5 Merge https://github.com/Kentoku/MariaDB/tree/10.1 into 10.1 2015-07-20 19:07:59 +02:00
Sergei Golubchik
e35fd20910 Null-merge branch 'github/10.0-galera' into 10.1
because the actual merge was already done in
dced5146bd
as a patch
2015-07-20 18:14:31 +02: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
Nirbhay Choubey
af2f7ce3f9 MDEV-8464 : ALTER VIEW not replicated in some cases
In galera, like other DDLs, CREATE/ALTER VIEW commands are recreated
and replicated during parsing. The ALGORITHM clause is internally set
to VIEW_ALGORITHM_INHERIT if its not explicitly specified by the user.
But since its not a valid type to be used in a command, it leads to an
assertion failure. The solution is to not include the ALGORITHM clause
in the command if its not explicitly specified (or INHERIT).
2015-07-19 22:51:19 -04:00
Nirbhay Choubey
6d3bd6588e MDEV-8492: Windows builds fail on current 10.1
In non-wsrep builds, wsrep_running_threads should be defined to (0).
2015-07-19 21:33:12 -04:00
Elena Stepanova
c57edf3b9a MDEV-8500 sys_vars.sysvars_innodb '32bit,xtradb' fails
The version in sysvars_innodb,32bit,xtradb.rdiff was not updated
2015-07-20 00:28:22 +03:00
Kristian Nielsen
7046788448 Fix build failures. 2015-07-19 10:31:24 +02:00
Kristian Nielsen
40215a9e79 Merge MDEV-8496 into 10.0 2015-07-19 09:31:02 +02:00
Kristian Nielsen
13dbb6fa9e Merge MDEV-8496 into 10.1 2015-07-19 09:30:36 +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
Elena Stepanova
d258f5ff04 MDEV-8495 encryption.innodb_first_page fails sporadically in buildbot
The test did not wait until the server shuts down
2015-07-17 19:20:50 +03:00
Monty
a63d873861 Merge branch '5.5' of github.com:MariaDB/server into 5.5 2015-07-17 00:07:01 +03:00
Monty
00d3b20fbb MDEV-8432 Slave cannot replicate signed integer-type values with high bit set to 1
The fix is that if the slave has a different integer size than
the master, then they will assume the master has the same signed/unsigned modifier
as the slave.

This means that one can safely change a coon the slave an int to a bigint
or an unsigned int to an unsigned int.  Changing an unsigned int to an
signed bigint will cause replication failures when the high bit of the
unsigned int is set.

We can't give an error if the signess is different on the master and slave
as the binary log doesn't contain the signess of the column on the master.
2015-07-17 00:06:27 +03:00
Monty
44de090a5f MDEV-8432 Slave cannot replicate signed integer-type values with high bit set to 1
The fix is that if the slave has a different integer size than
the master, then they will assume the master has the same signed/unsigned modifier
as the slave.

This means that one can safely change a coon the slave an int to a bigint
or an unsigned int to an unsigned int.  Changing an unsigned int to an
signed bigint will cause replication failures when the high bit of the
unsigned int is set.

We can't give an error if the signess is different on the master and slave
as the binary log doesn't contain the signess of the column on the master.
2015-07-17 00:02:25 +03: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
Monty
0ad00c66d2 Fix for MySQL bug #77448 Inconsistent handling of RAND() in WHERE and HAVING
Problem was that for queries of type:

select rand() r, rand()  p, rand() = rand() from a having r = p

The optimizer thought that r = p was same as rand() = rand() and this would always be true.

The problem was that when testing if two expressions are equal, we didn't take into account no determinstic functions.

The fix is to not compare non deterministic functions as equal.
2015-07-16 10:36:58 +03:00
Monty
872a953b22 MDEV-8469 Add RESET MASTER TO x to allow specification of binlog file nr
Other things:
- Avoid calling init_and_set_log_file_name() when opening binary log.
- Remove newlines early when reading from index file.
- Ensure that reset_logs() will work even if thd is 0 (Can happen on startup)
- Added thd to sart_slave_threads() for better error handling.
2015-07-16 10:36:58 +03:00
Nirbhay Choubey
df0498fd76 Update sys_vars.sys_vars_wsrep result. 2015-07-14 21:38:17 -04:00
Nirbhay Choubey
ee9bdcf79a Binlog SE doesn't implement abort_transaction(), so skip warning. 2015-07-14 17:33:22 -04:00
Nirbhay Choubey
e204116734 Check supress_my_ok before sending Ok packet (logic lost during merge). 2015-07-14 17:21:35 -04:00
Nirbhay Choubey
0e2ce3b745 Allow binlog row image column marking even for wsrep binlog emulation. 2015-07-14 17:16:28 -04:00
Nirbhay Choubey
dd4d81ddfd Update read_pos after reading from the cache. 2015-07-14 16:58:38 -04:00
Nirbhay Choubey
dced5146bd Merge branch '10.0-galera' into 10.1 2015-07-14 16:05: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
Alexander Barkov
75931feabe MDEV-8362 dash '-' is not recognized in charset armscii8 on select where query 2015-07-14 12:00:05 +04: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
Alexander Barkov
657f8a8d60 MDEV-8456 Dead code in Item_cond::fix_fields() and Item_func_between::fix_fields() 2015-07-13 13:16:14 +04: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