Commit graph

6945 commits

Author SHA1 Message Date
Sergei Golubchik
0375f2e273 MDEV-12144 Signal 6 crash corrupts ibd files
Avoid using STDERR_FILENO. The server uses freopen(stderr),
so stderr can be on any file descriptor.
2017-07-15 08:44:14 +02:00
Marko Mäkelä
57fea53615 Merge bb-10.2-ext into 10.3 2017-07-07 12:39:43 +03:00
Alexander Barkov
8b2c7c9444 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-07-07 12:43:10 +04:00
Sergei Golubchik
f6633bf058 Merge branch '10.1' into 10.2 2017-07-05 19:08:55 +02:00
Alexander Barkov
3b9273d203 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-07-05 17:43:32 +04:00
Alexander Barkov
5c0df0e4a8 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-07-04 15:31:25 +04:00
Vicențiu Ciorbaru
9003869390 Simplify IO_CACHE by removing current_pos and end_pos as self-references
These self references were previously used to avoid having to check the
IO_CACHE's type. However, a benchmark shows that on x86 5930k stock,
the type comparison is marginally faster than the double pointer dereference.
For 40 billion my_b_tell calls, the difference is .1 seconds in favor of performing the
type check. (Basically there is no measurable difference)

To prevent bugs from copying the structure using the equals(=) operator,
and having to do the bookkeeping manually, remove these "convenience"
variables.
2017-06-28 15:23:36 +03:00
Vicențiu Ciorbaru
2e335a471c Merge remote-tracking branch '10.0' into 10.1 2017-06-21 16:19:43 +03:00
Marko Mäkelä
2a3fe45dd2 Remove XtraDB
The XtraDB storage engine was already replaced by InnoDB
and disabled in MariaDB Server 10.2. Let us remove it altogether
to avoid dragging dead code around.

Replace some references to XtraDB with references to InnoDB.

rpl_get_position_info(): Remove.

Remove the mysql-test-run --suite=percona, because it only contains
tests specific to XtraDB, many of which were disabled already in
earlier MariaDB versions.
2017-06-21 13:44:16 +03:00
Vicențiu Ciorbaru
8baf9b0c46 Merge remote-tracking branch '5.5' into 10.0 2017-06-20 12:31:17 +03:00
Sergei Golubchik
ded614d7db MDEV-12778 mariadb-10.1 FTBFS on GNU/Hurd due to use of PATH_MAX 2017-06-19 16:34:50 +02:00
Marko Mäkelä
1e3886ae80 Merge bb-10.2-ext into 10.3 2017-06-19 17:28:08 +03:00
Alexander Barkov
765347384a Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-06-15 15:27:11 +04:00
Marko Mäkelä
3d615e4b1a Merge branch 'bb-10.2-ext' into 10.3
This excludes MDEV-12472 (InnoDB should accept XtraDB parameters,
warning that they are ignored). In other words, MariaDB 10.3 will not
recognize any XtraDB-specific parameters.
2017-06-02 09:36:04 +03:00
Sachin Setiya
92209ac6f6 Merge tag 'mariadb-10.0.31' into 10.0-galera
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-05-30 15:28:52 +05:30
Alexander Barkov
9bc3225642 Merge tag 'mariadb-10.2.6' into bb-10.2-ext 2017-05-26 19:32:28 +04:00
Monty
6a779a6d28 Make SEQUENCE working with replication
- Old sequence code forced row based replication for any statements that
  refered to a sequence table. What is new is that row based replication
  is now sequence aware:
   - NEXT VALUE is now generating a short row based event with only
     next_value and round being replicated.
   - Short row based events are now on the slave updated as trough
     SET_VALUE(sequence_name)
   - Full row based events are on the slave updated with a full insert,
     which is practically same as ALTER SEQUENCE.
- INSERT on a SEQUENCE table does now a EXCLUSIVE LOCK to ensure that
  it is logged in binary log before any following NEXT VALUE calls.
- Enable all sequence tests and fixed found bugs
- ALTER SEQUENCE doesn't anymore allow changes that makes the next_value
  outside of allowed range
- SEQUENCE changes are done with TL_WRITE_ALLOW_WRITE. Because of this
  one can generate a statement for MyISAM with both
  TL_WRITE_CONCURRENT_INSERT and TL_WRITE_ALLOW_WRITE. To fix a warning
  I had to add an extra test in thr_lock.c for this.
