1. 27 Sep, 2019 1 commit
    • Marko Mäkelä's avatar
      MDEV-20117: Fix another scenario · ea2b19de
      Marko Mäkelä authored
      Thanks to Eugene Kosov for noting that the fix is incomplete.
      It turns out that on instant DROP/reorder column (MDEV-15562),
      we must always write the metadata record, even though the table
      was empty. Alternatively, we should guarantee that all undo
      log records for the table have been purged. (Attempting to do
      that by updating table_id leads to other problems; see
      commit 1b31d885.)
      
      It would be tempting to remove dict_index_t::clear_instant_alter()
      altogether, but it turns that we need that when the instant ALTER TABLE
      operation of a first-time DROP COLUMN is being rolled back.
      
      innobase_instant_try(): Clarify a comment. Purge never calls
      dict_index_t::clear_instant_alter(), but it may invoke
      dict_index_t::clear_instant_add(). On first-time instant DROP/reorder,
      always write a metadata record, even if the table is empty.
      ea2b19de
  2. 26 Sep, 2019 9 commits
    • Marko Mäkelä's avatar
      MDEV-20117 Assertion 0 failed in row_sel_get_clust_rec_for_mysql · 1f4ee3fa
      Marko Mäkelä authored
      The crash scenario is as follows:
      
      (1) A non-empty table exists.
      (2) MDEV-15562 instant ADD/DROP/reorder has been invoked.
      (3) Some purgeable undo log exists for the table.
      (4) The table becomes empty, containing not even any delete-marked records,
      only containing the hidden metadata record that was added in (2).
      (5) An instant ADD/DROP/reorder column is executed, and the table
      is emptied and the (2) metadata removed.
      (6) Purge processes an undo log record from (3), which will refer to
      a non-existent clustered index field, because the metadata that
      was created in (2) was remoeved in (5).
      
      We fix this by adjusting step (5) so that we will never remove the
      MDEV-15562-style metadata record. Removing the MDEV-11369 metadata
      record (instant ADD COLUMN to the end of the table) is completely
      fine at any time when the table becomes empty, because
      dict_index_t::n_fields will remain unchanged.
      
      innobase_instant_try(): Never remove the MDEV-15562 metadata record.
      
      page_cur_delete_rec(): Do not reset FIL_PAGE_TYPE when the
      MDEV-15562 metadata record is being removed as part of
      btr_cur_pessimistic_update() invoked by innobase_instant_try().
      1f4ee3fa
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · bb5afc7c
      Marko Mäkelä authored
      bb5afc7c
    • Marko Mäkelä's avatar
      Fix GCC 9 -Wmaybe-uninitialized · 46facaed
      Marko Mäkelä authored
      Always initialize ScopedStatementReplication::saved_binlog_format,
      so that GCC cannot emit a bogus warning about
      ScopedStatementReplication::~ScopedStatementReplication() using the
      variable.
      
      The code was originally introduced in
      commit d998da03.
      46facaed
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1cf0694d
      Marko Mäkelä authored
      1cf0694d
    • Marko Mäkelä's avatar
      MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5 · 3e4931cd
      Marko Mäkelä authored
      lock_print_info::operator(): Do not dereference purge_sys.query in case
      it is NULL. We would not initialize purge_sys if innodb_force_recovery
      is set to 5 or 6.
      
      The test case will be added by merge from 10.2.
      3e4931cd
    • Marko Mäkelä's avatar
      MDEV-19514 preparation: Extend innodb.innodb-change-buffer-recovery · 2d6719d7
      Marko Mäkelä authored
      Test innodb_read_only startup (which will be refused after a crash),
      and test also innodb_force_recovery=5, and extract some change buffer
      merge statistics. Omit any statistics about delete (purge) buffering,
      because purge could happen at any time.
      
      Use the sequence storage engine for populating the table.
      2d6719d7
    • Marko Mäkelä's avatar
      MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5 · 23d67545
      Marko Mäkelä authored
      Add a test case. MariaDB Server 10.2 is not affected.
      23d67545
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 574ff87f
      Marko Mäkelä authored
      574ff87f
    • Marko Mäkelä's avatar
      MDEV-13564 follow-up: Remove dead code · e3c39c0b
      Marko Mäkelä authored
      In MariaDB 10.4.0, commit 09af00cb
      removed the crash-upgrade logic for the MariaDB 10.2
      innodb_safe_truncate=OFF TRUNCATE TABLE (which was the only option
      between MariaDB 10.2.2 and 10.2.18), but failed to adjust some
      comments and code.
      
      buf_page_io_complete(): Remove a bogus comment about TRUNCATE.
      
      dict_recreate_index_tree(): Unused function; remove.
      
      fil_space_t::stop_new_ops: Clarify the comment.
      
      fil_space_acquire_low(): Remove a bogus comment about TRUNCATE.
      
      fil_check_pending_ops(), fil_check_pending_io(): Adjust a warning message.
      This code is only invoked as part of DISCARD TABLESPACE or DROP TABLE.
      DROP TABLE is internally used as part of ALTER TABLE, OPTIMIZE TABLE,
      or TRUNCATE TABLE.
      
      RemoteDatafile::create_link_file(): Clarify a comment.
      
      ibuf_delete_for_discarded_space(): Clarify the function comment.
      
      dict_table_x_lock_indexes(), dict_table_x_unlock_indexes():
      Merge with the only remaining caller, row_quiesce_set_state().
      
      page_create_zip(): Remove a bogus comment about TRUNCATE.
      e3c39c0b
  3. 25 Sep, 2019 2 commits
    • Marko Mäkelä's avatar
      Speed up main.sum_distinct-big · 516f7c11
      Marko Mäkelä authored
      Eliminate one InnoDB table with 128*16384 rows, and use
      the sequence engine instead. Also, run everything in a single
      transaction, to prevent purge from running concurrently
      unnecessarily. (Starting with MariaDB Server 10.3, purge would
      reset the DB_TRX_ID after INSERT.)
      516f7c11
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · d3350c16
      Marko Mäkelä authored
      d3350c16
  4. 24 Sep, 2019 10 commits
  5. 23 Sep, 2019 10 commits
  6. 22 Sep, 2019 1 commit
    • Michael Widenius's avatar
      Proper fix for disabling warnings in read_statistics_for_table(). · 1bbe8c5e
      Michael Widenius authored
      MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value
      
      - Use dbug_tmp_use_all_columns() to mark that all fields can be used
      - Remove field->is_stat_field (not needed)
      - Remove extra arguments to Field::clone() that should not be there
      - Safety fix for Field::set_warning_truncated_wrong_value() to not crash
        if table is zero in production builds (We have got crashes several times
        here so better to be safe than sorry).
      - Threat wrong character string warnings identical to other field
        conversion warnings. This removes some warnings we before got from
        internal conversion errors.  There is no good reason why a user would
        get an error in case of 'key_field='wrong-utf8-string' but not for
        'field=wrong-utf8-string'.  The old code could also easily give
        thousands of no-sence warnings for one single statement.
      1bbe8c5e
  7. 21 Sep, 2019 2 commits
  8. 20 Sep, 2019 5 commits
    • Igor Babaev's avatar
      MDEV-20229 CTE defined with table value constructor cannot be used in views · ba7725da
      Igor Babaev authored
      A CTE can be defined as a table values constructor. In this case the CTE is
      always materialized in a temporary table.
      If the definition of the CTE contains a list of the names of the CTE
      columns then the query expression that uses this CTE can refer to the CTE
      columns by these names. Otherwise the names of the columns are taken from
      the names of the columns in the result set of the query that specifies the
      CTE.
      Thus if the column names of a CTE are provided in the definition the
      columns of result set should be renamed. In a general case renaming of
      the columns is done in the select lists of the query specifying the CTE.
      If a CTE is specified by a table value constructor then there are no such
      select lists and renaming is actually done for the columns of the result
      of materialization.
      Now if a view is specified by a query expression that uses a CTE specified
      by a table value constructor saving the column names of the CTE in the
      stored view definition becomes critical: without these names the query
      expression is not able to refer to the columns of the CTE.
      
      This patch saves the given column names of CTEs in stored view definitions
      that use them.
      ba7725da
    • rantal's avatar
      Update mysqld_safe.sh - introduce defaults-group-suffix handling · fd3ad41e
      rantal authored
      "--defaults-group-suffix" must be be given as the first argument on the command-line of mysqld
      fd3ad41e
    • Vicențiu Ciorbaru's avatar
      MDEV-19211 Fix mysqld_safe --dry-run · 6a7d51b1
      Vicențiu Ciorbaru authored
      mysqld_safe --dry-run needs to either call exit or return, depending if
      it is being sourced or not, otherise return can lead to the error:
      
      return: can only `return' from a function or sourced script
      
      The original fix suggestion was proposed by FaramosCZ <mschorm@centrum.cz>
      6a7d51b1
    • David Carlier's avatar
      Removing obsolete register keyword · 631c5ab4
      David Carlier authored
      631c5ab4
    • chriscalender's avatar
      MDEV-4968 Old advices in mysql-log-rotate script · 13274032
      chriscalender authored
      * Change the comments in mysql-log-rotate.sh to refer to mysqld, not mysqld_safe
        as that's what most distros are using.
      * Change err-log to log-error as err-log is no longer valid.
      * Convert tab to space for consistency.
      13274032