1. 14 Apr, 2024 2 commits
  2. 12 Apr, 2024 1 commit
    • Vlad Lesin's avatar
      MDEV-33802 Weird read view after ROLLBACK of other transactions. · d7fc975c
      Vlad Lesin authored
      In the case if some unique key fields are nullable, there can be
      several records with the same key fields in unique index with at least
      one key field equal to NULL, as NULL != NULL.
      
      When transaction is resumed after waiting on the record with at least one
      key field equal to NULL, and stored in persistent cursor record is
      deleted, persistent cursor can be restored to the record with all key
      fields equal to the stored ones, but with at least one field equal to
      NULL. And such record is wrongly treated as a record with the same unique
      key as stored in persistent cursor record one, what is wrong as
      NULL != NULL.
      
      The fix is to check if at least one unique field is NULL in restored
      persistent cursor position, and, if so, then don't treat the record as
      one with the same unique key as in the stored record key.
      
      dict_index_t::nulls_equal was removed, as it was initially developed for
      never existed in MariaDB "intrinsic tables", and there is no code, which
      would set it to "true".
      
      Reviewed by Marko Mäkelä.
      d7fc975c
  3. 10 Apr, 2024 2 commits
    • Marko Mäkelä's avatar
      MDEV-33512 Corrupted table after IMPORT TABLESPACE and restart · d8249775
      Marko Mäkelä authored
      In commit d74d9596 (MDEV-18543)
      there was an error that would cause the hidden metadata record
      to be deleted, and therefore cause the table to appear corrupted
      when it is reloaded into the data dictionary cache.
      
      PageConverter::update_records(): Do not delete the metadata record,
      but do validate it.
      
      RecIterator::open(): Make the API more similar to 10.6, to simplify
      merges.
      d8249775
    • Yuchen Pei's avatar
      MDEV-33661 MENT-1591 Keep spider in memory until exit in ASAN builds · 662bb176
      Yuchen Pei authored
      Same as MDEV-29579. For some reason, libodbc does not clean up
      properly if unloaded too early with the dlclose() of spider. So we add
      UNIQUE symbols to spider so the spider does not reload in dlclose().
      
      This change, however, uncovers some hidden problems in the spider
      codebase, for which we move the initialisation of some spider global
      variables into the initialisation of spider itself.
      
      Spider has some global variables. Their initialisation should be done
      in the initialisation of spider itself, otherwise, if spider were
      re-initialised without these symbol being unloaded, the values could
      be inconsistent and causing issues.
      
      One such issue is caused by the variables
      spider_mon_table_cache_version and spider_mon_table_cache_version_req.
      They are used for resetting the spider monitoring table cache and have
      initial values of 0 and 1 respectively. We have that always
      spider_mon_table_cache_version_req >= spider_mon_table_cache_version,
      and when the relation is strict, the cache is reset,
      spider_mon_table_cache_version is brought to be equal to
      spider_mon_table_cache_version_req, and the cache is searched for
      matching table_name, db_name and link_idx. If the relation is equal,
      no reset would happen and the cache would be searched directly.
      
      When spider is re-inited without resetting the values of
      spider_mon_table_cache_version and spider_mon_table_cache_version_req
      that were set to be equal in the previous cache reset action, the
      cache was emptied in the previous spider deinit, which would result in
      HA_ERR_KEY_NOT_FOUND unexpectedly.
      
      An alternative way to fix this issue would be to call the spider udf
      spider_flush_mon_cache_table(), which increments
      spider_mon_table_cache_version_req thus making sure the inequality is
      strict. However, there's no reason for spider to initialise these
      global variables on dlopen(), rather than on spider init, which is
      cleaner and "purer".
      
      To reproduce this issue, simply revert the changes involving the two
      variables and then run:
      
      mtr --no-reorder spider.ha{,_part}
      662bb176
  4. 08 Apr, 2024 8 commits
  5. 05 Apr, 2024 1 commit
  6. 04 Apr, 2024 1 commit
    • Sergei Petrunia's avatar
      MDEV-21102: Server crashes in JOIN_CACHE::write_record_data upon EXPLAIN with subqueries · 8cc36fb7
      Sergei Petrunia authored
      JOIN_CACHE has a light-weight initialization mode that's targeted at
      EXPLAINs. In that mode, JOIN_CACHE objects are not able to execute.
      
      Light-weight mode was used whenever the statement was an EXPLAIN. However
      the EXPLAIN can execute subqueries, provided they enumerate less than
      @@expensive_subquery_limit rows.
      
      Make sure we use light-weight initialization mode only when the select is
      more expensive @@expensive_subquery_limit.
      
      Also add an assert into JOIN_CACHE::put_record() which prevents its use
      if it was initialized for EXPLAIN only.
      8cc36fb7
  7. 28 Mar, 2024 2 commits
  8. 27 Mar, 2024 6 commits
  9. 26 Mar, 2024 6 commits
  10. 25 Mar, 2024 1 commit
  11. 21 Mar, 2024 2 commits
  12. 19 Mar, 2024 4 commits
  13. 18 Mar, 2024 2 commits
  14. 15 Mar, 2024 2 commits
    • mariadb-DebarunBanerjee's avatar
      MDEV-31154 Fatal InnoDB error or assertion `!is_v' failure upon multi-update... · d912a636
      mariadb-DebarunBanerjee authored
      MDEV-31154 Fatal InnoDB error or assertion `!is_v' failure upon multi-update with indexed virtual column
      MDEV-33558 Fatal error InnoDB: Clustered record field for column x not found
      
      This is issue is about row ID filtering used with index on virtual
      column(s). We hit debug assert and crash while building the record
      template in Innodb. The primary reason is that we try to force the code
      path to use the ICP path. With ICP, we don't support index with virtual
      column and we validate it while index condition is pushed.
      
      Simplify the code for building template to handle both ICP and Row ID
      filtering by skipping virtual columns.
      d912a636
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-33214 Table is getting rebuild with ALTER TABLE ADD COLUMN · f5df4482
      Thirunarayanan Balathandayuthapani authored
      Problem:
      ======
      - InnoDB fail to do instant operation while adding the variable
      length column. Problem is that InnoDB wrongly assumes that
      variable character length can never part of externally stored
      page.
      
      Solution:
      ========
      instant_alter_column_possible(): Variable length
      character field can be stored as externally stored page.
      f5df4482