1. 19 May, 2017 1 commit
  2. 18 May, 2017 7 commits
    • Vladislav Vaintroub's avatar
      d0eb4ee9
    • Vladislav Vaintroub's avatar
      9dffa307
    • Vladislav Vaintroub's avatar
      MDEV-12814 mariabackup : don't try io throttling in copy-back · 40c7778e
      Vladislav Vaintroub authored
      Throttling only works with when creating backup.  Attempt to use it with
       --copy-back results in crash, since throttle events are not initialized.
      Thus, ignore throttling unless --backup is given.
      40c7778e
    • Jan Lindström's avatar
      MDEV-12593: InnoDB page compression should use lz4_compress_default if · f302a3cf
      Jan Lindström authored
      available
      
      lz4.cmake: Check if shared or static lz4 library has LZ4_compress_default
      function and if it has define HAVE_LZ4_COMPRESS_DEFAULT.
      
      fil_compress_page: If HAVE_LZ4_COMPRESS_DEFAULT is defined use
      LZ4_compress_default function for compression if not use
      LZ4_compress_limitedOutput function.
      
      Introduced a innodb-page-compression.inc file for page compression
      tests that will also search .ibd file to verify that pages
      are compressed (i.e. used search string is not found). Modified
      page compression tests to use this file.
      
      Note that snappy method is not included because of MDEV-12615
      InnoDB page compression method snappy mostly does not compress pages
      that will be fixed on different commit.
      f302a3cf
    • Marko Mäkelä's avatar
      Fix some __attribute__((nonnull)) misuse · 54bb04f7
      Marko Mäkelä authored
      This fixes warnings that were emitted when running InnoDB test
      suites on a debug server that was compiled with GCC 7.1.0 using
      the flags -O3 -fsanitize=undefined.
      
      thd_requested_durability(): XtraDB can call this with trx->mysql_thd=NULL.
      Remove the function in InnoDB, because it is not used there.
      
      calc_row_difference(): Do not call memcmp(o_ptr, NULL, 0).
      
      innobase_index_name_is_reserved(): This can be called with
      key_info=NULL, num_of_keys=0.
      
      innobase_dropping_foreign(), innobase_check_foreigns_low(),
      innobase_check_foreigns(): This can be called with
      drop_fk=NULL, n_drop_fk=0.
      
      rec_convert_dtuple_to_rec_comp(): Do not invoke memcpy(end, NULL, 0).
      54bb04f7
    • Marko Mäkelä's avatar
      ibuf_get_volume_buffered_hash(): Use a proper type cast · a436e349
      Marko Mäkelä authored
      On 64-bit systems, the constant 1 would be 32-bit (int or unsigned)
      by default. Cast the constant to ulint before shifting to avoid a
      -fsanitize=undefined warning or any potential overflow.
      a436e349
    • Marko Mäkelä's avatar
      Refactor trx_undo_report_row_operation() · 9f57e595
      Marko Mäkelä authored
      Fix a -fsanitizer=undefined warning that trx_undo_report_row_operation()
      was being passed thr=NULL when the BTR_NO_UNDO_LOG_FLAG flag was set.
      
      trx_undo_report_row_operation(): Remove the first two parameters.
      The parameter clust_entry!=NULL distinguishes inserts from updates.
      
      This should be a non-functional change (no observable change in
      behaviour; slightly smaller code).
      9f57e595
  3. 17 May, 2017 12 commits
    • Marko Mäkelä's avatar
      Follow-up to MDEV-12534: Align srv_sys · 8b34aabf
      Marko Mäkelä authored
      Allocate srv_sys statically so that the desired alignment can be
      guaranteed. This silences -fsanitize=undefined warnings.
      There probably is no performance impact of this, because the
      reason for the alignment to ensure the absence of false sharing
      between counters. Even with the misalignment, each counter would
      have been been aligned at 64 bits, and the counters would reside
      in separate cache lines.
      8b34aabf
    • Marko Mäkelä's avatar
      MDEV-12358 Work around what looks like a bug in GCC 7.1.0 · 9f89b94b
      Marko Mäkelä authored
      The parameter thr of the function btr_cur_optimistic_insert()
      is not declared as nonnull, but GCC 7.1.0 with -O3 is wrongly
      optimizing away the first part of the condition
      UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes)
      when the function is being called by row_merge_insert_index_tuples()
      with thr==NULL.
      
      The fake_changes is an XtraDB addition. This GCC bug only appears
      to have an impact on XtraDB, not InnoDB.
      
      We work around the problem by not attempting to dereference thr
      when both BTR_NO_LOCKING_FLAG and BTR_NO_UNDO_LOG_FLAG are set
      in the flags. Probably BTR_NO_LOCKING_FLAG alone should suffice.
      
      btr_cur_optimistic_insert(), btr_cur_pessimistic_insert(),
      btr_cur_pessimistic_update(): Correct comments that disagree with
      usage and with nonnull attributes. No other parameter than thr can
      actually be NULL.
      
      row_ins_duplicate_error_in_clust(): Remove an unused parameter.
      
      innobase_is_fake_change(): Unused function; remove.
      
      ibuf_insert_low(), row_log_table_apply(), row_log_apply(),
      row_undo_mod_clust_low():
      Because we will be passing BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG
      in the flags, the trx->fake_changes flag will be treated as false,
      which is the right thing to do at these low-level operations
      (change buffer merge, ALTER TABLE…LOCK=NONE, or ROLLBACK).
      This might be fixing actual XtraDB bugs.
      
      Other callers that pass these two flags are also passing thr=NULL,
      implying fake_changes=false. (Some callers in ROLLBACK are passing
      BTR_NO_LOCKING_FLAG and a nonnull thr. In these callers, fake_changes
      better be false, to avoid corruption.)
      9f89b94b
    • Marko Mäkelä's avatar
      fil_create_new_single_table_tablespace(): Correct a bogus nonnull attribute · e22d86a3
      Marko Mäkelä authored
      The parameter path can be passed as NULL.
      This error was reported by GCC 7.1.0 when compiling
      CMAKE_BUILD_TYPE=Debug with -O3.
      e22d86a3
    • Marko Mäkelä's avatar
      Remove redundant UT_LIST_INIT() calls · 956d2540
      Marko Mäkelä authored
      The macro UT_LIST_INIT() zero-initializes the UT_LIST_NODE.
      There is no need to call this macro on a buffer that has
      already been zero-initialized by mem_zalloc() or mem_heap_zalloc()
      or similar.
      
      For some reason, the statement UT_LIST_INIT(srv_sys->tasks) in
      srv_init() caused a SIGSEGV on server startup when compiling with
      GCC 7.1.0 for AMD64 using -O3. The zero-initialization was attempted
      by the instruction movaps %xmm0,0x50(%rax), while the proper offset
      of srv_sys->tasks would seem to have been 0x48.
      956d2540
    • Marko Mäkelä's avatar
      Make some variables const in fil_iterate() · febe8819
      Marko Mäkelä authored
      This is a non-functional change to make it slightly easier
      to read the code. We seem to have some bugs in this
      IMPORT TABLESPACE code; see MDEV-12396.
      febe8819
    • Marko Mäkelä's avatar
      Never pass NULL to innobase_get_stmt() · 408ef65f
      Marko Mäkelä authored
      408ef65f
    • Marko Mäkelä's avatar
      Silence bogus GCC 7 warnings -Wimplicit-fallthrough · 71cd2059
      Marko Mäkelä authored
      Do not silence uncertain cases, or fix any bugs.
      
      The only functional change should be that ha_federated::extra()
      is not calling DBUG_PRINT to report an unhandled case for
      HA_EXTRA_PREPARE_FOR_DROP.
      71cd2059
    • Marko Mäkelä's avatar
      Never pass NULL to innobase_get_stmt() · 4754f88c
      Marko Mäkelä authored
      4754f88c
    • Marko Mäkelä's avatar
      Silence bogus GCC 7 warnings -Wimplicit-fallthrough · 7972da8a
      Marko Mäkelä authored
      Do not silence uncertain cases, or fix any bugs.
      
      The only functional change should be that ha_federated::extra()
      is not calling DBUG_PRINT to report an unhandled case for
      HA_EXTRA_PREPARE_FOR_DROP.
      7972da8a
    • Marko Mäkelä's avatar
      Fix an incorrect debug assertion · 492c1e41
      Marko Mäkelä authored
      492c1e41
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Fix warnings in innochecksum compilation · e63e2fe2
      Marko Mäkelä authored
      e63e2fe2
  4. 16 May, 2017 2 commits
  5. 15 May, 2017 12 commits
    • Sergei Golubchik's avatar
      MDEV-10936 CONNECT engine JDBC type can't find JdbcInterface · a3cf69e2
      Sergei Golubchik authored
      Don't use instal_jar() from Use_Java.cmake -
      at least in CentOS 7 (cmake 2.8.12.2) it doesn't yet support
      the COMPONENT option.
      a3cf69e2
    • Sergei Golubchik's avatar
      MDEV-12660 inconsistent mysql_stmt_close · a8773ef3
      Sergei Golubchik authored
      remove dead code: this "return rc" could've never happened,
      because reset_stmt_handle can only possibly fail if RESET_SERVER
      flag is used.
      
      But this "return rc" was confusing, it was under DBUG_ENTER (while
      not being DBUG_RETURN) and it was skipping required stmt cleanup
      at the end of the function.
      a8773ef3
    • Sergei Golubchik's avatar
      MDEV-11883 MariaDB crashes with out-of-memory when query information_schema · a65623b3
      Sergei Golubchik authored
      CSV engine didn't expect CSM files to be read-only
      a65623b3
    • Sergei Golubchik's avatar
      MDEV-9998 Fix issues caught by Clang's -Wpointer-bool-conversion warning · 71b45032
      Sergei Golubchik authored
      remove useless checks
      and a couple of others
      71b45032
    • Sergei Golubchik's avatar
      MDEV-12761 Error return from external_lock make the server crash · f9264280
      Sergei Golubchik authored
      bunch of bugs when external_lock() fails on unlock:
      * mi_lock_database() used mi_mark_crashed() under share->intern_lock,
        but mi_mark_crashed() itself locks this mutex.
      * handler::close() required table to be unlocked, but failed
        external_lock didn't count as unlock
      * mysql_unlock_tables() ignored all unlock errors, but they still set
        the error status in stmt_da.
      f9264280
    • Sergei Golubchik's avatar
      MDEV-12420 max_recursive_iterations did not prevent a stack-overflow and segfault · 52aa2009
      Sergei Golubchik authored
      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
      52aa2009
    • Daniel Black's avatar
      602b5e4c
    • Daniel Black's avatar
      b30311e5
    • Daniel Black's avatar
      fbc057ad
    • Daniel Black's avatar
      MDEV-12420: PCRE stack overflow · d672f88e
      Daniel Black authored
      It was possible to construct a PCRE expression that exceeded the stack.
      resulting in a crash:
      
      With fix:
      
      MariaDB [(none)]> SELECT 1
          -> FROM dual
          -> WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,Golf,Hotel,India,Juliet,Kilo,Lima,Mike,StrataL3,November,Oscar,StrataL2,Sand,P3,P4SwitchTest,Arsys,Poppa,ExtensionMgr,Arp,Quebec,Romeo,StrataApiV2,PtReyes,Sierra,SandAcl,Arrow,Artools,BridgeTest,Tango,SandT,PAlaska,Namespace,Agent,Qos,PatchPanel,ProjectReport,Ark,Gimp,Agent,SliceAgent,Arnet,Bgp,Ale,Tommy,Central,AsicPktTestLib,Hsc,SandL3,Abuild,Pca9555,Standby,ControllerDut,CalSys,SandLib,Sb820,PointV2,BfnLib,Evpn,BfnSdk,Sflow,ManagementActive,AutoTest,GatedTest,Bgp,Sand,xinetd,BfnAgentLib,bf-utils,Hello,BfnState,Eos,Artest,Qos,Scd,ThermoMgr,Uniform,EosUtils,Eb,FanController,Central,BfnL3,BfnL2,tcp_wrappers,Victor,Environment,Route,Failover,Whiskey,Xray,Gimp,BfnFixed,Strata,SoCal,XApi,Msrp,XpProfile,tcpdump,PatchPanel,ArosTest,FhTest,Arbus,XpAcl,MacConc,XpApi,telnet,QosTest,Alpha2,BfnVlan,Stp,VxlanControllerTest,MplsAgent,Bravo2,Lanz,BfnMbb,Intf,XCtrl,Unicast,SandTunnel,L3Unicast,Ipsec,MplsTest,Rsvp,EthIntf,StageMgr,Sol,MplsUtils,Nat,Ira,P4NamespaceDut,Counters,Charlie2,Aqlc,Mlag,Power,OpenFlow,Lag,RestApi,BfdTest,strongs,Sfa,CEosUtils,Adt746,MaintenanceMode,MlagDut,EosImage,IpEth,MultiProtocol,Launcher,Max3179,Snmp,Acl,IpEthTest,PhyEee,bf-syslibs,tacc,XpL2,p4-ar-switch,p4-bf-switch,LdpTest,BfnPhy,Mirroring,Phy6,Ptp'
          ->
          -> REGEXP '^((?!\b(Strata|StrataApi|StrataApiV2)\b).)*$');
      Empty set, 1 warning (0.00 sec)
      
      MariaDB [(none)]> show warnings;
      +---------+------+---------------------------------------------------------+
      | Level   | Code | Message                                                 |
      +---------+------+---------------------------------------------------------+
      | Warning | 1139 | Got error 'pcre_exec: Internal error (-21)' from regexp |
      +---------+------+---------------------------------------------------------+
      d672f88e
    • Marko Mäkelä's avatar
      MDEV-12188 information schema - errors populating fail to free memory, unlock mutexes · 217b8115
      Marko Mäkelä authored
      Given the OK macro used in innodb does a DBUG_RETURN(1) on expression failure
      the innodb implementation has a number of errors in i_s.cc.
      
      We introduce a new macro BREAK_IF that replaces some use of the OK macro.
      Also, do some other cleanup detailed below.
      
      When invoking Field::store() on integers, always pass the parameter
      is_unsigned=true to avoid an unnecessary conversion to double.
      
      i_s_fts_deleted_generic_fill(), i_s_fts_config_fill():
      Use the BREAK_IF macro instead of OK.
      
      i_s_fts_index_cache_fill_one_index(), i_s_fts_index_table_fill_one_index():
      Add a parameter for conv_string, and let the caller allocate that buffer.
      
      i_s_fts_index_cache_fill(): Check the return status of
      i_s_fts_index_cache_fill_one_index().
      
      i_s_fts_index_table_fill(): Check the return status of
      i_s_fts_index_table_fill_one_index().
      
      i_s_fts_index_table_fill_one_fetch(): Always let the caller invoke
      i_s_fts_index_table_free_one_fetch().
      
      i_s_innodb_buffer_page_fill(), i_s_innodb_buf_page_lru_fill():
      Do release dict_sys->mutex if filling the buffers fails.
      
      i_s_innodb_buf_page_lru_fill(): Also display the value
      INFORMATION_SCHEMA.INNODB_BUFFER_PAGE.PAGE_IO_FIX='IO_PIN'
      when a block is in that state. Remove the unnecessary variable 'heap'.
      217b8115
    • Marko Mäkelä's avatar
      Fix the Solaris compilation after MDEV-12674 · 8417252b
      Marko Mäkelä authored
      simple_counter::add(): Add a type cast to the os_atomic_increment_ulint()
      call, because GCC would check the type compatibility even when the code
      branch is not being instantiated (atomic=false). On Solaris,
      os_atomic_increment_ulint() actually needs a compatible parameter type,
      and an error would be emitted due to an incompatible 64-bit type,
      for srv_stats.n_lock_wait_time.add(diff_time).
      8417252b
  6. 12 May, 2017 2 commits
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 03dca7a3
      Marko Mäkelä authored
      03dca7a3
    • Marko Mäkelä's avatar
      MDEV-12674 Innodb_row_lock_current_waits has overflow · ff166093
      Marko Mäkelä authored
      There is a race condition related to the variable
      srv_stats.n_lock_wait_current_count, which is only
      incremented and decremented by the function lock_wait_suspend_thread(),
      
      The incrementing is protected by lock_sys->wait_mutex, but the
      decrementing does not appear to be protected by anything.
      This mismatch could allow the counter to be corrupted when a
      transactional InnoDB table or record lock wait is terminating
      roughly at the same time with the start of a wait on a
      (possibly different) lock.
      
      ib_counter_t: Remove some unused methods. Prevent instantiation for N=1.
      Add an inc() method that takes a slot index as a parameter.
      
      single_indexer_t: Remove.
      
      simple_counter<typename Type, bool atomic=false>: A new counter wrapper.
      Optionally use atomic memory operations for modifying the counter.
      Aligned to the cache line size.
      
      lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>.
      These counters are either only incremented (and we do not care about
      losing some increment operations), or the increment/decrement operations
      are protected by some mutex.
      
      srv_stats_t::os_log_pending_writes: Document that the number is protected
      by log_sys->mutex.
      
      srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>,
      that is, atomic inc() and dec() operations.
      
      lock_wait_suspend_thread(): Release the mutexes before incrementing
      the counters. Avoid acquiring the lock mutex if the lock wait has
      already been resolved. Atomically increment and decrement
      srv_stats.n_lock_wait_current_count.
      
      row_insert_for_mysql(), row_update_for_mysql(),
      row_update_cascade_for_mysql(): Use the inc() method with the trx->id
      as the slot index. This is a non-functional change, just using
      inc() instead of add(1).
      
      buf_LRU_get_free_block(): Replace the method add(index, n) with inc().
      There is no slot index in the simple_counter.
      ff166093
  7. 09 May, 2017 4 commits