Commit graph

171620 commits

Author SHA1 Message Date
Sergei Petrunia
ebe2bd74fe MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP BY
ANALYZE should also record remove_duplicates() operation.
2015-06-20 04:20:18 +03:00
Sergei Petrunia
f33173d19e MDEV-8282: crash in filesort() with simple ordered delete
Handle the case where the optimizer decides to use
handler->delete_all_rows(), but then this call returns
HA_ERR_UNSUPPORTED and execution switches to regular
row-by-row deletion.
2015-06-20 01:24:06 +03:00
Sergey Vojtovich
12d9fe14be MDEV-7956 - handler::rebind_psi() takes 0.07% in OLTP RO
Do not call handler::rebind_psi() and handler::unbind_psi() when performance
schema is compiled out.

Overhead change:
handler::rebind_psi 0.04% -> out of radar
handler::unbind_psi 0.03% -> out of radar
open_table          0.21% -> 0.18%
close_thread_table  0.05% -> 0.05%
2015-06-19 15:06:34 +04:00
Sergey Vojtovich
8f603bcbca MDEV-7952 - clock_gettime() takes 0.24% in OLTP RO
Initialize abs_timeout when it is about to be used. This saves one my_hrtime()
call on hot path (when we acquire MDL lock without waiting).

When filling I_S.PROCESSLIST use THD::start_utime/THD::utime_after_query instead
of THD::start_time. This allows us to save 2 clock_gettime() calls.

Overhead change:
__clock_gettime   0.13% -> 0.11% (122 -> 76 calls per OLTP RO transaction)
my_interval_timer 0.07% -> 0.06%
my_hrtime         0.04% -> 0.01%
2015-06-19 15:06:34 +04:00
Sergey Vojtovich
2bc6e29afe MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Pass THD to Sort_and_group_tracker::report_sorting().
This reduces number of pthread_getspecific() calls from 292 to 290.
2015-06-19 15:06:34 +04:00
Sergey Vojtovich
360176f397 MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Pass THD to Item_field (and all derivatives) constructors.
This reduces number of pthread_getspecific() calls from 322 to 292.
2015-06-19 15:06:34 +04:00
Sergey Vojtovich
b85e5efca3 MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Pass THD to find_all_keys() and Item_equal::Item_equal().
In MRR use table->in_use instead of current_thd.

This reduces number of pthread_getspecific() calls from 354 to 320.
2015-06-19 15:06:34 +04:00
Sergey Vojtovich
2b253ed41f MDEV-8324 - MariaDB fails to build with performance schema disabled
Various fixes to let MariaDB compile with performance schema disabled.
2015-06-19 15:06:33 +04:00
Alexander Barkov
366cda4937 Adding "const" qualifier into a few methods in Field. 2015-06-18 23:27:44 +04:00
Alexander Barkov
091f67738e Removing duplicate code: Adding a protected method
Field_temporal_with_date::validate_for_get_date()
and reusing it in a few places.
2015-06-18 22:16:44 +04:00
Jan Lindström
f5ddffd83e MDEV-8156: Assertion failure in file log0crypt.cc line 220 on server restart
Instead of asserting print informative error message to error log
and return failure from innodb_init causing the server to shutdown.
2015-06-18 20:01:00 +03:00
Sergei Petrunia
e2a59eba5d Make dbug_print_item() print conditions in siccint form 2015-06-18 14:52:17 +03:00
Sergei Petrunia
caf4291d29 Remove garbage comment 2015-06-18 14:51:50 +03:00
Jan Lindström
eb2c170bb0 MDEV-8303; Dumping buffer pool noisy in the logs.
Added new dynamic configuration variable innodb_buf_dump_status_frequency
to configure how often buffer pool dump status is printed in the logs.
A number between [0, 100] that tells how oftern buffer pool dump status
in percentages should be printed. E.g. 10 means that buffer pool dump
status is printed when every 10% of number of buffer pool pages are
dumped. Default is 0 (only start and end status is printed).
2015-06-18 12:20:21 +03:00
Jan Lindström
b94eaff8d9 MDEV-8310: Encryption bogus message still in 10.1.5
Moved warning print to debug builds only because on production
these messages are unnecessary.
2015-06-17 09:12:26 +03:00
Kristian Nielsen
6a92fa4be5 Merge branch 'mdev8294' into 10.1 2015-06-15 08:28:04 +02:00
Kristian Nielsen
93c039dd3c MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
Follow-up patch to temporarily avoid a sporadic failure in the test
rpl.rpl_000011 due to MDEV-8301.

