Commit graph

173719 commits

Author SHA1 Message Date
Alexander Barkov
b25373beb5 MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
MDEV-9752 Wrong data type for COALEASCE(?,1) in prepared statements
2016-03-18 17:50:18 +04:00
Sergey Vojtovich
546e9139ab Fixed plugins.cracklib_password_check failure
In RHEL7/RHEL7.1 libcrack behavior seem to have been modified so that
"foobar" password is considered bad (due to descending "ba") earlier than
expected. For details google for cracklib-2.9.0-simplistic.patch.

Adjusted affected passwords not to have descending and ascending sequences.
2016-03-18 14:39:17 +04:00
Akira Higuchi
1c84836819 fix that mysqld aborts on exit if an open handlersocket connection remains 2016-03-18 14:32:18 +04:00
Akira Higuchi
4f0fc0f912 fix a memory leak in handlersocket 2016-03-18 14:32:18 +04:00
Jan Lindström
ee768d8e0e MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION 2016-03-18 11:48:49 +02:00
Sergey Vojtovich
4aac51db9a MDEV-9587 - Debian packaging for GSSAPI plugin 2016-03-18 11:03:38 +04:00
Jan Lindström
f448a800e1 MDEV-9422: Checksum errors on restart when killing busy instance that uses encrypted XtraDB tables
Analysis:

-- InnoDB has n (>0) redo-log files.
-- In the first page of redo-log there is 2 checkpoint records on fixed location (checkpoint is not encrypted)
-- On every checkpoint record there is up to 5 crypt_keys containing the keys used for encryption/decryption
-- On crash recovery we read all checkpoints on every file
-- Recovery starts by reading from the latest checkpoint forward
-- Problem is that latest checkpoint might not always contain the key we need to decrypt all the
   redo-log blocks (see MDEV-9422 for one example)
-- Furthermore, there is no way to identify is the log block corrupted or encrypted

For example checkpoint can contain following keys :

write chk: 4 [ chk key ]: [ 5 1 ] [ 4 1 ] [ 3 1 ] [ 2 1 ] [ 1 1 ]

so over time we could have a checkpoint

write chk: 13 [ chk key ]: [ 14 1 ] [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ]

killall -9 mysqld causes crash recovery and on crash recovery we read as
many checkpoints as there is log files, e.g.

read [ chk key ]: [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ] [ 9 1 ]
read [ chk key ]: [ 14 1 ] [ 13 1 ] [ 12 1 ] [ 11 1 ] [ 10 1 ] [ 9 1 ]

This is problematic, as we could still scan log blocks e.g. from checkpoint 4 and we do
not know anymore the correct key.

CRYPT INFO: for checkpoint 14 search 4
CRYPT INFO: for checkpoint 13 search 4
CRYPT INFO: for checkpoint 12 search 4
CRYPT INFO: for checkpoint 11 search 4
CRYPT INFO: for checkpoint 10 search 4
CRYPT INFO: for checkpoint 9 search 4 (NOTE: NOT FOUND)

For every checkpoint, code generated a new encrypted key based on key
from encryption plugin and random numbers. Only random numbers are
stored on checkpoint.

Fix: Generate only one key for every log file. If checkpoint contains only
one key, use that key to encrypt/decrypt all log blocks. If checkpoint
contains more than one key (this is case for databases created
using MariaDB server version 10.1.0 - 10.1.12 if log encryption was
used). If looked checkpoint_no is found from keys on checkpoint we use
that key to decrypt the log block. For encryption we use always the
first key. If the looked checkpoint_no is not found from keys on checkpoint
we use the first key.

