1. 29 Mar, 2018 40 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
      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
    • Marko Mäkelä's avatar
      MDEV-12266: Make trx_rseg_t::space a pointer · 9043bec9
      Marko Mäkelä authored
      trx_rsegf_get(), trx_undo_get_first_rec(): Change the parameter to
      fil_space_t* so that fewer callers need to be adjusted.
      
      trx_undo_free_page(): Remove the redundant parameter 'space'.
      9043bec9
    • Marko Mäkelä's avatar
      MDEV-12266: Remove trx_undo_t::space · 39ed0743
      Marko Mäkelä authored
      39ed0743
    • Marko Mäkelä's avatar
      MDEV-12266: Clean up btr_search_drop_page_hash_when_freed() · 5dd5b6ca
      Marko Mäkelä authored
      Remove the parameter page_size, and pass a dummy page size
      to buf_page_get_gen() along with BUF_PEEK_IF_IN_POOL.
      5dd5b6ca
    • Marko Mäkelä's avatar
      MDEV-12266: Cleanup DISCARD TABLESPACE · e2bf76cb
      Marko Mäkelä authored
      fil_discard_tablespace(): Merge to row_discard_tablespace()
      which was the only caller.
      e2bf76cb
    • Marko Mäkelä's avatar
      MDEV-12266: Cleanup TRUNCATE · f8d1bd01
      Marko Mäkelä authored
      fil_recreate_table(), fil_recreate_tablespace(),
      fil_reinit_space_header_for_table(): Move the functions
      to the only calling module and declare static.
      
      fil_recreate_table(): Remove the constant parameter space_id=0,flags.
      f8d1bd01
    • Marko Mäkelä's avatar
      MDEV-12266: Clean up recv_recover_page() · f2a581e6
      Marko Mäkelä authored
      f2a581e6
    • Marko Mäkelä's avatar
      332e805e
    • Marko Mäkelä's avatar
      MDEV-12266: Remove dict_index_t::table_name · 428e0289
      Marko Mäkelä authored
      Replace index->table_name with index->table->name.
      428e0289
    • Marko Mäkelä's avatar
      MDEV-12266: Remove dict_index_t::space · 604fea1a
      Marko Mäkelä authored
      We can rely on the dict_table_t::space. All indexes of a table object
      are always in the same tablespace. (For fulltext indexes, the data is
      located in auxiliary tables, and these will continue to have their own
      table objects, separate from the main table.)
      604fea1a
    • Marko Mäkelä's avatar
      MDEV-12266: Add dict_index_t::set_modified(mtr) · e7980f9c
      Marko Mäkelä authored
      This is a non-functional change (pure refactoring).
      e7980f9c
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      MDEV-12266: fsp_flags_try_adjust(): Remove a lookup · c577192d
      Marko Mäkelä authored
      fsp_header_init(): Take fil_space_t* as a parameter.
      c577192d
    • Marko Mäkelä's avatar
      MDEV-12266: Add fil_system.sys_space, temp_space · 2ac8b1a9
      Marko Mäkelä authored
      Add fil_system_t::sys_space, fil_system_t::temp_space.
      These will replace lookups for TRX_SYS_SPACE or SRV_TMP_SPACE_ID.
      
      mtr_t::m_undo_space, mtr_t::m_sys_space: Remove.
      
      mtr_t::set_sys_modified(): Remove.
      
      fil_space_get_type(), fil_space_get_n_reserved_extents(): Remove.
      
      fsp_header_get_tablespace_size(), fsp_header_inc_size():
      Merge to the only caller, innobase_start_or_create_for_mysql().
      2ac8b1a9
    • Marko Mäkelä's avatar
      Allocate the singleton fil_system statically · 600c85e8
      Marko Mäkelä authored
      fil_system_t::create(): Replaces fil_init(), fsp_init().
      
      fil_system_t::close(): Replaces fil_close().
      
      fil_system_t::max_n_open: Remove. Use srv_max_n_open_files directly.
      600c85e8
    • Marko Mäkelä's avatar
      Remove dict_build_tablespace_for_table() · 1f0f7d59
      Marko Mäkelä authored
      create_table_info_t::create_table_def(): Assign the innodb_temporary
      tablespace directly.
      
      dict_build_tablespace_for_table(): Merge to the only remaining caller,
      dict_build_table_def_step().
      1f0f7d59
    • Marko Mäkelä's avatar
      Remove an unnecessary global declaration · 60ef478c
      Marko Mäkelä authored
      60ef478c
    • Marko Mäkelä's avatar
      d177a0ed
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 980dd09b
      Marko Mäkelä authored
      980dd09b
    • Marko Mäkelä's avatar
      MDEV-15719: Adjust a test case · 014dfe47
      Marko Mäkelä authored
      014dfe47
    • Marko Mäkelä's avatar
      3eb73bf6
    • Marko Mäkelä's avatar
      row_drop_table_for_mysql(): Use a constant string · 622d21e2
      Marko Mäkelä authored
      It does not hurt to delete non-existing records from SYS_TABLESPACES
      and SYS_DATAFILES. Because MariaDB does not support CREATE TABLESPACE,
      only the system tablespace (space_id=0) can contain multiple tables.
      But, there are no entries for the system tablespace in these tables
      (which actually are stored inside the system tablespace).
      622d21e2
    • Sergei Petrunia's avatar
      MDEV-15472: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failure · b9227410
      Sergei Petrunia authored
      MariaDB differs from the upstream for "DDL-like" command. For these,
      it sets binlog_format=STATEMENT for the duration of the statement.
      This doesn't play well with MyRocks, which tries to prevent DML
      commands with binlog_format!=ROW.
      
      Also, if Locked_tables_list::reopen_tables() returned an error, then
      close_cached_tables should propagate the error condition and not silently
      consume it (it's difficult to have test coverage for this because this
      error condition is rare)
      b9227410
    • Monty's avatar
      MDEV-15149 Assert upon concurrent creating / querying sequences · 4277c173
      Monty authored
      MDEV-15117 Server crashes in in open_and_process_table or ASAN
      heap-use-after-free in is_temporary_table upon creating/flushing
      sequences.
      
      Problem was that sequence_insert closed and reopened the like table
      without proper locking.  Fixed by ensuring that the like table is
      not reopened in sequence_insert
      4277c173
    • Monty's avatar
      MDEV-15149 Assert upon concurrent creating / querying sequences · cd93eeeb
      Monty authored
      Problem was that sequence_insert closed and reopened the like table
      without proper locking.  Fixed by ensuring that the like table is
      not reopened in sequence_insert
      cd93eeeb
    • Monty's avatar
      MDEV-14275 Improving memory utilization for information schema · e2664ee8
      Monty authored
      SELECT queries on information_schema table will now not store data
      in the temporary table for columns that are not used in the query.
      This can drastically reduce memory when there are many rows involved
      in a query, like using
      SELECT table_name FROM information_schema.table
      on a system with many tables.
      The difference for the above query is about 14K per existing table.
      
      The code works this way:
      - Create a bitmap for all information_schema fields used in the query
      - For BLOB and VARCHAR fields that are not use, create a Field_null field.
      e2664ee8
    • Monty's avatar
      Ensure that map->mutex is reset in my_bitmap_init · 33fa6abd
      Monty authored
      33fa6abd
    • Monty's avatar
      Fixed compiler warnings · 75dd94c7
      Monty authored
      Remove compiler warnings in sphinx, item_sum.cc and opt_split.cc
      75dd94c7
    • Michael Widenius's avatar
      Added flush tables to acl_load_mutex-5170.test · d572c19f
      Michael Widenius authored
      This is needed as otherwise a lot of MyISAM tables may be marked
      as crashed, depending on in which order tests are run
      d572c19f
    • Monty's avatar
      410d0930
    • Michael Widenius's avatar
      Move mysql-test-run/extra/rpl_tests to suite/rpl/include · 39018f2a
      Michael Widenius authored
      Renamed suite/rpl/include/rpl_sync.inc to rpl_sync_test.inc to
      remove clash with include/rpl_sync.inc
      39018f2a
    • Michael Widenius's avatar
    • Michael Widenius's avatar
    • Monty's avatar
      Move alter partition flags to alter_info->partition_flags · ab194126
      Monty authored
      This is done to get more free flag bits for alter_info->flags
      
      Renamed all ALTER PARTITION defines to start with ALTER_PARTITION_
      Renamed ALTER_PARTITION to ALTER_PARTITION_INFO
      Renamed ALTER_TABLE_REORG to ALTER_PARTITION_TABLE_REORG
      
      Other things:
      - Shifted some ALTER_xxx defines to get empty bits at end
      ab194126
    • Monty's avatar
      Changed static const in Alter_info and Alter_online_info to defines · 2dbeebdb
      Monty authored
      Main reason was to make it easier to print the above structures in
      a debugger. Additional benefits is that I was able to use same
      defines for both structures, which simplifes some code.
      
      Most of the code is just removing Alter_info:: and Alter_inplace_info::
      from alter table flags.
      
      Following renames was done:
      HA_ALTER_FLAGS        -> alter_table_operations
      CHANGE_CREATE_OPTION  -> ALTER_CHANGE_CREATE_OPTION
      Alter_info::ADD_INDEX -> ALTER_ADD_INDEX
      DROP_INDEX            -> ALTER_DROP_INDEX
      ADD_UNIQUE_INDEX      -> ALTER_ADD_UNIQUE_INDEX
      DROP_UNIQUE_INDEx     -> ALTER_DROP_UNIQUE_INDEX
      ADD_PK_INDEX          -> ALTER_ADD_PK_INDEX
      DROP_PK_INDEX         -> ALTER_DROP_PK_INDEX
      Alter_info:ALTER_ADD_COLUMN    -> ALTER_PARSE_ADD_COLUMN
      Alter_info:ALTER_DROP_COLUMN   -> ALTER_PARSE_DROP_COLUMN
      Alter_inplace_info::ADD_INDEX  -> ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX
      Alter_inplace_info::DROP_INDEX -> ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX
      
      Other things:
      - Added typedef alter_table_operatons for alter table flags
      - DROP CHECK CONSTRAINT can now be done online
      - Added checks for Aria tables in alter_table_online.test
      - alter_table_flags now takes an ulonglong as argument.
      - Don't support online operations if checksum option is used.
      - sql_lex.cc doesn't add ALTER_ADD_INDEX if index is not created
      2dbeebdb