Commit graph

6520 commits

Author SHA1 Message Date
Sergei Golubchik
76a262cdf8 remove my_hash_const_element(), use Hash_set in C++ code 2017-03-31 19:22:19 +02:00
Sergei Petrunia
5210c69e71 Merge 10.2 into bb-10.2-mariarocks 2017-03-31 01:14:00 +03:00
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
Sergei Golubchik
09a2107b1b Merge branch '10.0' into 10.1 2017-03-21 19:20:44 +01:00
Vladislav Vaintroub
66905f6dcb Fix several compile warnings on Windows 2017-03-17 08:56:57 +00:00
Sergei Golubchik
2c2bd8c155 MDEV-12261 build failure without P_S
restore mysql_file_delete_with_symlink() but let it use
new my_handler_delete_with_symlink() mysys helper.
2017-03-15 17:48:30 +01:00
Sergei Petrunia
5b30c7896e Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks 2017-03-11 20:12:15 +00:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergei Golubchik
051851b9a6 base64 service 2017-03-10 18:21:27 +01:00
Sergei Golubchik
6cddd12ad6 make sql_udf.cc to shorten dlerror() messages
just as sql_plugin.cc does
2017-03-10 18:21:26 +01:00
Marko Mäkelä
ad0c218a44 Merge 10.0 into 10.1
Also, implement MDEV-11027 a little differently from 5.5 and 10.0:

recv_apply_hashed_log_recs(): Change the return type back to void
(DB_SUCCESS was always returned).

Report progress also via systemd using sd_notifyf().
2017-03-09 08:53:08 +02:00
Vicențiu Ciorbaru
fc0a6dd57f Merge branch '5.5' into 10.0 2017-03-08 12:21:13 +02:00
Vicențiu Ciorbaru
f65c9f825d mysql_client_test_nonblock fails when compiled with clang
mysql_client uses some inline assembly code to switch thread stacks.
This works, however tools that perform backtrace get confused to fix
this we write a specific constant to signify bottom of stack. This
constant is needed when compiling with CLang as well.
2017-03-08 11:56:09 +02:00
Marko Mäkelä
89d80c1b0b Fix many -Wconversion warnings.
Define my_thread_id as an unsigned type, to avoid mismatch with
ulonglong.  Change some parameters to this type.

Use size_t in a few more places.

Declare many flag constants as unsigned to avoid sign mismatch
when shifting bits or applying the unary ~ operator.

When applying the unary ~ operator to enum constants, explictly
cast the result to an unsigned type, because enum constants can
be treated as signed.

In InnoDB, change the source code line number parameters from
ulint to unsigned type. Also, make some InnoDB functions return
a narrower type (unsigned or uint32_t instead of ulint;
bool instead of ibool).
2017-03-07 19:07:27 +02:00
klemens
7be541f281 spelling fixes 2017-03-07 13:38:06 +04:00
Vicențiu Ciorbaru
606a4a4847 Post MDEV-11902 Fix test failures in maria and myisam storage engines
my_readline can fail due to missing file. Make my_readline report this
condition separately so that we can catch it and report an appropriate
error message to the user.
2017-03-03 20:12:48 +02:00
Marko Mäkelä
adc91387e3 Merge 10.0 into 10.1 2017-03-03 13:27:12 +02:00
Vicențiu Ciorbaru
1acfa942ed Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
Monty
c5e25c8b40 Added a separate lock for start/stop/reset slave.
This solves some possible dead locks when one calls stop slave while slave
is starting.
2017-02-28 16:10:46 +01:00
Monty
e65f667bb6 MDEV-9573 'Stop slave' hangs on replication slave
The reason for this is that stop slave takes LOCK_active_mi over the
whole operation while some slave operations will also need LOCK_active_mi
which causes deadlocks.

Fixed by introducing object counting for Master_info and not taking
LOCK_active_mi over stop slave or even stop_all_slaves()

Another benefit of this approach is that it allows:
- Multiple threads can run SHOW SLAVE STATUS at the same time
- START/STOP/RESET/SLAVE STATUS on a slave will not block other slaves
- Simpler interface for handling get_master_info()
- Added some missing unlock of 'log_lock' in error condtions
- Moved rpl_parallel_inactivate_pool(&global_rpl_thread_pool) to end
  of stop_slave() to not have to use LOCK_active_mi inside
  terminate_slave_threads()
