1. 15 May, 2018 1 commit
    • Galina Shalygina's avatar
      MDEV-12387 Push conditions into materialized subqueries · d3ff1333
      Galina Shalygina authored
      The logic and the implementation scheme are similar with the
      MDEV-9197 Pushdown conditions into non-mergeable views/derived tables
      
      How the push down is made on the example:
      
      select * from t1
      where a>3 and b>10 and
       (a,b) in (select x,max(y) from t2 group by x);
      
      -->
      
      select * from t1
      where a>3 and b>10 and
        (a,b) in (select x,max(y)
                  from t2
                  where x>3
                  group by x
                  having max(y)>10);
      
      The implementation scheme:
      
      1. Search for the condition cond that depends only on the fields
         from the left part of the IN subquery (left_part)
      2. Find fields F_group in the select of the right part of the
         IN subquery (right_part) that are used in the GROUP BY
      3. Extract from the cond condition cond_where that depends only on the
         fields from the left_part that stay at the same places in the left_part
         (have the same indexes) as the F_group fields in the projection of the
         right_part
      4. Transform cond_where so it can be pushed into the WHERE clause of the
         right_part and delete cond_where from the cond
      5. Transform cond so it can be pushed into the HAVING clause of the right_part
      
      The optimization is made in the
      Item_in_subselect::pushdown_cond_for_in_subquery() and is controlled by the
      variable condition_pushdown_for_subquery.
      
      New test file in_subq_cond_pushdown.test is created.
      
      There are also some changes made for setup_jtbm_semi_joins().
      Now it is decomposed into the 2 procedures: setup_degenerate_jtbm_semi_joins()
      that is called before optimize_cond() for cond and setup_jtbm_semi_joins()
      that is called after optimize_cond().
      New setup_jtbm_semi_joins() is made in the way so that the result of its work is
      the same as if it was called before optimize_cond().
      
      The code that is common for pushdown into materialized derived and into materialized
      IN subqueries is factored out into pushdown_cond_for_derived(),
      Item_in_subselect::pushdown_cond_for_in_subquery() and
      st_select_lex::pushdown_cond_into_where_clause().
      d3ff1333
  2. 11 May, 2018 1 commit
  3. 10 May, 2018 1 commit
    • Daniel Black's avatar
      MDEV-15655: Add Linux abstract socket support · 08098366
      Daniel Black authored
      The functionality of the socket system variable is extended
      here such that a preciding '@' indicates that the socket
      will be an abstract socket. Thie socket name wil be
      the remainder of the name after the '@'. This is consistent
      with the approached used by systemd in socket activation.
      
      Thanks to Sergey Vojtovich:
      
      On OS X sockaddr_un is defined as:
      
      struct sockaddr_un
      {
        u_char sun_len;
        u_char sun_family;
        char  sun_path[104];
      };
      
      There is a comment in man 7 unix (on linux):
      
      "
      On Linux, the above offsetof() expression equates to the same value as sizeof(sa_family_t),
      but some other implementations include other fields before sun_path, so the offsetof()
      expression more portably describes the size of the address structure.
      "
      
      As such, use the offsetof for Linux and use the previous sizeof(UNIXaddr)
      for non-unix platforms as that's what worked before and they don't
      support abstract sockets so there's no compatibility problem..
      
      strace -fe trace=networking mysqld --skip-networking --socket @abc ...
      ...
      [pid 10578] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 22
      [pid 10578] setsockopt(22, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
      [pid 10578] bind(22, {sa_family=AF_UNIX, sun_path=@"abc"}, 6) = 0
      [pid 10578] listen(22, 80)              = 0
      ...
      Version: '10.3.6-MariaDB-log'  socket: '@abc'  port: 0  Source distribution
      
      $ lsof -p 10578
      mysqld  10578  dan   22u  unix 0x00000000087e688c       0t0 4787815 @abc type=STREAM
      08098366
  4. 07 May, 2018 1 commit
  5. 13 Apr, 2018 5 commits
  6. 12 Apr, 2018 10 commits
  7. 11 Apr, 2018 5 commits
    • Vicentiu Ciorbaru's avatar
      Fix perfschema.hostcache_ipv4_max_con · 990283b6
      Vicentiu Ciorbaru authored
      Also fix perfschema.hostcache_ipv6_max_con.
      The test case makes use of a debug switch to execute some special code.
      The code does hostname replacement. Every hostname sent during connect
      phase becomes santa.claus.ipv4.example.com (or ipv6). This causes a
      connection from root@localhost to fail, as root is not registered as
      santa claus user. The failure is only apparent on Windows as Unix
      systems make use of sockets, which bypass the name resolution check
      entirely.
      990283b6
    • Vladislav Vaintroub's avatar
      MDEV-15780 : mariabackup does not handle absolute names in for system tablespaces · 4c7a1a1b
      Vladislav Vaintroub authored
      Fix 10.2-specific bug - copy-back is not prepared to handle system
      tablespaces with absolute path.
      4c7a1a1b
    • Jan Lindström's avatar
      MDEV-12903: encryption.innodb_encryption_discard_import fails in buildbot with FOUND vs NOT FOUND · 91245909
      Jan Lindström authored
      Wait until rotation has ended and shutdown before grep to make sure
      that dirty pages are on datafiles.
      91245909
    • Marko Mäkelä's avatar
      MDEV-15832 With innodb_fast_shutdown=3, skip the rollback of connected transactions · dd127799
      Marko Mäkelä authored
      row_undo_step(): If innodb_fast_shutdown=3 has been requested,
      abort the rollback of any non-DDL transactions. Starting with
      MDEV-12323, we aborted the rollback of recovered transactions. The
      transactions would be rolled back on subsequent server startup.
      
      trx_roll_report_progress(): Renamed from trx_roll_must_shutdown(),
      now that the shutdown check has been moved to the only caller.
      
      trx_commit_low(): Allow mtr=NULL for transactions that are aborted
      on rollback.
      
      trx_rollback_finish(): Clean up aborted transactions to avoid
      assertion failures and memory leaks on shutdown. This code was
      previously in trx_rollback_active().
      
      trx_rollback_to_savepoint_low(), trx_rollback_for_mysql_low():
      Remove some redundant assertions.
      dd127799
    • Igor Babaev's avatar
      Fixed mdev-15765 BETWEEN not working in certain cases · 740fc2ae
      Igor Babaev authored
      The implementations of the convert_to_basic_const_item() virtual
      function for the Item_cache classes should call cache_value() when
      value_cached == NULL.
      740fc2ae
  8. 10 Apr, 2018 16 commits