1. 10 Jul, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-31642: Upgrade may crash if innodb_log_file_buffering=OFF · c358e216
      Marko Mäkelä authored
      recv_log_recover_10_5(): Make reads aligned by 4096 bytes, to avoid
      any trouble in case the file was opened in O_DIRECT mode and
      the physical block size is larger than 512 bytes.
      Because innodb_log_file_size used to be defined in whole megabytes,
      reading multiples of 4096 bytes instead of 512 should not be an issue.
      c358e216
  2. 06 Jul, 2023 1 commit
  3. 05 Jul, 2023 10 commits
    • Sergei Golubchik's avatar
      bugfix: join a=b where cast(a as type_of_b) can produce NULL · 1570c6e3
      Sergei Golubchik authored
      optimizer implicitly assumed that if `a` in `a=b` is not NULL,
      then it's safe to convert `a` to the type of `b` and search the
      result in the index(b).
      
      which is not always the case, as converting a non-null value
      to a different type might produce NULL. And searching for NULL
      in the index might find NULL there, so NULL will be equal to NULL,
      making `a=b` behave as if it was `a<=>b`
      1570c6e3
    • Sergei Golubchik's avatar
      MDEV-29959 UUID Sorting · ef84f813
      Sergei Golubchik authored
      * UUIDs version >= 6 are now stored without byte-swapping
      * UUIDs with version >=8 and variant=0 are now considered invalid
      * old tables are supported
      * old (always byte swapped) and new (swapped for version < 6) UUIDs
        can be compared and converted transparently
      ef84f813
    • Sergei Golubchik's avatar
      cleanup: remove sql_type_uuid.cc · 8bf25f3f
      Sergei Golubchik authored
      this is a necessary prerequisite for making UUID itself a template
      8bf25f3f
    • Sergei Golubchik's avatar
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.9 · 15a42a0a
      Marko Mäkelä authored
      15a42a0a
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 2855bc53
      Marko Mäkelä authored
      2855bc53
    • Marko Mäkelä's avatar
      MDEV-31568 InnoDB protection against dual processes accessing data insufficient · bd7908e6
      Marko Mäkelä authored
      fil_node_open_file_low(): Always acquire an advisory lock on
      the system tablespace. Originally, we already did this in
      SysTablespace::open_file(), but SysTablespace::open_or_create()
      would release those locks when it is closing the file handles.
      
      This is a 10.5+ specific follow up to
      commit 0ee1082b (MDEV-28495).
      
      Thanks to Daniel Black for verifying this bug.
      bd7908e6
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.9 · ecd23f62
      Marko Mäkelä authored
      ecd23f62
    • Marko Mäkelä's avatar
      MDEV-31628: InnoDB reports the wrong system tablespace size on bootstrap · b1317c17
      Marko Mäkelä authored
      SysTablespace::set_size(): Use correct 64-bit arithmetics for
      reporting the initial size of the InnoDB system or temporary tablespace.
      b1317c17
    • Marko Mäkelä's avatar
      MDEV-31621 Remove ibuf_read_merge_pages() call from ibuf_insert_low() · 5b62644e
      Marko Mäkelä authored
      When InnoDB attempts to buffer a change operation of a secondary index
      leaf page (to insert, delete-mark or remove a record) and the
      change buffer is too large, InnoDB used to trigger a change buffer merge
      that could affect any tables. This could lead to huge variance in
      system throughput and potentially unpredictable crashes, in case the
      change buffer was corrupted and a crash occurred while attempting to
      merge changes to a table that is not being accessed by the current
      SQL statement.
      
      ibuf_insert_low(): Simply return DB_STRONG_FAIL when the maximum size
      of the change buffer is exceeded.
      
      ibuf_contract_after_insert(): Remove.
      
      ibuf_get_merge_page_nos_func(): Remove a constant parameter.
      The function ibuf_contract() will be our only caller, during
      shutdown with innodb_fast_shutdown=0.
      5b62644e
  4. 04 Jul, 2023 10 commits
  5. 03 Jul, 2023 5 commits
  6. 30 Jun, 2023 3 commits
    • Marko Mäkelä's avatar
      MDEV-31559 btr_search_hash_table_validate() does not check if CHECK TABLE is killed · 3d901438
      Marko Mäkelä authored
      btr_search_hash_table_validate(), btr_search_validate(): Add the
      parameter THD for checking if the statement has been killed.
      Any non-QUICK CHECK TABLE will validate the entire adaptive hash index
      for all InnoDB tables, which may be extremely slow when running
      multiple concurrent CHECK TABLE.
      3d901438
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.9 · d04de1aa
      Marko Mäkelä authored
      d04de1aa
    • Oleg Smirnov's avatar
      MDEV-30639 Upgrade to 10.8 and later does not work on Windows · 6d911219
      Oleg Smirnov authored
      During the upgrade procedure on Windows mysqld.exe is started with
      the named pipe connection protocol. mysqladmin.exe then pings the
      server to check if is up and running. Command line looks like:
         mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
      But the "socket" parameter resets the "protocol" which was previously
      initialized with the "pipe" value, setting it to "socket".
      As a result, connection cannot be established and the upgrade
      procedure fails.
      "socket" in Windows is used to pass the name of the pipe so resetting
      the protocol is not valid in this case.
      
      This commit fixes resetting of the "protocol" parameter with "socket"
      parameter in the case when protocol has been previously initialized
      to "pipe" value
      6d911219
  7. 29 Jun, 2023 3 commits
    • Alexander Barkov's avatar
      MDEV-31578 DECLARE CURSOR: "Memory not freed: 280 bytes lost" on syntax error · fdab2c4c
      Alexander Barkov authored
      When CURSOR parameters get parsed, their sp_assignment_lex instances
      (one instance per parameter) get collected to List<sp_assignment_lex>.
      
      These instances get linked to sphead only in the end of the list.
      If a syntax error happened in the middle of the parameter list,
      these instances were not deleted, which caused memory leaks.
      
      Fix:
      
      using a Bison %destructor to free rules of the <sp_assignment_lex_list>
      type (on syntax errors).
      
      Afte the fix these sp_assignment_lex instances from CURSOR parameters
      deleted as follows:
      
      - If the CURSOR statement was fully parsed, then these instances
        get properly linked to sp_head structures, so they are deleted
        during ~sp_head (this did not change)
      
      - If the CURSOR statement failed on a syntax error, then by Bison's
        %destructor (this is being added in the current patch).
      fdab2c4c
    • Oleg Smirnov's avatar
      MDEV-30639 Upgrade to 10.8 and later does not work on Windows · 8e2b20bf
      Oleg Smirnov authored
      During the upgrade procedure on Windows mysqld.exe is started with
      the named pipe connection protocol. mysqladmin.exe then pings the
      server to check if is up and running. Command line looks like:
         mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
      But the "socket" parameter resets the "protocol" which was previously
      initialized with the "pipe" value, setting it to "socket".
      As a result, connection cannot be established and the upgrade
      procedure fails.
      "socket" in Windows is used to pass the name of the pipe so resetting
      the protocol is not valid in this case.
      
      This commit fixes resetting of the "protocol" parameter with "socket"
      parameter in the case when protocol has been previously initialized
      to "pipe" value
      8e2b20bf
    • Alexander Barkov's avatar
      MDEV-30680 Warning: Memory not freed: 280 on mangled query, LeakSanitizer: detected memory leaks · 0d3720c1
      Alexander Barkov authored
      The parser works as follows:
      
      The rule expr_lex returns a pointer to a newly created sp_expr_lex
      instance which is not linked to any MariaDB structures yet - it is
      pointed only from a Bison stack variable. The sp_expr_lex instance
      gets linked to other structures (such as sp_instr_jump_if_not) later,
      after scanning some following grammar.
      
      Problem before the fix:
      If a parse error happened immediately after expr_lex (before it got linked),
      the created sp_expr_lex value got lost causing a memory leak.
      
      Fix:
      
      - Using Bison's "destructor" directive to free the results of expr_lex
        on parse/oom errors.
      
      - Moving the call for LEX::cleanup_lex_after_parse_error() from
        MYSQL_YYABORT and yyerror inside parse_sql().
        This is needed because Bison calls destructors after yyerror(),
        while it's important to delete the sp_expr_lex instance before
        LEX::cleanup_lex_after_parse_error().
        The latter frees the memory root containing the sp_expr_lex instance.
      
        After this change the code block are executed in the following order:
      
        - yyerror() -- now only raises the error to DA (no cleanup done any more)
        - %destructor { delete $$; } <expr_lex>  -- destructs the sp_expr_lex instance
        - LEX::cleanup_lex_after_parse_error()   -- frees the memory root containing
                                                    the sp_expr_lex instance
      
      - Removing the "delete sublex" related code from restore_lex():
        - restore_lex() is called in most cases on success, when delete is not needed.
        - There is one place when restore_lex() is called on error:
          In sp_create_assignment_instr(). But in this case LEX::sp_lex_in_use
          is true anyway.
          The patch adds a new DBUG_ASSERT(lex->sp_lex_in_use) to guard this.
      0d3720c1
  8. 28 Jun, 2023 6 commits
  9. 27 Jun, 2023 1 commit