- Removed UPDATE of SEQUENCE (no need to support this as we
  have ALTER SEQUENCE, which takes the EXCLUSIVE lock properly.
- Removed DBUG_ASSERT() in MDL_context::upgrade_shared_lock. This was
  removed upstream in MySQL 5.6 in 72f823de453.
- Simplified test in decided_logging_format() by using sql_command_flags()
- Fix that we log DROP SEQUENCE correctly.
- Fixed that Aria works with SEQUENCE
2017-05-23 21:12:27 +03:00
Marko Mäkelä
8f643e2063 Merge 10.1 into 10.2 2017-05-23 11:09:47 +03:00
Marko Mäkelä
b61700c221 Merge 10.0 into 10.1 2017-05-23 08:59:03 +03:00
Marko Mäkelä
70505dd45b Merge 10.1 into 10.2 2017-05-22 09:46:51 +03:00
Marko Mäkelä
65e1399e64 Merge 10.0 into 10.1
Significantly reduce the amount of InnoDB, XtraDB and Mariabackup
code changes by defining pfs_os_file_t as something that is
transparently compatible with os_file_t.
2017-05-20 08:41:20 +03:00
Sergei Golubchik
7c03edf2fe MDEV-6262 analyze the coverity report on mariadb
uploaded 10.0, analyzed everything with the Impact=High
(and a couple of Medium)
2017-05-19 20:26:56 +02:00
Marko Mäkelä
13a350ac29 Merge 10.0 into 10.1 2017-05-19 12:29:37 +03:00
Oleksandr Byelkin
648d866150 Fixed typo in the case operator. 2017-05-18 12:24:44 +02:00
Monty
6378c95ee0 Fix that end_bulk_insert() doesn't write to to-be-deleted files
This affected mainly MyISAM and Aria engines.
Also fixed that end_bulk_insert() detects errors from
internal mi_end_bulk_insert() and ma_end_bulk_insert()

- delete_tree() and delete_tree_element() now has an
  extra argument that marks if future calls to
  tree->free should be ignored.
- tree->free changed to function returning int, to be
  able to signal errors.
- Restored deleting flag in MyISAM that was accidently
  disabled in mi_extra(PREPARE_FOR_DROP)
2017-05-17 00:34:48 +03:00
Sergei Golubchik
52aa200919 MDEV-12420 max_recursive_iterations did not prevent a stack-overflow and segfault
post-review fixes
* move pcre-specific variable out of mysys
* don't use current_thd
* move a commonly used macro to my_sys.h
* remove new sysvar
2017-05-15 22:23:10 +02:00
Daniel Black
602b5e4c49 WIP: global readonly variable pcre_frame_size 2017-05-15 22:23:10 +02:00
Nisha Gopalakrishnan
b615c3dff8 BUG#25451091:CREATE TABLE DATA DIRECTORY / INDEX DIRECTORY
SYMLINK CHECK RACE CONDITIONS

ANALYSIS:
=========
A potential defect exists in the handling of CREATE
TABLE .. DATA DIRECTORY/ INDEX DIRECTORY which gives way to
the user to gain access to another user table or a system
table.

FIX:
====
The lstat and fstat output of the target files are now
stored which help in determining the identity of the target
files thus preventing the unauthorized access to other
files.
2017-05-12 09:47:48 +05:30
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
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
Sachin Setiya
1c14280048 Merge tag 'mariadb-5.5.56' into 5.5-galera 2017-05-03 10:16:15 +05:30
Sergei Golubchik
e74f2e2b86 Merge branch '10.0' 10.1 2017-04-28 20:19:32 +02:00
Sergei Golubchik
8d75a7533e Merge branch '5.5' into 10.0 2017-04-21 18:34:06 +02:00
Sergei Golubchik
4fe65ca33a MDEV-12230 include/my_sys.h:600:43: error: unknown type name ‘PSI_file_key’" when -DWITHOUT_SERVER=1
cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
2017-04-20 16:36:23 +02:00
Sergei Golubchik
036b689f18 MDEV-12310 openat(<directory>, ...O_EXEC) fails on Illumos / Solaris
it could be
* O_SEARCH on Illumos
* O_EXEC on FreeBSD
* O_PATH on Linux
ugh
2017-04-20 16:36:22 +02:00
Sachin Setiya
5ca8121292 Merge tag 'mariadb-5.5.55' into bb-5.5-sachin-merge
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-18 12:01:56 +05:30
Alexander Barkov
3edfe79712 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-04-07 20:10:18 +04:00
Monty
17a87d6063 MDEV-10139 Support for SEQUENCE objects
Working features:
CREATE OR REPLACE [TEMPORARY] SEQUENCE [IF NOT EXISTS] name
    [ INCREMENT [ BY | = ] increment ]
    [ MINVALUE [=] minvalue | NO MINVALUE ]
    [ MAXVALUE [=] maxvalue | NO MAXVALUE ]
    [ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ]
    ENGINE=xxx COMMENT=".."
SELECT NEXT VALUE FOR sequence_name;
SELECT NEXTVAL(sequence_name);
SELECT PREVIOUS VALUE FOR sequence_name;
SELECT LASTVAL(sequence_name);

SHOW CREATE SEQUENCE sequence_name;
SHOW CREATE TABLE sequence_name;
CREATE TABLE sequence-structure ... SEQUENCE=1
ALTER TABLE sequence RENAME TO sequence2;
RENAME TABLE sequence TO sequence2;
DROP [TEMPORARY] SEQUENCE  [IF EXISTS] sequence_names

Missing features
- SETVAL(value,sequence_name), to be used with replication.
- Check replication, including checking that sequence tables are marked
  not transactional.
- Check that a commit happens for NEXT VALUE that changes table data (may
  already work)
- ALTER SEQUENCE. ANSI SQL version of setval.
- Share identical sequence entries to not add things twice to table list.
- testing insert/delete/update/truncate/load data
- Run and fix Alibaba sequence tests (part of mysql-test/suite/sql_sequence)
- Write documentation for NEXT VALUE / PREVIOUS_VALUE
- NEXTVAL in DEFAULT
  - Ensure that NEXTVAL in DEFAULT uses database from base table
- Two NEXTVAL for same row should give same answer.
- Oracle syntax sequence_table.nextval, without any FOR or FROM.
- Sequence tables are treated as 'not read constant tables' by SELECT; Would
  be better if we would have a separate list for sequence tables so that
  select doesn't know about them, except if refereed to with FROM.

Other things done:
- Improved output for safemalloc backtrack
- frm_type_enum changed to Table_type
- Removed lex->is_view and replaced with lex->table_type. This allows
  use to more easy check if item is view, sequence or table.
- Added table flag HA_CAN_TABLES_WITHOUT_ROLLBACK, needed for handlers
  that want's to support sequences
- Added handler calls:
 - engine_name(), to simplify getting engine name for partition and sequences
 - update_first_row(), to be able to do efficient sequence implementations.
 - Made binlog_log_row() global to be able to call it from ha_sequence.cc
- Added handler variable: row_already_logged, to be able to flag that the
  changed row is already logging to replication log.
- Added CF_DB_CHANGE and CF_SCHEMA_CHANGE flags to simplify
  deny_updates_if_read_only_option()
- Added sp_add_cfetch() to avoid new conflicts in sql_yacc.yy
- Moved code for add_table_options() out from sql_show.cc::show_create_table()
- Added String::append_longlong() and used it in sql_show.cc to simplify code.
- Added extra option to dd_frm_type() and ha_table_exists to indicate if
  the table is a sequence. Needed by DROP SQUENCE to not drop a table.
2017-04-07 18:09:56 +04:00
Alexander Barkov
3d004de31d Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-04-05 14:47:06 +04:00
Alexander Barkov
15d98ddc2a Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-04-03 17:35:55 +04:00
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
Alexander Barkov
ab96710bb7 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-03-24 18:48:40 +04:00
Sergei Golubchik
09a2107b1b Merge branch '10.0' into 10.1 2017-03-21 19:20:44 +01:00
Sachin Setiya
9cf499724f Merge branch '10.0' into bb-10.0-galera 2017-03-20 18:11:56 +05:30
Vladislav Vaintroub
66905f6dcb Fix several compile warnings on Windows 2017-03-17 08:56:57 +00:00
Sachin Setiya
f66395f7c0 Merge tag 'mariadb-10.0.30' into bb-sachin-10.0-galera-merge
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-03-17 02:05:20 +05:30
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
Alexander Barkov
fa2a3480c4 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-03-09 00:02:13 +04: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
Alexander Barkov
b5d7fff687 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-02-27 12:41:37 +04: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
Alexander Barkov
11e9b25e8e Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-02-06 10:19:19 +04: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
Nirbhay Choubey
ee8b5c305a Merge tag 'mariadb-10.0.29' into 10.0-galera 2017-01-13 13:53:59 -05: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
Alexander Barkov
86209c7304 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2016-12-30 15:43:08 +04:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Nirbhay Choubey
901f7ebcf3 Merge tag 'mariadb-5.5.54' into 5.5-galera 2016-12-27 21:39:05 -05:00
Sergei Golubchik
c8e49f2f57 move check_user/set_user from mysqld.cc to mysys 2016-12-22 12:25:10 +01:00
Alexander Barkov
ab774974d6 Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2016-12-17 22:06:55 +04:00
Sergey Vojtovich
8f9999b5fc MDEV-11212 - Clean-up MariaDB atomic operations
Removed my_atomic_initialize(): it doesn't make sense anymore.
2016-12-13 16:38:20 +04:00
Sergei Golubchik
d137b4dbba MDEV-5800 MyISAM support for indexed vcols
* don't issue an error for ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
* support keyread on vcols
* callback into the server to compute vcol values from mi_check/mi_repair
* DMLs just work. Automatically.
2016-12-12 20:27:36 +01:00
Sergei Golubchik
590d473760 cleanup: my_printf_error(ER_xxx, ER(ER_xxx), ... )
only use my_print_error when the error message is not
ER(error_code)
2016-12-12 20:27:28 +01:00
Sergei Golubchik
e336fc07bd fix stack traces when linking with libbfd
also, return different values for different errors in my_addr_resolve()
2016-12-12 20:27:20 +01:00
kevg
780db8e252 fix build and some warnings 2016-11-24 17:36:02 +03:00
Alexander Barkov
0259b3cbbe MDEV-11255 LDML: allow defining 2-level UCA collations 2016-11-08 20:57:19 +04:00
Nirbhay Choubey
5db2195a35 Merge tag 'mariadb-10.0.28' into 10.0-galera 2016-10-28 15:50:13 -04:00
Vladislav Vaintroub
8f5e3e2a34 Fix escaping '\' in a string constant. 2016-10-22 11:06:26 +00:00
Sergei Petrunia
274e5be194 MariaRocks: port my_hash_const_element
"Add new function my_hash_const_element(), the const equivalent of
my_hash_element()" - comes from facebook/mysql-5.6,
7c869d34b9fa2262b941efd6363a260b7c37948f
2016-10-16 11:00:07 +00:00
Vladislav Vaintroub
057c560ee4 MDEV-10943 . Workaround linker error on Linux. Linux does not actually use __bss_start, put __bss_start into #ifndef __linux__ section 2016-10-15 02:27:28 +02:00
Nirbhay Choubey
308c666b60 Merge remote-tracking branch 'origin/5.5' into 5.5-galera 2016-10-14 10:57:07 -04:00
Sergei Golubchik
2ede40e67e Merge branch '10.0' into 10.1 2016-09-29 12:59:51 +02:00
Sergei Golubchik
a3f11f7549 Merge branch '5.5' into 10.0 2016-09-29 12:31:46 +02:00
Sergei Golubchik
735a4a17c2 MDEV-10508 Mariadb crash on out of disk space during dump import
update info->write_end and info->write_pos together, with no
"return on error" in between, otherwise write_end might end up being
smaller than write_pos
2016-09-28 17:59:11 +02:00
Sergei Golubchik
66d9696596 Merge branch '10.0' into 10.1 2016-09-28 17:55:28 +02:00
Vladislav Vaintroub
b38d3c3d8a MDEV-10907 MTR and server writes can interleave in the error log
Ensure atomic appends to the error log by using CreateFile with
FILE_APPEND_DATA flag to open error log file (both MTR and server)
2016-09-27 12:34:15 +00:00
Vladislav Vaintroub
f1aefd9d75 MDEV-10823 Certain unicode characters in hostname prevent mysqld from starting
Server uses gethostname() for the default base name for pid/log files.
If a character is not representable in current ANSI encoding, gethostname
replaces it with question mark. Thus, generated log file name would also
contain a question mark. However, Windows forbids certain characters in
filenames, among them '?'.

This is described in MSDN article https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
At attempts to create the file via freopen() fails, thus server would not
be able to start.

The fix is to verify hostname and fall back to  "mysql", if
invalid characters are found.
2016-09-27 10:54:01 +00:00
Sergei Golubchik
77ce4ead81 Merge branch '5.5' into 10.0 2016-09-27 09:21:19 +02:00
Sergei Petrunia
047963922c MDEV-9736: Window functions: multiple cursors to read filesort result
Add support for having multiple IO_CACHEs with type=READ_CACHE to share
the file they are reading from.
Each IO_CACHE keeps its own in-memory buffer. When doing a read or seek
operation on the file, it notifies other IO_CACHEs that the file position
has been changed.

Make Rowid_seq_cursor use cloned IO_CACHE when reading filesort result.
2016-09-24 15:12:34 +02:00
Alexander Barkov
0f8a1a314d MDEV-10877 xxx_unicode_nopad_ci collations 2016-09-23 14:19:07 +04:00
Sergei Golubchik
59d51f0c12 Merge branch '10.2' into bb-10.2-connector-c-integ-subm 2016-09-21 12:54:56 +02:00
Nirbhay Choubey
81c13acfb3 Merge tag 'mariadb-5.5.52' into 5.5-galera 2016-09-19 12:12:33 -04:00
Sergei Golubchik
0aa6817e86 name clash with gnutls on on base64_encode 2016-09-12 17:51:52 +02:00
Sergei Golubchik
ece01ef3dc After-review changes
* remove redundant code
* fix tests
* move declarations and defines where they belong
2016-09-12 17:51:50 +02:00
Sergei Golubchik
347eeefbfc don't use my_copystat in the server
it was supposed to be used in command-line tools only.
Different fix for 4e5473862e:

Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
2016-09-12 16:42:05 +02:00
Sergei Golubchik
06b7fce9f2 Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
Alexander Barkov
ee19806b8e MDEV-9711 NO PAD collations
Based on the patch from Daniil Medvedev (a Google Summer of Code task)
2016-09-06 12:50:02 +04:00
Alexander Barkov
e4f6fd5e12 MDEV-10743 LDML: a new syntax to reuse sort order from another 8bit simple collation 2016-09-06 12:37:11 +04:00
Alexander Barkov
1ca595fbf7 LDML refactoring for "MDEV-9711 NO PAD collations"
- Moving detection of the MY_CS_CSSORT, MY_CS_PUREASCII, MY_CS_NONASCII
  flags of loadable collations from add_collation() in mysys.c
  to my_cset_init_8bit() and my_coll_init_simple() in ctype-simple.c.

- Adding tests that these flags are set properly for loadable collations

- Moving LDML test related *.xml files from mysql-test/std_data/
  to mysql-test/std_data/ldml/, as there will be more *.xml test files
2016-09-03 09:05:56 +04:00
Vladislav Vaintroub
56c4cfe0be MDEV-9293 - Use MariaDB's Connector/C in server 2016-08-25 16:27:57 +02:00
Sergei Golubchik
6b1863b830 Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
Monty
4da2b83af7 Fixed compiler error and some warnings on windows 2016-08-23 15:03:31 +03:00
Vladislav Vaintroub
31a8cf54c8 Revert "MDEV-9293 Connector/C integration"
This reverts commit 7b89b9f510.
2016-08-19 15:46:27 +00:00
Vladislav Vaintroub
7b89b9f510 MDEV-9293 Connector/C integration 2016-08-19 15:27:37 +00:00
Jon Olav Hauglid
033b119121 Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file with chmod/chown. If a user
managed to replace the temporary file before chmod/chown was executed,
it was possible to get an arbitrary file with the privileges of the
mysql user.

This patch fixes the problem by not copying stats from the old
file to the new file. This is not needed as the new file was
created with the correct stats. This fix only changes server
behavior - external utilities such as myisamchk still does
chmod/chown.

No test case provided since the problem involves synchronization
with file system operations.
2016-08-19 09:09:07 +02:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Nirbhay Choubey
38a0def805 Merge tag 'mariadb-5.5.51' into 5.5-galera 2016-08-10 10:34:54 -04:00
Daniel Black
a2c826b6aa MDEV-9872: New Power8 crc32(ieee) optimized functions
These are different from the existing crc32 functions which
where really crc32c.
2016-08-05 11:50:46 +04:00
Sergey Vojtovich
9c2215e022 MDEV-9872 - Add common optimized CRC32 function interface
Move crc32-vpmsum to extra.
Compile static crc32-vpmsum instead of adding sources directly.
Make use of crc32-vpmsum via my_checksum().

Based on contribution by Daniel Black.
2016-08-04 10:45:20 +04:00
Vladislav Vaintroub
141f88d1d5 MDEV-10357 my_context_continue() does not store current fiber on Windows
Make sure current fiber is saved in my_context::app_fiber
in both my_context_spawn() and my_context_continue()
2016-08-03 12:41:38 +00:00
Sergei Golubchik
326a8dcd87 Merge branch '10.0' into 10.1 2016-07-13 12:09:59 +02:00
Vicențiu Ciorbaru
7d4a7d8c58 [MDEV-9127] Crash reporter often fails to show the query that crashed
Addreses are not necessarily between heap_start && heap_end. Malloc
calls using mmap can place pointers outside these bounds. In this case,
we'll warn the user that the query pointer is potentially invalid.
However, we'll attempt to print the data anyway after we're done
printing everything else.
2016-07-12 11:58:20 +03:00
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Sergei Golubchik
3361aee591 Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
Nirbhay Choubey
14d62505d9 Merge tag 'mariadb-10.0.26' into 10.0-galera 2016-06-24 12:01:22 -04:00
Monty
4dc5075860 Fixed compiler warnings and test failures found by buildbot
Fixed ccfilter to detect errors where the column is included in the error message
2016-06-24 02:25:14 +03:00
Nirbhay Choubey
ecdb2b6e86 Merge tag 'mariadb-5.5.50' into 5.5-galera 2016-06-23 12:54:38 -04:00
Sergei Golubchik
c081c978a2 Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
Sergei Golubchik
1d21b22155 MDEV-10001 my_b_seek() may not work correctly after my_b_read() hits EOF
applied the patch from  David Gow
2016-06-15 13:53:19 +02:00
Daniel Black
bfef17bec1 MDEV-9433: [PATCH} cppcheck reported a number of minor coding errors
Fix cppwarning of va_args being opened but not closed.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2016-06-14 19:17:29 +03:00
Daniel Black
0089af8e1c MDEV-9433: [PATCH] cppcheck reported a number of minor coding errors
Fix a bug in testhash.c that caused an out of bounds memory access
when command line parameters specified 0 records to be inserted
in the hashtable.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2016-06-14 19:17:29 +03:00
Sergei Golubchik
ae29ea2d86 Merge branch 'mysql/5.5' into 5.5 2016-06-14 13:55:28 +02:00
Kristian Nielsen
94b47bc5a5 Merge branch 'mdev9991' into mdev9991-10.1 2016-06-08 15:16:39 +02:00
Kristian Nielsen
732e269405 Merge branch 'mdev9991' into mdev9991-10.0 2016-06-08 15:16:24 +02:00
Kristian Nielsen
196d96cc8f Fix compiler check for stack unwind hint
The check inserts a DWARF directive to tell stack unwinding that the
bottom of the (co-routine) stack has been reached. Without this, stack
traces may attempt to continue past the bottom of the stack.

The GCC version check was incorrect, and failed to trigger for GCC
version 5.[0123].
2016-06-08 15:12:44 +02:00
Otto Kekäläinen
effbe7dd7b General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
Sergey Vojtovich
9de6708390 MDEV-9857 - CACHE_LINE_SIZE in innodb should be 128 on POWER
Replaced hard-coded cache line size.

Changes based on Daniel Black's work.
2016-06-07 13:02:31 +04:00
Monty
89685d55d7 Reuse THD for new user connections
- To ensure that mallocs are marked for the correct THD, even if it's
  allocated in another thread, I added the thread_id to the THD constructor
- Added st_my_thread_var to thr_lock_info_init() to avoid a call to my_thread_var
- Moved things from THD::THD() to THD::init()
- Moved some things to THD::cleanup()
- Added THD::free_connection() and THD::reset_for_reuse()
- Added THD to CONNECT::create_thd()
- Added THD::thread_dbug_id and st_my_thread_var->dbug_id. These are needed
  to ensure that we have a constant thread_id used for debugging with a THD,
  even if it changes thread_id (=connection_id)
- Set variables.pseudo_thread_id in constructor. Removed not needed sets.
2016-06-04 09:06:00 +02:00
Vladislav Vaintroub
3a7bc23a16 MDEV-9154 : Remove workarounds (mainly dynamic function loading)
for running obsolete versions of Windows
2016-06-01 20:29:10 +02:00
Alexander Barkov
bc546225c0 Adding collations
utf8mb4_thai_520_w2, ucs2_thai_520_w2, utf16_thai_520_w2, utf32_thai_520_w2
2016-05-30 16:56:29 +04:00
pruet
fb35b9ad07 Multi-level collation in UCA, Thai sorting with contraction for UTF8. 2016-05-26 16:45:50 +07:00
Alexander Barkov
e7ff281d2e MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
Sujatha Sivakumar
ef3f09f0c9 Bug#23251517: SEMISYNC REPLICATION HANGING
Revert following bug fix:

Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS
FULL
Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO
THREAD WAITS FOR DISK SPACE

This fix results in a deadlock between slave IO thread
and SQL thread.

(cherry picked from commit e3fea6c6dbb36c6ab21c4ab777224560e9608b53)
2016-05-16 11:34:20 +02:00
Sujatha Sivakumar
df7ecf64f5 Bug#23251517: SEMISYNC REPLICATION HANGING
Revert following bug fix:

Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS
FULL
Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO
THREAD WAITS FOR DISK SPACE

This fix results in a deadlock between slave IO thread
and SQL thread.
2016-05-13 16:42:45 +05:30
Sergei Golubchik
87e3e67f43 Merge branch '10.0' into 10.1 2016-05-04 15:23:26 +02:00
Nirbhay Choubey
8a1efa1bdd Merge branch '10.0' into 10.0-galera 2016-04-29 16:50:58 -04:00
Monty
fabeab7819 Cleanups
- Avoid some realloc() during startup
- Ensure that file_key_management_plugin frees it's memory early, even if
  it's linked statically.
- Fixed compiler warnings from unused variables and missing destructors
- Fixed wrong indentation
2016-04-28 16:36:02 +03:00
Sergei Golubchik
872649c7ba Merge branch '5.5' into 10.0 2016-04-26 23:05:26 +02:00
Nirbhay Choubey
4f1c1975b5 Merge tag 'mariadb-5.5.49' into 5.5-galera 2016-04-25 11:06:16 -04:00
Sergei Golubchik
9c64735986 MDEV-9748 Include Twin (mysys_err.h is included twice in mysys/my_copy.c) 2016-04-19 11:27:00 +02:00
Sujatha Sivakumar
3a8f43bec7 Bug#22897202: RPL_IO_THD_WAIT_FOR_DISK_SPACE HAS OCCASIONAL
FAILURES

Analysis:
=========
Test script is not ensuring that "assert_grep.inc" should be
called only after 'Disk is full' error is written to the
error log.

Test checks for "Queueing master event to the relay log"
state. But this state is set before invoking 'queue_event'.
Actual 'Disk is full' error happens at a very lower level.
It can happen that we might even reset the debug point
before even the actual disk full simulation occurs and the
"Disk is full" message will never appear in the error log.

In order to guarentee that we must have some mechanism where
in after we write "Disk is full" error messge into the error
log we must signal the test to execute SSS and then reset
the debug point. So that test is deterministic.

Fix:
===
Added debug sync point to make script deterministic.
2016-04-19 11:44:34 +05:30
Vladislav Vaintroub
bddd63cfba fix compile error on Windows, intrduced by previous monty's push 2016-04-06 01:01:09 +02:00
Monty
d0b178fb45 Added new range of MariaDB error messages, starting from 3000
This is done by splitting variables.errmsg and locale.errmsg to
variables.errmsg_extra and locale.errmsg_extra

The ER() macros in unireg.h now looks more complex than before, but this
isn't critical as most usage of them are with constants and the compiler
will remove most of the test code.
2016-04-05 18:00:03 +03:00
Alexander Barkov
3fc6a8b832 MDEV-9811 LOAD DATA INFILE does not work well with gbk in some cases
MDEV-9824 LOAD DATA does not work with multi-byte strings in LINES TERMINATED BY when IGNORE is specified
2016-03-31 14:22:25 +04:00
Alexander Barkov
1d73005bf3 MDEV-8360 Clean-up CHARSET_INFO: strnncollsp: diff_if_only_endspace_difference
- Removing the "diff_if_only_endspace_difference" argument from
  MY_COLLATION_HANDLER::strnncollsp(), my_strnncollsp_simple(),
  as well as in the function template MY_FUNCTION_NAME(strnncollsp)
  in strcoll.ic

- Removing the "diff_if_only_space_different" from ha_compare_text(),
  hp_rec_key_cmp().

- Adding a new function my_strnncollsp_padspace_bin() and reusing
  it instead of duplicate code pieces in my_strnncollsp_8bit_bin(),
  my_strnncollsp_latin1_de(), my_strnncollsp_tis620(),
  my_strnncollsp_utf8_cs().

- Adding more tests for better coverage of the trailing space handling.

- Removing the unused definition of HA_END_SPACE_ARE_EQUAL
2016-03-31 11:04:48 +04:00
Oleksandr Byelkin
2481ed2245 Merge branch '10.1' into 10.2 2016-03-25 10:36:33 +01:00
Oleksandr Byelkin
2cb72dcccb Merge branch '10.0' into 10.1 2016-03-24 09:24:02 +01:00
Oleksandr Byelkin
f6d99a0d8a MDEV-9773: Memory corruption in mariadb_dyncol_unpack
Fixed calculating pointer to memory allocated for names in numeric format in unpacking procedure.
2016-03-24 08:57:41 +01:00
Sergei Golubchik
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
Sergei Golubchik
3b0c7ac1f9 Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
Sergei Golubchik
98ea806207 Merge branch '5.5' into 10.0 2016-03-21 11:54:45 +01:00
Sergei Golubchik
fc2c1e4385 MDEV-9733 Server crashes in lf_pinbox_real_free on replication slaves
don't allocate all the stack, leave some stack for
function calls.

To test I added the following line:
  alloca_size = available_stack_size() - X
at X=4096 or less mysqld crashed, at 8192 mtr test passed.
2016-03-17 21:30:33 +01:00
Nisha Gopalakrishnan
6608f84158 BUG#22594514: HANDLE_FATAL_SIGNAL (SIG=11) IN
UNIQUE::~UNIQUE | SQL/UNIQUES.CC:355

Analysis
========

Enabling the sort_buffer_size with a large value
can cause operations utilizing the sort buffer
like DELETE as mentioned in the bug report to
fail. 5.5 and 5.6 versions reports OOM error
while in 5.7+, the server crashes.

While initializing the mem_root for the sort buffer
tree, the block size for the mem_root is determined
from the 'sort_buffer_size' value. This unsigned
long value is typecasted to unsigned int, hence
it becomes zero. Further block_size computation
while initializing the mem_root results in a very
large block_size value. Hence while trying to
allocate a block during the DELETE operation,
an OOM error is reported. In case of 5.7+, the PFS
instrumentation for memory allocation, overshoots
the unsigned value and allocates a block of just
one byte. While trying to free the block of the
mem_root, the original block_size is used. This
triggers the crash since the server tries to free
unallocated memory.

Fix:
====
In order to restrict usage of such unreasonable
sort_buffer_size, the typecast of block size
to 'unsigned int' is removed and hence reports
OOM error across all versions for sizes
exceeding unsigned int range.
2016-03-17 08:49:37 +05:30
Otto Kekäläinen
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
Sujatha Sivakumar
8361151765 Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS
FULL
Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO
THREAD WAITS FOR DISK SPACE

Problem:
========
Currently SHOW SLAVE STATUS blocks if IO thread waits for
disk space. This makes automation tools verifying
server health block on taking relevant action. Finally this
will create SHOW SLAVE STATUS piles.

Analysis:
=========
SHOW SLAVE STATUS hangs on mi->data_lock if relay log write
is waiting for free disk space while holding mi->data_lock.
mi->data_lock is needed to protect the format description
event (mi->format_description_event) which is accessed by
the clients running FLUSH LOGS and slave IO thread. Note
relay log writes don't need to be protected by
mi->data_lock, LOCK_log is used to protect relay log between
IO and SQL thread (see MYSQL_BIN_LOG::append_event). The
code takes mi->data_lock to protect
mi->format_description_event during relay log rotate which
might get triggered right after relay log write.

Fix:
====
Release the data_lock just for the duration of writing into
relay log.

Made change to ensure the following lock order is maintained
to avoid deadlocks.

data_lock, LOCK_log

data_lock is held during relay log rotations to protect
the description event.
2016-03-01 12:29:51 +05:30
Sergey Vojtovich
d30ae14c24 Fixed compilarion failure on 32bit systems
Compile time assertion "sizeof(struct st_irem) % sizeof(double) == 0" started
to fail on 32bit systems after my_thread_id was changed from ulong to int64.

Fixed by added padding to struct st_irem on 32bit systems.
2016-02-26 15:32:34 +04:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Nirbhay Choubey
0d58323e26 Merge tag 'mariadb-10.0.24' into 10.0-galera 2016-02-23 20:53:29 -05:00
Sergei Golubchik
a5679af1b1 Merge branch '10.0' into 10.1 2016-02-23 21:35:05 +01:00
Sergei Golubchik
271fed4106 Merge branch '5.5' into 10.0 2016-02-15 22:50:59 +01:00
Sergei Golubchik
8f5030ea86 fix my_gethwaddr() for solaris
it caused feedback plugin tests to fail
2016-02-15 12:51:35 +01:00
Vicențiu Ciorbaru
b7dc830274 Fix memory leak when failing to read config file
In the case of error during my_load_defaults, we would not free the
args array.
2016-02-14 18:31:48 +02:00
Nirbhay Choubey
d23bd26bec Merge tag 'mariadb-5.5.48' into 5.5-galera 2016-02-13 18:28:36 -05:00
Sergei Golubchik
f3444df415 Merge branch 'mysql/5.5' into 5.5
reverted about half of commits as either not applicable or
outright wrong
2016-02-09 11:27:40 +01:00
Monty
3d4a7390c1 MDEV-6150 Speed up connection speed by moving creation of THD to new thread
Creating a CONNECT object on client connect and pass this to the working thread which creates the THD.
Split LOCK_thread_count to different mutexes
Added LOCK_thread_start to syncronize threads
Moved most usage of LOCK_thread_count to dedicated functions
Use next_thread_id() instead of thread_id++

Other things:
- Thread id now starts from 1 instead of 2
- Added cast for thread_id as thread id is now of type my_thread_id
- Made THD->host const (To ensure it's not changed)
- Removed some DBUG_PRINT() about entering/exiting mutex as these was already logged by mutex code
- Fixed that aborted_connects and connection_errors_internal are counted in all cases
- Don't take locks for current_linfo when we set it (not needed as it was 0 before)
2016-02-07 10:34:03 +02:00
Sergei Golubchik
c4cb240061 MDEV-9024 Build fails with VS2015
cherry-pick f1daf9ce from 10.0 branch
-------------------------------------

Fix build failures caused by new C runtime library
- isnan, snprintf, struct timespec are now defined, attempt to
redefine them leads
- P_tmpdir, tzname are no more defined
-  lfind() and lsearch() in lf_hash.c had to be renamed,  declaration
conflicts with some C runtime functions with the same name declared in
a header included by stdlib.h

 Also fix couple of annoying warnings :
- remove #define NOMINMAX from config.h to avoid "redefined" compiler
warnings(NOMINMAX is already in compile flags)

- disable incremental linker in Debug as well (feature not used much
and compiler crashes often)

Also simplify package building with Wix, require Wix 3.9 or later
(VS2015 is not compatible with old Wix 3.5/3.6)
2016-02-06 22:41:58 +01:00
Sergei Golubchik
1e361f286b MDEV-4664 mysql_upgrade crashes if root's password contains an apostrophe/single quotation mark
fix dynstr_append_os_quoted() to escape single quotes correctly
for a POSIX shell
2016-02-06 17:57:37 +01:00
Sergei Golubchik
9e4e4121b8 unit test for dynstr_append_os_quoted()
and a trivial cleanup to avoid manually-specified lengths
2016-02-06 17:57:37 +01:00
Monty
b2f8d7b410 Merge branch '10.1' into 10.2
Conflicts:
	VERSION
	cmake/plugin.cmake
	config.h.cmake
	configure.cmake
	plugin/server_audit/server_audit.c
	sql/sql_yacc.yy
2016-02-06 18:14:54 +02:00
Vicențiu-Marian Ciorbaru
be19bba4fb Merge pull request #150 from grooverdan/10.0-my_rnd_cpp
MDEV-9433: mysys/my_rnd.c - remove #ifdef __cplusplus
2016-02-06 12:58:06 +02:00
Vicențiu Ciorbaru
7d39b28093 [MDEV-9468]: Client hangs in my_addr_resolve
Account for timeout of select returning a 0 error code.
2016-01-26 21:42:37 +02:00
Jon Olav Hauglid
a204ce5b3f Bug#21770366 backport bug#21657078 to 5.5 and 5.6
Post-push fix: The problem was that condition variable
timeouts could in some cases (slow machines and/or short
timeouts) be infinite.

When the number of milliseconds to wait is computed, the
end time is computed before the now() time. This can result
in the now() time being later than the end time, leading to
negative timeout. Which after conversion to unsigned becomes
~infinite.

This patch fixes the problem by explicitly checking if we
get negative timeout and then using 0 if this is the case.
2016-01-26 09:18:10 +01:00
Sergei Golubchik
f4faac4d6a Merge branch '10.0' into 10.1 2016-01-25 22:58:57 +01:00
Alexey Botchkov
1793646d78 Merge branch '5.5' into 10.0
Conflicts:
	plugin/server_audit/server_audit.c
2016-01-25 16:37:08 +04:00
Daniel Black
a7a49886e1 mysys/my_rnd.c - remove #ifdef __cplusplus 2016-01-19 16:53:13 +11:00
Vicențiu Ciorbaru
275f7d7d82 Remove warning in my_addr_resolve
ISO C90 does not allow mixed declarations and code.
2016-01-17 22:33:36 +02:00
Vicențiu Ciorbaru
b2bd10d4d6 [MDEV-9427] Server does not build on OpenSUSE 42.1
Changed code to comply to C90 standard.
2016-01-17 22:26:22 +02:00
Vicențiu Ciorbaru
6d3ffd2e3a Fixed a crash during stacktrace printing if addr2line failed to start.
In order to get all the input from addr2line we must read in a loop,
until the response is complete. Also, in case that the response is
malformed, we must not end up reading invalid memory.
2016-01-17 14:20:09 +02:00
Alexey Botchkov
c9552533c9 MDEV-9106 Audit plugin compiled with MariaDB can't install on MySQL 5.7.
The audit API was seriously changed in MySQL 5.7.
        so we had to adapt the plugin's code to that.
2016-01-12 18:43:55 +04:00
Ajo Robert
3d1306f7b7 Bug#21770366 backport bug#21657078 to 5.5 and 5.6
Problem Statement
=========
Fix various issues when building MySQL with Visual Studio 2015.

Fix:
=======
- Visual Studio 2015 adds support for timespec. Add check and
  related code to use this and only use our replacement if
  timespec is not defined.
- Rename lfind/lsearch to my* to avoid redefinition problems.
- Set default value for TMPDIR to "" on Windows as P_tmpdir
  no longer exists.
- using VS definition of snprintf if available
- tzname are now renamed to _tzname.
2016-01-07 14:36:19 +05:30
Alexander Barkov
2ba7ed77aa Merge remote-tracking branch 'origin/10.1' into 10.2 2015-12-29 19:37:11 +04:00
Sergei Golubchik
a2bcee626d Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
Nirbhay Choubey
dad555a09c Merge tag 'mariadb-10.0.23' into 10.0-galera 2015-12-19 14:24:38 -05:00
Nirbhay Choubey
58b54b7d1a MDEV-9044 : Binlog corruption in Galera
While refreshing the IO_CACHE, do not update its parameters (read_pos,
read_end & pos_in_file) if there is nothing left to read.
2015-12-18 14:35:56 -05:00
Sergey Vojtovich
90ea014585 MDEV-8378 - Debian: the Lintian complains about many "shlib-calls-exit" in many
of the plugins

Removed exit() from daemon_example, pass error to caller instead.
Also removed unused my_abort_hook.
2015-12-16 19:39:00 +04:00
Oleksandr Byelkin
71eee693b2 MDEV-9167: COLUMN_CHECK fails on valid decimal data
Check now allows zero length decimals too.

(backporting Adam Chainz patch to 10.0)
2015-12-16 11:09:54 +01:00
Sergei Golubchik
1623995158 Merge branch '5.5' into 10.0 2015-12-13 00:10:40 +01:00
Nirbhay Choubey
ca07ee85ea Merge tag 'mariadb-5.5.47' into 5.5-galera 2015-12-10 13:00:08 -05:00
Oleksandr Byelkin
537c750e32 MDEV-8521 Drastic loss of precision in COLUMN_JSON() on DOUBLEs
fixed conversion
2015-12-10 16:18:15 +01:00
Oleksandr Byelkin
d289ba808d MDEV-8401 COLUMN_CREATE(name, value as DOUBLE) results in string
Double representation fixed (JSON is valid even with 'e' in the number)
2015-12-10 10:19:56 +01:00
Sergey Vojtovich
218da97d5d MDEV-9172 - Analyze patches for IBM System z
Extended my_timer_cycles() to support s390.
Some compiler tunings for RHEL/SLES RPM packages on s390.
2015-12-09 16:52:12 +04:00
Sergei Golubchik
abf9d35213 Merge branch 'mysql/5.5' into 5.5 2015-12-09 10:00:49 +01:00
Monty
c3018b0ff4 Fixes to get all test to run on MacosX Lion 10.7
This includes fixing all utilities to not have any memory leaks,
as safemalloc warnings stopped tests from passing on MacOSX.

- Ensure that all clients takes character-set-dir, as the
  libmysqlclient library will use it.
- mysql-test-run now passes character-set-dir to all external clients.
- Changed dynstr_free() so that it can be called twice (made freeing code easier)
- Changed rpl_global_gtid_slave_state to be allocated dynamicly as it
  includes a mutex that needs to be initizlied/destroyed before my_end() is called.
- Removed rpl_slave_state::init() and rpl_slave_stage::deinit() as
  their job are better handling by constructor and delete.
- Print alias instead of table_name in check_duplicate_key as
  table_name may have been converted to lower case.

Other things:
- Fixed a case in time_to_datetime_with_warn() where we where
  using && instead of & in tests
2015-11-29 17:51:23 +02:00
Sergey Vojtovich
e562b43222 MDEV-8111 - remove "fast mutexes"
They aren't faster than normal mutexes. They're disabled by default for years,
so de facto it's dead code, never used.
2015-11-26 11:34:17 +04:00
Sergei Golubchik
65d69c84cf cmake: remove unused checks, options, and symbols 2015-11-23 16:02:56 +01:00
Sergei Golubchik
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00
Sergei Golubchik
daf3551cce add missing DBUG_RETURN-s 2015-11-16 07:55:55 +01:00
Nirbhay Choubey
7ec6558503 MDEV-9021: MYSQLD SEGFAULTS WHEN BUILT USING --WITH-MAX-INDEXES=128
The bitmap implementation defines two template Bitmap classes. One
optimized for 64-bit (default) wide bitmaps while the other is used for
all other widths.

In order to optimize the computations, Bitmap<64> class has defined its
own member functions for bitmap operations, the other one, however,
relies on mysys' bitmap implementation (mysys/my_bitmap.c).

Issue 1:
In case of non 64-bit Bitmap class, intersect() wrongly reset the
received bitmap while initialising a new local bitmap structure
(bitmap_init() clears the bitmap buffer) thus, the received bitmap was
getting cleared.

Fixed by initializing the local bitmap structure by using a temporary
buffer and later copying the received bitmap to the initialised bitmap
structure.

Issue 2:
The non 64-bit Bitmap class had the Iterator missing which caused
compilation failure.

Also added a cmake variable to hold the MAX_INDEXES value when supplied
from the command prompt. (eg. cmake .. -DMAX_INDEXES=128U). Checks have
been put in place to trigger build failure if MAX_INDEXES value is
greater than 128.

Test modifications:
* Introduced include/have_max_indexes_[64|128].inc to facilitate
skipping of tests for which the output differs with different
MAX_INDEXES.

* Introduced include/max_indexes.inc which would get modified by cmake
to reflect the MAX_INDEXES value used to build the server. This file
simply sets an mtr variable '$max_indexes' to show the MAX_INDEXES
value, which will then be consumed by the above introduced include file.

* Some tests (portions), dependent on MAX_INDEXES value, have been moved
to separate test files.
2015-11-09 09:28:00 -05:00
Vladislav Vaintroub
f1daf9ced4 MDEV-9024 Build fails with VS2015
Fix build failures caused by new C runtime library
- isnan, snprintf, struct timespec are now defined, attempt to
redefine them leads
- P_tmpdir, tzname are no more defined
-  lfind() and lsearch() in lf_hash.c had to be renamed,  declaration
conflicts with some C runtime functions with the same name declared in
a header included by stdlib.h

 Also fix couple of annoying warnings :
- remove #define NOMINMAX from config.h to avoid "redefined" compiler
warnings(NOMINMAX is already in compile flags)

- disable incremental linker in Debug as well (feature not used much
and compiler crashes often)


Also simplify package building with Wix, require Wix 3.9 or later
(VS2015 is not compatible with old Wix 3.5/3.6)
2015-11-06 17:27:24 +01:00
Nirbhay Choubey
4d15112962 Merge tag 'mariadb-10.0.22' into 10.0-galera 2015-10-31 18:07:02 -04:00
Alexander Barkov
59dd58b17e MDEV-8692 prefschema test failures on ARM (on Debian build system)
A few tests assumes that the CYCLE timer is always available,
which is not true on some platforms (e.g. ARM).
Fixing the tests not to reply on the CYCLE availability.
2015-10-30 10:10:43 +04:00
Oleksandr Byelkin
9a3ff0789f MDEV-8565: COLUMN_CHECK fails on valid data
Check allows zero lengts int/uint now.
2015-10-19 12:15:49 +02:00
Sergei Golubchik
1993780284 fix build on sol10-64 2015-10-15 12:23:04 +02:00
Nirbhay Choubey
6927459e5b MDEV-8208: Sporadic SEGFAULT on startup
Addendum:
* Before calling THD::init_for_queries(), flip the current_thd to wsrep
thread so that memory gets allocated for the right THD.
* Use wsrep_creating_startup_threads instead of plugins_are_initialized
as the condition for the execution of THD::init_for_queries() within
start_wsrep_THD(), as use of latter could still leave some room for
race.
2015-09-25 18:50:57 -04:00
Nirbhay Choubey
4d33f9dca0 Merge branch '5.5-galera' into 10.0-galera 2015-09-25 14:57:56 -04:00
Nirbhay Choubey
13615c5e18 MDEV-8208: Sporadic SEGFAULT on startup
Addendum:
* Before calling THD::init_for_queries(), flip the current_thd to wsrep
thread so that memory gets allocated for the right THD.
* Use wsrep_creating_startup_threads instead of plugins_are_initialized
as the condition for the execution of THD::init_for_queries() within
start_wsrep_THD(), as use of latter could still leave some room for
race.
2015-09-25 13:56:02 -04:00
Sergei Golubchik
bc12d5fd43 MDEV-6066: Merge new defaults from 5.6 and 5.7
cosmetic fixes. test fixes.
2015-09-04 10:33:56 +02:00
Oleksandr Byelkin
21daa7b929 MDEV-6066: Merge new defaults from 5.6 and 5.7 (autoset)
--autoset- command line prefix added
2015-09-04 10:33:55 +02:00
Sergei Golubchik
08687f7ef3 cleanup: my_checksum
remove my_crc_dbug_check (gdb can do it itself).
use 0 instead of my_checkum(0, 0, 0) - just as 10.0 does now.
2015-09-04 10:33:50 +02:00
Sergei Golubchik
66b9a9409c New encryption API. Piece-wise encryption.
Instead of encrypt(src, dst, key, iv) that encrypts all
data in one go, now we have encrypt_init(key,iv),
encrypt_update(src,dst), and encrypt_finish(dst).

This also causes collateral changes in the internal my_crypt.cc
encryption functions and in the encryption service.

There are wrappers to provide the old all-at-once encryption
functionality. But binlog events are often written piecewise,
they'll need the new api.
2015-09-04 10:33:50 +02:00
Arun Kuruvila
ddcad361d6 Bug #21503595 : --QUERY-ALLOC-BLOCK-SIZE=-1125899906842624 +
PID_FILE CHECK LEADS TO OOM SIG 11

Description:- A server started with 'query_alloc_block_size'
option set to a certain range of negative values on a
machine without enough memory may lead to OOM.

Analysis:- Server uses 'strtoull()' to convert server
variable values of type 'GET_UINT', 'GET_ULONG' or 'GET_ULL'
from string to unsigned long long. According to the man
page, 'strtoull()' function returns either the result of the
conversion or, if there was a leading minus sign, the
negation of the result of the conversion represented as an
unsigned value, unless the original(nonnegated) value would
overflow; in the latter case, strtoull() returns ULLONG_MAX
and sets errno to ERANGE. So 'strtoull()' converts a small
negative value to a larger postive value. For example string
'-1125899906842624' will be converted to an unsigned value,
'18445618173802708992' (ulonglong typecast of
'-1125899906842624'). So a
server started with 'query_alloc_block_size' set to
"-1125899906842624" on a machine without enough memory will
lead to OOM since server allocates '18445618173802708992'
bytes(17178820608 GB) for query allocation block.

Fix:- When server is started with any server variable, of
type "GET_UINT", "GET_ULONG" or "GET_ULL", set to a negative
value, a warning, "option xxx: value -yyy adjusted to zzz"
is thrown and the value is adjusted to the lowest possible
value for that variable. The dynamic server variable which
is configured through the client exhibit the same behavior
as fix made for variables configured during the server
start up.
2015-09-04 11:10:57 +05:30
Sergei Golubchik
530a6e7481 Merge branch '10.0' into 10.1
referenced_by_foreign_key2(), needed for InnoDB to compile,
was taken from 10.0-galera
2015-09-03 12:58:41 +02:00
Monty
afa9cb7519 Fixed overrun in key cache if one tried to allocate a key cache
of more than 45G with a key_cache_block_size of 1024 or less.

The problem was that some of the arguments to my_multi_malloc() got to be
more than 4G.

Fix:
- Inntroduced my_multi_malloc_large() that can handle big regions.
- Changed MyISAM and Aria key caches to use my_multi_malloc_large().

I didn't change the default my_multi_malloc() as this would be a too big
patch and we don't allocate 4G blocks anywhere else.
2015-08-13 01:27:23 +03:00
Nirbhay Choubey
91acc8b16f Merge tag 'mariadb-10.0.21' into 10.0-galera 2015-08-08 14:21:22 -04:00
Nirbhay Choubey
5b9dd459fb Merge tag 'mariadb-5.5.45' into 5.5-galera 2015-08-07 17:02:51 -04:00
Sergei Golubchik
928edb5a91 Merge branch '5.5' into 10.0
5.5 without InnoDB/XtraDB changes
2015-08-05 09:45:17 +02:00
Sergei Golubchik
6300f2f274 Merge tag 'mysql-5.5.45' into 5.5 2015-08-01 14:56:18 +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
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
Nirbhay Choubey
dced5146bd Merge branch '10.0-galera' into 10.1 2015-07-14 16:05:29 -04:00
Monty
7332af49e4 - Renaming variables so that they don't shadow others (After this patch one can compile with -Wshadow and get much fewer warnings)
- Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function.
- Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined.
- Removing calls to current_thd when we have access to thd

Part of this is optimization (not calling current_thd when not needed),
but part is bug fixing for error condition when current_thd is not defined
(For example on startup and end of mysqld)

Notable renames done as otherwise a lot of functions would have to be changed:
- In JOIN structure renamed:
   examined_rows -> join_examined_rows
   record_count -> join_record_count
- In Field, renamed new_field() to make_new_field()

Other things:
- Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe.
- Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly
- Added 'thd' as argument to a few functions to avoid calling current_thd.
2015-07-06 20:24:14 +03:00
Nirbhay Choubey
0f4478105f Add close-on-exec flag to open(), socket(), accept() & fopen(). 2015-06-24 17:02:33 -04:00
Yashwant Sahu
9068238b19 Bug# 20376760: STACK-BUFFER-OVERFLOW WITH LONG PATHS TO CERTAIN VARIABLES 2015-06-24 17:48:46 +05:30
Nirbhay Choubey
46024098be Merge tag 'mariadb-10.0.20' into 10.0-galera 2015-06-21 23:54:55 -04:00
Nirbhay Choubey
327409443f Merge tag 'mariadb-5.5.44' into 5.5-galera 2015-06-21 21:50:43 -04:00
Tor Didriksen
0dedf55d5d Bug#19660891 HANDLE_FATAL_SIGNAL (SIG=11) IN QUEUE_INSERT
Backport from 5.6 to 5.5
This makes filesort robust to misc variants of order by / group by
on columns/expressions with zero length.
2015-06-17 13:44:32 +02:00
Sergei Golubchik
6d49d3b2cc compiler warnings 2015-06-11 20:20:45 +02:00
Sergei Golubchik
8e7d6652ad CRLF->LF 2015-06-02 22:07:47 +02:00
Sergei Golubchik
ebc5e00641 my_aes_get_size()
return unsigned, not signed.
return a value large enough for GCM
2015-06-02 19:00:23 +02:00
Sergei Golubchik
d9340d6c8e MDEV-8126 encryption for temp files
IO_CACHE tempfiles encryption
2015-06-02 18:53:37 +02:00
Sergei Golubchik
318c826e93 always use my_b_pread() instead of mysql_file_pread()
when working with IO_CACHE's, don't access IO_CACHE::file directly
2015-06-02 18:53:37 +02:00
Sergei Golubchik
6309a30dc9 my_b_fill, inline my_b_* functions instead of hairy macros 2015-06-02 18:53:37 +02:00
Sergei Golubchik
196e852983 misc IO_CACHE cleanups
* remove unused (and not implemented) WRITE_NET type
* remove cast in my_b_write() macro. my_b_* macros are
  function-like, casts are responsibility of the caller
* replace hackish _my_b_write(info,0,0) with the explicit
  my_b_flush_io_cache() in my_b_write_byte()
* remove unused my_b_fill_cache()
* replace pbool -> my_bool
* make internal IO_CACHE functions static
* reformat comments, correct typos, remove obsolete comments (ISAM)
* assert valid cache type in init_functions()
* use IO_ROUND_DN() macro where appropriate
* remove unused DBUG_EXECUTE_IF in _my_b_cache_write()
* remove unnecessary __attribute__((unused))
* fix goto error in parse_file.cc
* remove redundant reinit_io_cache() in uniques.cc
* don't do reinit_io_cache() if the cache was not initialized
  in ma_check.c
* extract duplicate functionality from various _my_b_*_read
  functions into a common wrapper. Same for _my_b_*_write
* create _my_b_cache_write_r instead of having if's in
  _my_b_cache_write (similar to existing _my_b_cache_read and
  _my_b_cache_read_r)
* don't call mysql_file_write() from my_b_flush_io_cache(),
  call info->write_function() instead
2015-06-02 18:53:37 +02:00
Sergei Golubchik
80e61ae21e cleanup: LOAD DATA replication support in IO_CACHE
remove some 14-year old code that added support for
LOAD DATA replication to IO_CACHE:
* three callbacks, of which only two were actually used and that
  were only needed for LOAD DATA replication but were
  tested in every IO_CACHE instance
* an additional opaque void * argument in IO_CACHE, also only
  used for LOAD DATA replication, but present everywhere
* the code to close IO_CACHE prematurely in LOAD DATA to have
  these callbacks called in the correct order and a long
  comment explaining what will happen if IO_CACHE is not
  closed prematurely
* a variable to track whether IO_CACHE was closed prematurely
  (to avoid double-closing it)
2015-06-02 18:53:36 +02:00
Sergei Golubchik
5091a4ba75 Merge tag 'mariadb-10.0.19' into 10.1 2015-06-01 15:51:25 +02:00
Nirbhay Choubey
e11cad9e9d Merge tag 'mariadb-10.0.19' into 10.0-galera 2015-05-09 17:09:21 -04:00
Philip Stoev
f725b0c49d LP1378355 - Reduce memory consumption slightly. 2015-05-08 17:41:05 -04:00
Philip Stoev
7d550c76be LP1378355 - Pass the value of --defaults-group-suffix to xtrabackup during SST 2015-05-08 17:41:05 -04:00
Sergei Golubchik
e1e1f94f47 remove unused file and unnecessary #include 2015-05-03 11:22:04 +02:00
Sergei Golubchik
5fcba6eb26 small cleanup
* my_aes.h doesn't compile without my_global.h
* typo in a comment
* redundant condition
* if encryption plugin fails, there's no encryption_key_manager
  at plugin deinit time
* encryption plugin tests must run when plugin.so is present,
  not when a plugin is active (otherwise the test will be skipped
  when plugin fails to initialize).
2015-04-08 10:58:49 +02:00
Sergey Vojtovich
18e9c314e4 MDEV-6650 - LINT_INIT emits code in non-debug builds
Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT.
Removed LINT_INIT macro.
2015-03-16 14:48:22 +04:00
Sergei Golubchik
2db62f686e Merge branch '10.0' into 10.1 2015-03-07 13:21:02 +01:00
Sergey Vojtovich
f4f37533a0 Replaced lf-hash element_size hack with initializer function. 2015-03-04 13:34:53 +04:00
Sergey Vojtovich
d9e3a9f20e MDEV-6089 - MySQL WL#7305 "Improve MDL scalability by using lock-free hash"
Extended lf-hash implementation to accept user defined hash function.
2015-03-04 13:34:53 +04:00
Sergey Vojtovich
9c8165fdb4 MDEV-6089 - MySQL WL#7305 "Improve MDL scalability by using lock-free hash"
Added initializer callback to lf-hash. Needed to initialize properly non-POD
types.
2015-03-04 13:34:53 +04:00
Sergei Golubchik
c78f594bbc MDEV-6479 stack traces in 10.1
Take into account that PIE binaries are loaded at some offset, so
addresses cannot be directly resolved with addr2line. Find this
offset and subtract it before resolving an address.
2015-02-28 19:48:22 +01:00
Nirbhay Choubey
af651c80f7 Merge tag 'mariadb-10.0.17' into 10.0-galera
Conflicts:
	storage/innobase/include/trx0trx.h
2015-02-27 17:36:54 -05:00
Sergei Golubchik
cbf8cdc252 MDEV-7530 !includedir reads files in random order 2015-02-25 09:43:31 +01:00
Nirbhay Choubey
3c9137deeb Merge branch '5.5' into 5.5-galera
Merge banch 5.5 till revision :
fdd6c11 - MDEV-7419 Function cli_safe_read not exported

Conflicts:
	.bzrignore
	debian/dist/Debian/mariadb-galera-server-5.5.files.in
	debian/dist/Ubuntu/mariadb-galera-server-5.5.files.in
	storage/tokudb/CMakeLists.txt
	support-files/build-tags
2015-02-18 17:15:57 -05:00
Sergei Golubchik
21430e4378 encryption keys service 2015-02-10 10:21:18 +01:00
Sergei Golubchik
cf8bf0b68e encryption key management plugin api 2015-02-10 10:21:17 +01:00
Monty
d7d589dc01 Push for testing of encryption 2015-02-10 10:21:17 +01:00
Sergei Golubchik
4280b25ed8 --getopt-prefix-matching command-line option 2015-02-10 10:21:15 +01:00
Sergei Golubchik
df37215efb small cleanup of my_default.c 2015-02-10 10:21:15 +01:00
Sergey Vojtovich
32b0b6434b MDEV-7177 - Server hangs on shutdown after InnoDB error (main.plugin_loaderr
fails in buildbot)

There was a race condition in timer functionality of query timeouts.

Race was as following:
main thread:          init_thr_timers()
timer handler thread: my_thread_init()
main thread:          end_thr_timer()/timer_thread_state= ABORTING
timer handler thread: timer_thread_state= RUNNING, continue normal op
main thread:          waits indefinitely for timer handler thread to go down

The original idea of the fix is to set RUNNING state in main thread, before
starting timer handler thread. But it didn't survive further cleanups:
- removed "timer_thread_state" and used "thr_timer_inited" for this purpose
- removed unused "timer_thread_running"
- removed code responisble for "timer handler thread" shutdown synchronization,
  use pthread_join() instead.
2015-02-05 13:58:30 +04:00
Sergei Golubchik
b050354ffb compiler warnings 2015-01-31 21:51:45 +01:00
Sergei Golubchik
4b21cd21fe Merge branch '10.0' into merge-wip 2015-01-31 21:48:47 +01:00
Nirbhay Choubey
7cda4bee0e maria-10.0.16 merge
bzr merge -r4588 maria/10.0
2015-01-26 22:54:27 -05:00
Sergei Golubchik
d9c01e4b4a 5.5 merge 2015-01-21 12:03:02 +01:00
Sergei Golubchik
c75eec8e0d rename st_my_thread_var::opt_info -> st_my_thread_var::keycache_link 2015-01-19 14:19:05 +01:00
Michael Widenius
7cb4a1c61f Fixed MDEV-7314: Deadlock when doing insert-select with Aria
mysql-test/suite/maria/insert_select.result:
  Added test case
mysql-test/suite/maria/insert_select.test:
  Added test case
mysys/thr_lock.c:
  Ensure we don't allow concurrent_insert when a read_no_write lock is in use
2015-01-18 20:38:07 +02:00
Michael Widenius
32be7dffbe Return to original stage after mysql_lock_tables
Stage "Filling schema table" is now properly shown in 'show processlist'


mysys/mf_keycache.c:
  Simple cleanup with more comments
sql/lock.cc:
  Return to original stage after mysql_lock_tables
  Made 'Table lock' as a true stage
sql/sql_show.cc:
  Restore original stage after get_schema_tables_result
2015-01-18 13:39:59 +02:00
Sergei Golubchik
e695db0f2d MDEV-7437 remove suport for "atomics" with rwlocks 2015-01-13 10:15:21 +01:00
Sergei Golubchik
a68ad5d50f MDEV-7325 make lf_hash_delete(), lf_hash_search(), and lf_hash_iterator() never to return OOM
if lf_hash_delete() and lf_hash_search() cannot create a new bucket
because of OOM, they'll start the search from the parent bucket.

As for lf_hash_iterate() - it only ever uses bucket number 0, so if it
cannot create *that* bucket, the hash must surely be empty.
2015-01-12 17:05:30 +01:00
Sergey Vojtovich
6dbc48ca79 MDEV-7324 - Lock-free hash for table definition cache 2014-12-28 19:46:18 +04:00
Sergei Golubchik
8883c54ac0 lf_hash_iterate() function 2014-12-28 19:46:18 +04:00
Sergei Golubchik
48430e4676 lf_hash changes, in lfind()
casts, etc

real changes are:
* remove one retry, it is enough to check for DELETED
  after the key is read
* advance 'head' pointer when we see a dummy node to have
  shorter retries
2014-12-28 19:46:18 +04:00
Nirbhay Choubey
eda3db826f Merge revisions from maria/5.5 (5.5.41)
bzr merge -r4393 lp:maria/5.5
2014-12-22 20:09:25 -05:00
Sergey Vojtovich
094640c036 Fixed a couple of compiler warnings. 2014-12-19 23:17:59 +04:00
Sergei Golubchik
a978bdda1e mysql-5.5.41 merge 2014-12-19 11:35:44 +01:00
Nirbhay Choubey
89b2bc42f4 Merge revisions from maria/5.5
bzr merge -r4388 lp:maria/5.5
2014-12-16 20:07:34 -05:00
Michael Widenius
10ab3e6887 MDEV-4010 Deadlock on concurrent INSERT .. SELECT into an Aria table with statement binary logging
There was a bug in lock handling when mixing INSERT ... SELECT on the same table.


mysql-test/suite/maria/insert_select.result:
  Test case for MDEV_4010
mysql-test/suite/maria/insert_select.test:
  Test case for MDEV_4010
mysys/thr_lock.c:
  We wrongly alldoed TL_WRITE_CONCURRENT_INSERT when there was a TL_READ_NO_INSERT lock
2014-12-15 14:49:23 +02:00
Nirbhay Choubey
3bb02f3e6d bzr merge -rtag:mariadb-10.0.15 maria/10.0 2014-12-05 12:33:02 -05:00
Sergey Vojtovich
9127784d5c Cherry pick dynamic array changes from commit:
commit 85fd3d901311688e18ffce92ffc78129e5625791
Author: Monty <monty@mariadb.org>
Date:   Fri Aug 29 14:07:43 2014 +0300

    my_alloc.c
    - Changed 0x%lx -> %p
    array.c:
    - Static (preallocated) buffer can now be anywhere
    my_sys.h
    - Define MY_INIT_BUFFER_USED
    sql_delete.cc & sql_lex.cc
    - Use memroot when allocating classes (avoids call to current_thd)
    sql_explain.h:
    - Use preallocated buffers
    sql_explain.cc:
    - Use preallocated buffers and memroot
    sql_select.cc:
    - Use multi_alloc_root() instead of many alloc_root()
    - Update calls to Explain
2014-12-05 11:01:50 +04:00
Sergey Vojtovich
974808772b MDEV-7004 - Merge scalability fixes from 10.0-power
All callers of open_cached_file() use 2 characters prefix. Allocating memory for
such short string is an overkill. Store it on IO_CACHE structure instead.

All callers of open_cached_file() use mysql_tmpdir as dir. No need to allocate
memory for it since it is constant and available till server shutdown.

This reduces number of allocations from 31 to 27 per OLTP RO transaction.
2014-12-05 11:01:50 +04:00
Sergei Golubchik
2ae7541bcf cleanup: s/const CHARSET_INFO/CHARSET_INFO/
as CHARSET_INFO is already const, using const on it
is redundant and results in compiler warnings (on Windows)
2014-12-04 10:41:51 +01:00
Sergei Golubchik
d2a78def63 cleanup: ptr_cmp
1. don't cast size_t* to int*
2. remove long obsolete register specifier
2014-12-04 10:41:51 +01:00
Sergei Golubchik
853077ad7e Merge branch '10.0' into bb-10.1-merge
Conflicts:
	.bzrignore
	VERSION
	cmake/plugin.cmake
	debian/dist/Debian/control
	debian/dist/Ubuntu/control
	mysql-test/r/join_outer.result
	mysql-test/r/join_outer_jcl6.result
	mysql-test/r/null.result
	mysql-test/r/old-mode.result
	mysql-test/r/union.result
	mysql-test/t/join_outer.test
	mysql-test/t/null.test
	mysql-test/t/old-mode.test
	mysql-test/t/union.test
	packaging/rpm-oel/mysql.spec.in
	scripts/mysql_config.sh
	sql/ha_ndbcluster.cc
	sql/ha_ndbcluster_binlog.cc
	sql/ha_ndbcluster_cond.cc
	sql/item_cmpfunc.h
	sql/lock.cc
	sql/sql_select.cc
	sql/sql_show.cc
	sql/sql_update.cc
	sql/sql_yacc.yy
	storage/innobase/buf/buf0flu.cc
	storage/innobase/fil/fil0fil.cc
	storage/innobase/include/srv0srv.h
	storage/innobase/lock/lock0lock.cc
	storage/tokudb/CMakeLists.txt
	storage/xtradb/buf/buf0flu.cc
	storage/xtradb/fil/fil0fil.cc
	storage/xtradb/include/srv0srv.h
	storage/xtradb/lock/lock0lock.cc
	support-files/mysql.spec.sh
2014-12-02 22:25:16 +01:00
unknown
4d882329a9 MDEV-7116: Dynamic column hangs/segfaults
Going to 'create_new_string:' caused double freeing alloc_plan (there and at 'end:').
2014-11-17 17:13:30 +01:00
Jon Olav Hauglid
5a59bf7a8a Bug#19974500: SERVER 5.5 / DEBUG DOESN\'T COMPILE WITH GCC 4.9.1
Fix broken gcc 4.9.1 debug build by removing end of line noise.

In 5.6+ this issue was already fixed by:
------------------------------------------------------------
revno: 3091
committer: Davi Arnaut <davi.arnaut@oracle.com>
branch nick: mysql-trunk
timestamp: Mon 2011-05-16 11:30:54 -0300
message:
  Fix warnings emitted by Clang.
2014-11-06 12:14:05 +01:00
Nirbhay Choubey
3c2c036248 MDEV-6939 : Dots in file names of configuration files
Use fn_ext2() to get the file extension from last occurrence
of FN_EXTCHAR ('.') instead.
2014-10-29 22:31:19 -04:00
Nirbhay Choubey
822dc6f5df mysys/mf_fn_ext.c: typos & indents 2014-10-29 22:28:14 -04:00
Nirbhay Choubey
4dec4e1175 MDEV-6939 : Dots in file names of configuration files
Use fn_ext2() to get the file extension from last occurrence
of FN_EXTCHAR ('.') instead. Also made some cosmetic changes
in mysys/mf_fn_ext.c.
2014-10-29 22:12:31 -04:00
Nirbhay Choubey
66085f2393 mysys/mf_fn_ext.c: typos & indents 2014-10-29 22:05:46 -04:00
Nirbhay Choubey
24603033e3 MDEV-6939 : Dots in file names of configuration files
Use fn_ext2() (backported from 10.0) to get the file
extension from last occurrence of FN_EXTCHAR ('.')
instead.
2014-10-29 22:20:58 -04:00
Sergei Golubchik
f62c12b405 Merge 10.0.14 into 10.1 2014-10-15 12:59:13 +02:00
Sergei Golubchik
7f5e51b940 MDEV-34 delete storage/ndb and sql/*ndb* (and collateral changes)
remove:
* NDB from everywhere
* IM from mtr-v1
* packaging/rpm-oel and packaging/rpm-uln
* few unused spec files
* plug.in file
* .bzrignore
2014-10-11 18:53:06 +02:00
Sergei Golubchik
534cbc1f2a cleanup: my_init_dynamic_array2 -> init_dynamic_array2 2014-10-11 18:53:04 +02:00
Sergei Golubchik
03ec3511a8 cleanup: galera misc cleanups
also disable galera-specific output in mysql_tzinfo_to_sql,
it'll be enabled later.
2014-10-10 22:27:36 +02:00
Venkatesh Duggirala
0827d75627 Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL MUTEX CONTENTION
Problem: For every event read, mysqlbinlog calls localtime() which in turn
calls stat(/etc/localtime) which is causing kernel mutex contention.

Analysis and Fix:
localtime() calls stat(/etc/localtime) for every instance of the call
where as localtime_r() the reentrant version was optimized to store
the read only tz internal structure. Hence it will not call
stat(/etc/localtime). It will call only once at the beginning.
The mysql server is calling localtime_r() and mysqlbinlog tool is
one place where we are still using localtime().

Once the process (mysqlbinlog) is started if timezone is changed
it will be not picked up the the process and it will continue
with the same values as the beginning of the process. This
behavior is in-lined with mysql server.

Also adding localtime_r() and gmtime_r() support for windows.
2014-10-08 21:54:35 +05:30
Venkatesh Duggirala
a3cc647dbd Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL MUTEX CONTENTION
Problem: For every event read, mysqlbinlog calls localtime() which in turn
calls stat(/etc/localtime) which is causing kernel mutex contention.

Analysis and Fix:
localtime() calls stat(/etc/localtime) for every instance of the call
where as localtime_r() the reentrant version was optimized to store
the read only tz internal structure. Hence it will not call
stat(/etc/localtime). It will call only once at the beginning.
The mysql server is calling localtime_r() and mysqlbinlog tool is
one place where we are still using localtime().

Once the process (mysqlbinlog) is started if timezone is changed
it will be not picked up the the process and it will continue
with the same values as the beginning of the process. This
behavior is in-lined with mysql server.

Also adding localtime_r() and gmtime_r() support for windows.
2014-10-08 21:54:35 +05:30
Monty
4af97bc0e3 Removed files that had been accidentally committed
Removed compiler warnings
2014-10-07 11:39:42 +03:00
Monty
cc8aed3eb7 MDEV 4427: query timeouts
Added MAX_STATEMENT_TIME user variable to automaticly kill queries after a given time limit has expired.

- Added timer functions based on pthread_cond_timedwait
- Added kill_handlerton() to signal storage engines about kill/timeout
- Added support for GRANT ... MAX_STATEMENT_TIME=#
- Copy max_statement_time to current user, if stored in mysql.user
- Added status variable max_statement_time_exceeded
- Added KILL_TIMEOUT
- Removed digest hash from performance schema tests as they change all the time.
- Updated test results that changed because of the new user variables or new fields in mysql.user

This functionallity is inspired by work done by Davi Arnaut at twitter.
Test case is copied from Davi's work.

Documentation can be found at
https://kb.askmonty.org/en/how-to-limittimeout-queries/

mysql-test/r/mysqld--help.result:
  Updated for new help message
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysql-test/suite/sys_vars/r/max_statement_time_basic.result:
  Added testing of max_statement_time
mysql-test/suite/sys_vars/t/max_statement_time_basic.test:
  Added testing of max_statement_time
mysql-test/t/max_statement_time.test:
  Added testing of max_statement_time
mysys/CMakeLists.txt:
  Added thr_timer
mysys/my_init.c:
mysys/mysys_priv.h:
  Added new mutex and condition variables
  Added new mutex and condition variables
mysys/thr_timer.c:
  Added timer functions based on pthread_cond_timedwait()
  This can be compiled with HAVE_TIMER_CREATE to benchmark agains timer_create()/timer_settime()
sql/lex.h:
  Added MAX_STATEMENT_TIME
sql/log_event.cc:
  Safety fix (timeout should be threated as an interrupted query)
sql/mysqld.cc:
  Added support for timers
  Added status variable max_statement_time_exceeded
sql/share/errmsg-utf8.txt:
  Added ER_QUERY_TIMEOUT
sql/signal_handler.cc:
  Added support for KILL_TIMEOUT
sql/sql_acl.cc:
  Added support for GRANT ... MAX_STATEMENT_TIME=#
  Copy max_statement_time to current user
sql/sql_class.cc:
  Added timer functionality to THD.
  Added thd_kill_timeout()
sql/sql_class.h:
  Added timer functionality to THD.
  Added KILL_TIMEOUT
  Added max_statement_time variable in similar manner as long_query_time was done.
sql/sql_connect.cc:
  Added handling of max_statement_time_exceeded
sql/sql_parse.cc:
  Added starting and stopping timers for queries.
sql/sql_show.cc:
  Added max_statement_time_exceeded for user/connects status in MariaDB 10.0
sql/sql_yacc.yy:
  Added support for GRANT ... MAX_STATEMENT_TIME=# syntax, to be enabled in 10.0
sql/structs.h:
  Added max_statement_time user resource
sql/sys_vars.cc:
  Added max_statement_time variables
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
  Removed test as we require all fields in mysql.user table.
scripts/mysql_system_tables.sql
scripts/mysql_system_tables_data.sql
scripts/mysql_system_tables_fix.sql
  Updated mysql.user with new max_statement_time field
2014-10-07 11:37:36 +03:00
Sergei Golubchik
4bb49d84a9 correct handling on defaults[-extra]-file is SST scripts
pass --defaults-file and --defaults-extra-file
(whatever was specified, or none)
from mysqld down to SST scripts.

parse these options in SST scripts and pass them down
to mysqldump, my_print_defaults, and xtrabackup
2014-10-01 23:38:27 +02:00
Sergei Golubchik
3620910eea cleanup: galera merge, simple changes 2014-10-01 23:38:27 +02:00
Sergei Golubchik
fe0ff58000 compiler warnings 2014-10-01 23:38:26 +02:00
Nirbhay Choubey
c916085e27 bzr merge -rtag:mariadb-10.0.14 maria/10.0/ 2014-09-28 20:43:56 -04:00
Sergei Golubchik
06d6552192 5.5 merge 2014-09-23 23:55:29 +02:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Nirbhay Choubey
8358dd53b7 bzr merge -r4346 maria/10.0 (maria-10.0.13) 2014-08-11 23:55:41 -04:00
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Nirbhay Choubey
ec91eea8db Local merge of mariadb-5.5.39
bzr merge -r4264 maria/5.5

Text conflict in sql/mysqld.cc
Text conflict in storage/xtradb/btr/btr0cur.c
Text conflict in storage/xtradb/buf/buf0buf.c
Text conflict in storage/xtradb/buf/buf0lru.c
Text conflict in storage/xtradb/handler/ha_innodb.cc
5 conflicts encountered.
2014-08-06 14:06:11 -04:00
Sergei Golubchik
91c47e6fdf MDEV-6485 Hard-coded paths in the source cannot be opt-out
when looking for my.cnf files: if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR)
is specified (for rpms it always is), use that instead of hardcoded /etc path.
2014-08-03 17:13:56 +02:00
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~40% bugfixed(*) applied
~40$ bugfixed reverted (incorrect or we're not buggy)
~20% bugfixed applied, despite us being not buggy
(*) only changes in the server code, e.g. not cmakefiles
2014-08-02 21:26:16 +02:00
Michael Widenius
f0f2072d1f Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write
Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable.

- Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria.
- Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write


mysql-test/r/features.result:
  Added test of Feature_delay_key_write
mysql-test/r/key_cache.result:
  Updated tests as the number of blocks has changed
mysql-test/r/mysqld--help.result:
  Updated result
mysql-test/suite/maria/maria3.result:
  Updated result
mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result:
  Test new variable
mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test:
  Test new variable
mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test:
  Test new variable
mysql-test/t/features.test:
  Added test of Feature_delay_key_write
mysql-test/t/key_cache.test:
  Updated tests as the number of blocks has changed
mysys/mf_keycache.c:
  Made CHANGED_BLOCKS_HASH dynamic
sql/handler.cc:
  Updated call to init_key_cache()
sql/mysqld.cc:
  Added "Feature_delay_key_write"
  Added support for key-cache-file-hash-size
sql/mysqld.h:
  Added support for key-cache-file-hash-size
sql/sql_class.h:
  Added feature_files_opened_with_delayed_keys
sql/sys_vars.cc:
  Added key_cache_file_hash_size
storage/maria/ha_maria.cc:
  Added pagecache_file_hash_size
  Added counting of files with delay_key_write
storage/maria/ma_checkpoint.c:
  Fixed compiler warning
storage/maria/ma_pagecache.c:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_pagecache.h:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_rt_test.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test1.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test2.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test3.c:
  Updated parameters for init_pagecache()
storage/maria/maria_chk.c:
  Updated parameters for init_pagecache()
storage/maria/maria_ftdump.c:
  Updated parameters for init_pagecache()
storage/maria/maria_pack.c:
  Updated parameters for init_pagecache()
storage/maria/maria_read_log.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_consist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist2.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_single.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  Updated parameters for init_pagecache()
storage/myisam/ha_myisam.cc:
  Added counting of files with delay_key_write
storage/myisam/mi_check.c:
  Updated call to init_key_cache()
storage/myisam/mi_test1.c:
  Updated call to init_key_cache()
storage/myisam/mi_test2.c:
  Updated call to init_key_cache()
storage/myisam/mi_test3.c:
  Updated call to init_key_cache()
storage/myisam/mi_test_all.sh:
  Fixed broken test
storage/myisam/myisam_ftdump.c:
  Updated call to init_key_cache()
storage/myisam/myisamchk.c:
  Updated call to init_key_cache()
storage/myisam/myisamlog.c:
  Updated call to init_key_cache()
2014-07-19 17:46:08 +03:00
Alexander Barkov
22a64047d1 MDEV-6274 Collation usage statistics
Adding collation usage statistics into the feedback plugin I_S table.
2014-08-11 05:45:45 +04:00
Nirbhay Choubey
a76a6601ec bzr merge -rtag:mariadb-10.0.12 maria/10.0 2014-06-19 13:12:38 -04:00
Sergei Golubchik
dc64ba2187 MDEV-6137 better help for SET/ENUM sysvars
Auto-generate the allowed list of values for enum/set/flagset options
in --help output. But don't do that when the help text already has them.

Also, remove lists of values from help strings of various options, where
they were simply listed without any additional information.
2014-06-19 12:02:23 +02:00
Sergey Vojtovich
d2a4b78574 MDEV-6039 - WebScaleSQL patches
Stop spawning dummy threads on client library initialization

Let's revert the fix for Bug#24507.  To quote Monty from 2006:

"After 1/2 a year, when all glibc versions are updated, we can delete
this code."

Note: The upstream glibc bug was fixed in 2006.
2014-06-18 18:15:04 +04:00
Nirbhay Choubey
b441c510a7 bzr merge -rtag:mariadb-5.5.38 maria/5.5 2014-06-10 16:04:26 -04:00
Sergey Vojtovich
7832f1bb62 MDEV-6314 - Compile/run MariaDB with ASan
Fixed some compilation errors/warnings with ASan.
2014-06-10 22:20:33 +04:00
Sergei Golubchik
e27c338634 5.5.38 merge 2014-06-06 00:07:27 +02:00
Michael Widenius
414e8388bf Fixed compiler warnings
mysys/psi_noop.c:
  Fixed wrong prototype
sql/rpl_gtid.cc:
  Added #ifndef to hide not used variable
storage/connect/connect.cc:
  Added volatile to avoid compiler warning in gcc 4.8.1
storage/connect/filamvct.cpp:
  Added volatile to avoid compiler warning in gcc 4.8.1
storage/maria/ma_checkpoint.c:
  Removed cast to avoid compiler warning
storage/myisam/mi_delete_table.c:
  Added attribute to avoid compiler warning
storage/tokudb/ha_tokudb.cc:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/hatoku_hton.cc:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/tokudb_card.h:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/tokudb_status.h:
  Use LINT_INIT_STRUCT to avoid compiler warnings
2014-06-04 13:23:00 +03:00
Sergei Golubchik
5d16592d44 mysql-5.5.38 merge 2014-06-03 09:55:08 +02:00
Nirbhay Choubey
086af8367e bzr merge -r4209 maria/10.0. 2014-05-21 11:09:55 -04:00
Neeraj Bisht
10978e0aa9 Bug#18207212 : FILE NAME IS NOT ESCAPED IN BINLOG FOR LOAD DATA INFILE STATEMENT
Problem:
Load_log_event::print_query() function does not put escape character in file name 
for "LOAD DATA INFILE" statement.

Analysis:
When we have "'" in our file name for "LOAD DATA INFILE" statement,
Load_log_event::print_query() function does not put escape character 
in our file name.

This one result that when we show binary-log, we get file name without 
escape character.

Solution:
To put escape character when we have "'" in file name, for this instead of using 
simple memcpy() to put file-name, we will use pretty_print_str().
2014-05-15 15:50:52 +05:30
Neeraj Bisht
cb0afbd126 Bug#18207212 : FILE NAME IS NOT ESCAPED IN BINLOG FOR LOAD DATA INFILE STATEMENT
Problem:
Load_log_event::print_query() function does not put escape character in file name 
for "LOAD DATA INFILE" statement.

Analysis:
When we have "'" in our file name for "LOAD DATA INFILE" statement,
Load_log_event::print_query() function does not put escape character 
in our file name.

This one result that when we show binary-log, we get file name without 
escape character.

Solution:
To put escape character when we have "'" in file name, for this instead of using 
simple memcpy() to put file-name, we will use pretty_print_str().
2014-05-15 15:50:52 +05:30
Sergei Golubchik
d3e2e1243b 5.5 merge 2014-05-09 12:35:11 +02:00
Tor Didriksen
918837f728 Backport from trunk:
Bug#18187290 ISSUE WITH BUILDING MYSQL USING CMAKE 2.8.12

We want to upgrade to VS2013 on Windows.
In order to do this, we need to upgrade to cmake 2.8.12
This has introduced some incompatibilities for .pdb files,
and "make install" no longer works.

To reproduce:
  cmake --build . --target package --config debug

The fix:
Rather than installing .pdb files for static libraries, we use the /Z7 flag
to store symbolic debugging information in the .obj files.
2014-05-07 17:09:14 +02:00