1. 23 Jan, 2018 9 commits
  2. 22 Jan, 2018 14 commits
    • Vicențiu Ciorbaru's avatar
      Fix TokuDB Not building · a04b07eb
      Vicențiu Ciorbaru authored
      We don't check for DLSYM in CMake, check for DLOPEN instead.
      a04b07eb
    • Sergei Golubchik's avatar
      improve ASAN instrumentation: clang · 8539e4b1
      Sergei Golubchik authored
      translate clang __has_feature to gcc macros
      8539e4b1
    • Vicențiu Ciorbaru's avatar
      MDEV-14715: Assertion `!table || (!table->read_set... failed in Field_num::val_decimal · b20c3dc6
      Vicențiu Ciorbaru authored
      The assertion failure was caused by an incorrectly set read_set for
      functions in the ORDER BY clause in part of a union, when we are using
      a mergeable view and the order by clause can be skipped (removed).
      
      An order by clause can be skipped if it's part of one part of the UNION as
      the result set is not meaningful when multiple SELECT queries are UNIONed. The
      server is aware of this optimization and tries to remove the order by
      clause before JOIN::prepare. The problem is that we need to throw an
      error when the ORDER BY clause contains invalid columns. To do this, we
      attempt resolving the ORDER BY expressions, then subsequently drop them
      if resolution succeeded. However, ORDER BY resolution had the side
      effect of adding the expressions to the all_fields list, which is used
      to construct temporary tables to store the result. We may be ignoring
      the ORDER BY statement, but the tmp table still tried to compute the
      values for the expressions, even if the columns are never used.
      
      The assertion only shows itself if the order by clause contains members
      which were not previously in the select list, and are part of a
      function.
      
      There is an additional question as to why this only manifests when using
      VIEWS and not when using a regular table. The difference lies with the
      "reset" of the read_set for the temporary table during
      SELECT_LEX::update_used_tables() in JOIN::optimize(). The changes
      introduced in fdf789a7 cleared the
      read_set when a mergeable view is encountered in the TABLE_LIST
      defintion.
      
      Upon initial order_list resolution, the table's read_set is updated
      correctly. JOIN::optimize() will only reset the read_set if it
      encounters a VIEW. Since we no longer have ORDER BY clause in
      JOIN::optimize() we never get to correctly update the read_set again.
      
      Other relevant commit by Timour, which first introduced the order
      resolution when we "can_skip_sort_order":
      883af99e
      
      Solution:
      Don't add the resolved ORDER BY elements to all_fields. We only resolve
      them to check if an error should be returned for the query. Ignore them
      completely otherwise.
      b20c3dc6
    • Vicențiu Ciorbaru's avatar
      6d826e3d
    • Sergei Golubchik's avatar
      03eb1593
    • Sergei Golubchik's avatar
      Finally! Make './mtr --valgrind-mysqld --gdb' to work. · d9c460b8
      Sergei Golubchik authored
      It has its limitations, e.g. it assumes that there's only one
      gdb and only one valgrind process is running. And a hard-coded
      one-second delay might be too short for slow machines.
      
      Still, it's better than "doesn't work at all"
      d9c460b8
    • Sergei Golubchik's avatar
      f2408e7e
    • Sergei Golubchik's avatar
      improve ASAN instrumentation: table->record[0] · 36eb0b7a
      Sergei Golubchik authored
      instrument table->record[0], table->record[1] and share->default_values.
      
      One should not access record image beyond share->reclength, even
      if table->record[0] has some unused space after it (functions that
      work with records, might get a copy of the record as an argument,
      and that copy - not being record[0] - might not have this buffer space
      at the end). See b80fa400 and 444587d8
      36eb0b7a
    • Sergei Golubchik's avatar
      improve ASAN instrumentation: mtr · fa331ace
      Sergei Golubchik authored
      fa331ace
    • Sergei Golubchik's avatar
      improve ASAN instrumentation: MEM_ROOT · dc28b6d1
      Sergei Golubchik authored
      more complete TRASH-ing of memroots
      dc28b6d1
    • Sergei Golubchik's avatar
      improve ASAN instrumentation: TRASH · a966d422
      Sergei Golubchik authored
      mark freed memory as not accessible, not merely undefined
      a966d422
    • Sergei Golubchik's avatar
      Correct TRASH() macro usage · 22ae3843
      Sergei Golubchik authored
      TRASH was mapped to TRASH_FREE and was supposed to be used for memory
      that should not be accessed anymore, while TRASH_ALLOC() is to be
      used for uninitialized but to-be-used memory.
      
      But sometimes TRASH() was used in the latter sense.
      
      Remove TRASH() macro, always use explicit TRASH_ALLOC() or TRASH_FREE().
      22ae3843
    • Sergei Golubchik's avatar
      Fix compilation without dlopen · 204cb85a
      Sergei Golubchik authored
      204cb85a
    • Marko Mäkelä's avatar
      MDEV-7049 MySQL#74585 - InnoDB: Failing assertion: *mbmaxlen < 5 in file ha_innodb.cc line 1904 · 906ce096
      Marko Mäkelä authored
      InnoDB limited the maximum number of bytes per character to 4.
      But, the filename character set that was introduced in MySQL 5.1
      uses up to 5 bytes per character.
      
      To allow InnoDB tables to be created with wider characters, let
      us split the mbminmaxlen fields into mbminlen, mbmaxlen, and increase
      the limit to 7 bytes per character. This will increase the payload size
      of dtype_t and dict_col_t by one bit. The storage size will be unchanged
      (54 bits and 77 bits will use the same number of bytes as the
      previous sizes 53 and 76 bits).
      906ce096
  3. 19 Jan, 2018 4 commits
    • Vicențiu Ciorbaru's avatar
    • Daniel Bartholomew's avatar
      bump the VERSION · 17f64b36
      Daniel Bartholomew authored
      17f64b36
    • Vicențiu Ciorbaru's avatar
      MDEV-14229: Stack trace is not resolved for shared objects · 26e5f9dd
      Vicențiu Ciorbaru authored
      Resolving a stacktrace including functions in dynamic libraries requires
      us to look inside the libraries for the symbols. Addr2line needs to be
      started with the correct binary for each address on the stack. To do this,
      figure out which library it is using dladdr, then if the addr2line
      binary was started with a different binary, fork it again with the
      correct one.
      
      We only have one addr2line process running at any point during the
      stacktrace resolving step. The maximum number of forks for addr2line should
      generally be around 6.
      
      One for server stacktrace code, one for plugin code, one when going back
      into server code, one for pthread library, one for libc, one for the
      _start function in the server. More can come up if plugin calls server
      function which goes back to a plugin, etc.
      26e5f9dd
    • Varun Gupta's avatar
      MDEV-14241: Server crash in key_copy / get_matching_chain_by_join_key or valgrind warnings · a7a4519a
      Varun Gupta authored
      In this case we were using the optimization derived_with_keys but we could not create a key
      because the length of the key was greater than the max allowed(MI_MAX_KEY_LENGTH).
      To do the join we needed to create a hash join key instead, but in the explain output it
      showed that we were still referring to derived keys which were created but not used.
      a7a4519a
  4. 18 Jan, 2018 8 commits
  5. 17 Jan, 2018 1 commit
  6. 16 Jan, 2018 4 commits
    • Sergei Golubchik's avatar
      bug: ha_heap was unilaterally increasing reclength · b80fa400
      Sergei Golubchik authored
      MEMORY engine needs the record length to be at least sizeof(void*),
      because it stores a pointer there (linking deleted records into a list).
      So when the reclength is less than sizeof(void*), it's set to sizeof(void*).
      That is done inside heap_create(), and the upper layer doesn't know
      that the engine writes beyond share->reclength.
      
      While it's usually safe (in-memory record size is rounded up to
      sizeof(double), so even if share->reclength is too small,
      share->rec_buff_len is not), it could cause problems in the code that
      copies records and expects them to fix in share->reclength,
      e.g. in partitioning.
      b80fa400
    • Sergei Golubchik's avatar
      BIT field woes · 444587d8
      Sergei Golubchik authored
      * get_rec_bits() was always reading two bytes, even if the
        bit field contained only of one byte
      * In various places the code used field->pack_length() bytes
        starting from field->ptr, while it should be field->pack_length_in_rec()
      * Field_bit::key_cmp and Field_bit::cmp_max passed field_length as
        an argument to memcmp(), but field_length is the number of bits!
      444587d8
    • Sergei Golubchik's avatar
      add support for ASAN instrumentation · 5e7593ad
      Sergei Golubchik authored
      5e7593ad
    • Sergei Golubchik's avatar
      fix compilation with ASAN · 6634f460
      Sergei Golubchik authored
      if the property is not found, set it to the empty string,
      otherwise it'll show as libmysql_link_flags-NOTFOUND on the linker
      command line, and the linker won't like it.
      
      Also, don't specify LINK_FLAG_NO_UNDEFINED twice, MERGE_LIBRARIES
      already put it into LINK_FLAGS.
      6634f460