There is a window during thread exit where the global status is
counted incorrectly - the contribution for the exiting thread is
counted twice. The patch for MDEV-8294 made this window visible to the
test case rpl.rpl_000011, causing it to sporadically fail. Temporarily
silence this with a wait for the expected value; can be removed once
MDEV-8294 is fixed.
2015-06-15 08:13:40 +02:00
Kristian Nielsen
b1b0db294f Merge MDEV-8294 into 10.1 2015-06-10 12:42:18 +02:00
Kristian Nielsen
682ed005c5 MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
There were some cases where the slave SQL thread could stop without
the pool of parallel replication worker threads being correctly
de-activated.
2015-06-10 11:57:42 +02:00
Nirbhay Choubey
f965cae5fb MDEV-7110 : Add missing MySQL variable log_bin_basename and log_bin_index
Add log_bin_index, log_bin_basename and relay_log_basename system
variables. Also, convert relay_log_index system variable to
NO_CMD_LINE and implement --relay-log-index as a command line
option.
2015-06-09 13:38:29 -04:00
Alexander Barkov
c94789c3d3 Adding a test for:
MDEV-8167 XOR returns bad results for an indexed column
The bug itself was earlier fixed by one of the earlier changes.
2015-06-09 15:35:25 +04:00
Alexander Barkov
b0928711e0 Adding a test for "MDEV-6973 XOR aggregates argument collations".
The bug itself was earlier fixed by this patch:

commit 3709c7fc6d
MDEV-8222 "string_field LIKE int_const" returns a wrong result in case of UCS2
MDEV-8257 Erroneous "Impossible where" when mixing decimal comparison and LIKE
2015-06-09 15:02:53 +04:00
Jan Lindström
70b82efd20 MDEV-8273: InnoDB: Assertion failure in file fil0pagecompress.cc line 532
Analysis: Problem was that actual payload size (page size) after compression
was handled incorrectly on encryption. Additionally, some of the variables
were not initialized.

Fixed by encrypting/decrypting only the actual compressed page size.
2015-06-09 11:35:21 +03:00
Jan Lindström
4a6a61cb81 MDEV-8268: InnoDB: Assertion failure in file buf0buf.cc line 5842 failing assertion ut_a(free_slot != NULL);
Analysis: Problem is that there is not enough temporary buffer slots
for pending IO requests.

Fixed by allocating same amount of temporary buffer slots as there
are max pending IO requests.
2015-06-09 11:35:21 +03:00
Jan Lindström
d7f3d889de MDEV-8272: Encryption performance: Reduce the number of unused memcpy's
Removed memcpy's on cases when page is not encrypted and make sure
we use the correct buffer for reading/writing.
2015-06-09 11:35:21 +03:00
Alexander Barkov
f744b2a15f MDEV-8283 crash in get_mm_leaf with xor on binary col 2015-06-09 12:08:46 +04:00
Sergei Petrunia
93fc04ff1d MDEV-6995: EXPLAIN JSON and ORDER BY, GROUP BY, etc
- Make ANALYZE correctly remember and report filesort() calls
- Temp.table use is collected but only basic info is reported.
2015-06-06 00:32:27 +03:00
Jan Lindström
f7002c05ae MDEV-8250: InnoDB: Page compressed tables are not compressed and compressed+encrypted tables cause crash
Analysis: Problem is that both encrypted tables and compressed tables use
FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION to store
required metadata. Furhermore, for only compressed tables currently
code skips compression.

Fixes:
- Only encrypted pages store key_version to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix
- Only compressed pages store compression algorithm to FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
  no need to fix as they have different page type FIL_PAGE_PAGE_COMPRESSED
