1. 04 Apr, 2018 8 commits
  2. 03 Apr, 2018 6 commits
  3. 02 Apr, 2018 6 commits
    • Galina Shalygina's avatar
      MDEV-15579 Crash in Item_field::used_tables() called by · 6223f1dd
      Galina Shalygina authored
                 Item::derived_field_transformer_for_having
      
      The crash occurred due to an inappropriate handling of multiple equalities
      when pushing conditions into materialized views/derived tables. If equalities
      extracted from a multiple equality can be pushed into a materialized
      view/derived table they should be plainly conjuncted with other pushed
      predicates rather than form a separate AND sub-formula.
      6223f1dd
    • Vladislav Vaintroub's avatar
    • Alexander Barkov's avatar
      Cleanup: removing duplicate code, adding "const", etc · 342d3df6
      Alexander Barkov authored
      - Adding class Field_int as a common
        parent for Field_{longlong|long|short|medium|tiny}
      - Moving store_decimal(), val_decimal(), get_date(), store_time_dec(),
        get_date(), val_bool() from Field_num to Field_int
      - Adding Field_int::val_str_from_long() and reusing it in
        Field_tiny::val_str(), Field_short::val_str(), Field_medium::val_str()
        and Field_long::val_str(). This removes a good amount of duplicate code
      - Adding "const" qualifier to "virtual bool Field::optimize_range()".
      342d3df6
    • Sergey Vojtovich's avatar
      MDEV-14929 - AddressSanitizer: memcpy-param-overlap in Field_longstr::compress · 443b9a41
      Sergey Vojtovich authored
      Handle overlaping "from" and Field_blob_compressed::value for compressed
      blobs similarily to regular blobs.
      443b9a41
    • Monty's avatar
    • Monty's avatar
      Fix for MDEV-14831 · 7d2e2835
      Monty authored
      MDEV-14831 CREATE OR REPLACE SEQUENCE under LOCK TABLE corrupts the
      sequence, causes ER_KEY_NOT_FOUND
      
      The problem was that sequence_insert didn't properly handle the case
      where there where there was a LOCK TABLE while creating the sequence.
      
      Fixed by opening the sequence table, for inserting the first record, in
      a new environment without any other open tables.
      
      Found also a bug in Locked_tables_list::reopen_tables() where the lock
      structure for the new tables was allocated in THD::mem_root, which causes
      crashes. This could cause problems with other create tables done under
      LOCK TABLES.
      7d2e2835
  4. 01 Apr, 2018 3 commits
    • Vladislav Vaintroub's avatar
      MDEV-15694 Windows : use GetSystemTimePreciseAsFileTime if available for high resolution time · 19bb7fdc
      Vladislav Vaintroub authored
      Use high accuracy timer on Windows 8.1+ for system versioning,it needs
      accurate high resoution start query time.
      
      Continue to use the inaccurate (but much faster timer function)
      GetSystemTimeAsFileTime() where accuracy does not matter, e.g in
      set_timespec_time_nsec(),or my_time()
      19bb7fdc
    • Vladislav Vaintroub's avatar
      MDEV-15636 mariabackup --lock-ddl-per-table hangs if ALTER table is running · 27c24808
      Vladislav Vaintroub authored
      concurrently.
      
      There is a deadlock between
      
      C1 mariabackup's connection that holds MDL locks
      C2 Online ALTER TABLE that wants to have MDL exclusively
         and tries to upgrade its mdl lock.
      C3 another mariabackup's connection that does FLUSH TABLES (or FTWRL)
      
      C3 waits waits for C2,  which waits for C1, which waits for C3,
      thus the deadlock.
      
      
      MDL locks cannot be released until FLUSH  succeeds, because
      otherwise it would allow ALTER to sneak in, causing backup to abort and
      breaking lock-ddl-per-table's promise.
      
      The fix here workarounds the deadlock, by killing connections in
      "Waiting for metadata lock" status (i.e ALTER). This killing continues
      until FTWRL succeeds.
      
      Killing connections is skipped in case --no-locks parameter
      was  passed to backup, because there won't be a FLUSH.
      
      For the reference,in Percona's xtrabackup --lock-ddl-per-connection
      silently implies --no-lock ie FLUSH is always skipped there.
      
      A rather large part of fix is introducing DBUG capability to start
      a query  the new connection at the right moment of backup
      compensating somewhat for mariabackup' lack of send_query or DBUG_SYNC.
      27c24808
    • Vladislav Vaintroub's avatar
  5. 30 Mar, 2018 10 commits
  6. 29 Mar, 2018 7 commits
    • Varun Gupta's avatar
      MDEV-14592: Custom Aggregates Usage Status Variable · cbc45d29
      Varun Gupta authored
      Introduced new status variable for custom aggregate functions.
      cbc45d29
    • Marko Mäkelä's avatar
      Fix a WITH_WSREP=OFF warning · 87ee8563
      Marko Mäkelä authored
      87ee8563
    • Marko Mäkelä's avatar
      MDEV-12266: Change dict_table_t::space to fil_space_t* · 4cad4239
      Marko Mäkelä authored
      InnoDB always keeps all tablespaces in the fil_system cache.
      The fil_system.LRU is only for closing file handles; the
      fil_space_t and fil_node_t for all data files will remain
      in main memory. Between startup to shutdown, they can only be
      created and removed by DDL statements. Therefore, we can
      let dict_table_t::space point directly to the fil_space_t.
      
      dict_table_t::space_id: A numeric tablespace ID for the corner cases
      where we do not have a tablespace. The most prominent examples are
      ALTER TABLE...DISCARD TABLESPACE or a missing or corrupted file.
      
      There are a few functional differences; most notably:
      (1) DROP TABLE will delete matching .ibd and .cfg files,
      even if they were not attached to the data dictionary.
      (2) Some error messages will report file names instead of numeric IDs.
      
      There still are many functions that use numeric tablespace IDs instead
      of fil_space_t*, and many functions could be converted to fil_space_t
      member functions. Also, Tablespace and Datafile should be merged with
      fil_space_t and fil_node_t. page_id_t and buf_page_get_gen() could use
      fil_space_t& instead of a numeric ID, and after moving to a single
      buffer pool (MDEV-15058), buf_pool_t::page_hash could be moved to
      fil_space_t::page_hash.
      
      FilSpace: Remove. Only few calls to fil_space_acquire() will remain,
      and gradually they should be removed.
      
      mtr_t::set_named_space_id(ulint): Renamed from set_named_space(),
      to prevent accidental calls to this slower function. Very few
      callers remain.
      
      fseg_create(), fsp_reserve_free_extents(): Take fil_space_t*
      as a parameter instead of a space_id.
      
      fil_space_t::rename(): Wrapper for fil_rename_tablespace_check(),
      fil_name_write_rename(), fil_rename_tablespace(). Mariabackup
      passes the parameter log=false; InnoDB passes log=true.
      
      dict_mem_table_create(): Take fil_space_t* instead of space_id
      as parameter.
      
      dict_process_sys_tables_rec_and_mtr_commit(): Replace the parameter
      'status' with 'bool cached'.
      
      dict_get_and_save_data_dir_path(): Avoid copying the fil_node_t::name.
      
      fil_ibd_open(): Return the tablespace.
      
      fil_space_t::set_imported(): Replaces fil_space_set_imported().
      
      truncate_t: Change many member function parameters to fil_space_t*,
      and remove page_size parameters.
      
      row_truncate_prepare(): Merge to its only caller.
      
      row_drop_table_from_cache(): Assert that the table is persistent.
      
      dict_create_sys_indexes_tuple(): Write SYS_INDEXES.SPACE=FIL_NULL
      if the tablespace has been discarded.
      
      row_import_update_discarded_flag(): Remove a constant parameter.
      4cad4239
    • Marko Mäkelä's avatar
      55f4e480
    • Marko Mäkelä's avatar
      MDEV-12266: Skip a lookup when checking free space · c02c329a
      Marko Mäkelä authored
      fsp_get_available_space_in_free_extents(): Declare the function static
      in the only caller, and take const fil_space_t& as a parameter.
      c02c329a
    • Marko Mäkelä's avatar
      330ecb90
    • Marko Mäkelä's avatar
      MDEV-12266: Remove fil_system_t::named_spaces · 05863142
      Marko Mäkelä authored
      fil_space_get_by_name(): Remove.
      (Implement differently in mariabackup.)
      
      fil_ibd_open(): Check if the tablespace by the same ID already
      exists. If it is the same name, return success, else failure.
      05863142