1. 02 Jun, 2018 1 commit
    • Varun Gupta's avatar
      MDEV-16225: wrong resultset from query with semijoin=on · 5fb2c586
      Varun Gupta authored
      For non-semi-join subquery optimization we do a cost based decision between
      Materialisation and IN -> EXIST transformation. The issue in this case is that for IN->EXIST transformation
      we run JOIN::reoptimize with the IN->EXISt conditions and we come up with a new query plan. But when we compare
      the cost with Materialization, we make the decision to chose Materialization so we need to restore the query plan
      for Materilization.
      The saving and restoring for keyuse array and join_tab keyuse is only done when we have atleast
      one element in the keyuse_array , we are now changing to do it even for 0 elements to main the generality.
      5fb2c586
  2. 23 May, 2018 1 commit
  3. 22 May, 2018 1 commit
  4. 18 May, 2018 1 commit
  5. 17 May, 2018 1 commit
  6. 16 May, 2018 1 commit
    • Sergey Vojtovich's avatar
      (almost) sane core handling in mtr · aa2e1ade
      Sergey Vojtovich authored
      Analyze core independently of max-save-datadir and max-save-core setting.
      
      Increment $num_saved_cores only if core was actually saved.
      
      "Move any core files from e.g. mysqltest" independently of
      max-save-datadir setting. Note: it may overwrite core from mysqld, which
      might not be desired (it did work this way even before).
      aa2e1ade
  7. 15 May, 2018 1 commit
  8. 10 May, 2018 1 commit
  9. 04 May, 2018 1 commit
  10. 30 Apr, 2018 2 commits
  11. 27 Apr, 2018 1 commit
  12. 25 Apr, 2018 2 commits
    • Igor Babaev's avatar
      MDEV-15035 Wrong results when calling a stored procedure · eb057dce
      Igor Babaev authored
      multiple times with different arguments.
      
      If the ON expression of an outer join is an OR formula with one
      of the disjunct being a constant formula then the expression
      cannot be null-rejected if the constant formula is true. Otherwise
      it can be null-rejected and if so the outer join can be converted
      into inner join. This optimization was added in the patch for
      mdev-4817. Yet the code had a defect: if the query was used in
      a stored procedure with parameters and the constant item contained
      some of them then the value of this constant item depended on the
      values of the parameters. With some parameters it may be true,
      for others not. The validity of conversion to inner join is checked
      only once and it happens only for the first call of procedure.
      So if the  parameters in the first call allowed the conversion it
      was done and next calls used the transformed query though there
      could be calls whose parameters made the conversion invalid.
      
      Fixed by cheking whether the constant disjunct in the ON expression
      originally contained an SP parameter. If so the expression is not
      considered as null-rejected. For this check a new item's attribute
      was intruduced: Item::with_param. It is calculated for each item
      by fix fields() functions.
      Also moved the call of optimize_constant_subqueries() in
      JOIN::optimize after the call of simplify_joins(). The reason
      for this is that after the optimization introduced by the patch
      for mdev-4817 simplify_joins() can use the results of execution
      of non-expensive constant subqueries and this is not valid.
      eb057dce
    • Oleksandr Byelkin's avatar
      MDEV-13699: Assertion `!new_field->field_name.str ||... · adaa891a
      Oleksandr Byelkin authored
      MDEV-13699: Assertion `!new_field->field_name.str || strlen(new_field->field_name.str) == new_field->field_name.length' failed in create_tmp_table on 2nd execution of PS with semijoin
      
      The problem was that SJ (semi-join) used secondary list (array) of subquery select list. The items there was prepared once then cleaned up (but not really freed from memory because it was made in statement memory).
      Original list was not prepared after first execution because select was removed by conversion to SJ.
      The solution is to use original list but prepare it first.
      adaa891a
  13. 23 Apr, 2018 1 commit
  14. 19 Apr, 2018 6 commits
  15. 16 Apr, 2018 1 commit
  16. 13 Apr, 2018 1 commit
    • Daniel Black's avatar
      defaults-group-suffix in print_defaults · 88ac368f
      Daniel Black authored
      Also clarify which --{no-,}default* options, must be first.
      
      Sample output:
      $  client/mysql --help
      client/mysql  Ver 15.1 Distrib 5.5.59-MariaDB, for Linux (x86_64) using readline 5.1
      Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
      
      Usage: client/mysql [OPTIONS] [database]
      
      Default options are read from the following files in the given order:
      /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
      The following groups are read: mysql client client-server client-mariadb
      The following options may be given as the first argument:
      --print-defaults          Print the program argument list and exit.
      --no-defaults             Don't read default options from any option file.
      The following specify which files/groups are read (specified before other options):
      --defaults-file=#         Only read default options from the given file #.
      --defaults-extra-file=#   Read this file after the global files are read.
      --defaults-group-suffix=# Additionally read default groups with # appended as a suffix.
      
      tests running from build directory:
      TEST: print defaults ignored as not first
      $ sql/mysqld  --no-defaults --print-defaults --lc-messages-dir=${PWD}/sql/share
      
      TEST: no startup occurs as --print-defaults specified
      $ sql/mysqld  --print-defaults --lc-messages-dir=${PWD}/sql/share
      sql/mysqld would have been started with the following arguments:
      --lc-messages-dir=/home/dan/repos/build-mariadb-5.5/sql/share
      
      TEST: default args can't be anywhere
      $ client/mysql --user=bob  --defaults-file=/etc/my.cnf
      client/mysql: unknown variable 'defaults-file=/etc/my.cnf'
      $ client/mysql --user=bob  --defaults-group-suffix=.group
      client/mysql: unknown variable 'defaults-group-suffix=.group'
      
      /etc/my.cnf:
      [client-server.group]
      socket=/var/lib/mysql-multi/group/mysqld.sock
      user=bob
      
      /etc/my.other.cnf:
      socket=/var/lib/mysql-other/mysqld.sock
      
      TEST: defaults file read and suffix also applied
      $  client/mysql  --defaults-file=/etc/my.other.cnf  --defaults-group-suffix=.group
      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2)
      
      TEST: defaults extra file
      $ client/mysql  --defaults-extra-file=/etc/my.other.cnf  --defaults-group-suffix=.group
      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql-other/mysqld.sock' (2)
      88ac368f
  17. 08 Apr, 2018 1 commit
  18. 07 Apr, 2018 1 commit
  19. 04 Apr, 2018 1 commit
  20. 03 Apr, 2018 3 commits
  21. 27 Mar, 2018 2 commits
  22. 21 Mar, 2018 3 commits
  23. 20 Mar, 2018 2 commits
  24. 19 Mar, 2018 1 commit
    • Eugene Kosov's avatar
      MDEV-15030 Add ASAN instrumentation · 75c76dbb
      Eugene Kosov authored
      Learn both valgrind and asan to catch this bug:
      
        mem_heap_t* heap = mem_heap_create(1024);
        byte* p = reinterpret_cast<byte*>(heap) + sizeof(mem_heap_t);
        *p = 123;
      
      Overflows of the last allocation in a block will be catched too.
      
      mem_heap_create_block(): poison newly allocated memory
      75c76dbb
  25. 14 Mar, 2018 1 commit
  26. 11 Mar, 2018 1 commit
  27. 26 Feb, 2018 1 commit
    • Nisha Gopalakrishnan's avatar
      BUG#27216817: INNODB: FAILING ASSERTION: · c0b4d74b
      Nisha Gopalakrishnan authored
                    PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1
      
      ANALYSIS:
      =========
      
      Adding unique index to a InnoDB table which is locked as
      mutliple instances may trigger an InnoDB assert.
      
      When we add a primary key or an unique index, we need to
      drop the original table and rebuild all indexes. InnoDB
      expects that only the instance of the table that is being
      rebuilt, is open during the process. In the current
      scenario we have opened multiple instances of the table.
      This triggers an assert during table rebuild.
      'Locked_tables_list' encapsulates a list of all
      instances of tables locked by LOCK TABLES statement.
      
      FIX:
      ===
      We are now temporarily closing all the instances of the
      table except the one which is being altered and later
      reopen them via Locked_tables_list::reopen_tables().
      c0b4d74b