- Compressed and encrypted pages now use a new page type FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED and
  key_version is stored on FIL header offset FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION and compression
  method is stored after FIL header similar way as compressed size, so that first
  FIL_PAGE_COMPRESSED_SIZE is stored followed by FIL_PAGE_COMPRESSION_METHOD
- Fix buf_page_encrypt_before_write function to really compress pages if compression is enabled
- Fix buf_page_decrypt_after_read function to really decompress pages if compression is used
- Small style fixes
2015-06-04 09:47:06 +03:00
Sergei Golubchik
cd70bed05e fix for 32-bit tests 2015-06-03 11:12:50 +02:00
Sergei Golubchik
51d67633ef AES-GCM support in file_key_management plugin 2015-06-02 19:00:23 +02:00
Sergei Golubchik
0f0092720f my_aes_encrypt_gcm() and my_aes_decrypt_gcm() 2015-06-02 19:00:23 +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
487e5f4590 file_key_management plugin: complain if key id 1 is not found
and don't recommend aes_ctr if it's unavailable
2015-06-02 19:00:23 +02:00
Sergei Golubchik
432b78c903 just like tempfiles: use key id 2 for temp Aria tables
introduce ENCRYPTION_KEY_SYSTEM_DATA and
ENCRYPTION_KEY_TEMPORARY_DATA constants; use them everywhere.
2015-06-02 18:53:37 +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
1841557e40 myisam/aria: don't mess with IO_CACHE::file
that is, don't create a "temporary" IO_CACHE with file==-1
and manually swap it later to the valid file descriptor.
2015-06-02 18:53:36 +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
91dab5ddb6 fix cmake dependencies
perfschema after 5.6 merge depends on sql_yacc.h
2015-06-02 18:09:53 +02:00
Sergei Golubchik
72d01f2426 remove few #ifdefs in innodb/xtradb 2015-06-02 17:46:05 +02:00
Sergey Vojtovich
5fc53b7cfe MDEV-8202 - st_select_lex::master_unit() takes 0.17% in OLTP RO
To make st_select_lex::master_unit() inlinable:
- moved it's definition to sql_lex.h
- removed base class virtual master_unit() declaration since this method is
  specific to st_select_lex

Overhead change:
st_select_lex::master_unit()      0.17% -> out of radar
execute_sqlcom_select()           0.13% -> 0.12%
JOIN::save_explain_data_intern()  0.27% -> 0.23%
JOIN::optimize_inner()            0.76% -> 0.72%
JOIN::exec_inner()                0.30% -> 0.24%
JOIN::prepare()                   0.30% -> 0.29%
JOIN::optimize()                  0.05% -> 0.05%
2015-06-02 18:02:32 +04:00
Sergey Vojtovich
adb952f548 MDEV-8192 - THD::set_command() takes 0.05% in OLTP RO
Moved THD::set_command() definition to sql_class.h so that it can be inlined.

Overhead change:
THD::set_command        0.05% -> out of radar
2015-06-02 18:02:32 +04:00
Sergey Vojtovich
d298b02233 MDEV-8191 - THD::set_query() takes 0.07% in OLTP RO
Moved THD::set_query() definition to sql_class.h so that it can be inlined.

Overhead change:
THD::set_query       0.07% -> out of radar
2015-06-02 18:02:32 +04:00
Alexander Barkov
3709c7fc6d MDEV-8222 "string_field LIKE int_const" returns a wrong result in case of UCS2
MDEV-8257 Erroneous "Impossible where" when mixing decimal comparison and LIKE
2015-06-02 15:42:01 +04:00
Sergei Golubchik
8f92a70e21 update for 32-bit, again 2015-06-02 09:26:16 +02:00
Sergei Golubchik
0d54cb12eb compilation failure on windows 2015-06-01 21:35:02 +02:00
Sergei Golubchik
2133230305 avoid ulong sysvars, prefer uint or ulonglong
ulong is not portable - different width on different architectures
2015-06-01 21:31:31 +02:00
Sergei Golubchik
78c10ccad8 MDEV-7913 main.openssl_6975 'tlsv10' fails in buildbot on Wheezy and Precise
version_ssl_library should show the version
of openssl library that is being used, not the one
that server was compiled with.
2015-06-01 17:31:39 +02:00