Modified code also so that if log is not encrypted, we do not generate
any empty keys. If we have a log block and no keys is found from
checkpoint we assume that log block is unencrypted. Log corruption or
missing keys is found by comparing log block checksums. If we have
a keys but current log block checksum is correct we again assume
log block to be unencrypted. This is because current implementation
stores checksum only before encryption and new checksum after
encryption but before disk write is not stored anywhere.
2016-03-18 07:58:04 +02:00
Vladislav Vaintroub
d1e6c40294 mtr complains about klist is not found, if Kerberos is not installed on machines 2016-03-17 17:58:40 +01:00
Alexander Barkov
9b53d84d14 MDEV-9656 Assertion `0' failed in Item_sum_field::get_tmp_table_field().
Removing a wrong ASSERT. Item_sum_field now uses the inherited
Item::get_tmp_table_field().
2016-03-16 13:43:06 +04:00
Jan Lindström
d5d0c35f23 Merge pull request #160 from grooverdan/crc32_power_abi_fix
MDEV-9699: power8 crc32: Per the PPC64 ABI, v20-v31 are non-volatile registers
2016-03-15 10:46:33 +02:00
Vladislav Vaintroub
46089d7691 MDEV-9659 : AWS KMS encryption plugin 2016-03-13 20:29:14 +01:00
Vladislav Vaintroub
517584dde0 Provide a way to reenable DISABLED plugin with -DPLUGIN_${NAME}=STATIC|DYNAMIC 2016-03-13 20:26:21 +01:00
Jan Lindström
a12326458d Add check to avoid NULL-pointer access if encryption information
is not available. Clarify system tablespace page 0 check.
2016-03-13 15:37:47 +02:00
Jan Lindström
f341d94423 MDEV-9549: Trying to decrypt a not encrypted page
Make sure that on decrypt we do not try to reference
NULL pointer and if page contains undefined
FIL_PAGE_FILE_FLUSH_LSN field on when page is not
the first page or page is not in system tablespace,
clear it.
2016-03-12 13:43:33 +02:00
Sergei Golubchik
8c2fd5537b bump the version 2016-03-08 09:06:02 +01:00
Anton Blanchard
5ea894a7c8 MDEV-9699: power crc32: Per the PPC64 ABI, v20-v31 are non-volatile registers
These where modified and not restored.

Corrected as per upstream:

f2145e5858...aaf0ac4
2016-03-08 16:17:32 +11:00
Sergei Golubchik
33d298493d MDEV-9683 Server crashes in Item::basic_const_item on numerous nested NULLIFs
test case only
2016-03-05 16:25:30 +01:00
Sergei Golubchik
70f5fabdbf MDEV-9682 Assertion `0' failed in Item_cache_row::illegal_method_call on 2nd execution of PS with NULLIF
don't cache Item_cache
2016-03-05 16:25:30 +01:00
Sergei Golubchik
ff93b77fd6 MDEV-9641 MDEV-9644 NULLIF assertions
* only copy args[0] to args[2] after fix_fields (when all item
  substitutions have already happened)

* change QT_ITEM_FUNC_NULLIF_TO_CASE (that allows to print NULLIF
  as CASE) to QT_ITEM_ORIGINAL_FUNC_NULLIF (that prohibits it).
  So that NULLIF-to-CASE is allowed by default and only disabled
  explicitly for SHOW VIEW|FUNCTION|PROCEDURE and mysql_make_view.
  By default it is allowed (in particular in error messages and
  debug output, that can happen anytime before or after optimizer).
2016-03-05 16:25:29 +01:00
Sergei Golubchik
5a3a79ce5f MDEV-9637 select nullif(count(col1),0) gives wrong result if in a view
don't do special SUM_FUNC_ITEM treatment in NULLIF for views
(as before), but do it for derived tables (when
context_analysis_only == CONTEXT_ANALYSIS_ONLY_DERIVED)
2016-03-05 16:25:29 +01:00
Sergei Golubchik
c689e93500 update sysvar_innodb,32bit,xtradb.rdiff 2016-03-05 16:25:23 +01:00
Oleksandr Byelkin
6c414fcf89 MDEV-5542: GROUP_CONCAT truncate output to 65.536 chars when using DISTINCT or ORDER BY
port of mysql fix WL#6098
2016-03-01 21:10:59 +01:00
Nirbhay Choubey
66832b6195 MDEV-9598: Donor's rsync SST script hangs if FTWRL fails
During SST, since wsrep_sst_rsync waits for mysqld to create
"tables_flushed" file after it has successfully executed FTWRL,
it would wait forever if FTWRL fails.
Fixed by introducing a mechanism to report failure to the script.
2016-02-26 10:49:19 -05:00
Nirbhay Choubey
0251232f8c Fix to ensure updates in gtid_slave_state table do not get binlogged.
Also, renamed wsrep_skip_append_keys to wsrep_ignore_table.
Test case : galera.galera_as_slave_gtid.test
2016-02-24 23:32:37 -05:00
Sergei Petrunia
b05158cc10 MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
- "Early NULLs filtering" optimization used to "peel off" Item_ref and
  Item_direct_ref wrappers from an outside column reference before
  adding "outer_table_col IS NOT NULL" into JOIN::outer_ref_cond.