- Changed argument for remove_master_info() to Master_info, as we always
  have this available
- Fixed core dump when doing FLUSH TABLES WITH READ LOCK and parallel
  replication. Problem was that waiting for pause_for_ftwrl was not done
  when deleting rpt->current_owner after a force_abort.
2017-02-28 16:10:46 +01:00
Sergei Golubchik
d72dbb4122 bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete()
calls with already resolved paths, or a safe high-level function
my_handler_delete_with_symlink(), like MyISAM and Aria already do.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
93cb0246b8 race-condition safe implementation of mi_delete_table/maria_delete_table 2017-02-27 12:35:10 +01:00
Sergei Golubchik
6d50324558 support MY_NOSYMLINKS in my_delete() 2017-02-27 12:35:10 +01:00
Sergei Golubchik
b27fd90ad3 MDEV-11902 mi_open race condition
TOCTOU bug. The path is checked to be valid, symlinks are resolved.
Then the resolved path is opened. Between the check and the open,
there's a window when one can replace some path component with a
symlink, bypassing validity checks.

Fix: after we resolved all symlinks in the path, don't allow open()
to resolve symlinks, there should be none.

Compared to the old MyISAM/Aria code:
* fastpath. Opening of not-symlinked files is just one open(),
  no fn_format() and lstat() anymore.
* opening of symlinked tables doesn't do fn_format() and lstat() either.
  it also doesn't to realpath() (which was lstat-ing every path
  component), instead if opens every path component with O_PATH.
* share->data_file_name stores realpath(path) not readlink(path). So,
  SHOW CREATE TABLE needs to do lstat/readlink() now (see ::info()),
  and certain error messages (cannot open file "XXX") show the real
  file path with all symlinks resolved.
2017-02-27 12:35:10 +01:00
Sergei Golubchik
d78d0d459d cleanup: NO_OPEN_3 was never defined 2017-02-27 12:35:10 +01:00
Sergei Golubchik
c826ac9d53 cleanup: mysys_test_invalid_symlink
Remove maria_test_invalid_symlink() and myisam_test_invalid_symlink(),
introduce mysys_test_invalid_symlink(). Other engines might need it too
2017-02-27 12:35:10 +01:00
Sergei Golubchik
24d8bc707a cleanup: my_register_filename()
Don't let my_register_filename() fail because strdup() failed. Better to
have NULL for a filename, then to fail the already successful open().

Filenames are only used for error reporting and there was already code
to ignore OOMs (my_fdopen()) and to cope with missing filenames
(my_filename()).
2017-02-27 12:35:10 +01:00
Sergei Golubchik
3cba74e032 cleanup: fn_format, remove dead code
my_realpath() ignores MY_xxx flags anyway
2017-02-27 12:35:10 +01:00
Vicențiu Ciorbaru
d474642254 MDEV-10092: Server crashes in in ha_heap::rnd_pos / Table_read_cursor::get_next
The bug was caused by several issues.
2 problems in seek_io_cache. Due to wrong offsets used, we would end up
seeking way too much (first change), or over the intended seek point
(second change). Fixing it requires correctly detecting available data
in buffer (first change), and not using "IO_SIZE alligned" reads. The
second is needed because _my_b_cache_read adjusts the pos_in_file itself
based on read_pos and read_end. Pretending buffer is empty when we want
to force a read will aleviate this problem.

Secondly, the big-table cursors didn't repect the interface definitions
of always returning the rownumber that Table_read_cursor::fetch() would activate.

At the same time, next(), prev() and move_to() should not perform any
row activation.
2017-02-15 14:09:27 +02:00
Sergei Golubchik
2195bb4e41 Merge branch '10.1' into 10.2 2017-02-10 17:01:45 +01:00
Vladislav Vaintroub
5875633c2a MDEV-11901 : MariaRocks on Windows
fixed compilation, disabled unix-only tests (the ones that use bash
etc).

Changed plugin library name to ha_rocksdb.dll/so
2017-02-01 21:27:13 +00:00
Monty
5c9baf54e7 Fix for memory leak in applications, like QT,that calls
my_thread_global_init() + my_thrad_global_end() repeatadily.
This caused THR_KEY_mysys to be allocated multiple times.

Deletion of THR_KEY_mysys was originally in my_thread_global_end() but was
moved to my_end() as DBUG uses THR_KEY_mysys and DBUG is released after
my_thread_global_end() is called.

