1. 13 Dec, 2017 2 commits
    • Alexander Barkov's avatar
      Removing a dead code in sql_load.cc · 701e22d5
      Alexander Barkov authored
      The loop in read_xml_field(), unlike the same loop in read_sep_field(),
      cannot end with item<>NULL, as it does not have any "break" statements.
      The entire block "if (item) {...}" was a dead code.
      701e22d5
    • Alexander Barkov's avatar
      MDEV-14628 Wrong autoinc value assigned by LOAD XML in the NO_AUTO_VALUE_ON_ZERO mode · a53e087e
      Alexander Barkov authored
      The fixes for these bugs:
      
      Bug#27586 Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode
      Bug#22372 Disable spatial key, load data, enable spatial key, crashes table
      
      fixed only LOAD DATA INFILE, but did not fix LOAD XML INFILE.
      
      This patch does for LOAD XML FILE what patches for Bug#27586 and Bug#22372
      earlier did for LOAD DATA INFILE.
      
      1. Fixing the auto_increment problem:
         a. table->auto_increment_field_not_null is not set to TRUE
            anymore when a column does not have a corresponding XML tag.
         b. Adding "table->auto_increment_field_not_null= false"
            in the end of read_xml_field().
         These two changes resemble the patch for Bug#27586.
      
      2. Fixing the GEOMETRY problem:
         The result for "reset()" was not tested for errors in read_xml_field(),
         which made it possible for empty string to sneak into a "GEOMETRY NOT NULL"
         column when this column does not have a corresponding XML tag with data.
         After this patch the result of reset() is tested and and an error is
         returned in such cases.
         This change effectively resembles the patch for Bug#22372
      
      3. Spliting the code into a new virtual method Field::load_data_set_null().
      
         Rationale:
         a. To avoid duplicate code in read_sep_field() and read_xml_field():
            Changes #1 and #2 made the code handling NULL values for Field
            exactly the same in read_sep_field() and read_xml_field().
      
        b. To avoid tests for field_type(), which is not friendly to
           upcoming data type plugins.
           This change makes it possible for data type plugins
           to implement their own special way for handling NULL values in LOAD DATA
           by overriding Field_xxx::load_data_set_null(),
           like Field_geom and Field_timestamp do.
      a53e087e
  2. 12 Dec, 2017 5 commits
  3. 11 Dec, 2017 11 commits
  4. 08 Dec, 2017 17 commits
    • Sergey Vojtovich's avatar
      Fixed LF_BACKOFF calls · 927dd9f3
      Sergey Vojtovich authored
      927dd9f3
    • Marko Mäkelä's avatar
      Remove the unused function row_is_magic_monitor_table() · 0af52734
      Marko Mäkelä authored
      Before MySQL 5.7 or MariaDB 10.2.2, there used to be some
      magic InnoDB table names that would assign some InnoDB flags
      on CREATE TABLE or DROP TABLE.
      0af52734
    • Marko Mäkelä's avatar
      Remove dead code for "InnoDB table(space) monitor" · 51bc4074
      Marko Mäkelä authored
      Starting with MySQL 5.7 (or MariaDB 10.2.2) InnoDB no longer contains
      the "table monitor" or "tablespace monitor". The conditions on
      srv_print_innodb_tablespace_monitor, srv_print_innodb_table_monitor
      never hold. So, the code was dead.
      
      Also, remove a bogus reference to dict_print(), which used to implement
      the InnoDB table monitor.
      51bc4074
    • Marko Mäkelä's avatar
      Remove space_name_list_t · 39450498
      Marko Mäkelä authored
      fil_get_space_names(): Remove.
      
      fts_drop_orphaned_tables(): Iterate fil_system->space_list directly.
      39450498
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 094b0f86
      Marko Mäkelä authored
      094b0f86
    • Vladislav Vaintroub's avatar
      Fix warnings · bf963106
      Vladislav Vaintroub authored
      bf963106
    • Monty's avatar
      Fix failing mtr tests · 38908aaf
      Monty authored
      - Changed rocksdb.2pcgroup_commit.test to print information on error
      - Updated myisam_views-big.result
      38908aaf
    • Monty's avatar
      Move all kill mutex protection to LOCK_thd_kill · c2118a08
      Monty authored
      LOCK_thd_data was used to protect both THD data and
      ensure that the THD is not deleted while it was in use
      
      This patch moves the THD delete protection to LOCK_thd_kill,
      which already protects the THD for kill.
      
      The benefits are:
      - More well defined what LOCK_thd_data protects
      - LOCK_thd_data usage is now much simpler and easier to verify
      - Less chance of deadlocks in SHOW PROCESS LIST as there is less
        chance of interactions between mutexes
      - Remove not needed LOCK_thread_count from
        thd_get_error_context_description()
      - Fewer mutex taken for thd->awake()
      
      Other things:
      - Don't take mysys->var mutex in show processlist to check if thread
        is kill marked
      - thd->awake() now automatically takes the LOCK_thd_kill mutex
        (Simplifies code)
      - Apc uses LOCK_thd_kill instead of LOCK_thd_data
      c2118a08
    • Monty's avatar
      Updated MW-388.result file · 3574f9c7
      Monty authored
      3574f9c7
    • Monty's avatar
      Don't wait too long in SHOW PROCESSLIST · 7891a713
      Monty authored
      This will allow show processlist to continue, without blocking
      all new connections, if some threads gets stuck while holding
      LOCK_thd_data or mysys_var->mutex
      
      Connections that has mutex 'stuck' are marked as 'Busy' in 'Command'
      
      Todo:
      Make F_BACKOFF to do 'pause' instead of just (1)
      7891a713
    • Sergey Vojtovich's avatar
      Restore LF_BACKOFF · b3346c2f
      Sergey Vojtovich authored
      Moved InnoDB UT_RELAX_CPU() to server. Restored cross-platform LF_BACKOFF
      implementation basing on UT_RELAX_CPU().
      b3346c2f
    • Jan Lindström's avatar
      Fix test failures. · 2662228d
      Jan Lindström authored
      2662228d
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-14378 In ALGORITHM=INPLACE, use a common name for the intermediate tables or partitions · 07e9ff1f
      Marko Mäkelä authored
      Allow DROP TABLE `#mysql50##sql-...._.` to drop tables that were
      being rebuilt by ALGORITHM=INPLACE
      
      NOTE: If the server is killed after the table-rebuilding ALGORITHM=INPLACE
      commits inside InnoDB but before the .frm file has been replaced, then
      the recovery will involve something else than DROP TABLE.
      
      NOTE: If the server is killed in a true inplace ALTER TABLE commits
      inside InnoDB but before the .frm file has been replaced, then we
      are really out of luck. To properly handle that situation, we would
      need a transactional mysql.ddl_fixup table that directs recovery to
      rename or remove files.
      
      prepare_inplace_alter_table_dict(): Use the altered_table->s->table_name
      for generating the new_table_name.
      
      table_name_t::part_suffix: The start of the partition name suffix.
      
      table_name_t::dbend(): Return the end of the schema name.
      
      table_name_t::dblen(): Return the length of the schema name, in bytes.
      
      table_name_t::basename(): Return the name without the schema name.
      
      table_name_t::part(): Return the partition name, or NULL if none.
      
      row_drop_table_for_mysql(): Assert for #sql, not #sql-ib.
      07e9ff1f
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 0a02c1a6
      Marko Mäkelä authored
      0a02c1a6
    • Marko Mäkelä's avatar
      MDEV-14606 Assertion failure on IMPORT TABLESPACE · dfafe15a
      Marko Mäkelä authored
      fseg_alloc_free_page_low(): Remove a bogus and redundant assertion about
      fil_space_t::purpose. The debug function fsp_space_modify_check()
      is asserting something similar, but more accurately.
      dfafe15a
    • Alexander Barkov's avatar
  5. 07 Dec, 2017 5 commits
    • Sergei Petrunia's avatar
      MDEV-14607: storage_engine-rocksdb.type_bit_indexes fails after latest pushes · 578b2659
      Sergei Petrunia authored
      Update the .result file. Old EXPLAIN output was incorrect due to
      hitting MDEV-14563.
      578b2659
    • Alexander Barkov's avatar
      08dae447
    • Jan Lindström's avatar
      4d016e6e
    • Jan Lindström's avatar
      MDEV-14401: Stored procedure that declares a handler that catches... · ba576c5b
      Jan Lindström authored
      MDEV-14401: Stored procedure that declares a handler that catches ER_LOCK_DEADLOCK error causes thd->is_error() assertion
      
      This was missing bug fix from MySQL wsrep i.e. Galera.
      Problem was that if stored procedure declares a handler that
      catches deadlock error, then the error may have been
      cleared in method sp_rcontext::handle_sql_condition().
      Use wsrep_conflict_state correctly to determine is the
      error already sent to client.
      
      Add test case for both this bug and MDEV-12837: WSREP: BF
      lock wait long. Test requires both fixes to pass.
      ba576c5b
    • Jan Lindström's avatar
      MDEV-12837: WSREP: BF lock wait long · da3a3a68
      Jan Lindström authored
      Problem was a merge error from MySQL wsrep i.e. Galera.
      
      wsrep_on_check
      	New check function. Galera can't be enabled
      	if innodb-lock-schedule-algorithm=VATS.
      
      innobase_kill_query
      	In Galera async kill we could own lock mutex.
      
      innobase_init
      	If Variance-Aware-Transaction-Sheduling Algorithm (VATS) is
      	used on Galera we fall back to First-Come-First-Served (FCFS)
      	with notice to user.
      
      Changed innodb-lock-schedule-algorithm as read-only parameter
      as it was designed to be.
      
      lock_reset_lock_and_trx_wait
      	Use ib::hex() to print out transaction ID.
      
      lock_rec_other_has_expl_req,
      lock_rec_other_has_conflicting,
      RecLock::add_to_waitq
      lock_rec_lock_slow
      lock_table_other_has_incompatible
      lock_rec_insert_check_and_lock
      lock_prdt_other_has_conflicting
      
      	Change pointer to conflicting lock to normal pointer as this
      	pointer contents could be changed later.
      
      RecLock::create
      	Conclicting lock pointer is moved to last parameter with
      	default value NULL. This conflicting transaction could
      	be selected as victim in Galera if requesting transaction
      	is BF (brute force) transaction. In this case contents
      	of conflicting lock pointer will be changed. Use ib::hex() to print
      	transaction ids.
      da3a3a68