1. 10 Apr, 2024 1 commit
    • 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
  2. 08 Apr, 2024 8 commits
  3. 05 Apr, 2024 1 commit
  4. 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
  5. 28 Mar, 2024 2 commits
  6. 27 Mar, 2024 6 commits
  7. 26 Mar, 2024 6 commits
  8. 25 Mar, 2024 1 commit
  9. 21 Mar, 2024 2 commits
  10. 19 Mar, 2024 4 commits
  11. 18 Mar, 2024 2 commits
  12. 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
  13. 14 Mar, 2024 3 commits
    • Kristian Nielsen's avatar
      MDEV-10793: MDEV-33292: main.kill_processlist-6619 fails sporadically in buildbot · ef7abc88
      Kristian Nielsen authored
      There were several races in the main.kill_processlist-6619 testcase:
      
       - Lingering connections from a previous test case could be visible in SHOW
         PROCESSLIST and cause .result diff.
       - A sync point "dispatch_command_end" was ineffective, as it was consumed at
         the end of the SET DEBUG command itself.
       - The signal from sync point "before_execute_sql_command" could override an
         earlier signal, causing DEBUG_SYNC timeout and test failure.
       - The final SHOW PROCESSLIST could occasionally see a connection in state
         "Busy" instead of the expected "Sleep".
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      ef7abc88
    • Monty's avatar
      Fixed random failure in main.kill_processlist-6619 · ae063e4f
      Monty authored
      The problem was that SHOW PROCESSLIST was done before the command of
      the default connection was cleared.
      
      Reviewer: Sergei Golubchik <serg@mariadb.org>
      ae063e4f
    • Dmitry Shulga's avatar
      MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute()... · d7758deb
      Dmitry Shulga authored
      MDEV-33218: Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed in st_select_lex::fix_prepare_information
      
      In case there is a view that queried from a stored routine or
      a prepared statement and this temporary table is dropped between
      executions of SP/PS, then it leads to hitting an assertion
      at the SELECT_LEX::fix_prepare_information. The fired assertion
       was added by the commit 85f2e4f8
      (MDEV-32466: Potential memory leak on executing of create view statement).
      Firing of this assertion means memory leaking on execution of SP/PS.
      Moreover, if the added assert be commented out, different result sets
      can be produced by the statement SELECT * FROM the hidden table.
      
      Both hitting the assertion and different result sets have the same root
      cause. This cause is usage of temporary table's metadata after the table
      itself has been dropped. To fix the issue, reload the cache of stored
      routines. To do it  cache of stored routines is reset at the end of
      execution of the function dispatch_command(). Next time any stored routine
      be called it will be loaded from the table mysql.proc. This happens inside
      the method Sp_handler::sp_cache_routine where loading of a stored routine
      is performed in case it missed in cache. Loading is performed unconditionally
      while previously it was controlled by the parameter lookup_only. By that
      reason the signature of the method Sroutine_hash_entry::sp_cache_routine
      was changed by removing unused parameter lookup_only.
      
      Clearing of sp caches affects the test main.lock_sync since it forces
      opening and locking the table mysql.proc but the test assumes that each
      statement locks its tables once during its execution. To keep this invariant
      the debug sync points with names "before_lock_tables_takes_lock" and
      "after_lock_tables_takes_lock" are not activated on handling the table
      mysql.proc
      d7758deb
  14. 13 Mar, 2024 1 commit