- When this happened in a subquery that was evaluated in a post-GROUP-BY
  context, attempt to evaluate JOIN::outer_ref_cond would fetch an
  incorrect value of outer_table_col.
2016-02-24 17:18:53 +03:00
Sergei Golubchik
d044507dc5 Merge branch 'bb-10.1-serg' into 10.1
10.0 merge
10.0-galera merge
connect/10.1 merge
2016-02-24 10:27:23 +01:00
Sergei Golubchik
5a4ec8e60b fix test results after the merge 2016-02-24 10:26:52 +01:00
Alexander Barkov
ff2d92b17d MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.ROUTINES
contains broken procedure body when used shielding quotes inside.
2016-02-24 13:12:03 +04:00
Nirbhay Choubey
cceec7858f Merge branch '10.0-galera' into bb-10.1-serg 2016-02-24 01:21:40 -05:00
Krunal Bauskar
f67d6fccac - PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cnf
If any given variable the xtrabackup-v2 sst script looks for is specified
  multiple times in cnf file then it tend to pick both of them causing
  some of the follow-up command to fail.

  Avoid this programatic mistake by honoring only the last variable assigned
  setting as done by mysqld too.

  Check https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1362830
2016-02-23 21:46:53 -05:00
Krunal Bauskar
0cf66e49db - PXC#460: wsrep_sst_auth don't work in Percona-XtraDB-Cluster-56-5.6.25-25.12.1.el7
Semantics:
---------

* Generally end-user will create a separate user with needed
privileges for
    performing DONOR action.
* This user credentials are specified using wsrep_sst_auth.

* Along with this user there could be other user(s) created on the
server
    that sysadmin may use for normal or other operations
* Credentials for these user(s) can be specified in same
cluster/server
    cnf file as part of [client] section

When cluster act as DONOR and if wsrep_sst_auth is provided then it
should
strictly use it for performing SST based action.

What if end-user has same credentials for performing both SST action
and
normal admin work ?
* Then end-user can simply specify these credentials as part of
[client]
    section in cnf file and skip providing wsrep_sst_auth.

Issue:
-----

MySQL client user/password parsing preference order is as follows:
* command line (through --user/--password)
* cnf file
* MYSQL_PWD enviornment variable.

Recent change tried passing sst user password through MYSQL_PWD
(and user though --user command line param as before).

On the system where-in admin had another user for performing non-SST
actions,
credentials for such user were present in cnf file under [client]
section.

Due to mysql client preference order, SST user name was used (as it
was
passed through command line) but password of other user (meant for
non-SST)
action was being used as it was passed through cnf file.

Password passed through MYSQL_PWD was completely ignored causing
user-name/password mismatch.

Solution:
---------

* If user has specified credentials for SST then pass them through
command
    line so that they are used in priority.