Releasing DBUG before my_thread_global_end() and move THR_KEY_mysys back
into my_thread_global_end() could be a solution, but as safe_mutex and other
things called by my_thread_global_end is using DBUG it may not be completely
safe.

To solve this, I used the simple solution to add a marker that THR_KEY_mysys
is created and not re-create it in my_thread_global_init if it already
exists.
2017-01-27 16:46:26 +02:00
Marko Mäkelä
f1f8ebc325 Merge 10.0 into 10.1 2017-01-26 23:40:11 +02:00
Sachin Setiya
18ef02b04d MDEV-4774 Strangeness with max_binlog_stmt_cache_size Settings
Problem:- When setting max_binlog_stmt_cache_size=18446744073709547520
from either command line or .cnf file, server fails to start.

Solution:- Added one more function eval_num_suffix_ull , which uses
strtoull to get unsigned ulonglong from string. And getopt_ull calls this
function instead of eval_num_suffix. Also changed previous eval_num_suffix to
eval_num_suffix_ll to remain consistent.
2017-01-20 21:33:36 +05:30
Marko Mäkelä
b05bf8ff0f Merge 10.1 to 10.2.
Most notably, this includes MDEV-11623, which includes a fix and
an upgrade procedure for the InnoDB file format incompatibility
that is present in MariaDB Server 10.1.0 through 10.1.20.

In other words, this merge should address
MDEV-11202 InnoDB 10.1 -> 10.2 migration does not work
2017-01-19 12:06:13 +02:00
Vicențiu Ciorbaru
7b44c31be8 Merge remote-tracking branch 'origin/10.1' into 10.1
Extra merge due to more extra commits during merge process
2017-01-16 12:18:21 +02:00
Vicențiu Ciorbaru
8e15768731 Merge branch '10.0' into 10.1 2017-01-16 03:18:14 +02:00
Sergei Golubchik
1282eb694c cleanup: make malloc_size_cb_func always defined 2017-01-15 07:41:13 +01:00
Vicențiu Ciorbaru
4f53384678 Merge branch 'bb-10.0-vicentiu' into 10.0
Extra merge commit due to intermediate commits pushed to 10.0 while
merge was done.
2017-01-12 03:37:35 +02:00
Sergei Golubchik
ed008a74cf Make atomic writes general
- Atomic writes are enabled by default
- Automatically detect if device supports atomic write and use it if
  atomic writes are enabled
- Remove ATOMIC WRITE options from CREATE TABLE
  - Atomic write is a device option, not a table options as the table may
    crash if the media changes
- Add support for SHANNON SSD cards
2017-01-11 09:18:35 +02:00
Monty
ed0bc17bee Removed usage of my_hash_search() with uninitialized HASH.
- Not documented on intened usage
- Extra checking takes time for all HASH usage
2017-01-11 09:18:35 +02:00
Monty
e80ad58de8 Improve mysys/hash by caching hash_nr
This is done without using any additional memory
Added internal test case

This is similar to MDEV-7716
2017-01-11 09:18:35 +02:00
Marko Mäkelä
f27ca6f667 Merge 10.1 into 10.2 2017-01-10 14:39:28 +02:00
Marko Mäkelä
5044dae239 Merge 10.0 into 10.1 2017-01-10 14:30:11 +02:00
Vladislav Vaintroub
eaf6b053b8 MDEV-11087 Search path for my.ini is wrong for default installation
Add <install_root>/data/my.ini to the search path -  this my.ini location
is used since MariaDB 5.2
2017-01-06 16:25:25 +01:00
vicentiu
e9aed131ea Merge remote-tracking branch 'origin/5.5' into 10.0 2017-01-06 17:09:59 +02:00
Sergei Golubchik
f4d12c1d3f MDEV-11676 Starting service with mysqld_safe_helper fails in SELINUX "enforcing" mode
correct the error message in case of setuid/setgid failures
2017-01-04 13:38:03 +01:00
Sergei Petrunia
31b2237c68 Merge branch '10.2' of github.com:MariaDB/server into 10.2-mariarocks
and a few trivial test result updates
2017-01-02 21:09:31 +00:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Sergei Golubchik
c8e49f2f57 move check_user/set_user from mysqld.cc to mysys 2016-12-22 12:25:10 +01:00