1. 21 Mar, 2018 2 commits
  2. 20 Mar, 2018 2 commits
  3. 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
  4. 14 Mar, 2018 1 commit
  5. 11 Mar, 2018 1 commit
  6. 24 Feb, 2018 1 commit
  7. 15 Feb, 2018 1 commit
  8. 14 Feb, 2018 2 commits
  9. 11 Feb, 2018 2 commits
  10. 30 Jan, 2018 3 commits
  11. 29 Jan, 2018 1 commit
    • Marko Mäkelä's avatar
      Do not SET DEBUG_DBUG=-d,... in tests · 547ec8ce
      Marko Mäkelä authored
      To disable debug instrumentation, save and restore the original value
      of the variable DEBUG_DBUG. Assigning -d,... will enable the output of
      a lot of unrelated DBUG messages to the server error log.
      547ec8ce
  12. 24 Jan, 2018 3 commits
  13. 23 Jan, 2018 10 commits
    • Marko Mäkelä's avatar
      Add ASAN instrumentation (and more strict Valgrind) to InnoDB · 8637931f
      Marko Mäkelä authored
      mem_heap_free_heap_top(): Remove UNIV_MEM_ASSERT_W() and unpoison
      the memory region first, because part of it may have been poisoned
      by an earlier mem_heap_free_top() call.
      Poison the address range at the end.
      
      mem_heap_block_free(): Poison the address range at the end.
      
      UNIV_MEM_ASSERT_AND_ALLOC(): Replace with UNIV_MEM_ALLOC().
      We want to keep the address ranges poisoned (unaccessible) as
      long as possible.
      
      UNIV_MEM_ASSERT_AND_FREE(): Replace with UNIV_MEM_FREE().
      8637931f
    • Marko Mäkelä's avatar
      Silence -Wimplicit-fallthrough · 70a9b12d
      Marko Mäkelä authored
      70a9b12d
    • Oleksandr Byelkin's avatar
      MDEV-14786: Server crashes in Item_cond::transform on 2nd execution of SP querying from a view · ba8d0fa7
      Oleksandr Byelkin authored
      MDEV-14957: JOIN::prepare gets unusable "conds" as argument
      
      Do not touch merged derived (it is irreversible)
      
      Fix first argument of in_optimizer for calls possible before fix_fields()
      ba8d0fa7
    • Oleksandr Byelkin's avatar
      11408a69
    • Sachin Setiya's avatar
      MDEV-14586 Assertion `0' failed in retrieve_auto_increment ... · 94da1cb4
      Sachin Setiya authored
      Problem:-
       If we create table using myisam/aria then this crashes the server.
        CREATE TABLE t1(a bit(1), b int auto_increment , index(a,b));
        insert into t1 values(1,1);
       Or this query
        CREATE TABLE t1 (b BIT(1), pk INTEGER AUTO_INCREMENT PRIMARY KEY);
        ALTER TABLE t1 ADD INDEX(b,pk);
        INSERT INTO t1 VALUES (1,b'1');
        ALTER TABLE t1 DROP PRIMARY KEY;
      
      Reason:-
       The reason for this is
       1st- find_ref_key() finds what key an auto_increment field belongs to by
        comparing key_part->offset and field->ptr. But BIT fields might have
        zero length in the record, so a key might have many key parts with the
        same offset. That is, comparing offsets cannot uniquely identify the
        correct key part.
       2nd- Since next_number_key_offset is zero it myisam/aria will think that
        auto_increment is in first part of key.
       3nd- myisam/aria will call retrieve_auto_key which will see first key_part
        field as a bit field and call assert(0)
      
      Solution:-
        Many key parts might have the same offset, but BIT fields do not
        support auto_increment. So, we can skip all key parts over BIT fields,
        and then comparing offsets will be unambiguous.
      94da1cb4
    • Daniel Black's avatar
      cc315541
    • Karim Geiger's avatar
      Fix error message typo · 701c7e77
      Karim Geiger authored
      701c7e77
    • Daniel Black's avatar
    • Daniel Black's avatar
      c98906e4
    • Eugene Kosov's avatar
      fix build for recent clang · 3532a421
      Eugene Kosov authored
      /home/kevg/work/mariadb/sql/sql_partition.cc:286:47: error: cannot initialize a parameter of type 'HA_CREATE_INFO *' (aka 'st_ha_create_information *') with an rvalue of type 'ulonglong' (aka 'unsigned long long')
                                                    (ulonglong)0, (uint)0);
                                                    ^~~~~~~~~~~~
      /home/kevg/work/mariadb/sql/partition_info.h:281:72: note: passing argument to parameter 'info' here
        bool set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info,
                                                                             ^
      3532a421
  14. 22 Jan, 2018 10 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