(There could be security concern on passing things through command
line but
   when I tried passing user-name and password through command line to
mysql
   client and then did ps I saw this
   ./bin/mysql --user=sstuser --password=x xxxxxxxx -S /tmp/n1.sock
so seems like password is not shown)
2016-02-23 21:44:32 -05:00
Nirbhay Choubey
0fd9d5a656 Update WSREP_PATCH_REVNO. 2016-02-23 21:24:00 -05:00
Nirbhay Choubey
1b0d811d2d Merge branch '5.5-galera' into 10.0-galera 2016-02-23 21:08:42 -05:00
Nirbhay Choubey
0d58323e26 Merge tag 'mariadb-10.0.24' into 10.0-galera 2016-02-23 20:53:29 -05:00
Nirbhay Choubey
276d65b324 Fix for test failures. 2016-02-23 20:33:21 -05:00
Sergei Golubchik
88576b3a80 Merge tracking branch 'connect/10.1' into 10.1 2016-02-23 22:16:35 +01:00
Sergei Golubchik
a5679af1b1 Merge branch '10.0' into 10.1 2016-02-23 21:35:05 +01:00
Philip Stoev
b9c42d7a47 Bump WSREP_PATCH_VERSION in cmake/wsrep.cmake to 13 2016-02-23 13:24:49 -05:00
Vicențiu Ciorbaru
28a36f617f Update column bitmaps for delete during binlog row image minimal. 2016-02-23 16:56:37 +02:00
Vicențiu Ciorbaru
de1fa45276 [MDEV-8411] Assertion failed in !table->write_set
The reason for the assertion failure is that the update statement for
the minimal row image sets only the PK column in the write_set of the
table to true. On the other hand, the trigger aims to update a different
column.

Make sure that triggers update the used columns accordingly, when being
processed.
2016-02-23 16:56:37 +02:00
Vicențiu Ciorbaru
0e20137a80 [Code cleanup] Refactor duplicate code within myisam and maria sort.cc 2016-02-23 13:05:16 +02:00
Sergei Golubchik
20c4dfd4a9 MDEV-9576 syntax error on view with nullif and count
don't transform Item_func_nullif if it's context_analysis_only
2016-02-23 10:54:36 +01:00
Sergei Golubchik
216b5cc9b6 MDEV-9606 Server crashes in fix_fields, main.null fails with ps-protocol #2 2016-02-23 10:54:35 +01:00
Sergei Golubchik
e6d51aac77 MDEV-9550 COUNT(NULL) returns incorrect result with sequence storage engine
when calculating COUNT(basic_const), take into account that
this basic_const may be NULL
2016-02-23 10:54:35 +01:00
Sergei Golubchik
9214d043fd disable SHOW I_S_table for built-in I_S tables
This fixes
MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
2016-02-23 10:54:34 +01:00
Sergei Golubchik
57905d18d6 MDEV-9535 Trigger doing "SET NEW.auctionStart = NOW();" on a timestamp kills MariaDB server
when doing set_field_to_new_field (from switch_to_nullable_trigger_fields())
make sure that the field we're about to change actually belongs
to the right table (otherwise we cannot dereference new_field[]
array as the wrong table might have more fields than
new_field[] has elements)
2016-02-23 10:54:34 +01:00
Sergei Golubchik
0fcd0ee34e MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11)
Case: table with a NOT NULL field, BEFORE UPDATE trigger,
and UPDATE with a subquery that uses GROUP BY on that
NOT NULL field, and needs a temporary table for it.

Because of the BEFORE trigger, the field becomes nullable
temporarily. But its Item_field (used in GROUP BY) doesn't.
When working with the temptable some code looked at
item->maybe_null, some - at field->null_ptr.
The fix: make Item_field nullable when its field is.

This triggers an assert. The group key size is calculated
before the item is made nullable, so the group key doesn't
have a null byte. The fix: make fields/items nullable
before the group key size is calculated.
2016-02-23 10:53:53 +01:00
Sergei Golubchik
a38b705fe0 MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0
when replicating old temporal type fields (that don't store
metadata in the binlog), take the precision from
destination fields.

(this fixes the replication failure, crashes were
fixed in a different commit)
2016-02-23 10:46:16 +01:00
Sergei Golubchik
4cabc608b6 correct temporal fields in max_display_length_for_field()
it's *display length* (a.k.a. field_length)
not storage length (a.k.a. pack_length)
2016-02-23 10:46:16 +01:00
Sergei Golubchik
d4b1425b60 cleanup
* make a local variable for target_table->field[col]
* move an often-used bit function to my_bit.h
* remove a non-static and not really needed trivial comparison
  function with a very generic name
2016-02-23 10:46:16 +01:00