1. 21 Jun, 2018 7 commits
    • Sergei Golubchik's avatar
      don't use my_error(0) or my_printf_error(0) · df704b5a
      Sergei Golubchik authored
      there's an assert that catches it
      df704b5a
    • Sergei Golubchik's avatar
      af2dd582
    • Sergei Golubchik's avatar
      MDEV-16238 root/localhost authn prioritizes authentication_string over Password · 5f051022
      Sergei Golubchik authored
      Don't let SET PASSWORD to set the password, if auth_string is set.
      
      Now SET PASSWORD always sets the plugin/auth_string fields and clears
      the password field (on pre-plugin mysql.user table it works as before).
      5f051022
    • Georg Richter's avatar
      b4db59ba
    • Sergei Golubchik's avatar
      MDEV-14578: mysql_install_db install unix_socket plugin when... · 1db1340c
      Sergei Golubchik authored
      MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
      
      post-merge fixes
      1db1340c
    • Daniel Black's avatar
      MDEV-14578: mysql_install_db install unix_socket plugin when... · 53db5edb
      Daniel Black authored
      MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
      
      $ cmake -DPLUGIN_AUTH_SOCKET=STATIC ../mariadb-server-10.2/
      
      $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-static --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
      Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-static' ...
      OK
      
      $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
      +----------------------------------------------------------+
      | CREATE USER for dan@localhost                            |
      +----------------------------------------------------------+
      | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
      +----------------------------------------------------------+
      
      $ cmake -DPLUGIN_AUTH_SOCKET=NO ../mariadb-server-10.2/
      $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-none --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
      Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-none' ...
      ERROR: 1126  Can't open shared library '.../plugin/auth_socket/auth_socket.so' (errno: 2, cannot open shared object file: No such file or directory)
      2018-05-01 11:38:56 0 [ERROR] Aborting
      
      $ cmake -DPLUGIN_AUTH_SOCKET=DYNAMIC ../mariadb-server-10.2/
      $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-dyn --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
      Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-dyn' ...
      OK
      $ ./sql/mysqld  --datadir=/tmp/mysqldatadir-auth-dyn  --lc-messages-dir=${PWD}/sql/share --plugin-dir=./plugin/auth_socket/
      $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
      +----------------------------------------------------------+
      | CREATE USER for dan@localhost                            |
      +----------------------------------------------------------+
      | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
      +----------------------------------------------------------+
      
      $ sudo make install
      $ sudo chmod a+rwx /usr/local/mysql/data
      $ cd /usr/local/mysql/
      $ scripts/mysql_install_db  --auth-root-socket-user=dan --auth-root-authentication-method=socket
      Installing MariaDB/MySQL system tables in './data' ...
      OK
      ..
      $ bin/mysqld_safe
      $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
      +----------------------------------------------------------+
      | CREATE USER for dan@localhost                            |
      +----------------------------------------------------------+
      | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
      +----------------------------------------------------------+
      
      Merges #767
      53db5edb
    • Sergei Golubchik's avatar
      MDEV-13403 Mariadb (with TokuDB) excessive memory usage/leak · 1033fa4b
      Sergei Golubchik authored
      In RPM/DEB packages - always ld-preload jemalloc, instead
      of linking ha_tokudb.so with it.
      
      Keep linking in bintars, because they don't install cnf files
      in the correct locations.
      1033fa4b
  2. 20 Jun, 2018 2 commits
  3. 19 Jun, 2018 5 commits
    • Vicențiu Ciorbaru's avatar
      MDEV-16525: MyRocks linking fails with: Undefined reference to `ZDICT_trainFromBuffer' · d79bf000
      Vicențiu Ciorbaru authored
      RocksDB will only build with libzstd support if libzstd version is
      >=1.1.13. Unfortunately CMake's FindPackage claims it found version
      1.1.13 when we have 1.1.12-1 installed, so a workaround with
      CheckFunctionExists is used to properly check for correct libzstd
      support.
      d79bf000
    • Galina Shalygina's avatar
      MDEV-16517: Server crash in Item_func_in::val_int() when · 778df046
      Galina Shalygina authored
                  IN predicate defined with non-constant values is pushed down
      
      The problem appears because of wrong changes made in MDEV-16090 in the
      Item_func_in::build_clone() method.
      For the clone of the IN predicate it copied 'cmp_fields' array values
      that become dirty after Item::cleanup_excluding_const_fields_processor
      has worked in pushdown. That causes crash.
      There is no need to copy 'cmp_fields' field, the array values should be
      NULLs in order to fix_fields() for the cloned IN predicate can set them
      correctly. fix_fields() computes values for 'cmp_fields' array only
      if they were not set earlier.
      778df046
    • Monty's avatar
      Fixed failing test acl_load_mutex-5170 · 10d09a57
      Monty authored
      Added flush tables to ensure that MyISAM tables are
      properly flushed before reboot
      10d09a57
    • Monty's avatar
      MDEV-15114 ASAN heap-use-after-free in mem_heap_dup or dfield_data_is_binary_equal · ab194666
      Monty authored
      The bug was that innobase_get_computed_value() trashed record[0] and data
      in Field_blob::value
      
      Fixed by using a record on the heap for innobase_get_computed_value()
      
      Reviewer: Marko Mäkelä
      ab194666
    • Monty's avatar
      Add PART_INDIRECT_KEY_FLAG · 831df109
      Monty authored
      This is to mark that a field is indirectly part of a key, which simplifes
      checking if we need to have this field up to date to evaluate a key.
      
      For example:
      CREATE TABLE t1 (a int, b int as (a) virtual,
                       c int as (b) virtual, index(c))
      would mark a and b with PART_INDIRECT_KEY_FLAG.
      c is marked with PART_KEY_FLAG as before.
      831df109
  4. 18 Jun, 2018 2 commits
    • Alexey Botchkov's avatar
      MDEV-16209 JSON_EXTRACT in query crashes server. · 5ba6cee0
      Alexey Botchkov authored
      The optimizer can create various item's over the original one,
          so we can't count on the exact item's type inside the comparison.
      5ba6cee0
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-16087 Inconsistent SELECT results when query cache is enabled · eb77f8cf
      Thirunarayanan Balathandayuthapani authored
      The following conditions will decide the query cache retrieval or
      storing inside innodb:
      
          (1) There should not be any locks on the table.
          (2) Some other trx shouldn't invalidated the cache before the
          transaction started.
          (3) Read view shouldn't exist. If exists then the view
          low_limit_id should be greater than or equal to the transaction that
          invalidates the cache for the particular table.
      
       For read-only transaction: should satisfy  the above (1) and (3)
       For read-write transaction: should satisfy the above (1), (2), (3).
      
       - Changed the variable from query_cache_inv_id to query_cache_inv_trx_id.
      
       - Moved the function row_search_check_if_query_cache_permitted from
          row0sel.h and made it as static function in ha_innodb.cc
      eb77f8cf
  5. 17 Jun, 2018 1 commit
  6. 15 Jun, 2018 4 commits
  7. 14 Jun, 2018 4 commits
    • Galina Shalygina's avatar
      MDEV-16386: Wrong result when pushdown into the HAVING clause of the · ec4fdd57
      Galina Shalygina authored
                  materialized derived table/view that uses aliases is done
      
      The problem appears when a column alias inside the materialized derived
      table/view t1 definition coincides with the column name used in the
      GROUP BY clause of t1. If the condition that can be pushed into t1
      uses that ambiguous column name this column is determined as a column that
      is used in the GROUP BY clause instead of the alias used in the projection
      list of t1. That causes wrong result.
      To prevent it resolve_ref_in_select_and_group() was changed.
      ec4fdd57
    • Marko Mäkelä's avatar
      MDEV-16457 mariabackup 10.2+ should default to innodb_checksum_algorithm=crc32 · a79b033b
      Marko Mäkelä authored
      Since MariaDB Server 10.2.2 (and MySQL 5.7), the default value of
      innodb_checksum_algorithm is crc32 (CRC-32C), not the inefficient "innodb"
      checksum. Change Mariabackup to use the same default, so that checksum
      validation (when using the default algorithm on the server) will take less
      time during mariabackup --backup. Also, mariabackup --prepare should be
      a little faster, and the server should read backups faster, because the
      page checksums would only be validated against CRC-32C.
      a79b033b
    • Marko Mäkelä's avatar
      MDEV-13103 Deal with page_compressed page corruption · 2ca904f0
      Marko Mäkelä authored
      fil_page_decompress(): Replaces fil_decompress_page().
      Allow the caller detect errors. Remove
      duplicated code. Use the "safe" instead of "fast" variants of
      decompression routines.
      
      fil_page_compress(): Replaces fil_compress_page().
      The length of the input buffer always was srv_page_size (innodb_page_size).
      Remove printouts, and remove the fil_space_t* parameter.
      
      buf_tmp_buffer_t::reserved: Make private; the accessors acquire()
      and release() will use atomic memory access.
      
      buf_pool_reserve_tmp_slot(): Make static. Remove the second parameter.
      Do not acquire any mutex. Remove the allocation of the buffers.
      
      buf_tmp_reserve_crypt_buf(), buf_tmp_reserve_compression_buf():
      Refactored away from buf_pool_reserve_tmp_slot().
      
      buf_page_decrypt_after_read(): Make static, and simplify the logic.
      Use the encryption buffer also for decompressing.
      
      buf_page_io_complete(), buf_dblwr_process(): Check more failures.
      
      fil_space_encrypt(): Simplify the debug checks.
      
      fil_space_t::printed_compression_failure: Remove.
      
      fil_get_compression_alg_name(): Remove.
      
      fil_iterate(): Allocate a buffer for compression and decompression
      only once, instead of allocating and freeing it for every page
      that uses compression, during IMPORT TABLESPACE. Also, validate the
      page checksum before decryption, and reduce the scope of some variables.
      
      fil_page_is_index_page(), fil_page_is_lzo_compressed(): Remove (unused).
      
      AbstractCallback::operator()(): Remove the parameter 'offset'.
      The check for it in FetchIndexRootPages::operator() was basically
      redundant and dead code since the previous refactoring.
      2ca904f0
    • Alexander Barkov's avatar
  8. 13 Jun, 2018 4 commits
  9. 12 Jun, 2018 2 commits
  10. 11 Jun, 2018 2 commits
  11. 07 Jun, 2018 4 commits
    • Vladislav Vaintroub's avatar
      aba2d730
    • Vladislav Vaintroub's avatar
      MDEV-16300 : remove rocksdb checkpoint created by mariabackup. · ea705862
      Vladislav Vaintroub authored
      Add variable rocksdb_remove_mariabackup_checkpoint.
      If set, it will remove $rocksdb_datadir/mariabackup-checkpoint directory.
      The variable is to be used by exclusively by mariabackup,
      to remove temporary checkpoints.
      ea705862
    • Marko Mäkelä's avatar
      MDEV-16367 mariabackup: error: failed to copy enough redo log · dc9c5554
      Marko Mäkelä authored
      log_copying_thread(): Keep copying redo log until the end has been
      reached. (Previously, we would stop copying as soon as
      the first batch of xtrabackup_copy_logfile() returned.)
      
      log_copying: Remove. Use log_copying_running instead.
      
      copy_logfile: Remove. Log copying will now only be invoked from
      2 places: from xtrabackup_backup_func() for the initial batch,
      and from log_copying_thread() until all of the log has been read.
      Use the global variable metadata_to_lsn for determining if the
      final part of the log is being copied.
      
      xtrabackup_copy_log(): Add diagnostic messages for terminating
      the copying. These messages should be dead code, because
      log_group_read_log_seg() should be checking for the same.
      
      xtrabackup_copy_logfile(): Correct the retrying logic.
      If anything was successfully read, process the portion that
      was read. On failure, let the caller close dst_log_file.
      
      io_watching_thread(): Stop throttling during the last phase
      of copying the log (metadata_to_lsn!=0). The final copying
      of the log will now be performed in log_copying_thread().
      
      stop_backup_threads(): Clean up the message about stopping
      the log copying thread.
      
      xtrabackup_backup_low(): Read metadata_to_lsn from the latest
      checkpoint header page, even if it is the first page.
      Let the log_copying_thread take care of copying all of
      the redo log.
      dc9c5554
    • Marko Mäkelä's avatar
      Mariabackup: Make some globals static · 619c277a
      Marko Mäkelä authored
      619c277a
  12. 06 Jun, 2018 2 commits
  13. 05 Jun, 2018 1 commit
    • Marko Mäkelä's avatar
      MDEV-16124 fil_rename_tablespace() times out and crashes server during table-rebuilding ALTER TABLE · 55abcfa7
      Marko Mäkelä authored
      InnoDB insisted on closing the file handle before renaming a file.
      Renaming a file should never be a problem on POSIX systems. Also on
      Windows it should work if the file was opened in FILE_SHARE_DELETE
      mode.
      
      fil_space_t::stop_ios: Remove. We no longer need to stop file access
      during rename operations.
      
      fil_mutex_enter_and_prepare_for_io(): Remove the wait for stop_ios.
      
      fil_rename_tablespace(): Remove the retry logic; do not close the
      file handle. Remove the unused fault injection that was added along
      with the DATA DIRECTORY functionality (MySQL WL#5980).
      
      os_file_create_simple_func(), os_file_create_func(),
      os_file_create_simple_no_error_handling_func(): Include FILE_SHARE_DELETE
      in the share_mode. (We will still prevent multiple InnoDB instances
      from using the same files by not setting FILE_SHARE_WRITE.)
      55abcfa7