1. 19 Jan, 2024 1 commit
  2. 18 Jan, 2024 1 commit
    • Marko Mäkelä's avatar
      MDEV-32268: GNU libc posix_fallocate() may be extremely slow · ee1407f7
      Marko Mäkelä authored
      os_file_set_size(): Let us invoke the Linux system call fallocate(2)
      directly, because the GNU libc posix_fallocate() implements a fallback
      that writes to the file 1 byte every 4096 or fewer bytes. In one
      environment, invoking fallocate() directly would lead to 4 times the
      file growth rate during ALTER TABLE. Presumably, what happened was
      that the NFS server used a smaller allocation block size than 4096 bytes
      and therefore created a heavily fragmented sparse file when
      posix_fallocate() was used. For example, extending a file by 4 MiB
      would create 1,024 file fragments. When the file is actually being
      written to with data, it would be "unsparsed".
      
      The built-in EOPNOTSUPP fallback in os_file_set_size() writes a buffer
      of 1 MiB of NUL bytes. This was always used on musl libc and other
      Linux implementations of posix_fallocate().
      ee1407f7
  3. 17 Jan, 2024 2 commits
    • Robin Newhouse's avatar
      MDEV-32587 Allow json exponential notation starting with zero · 615f4a8c
      Robin Newhouse authored
      Modify the NS_ZERO state in the JSON number parser to allow
      exponential notation with a zero coefficient (e.g. 0E-4).
      
      The NS_ZERO state transition on 'E' was updated to move to the
      NS_EX state rather than returning a syntax error. Similar change
      was made for the NS_ZE1 (negative zero) starter state.
      
      This allows accepted number grammar to include cases like:
      
      - 0E4
      - -0E-10
      
      which were previously disallowed. Numeric parsing remains
      the same for all other states.
      
      Test cases are added to func_json.test to validate parsing for
      various exponential numbers starting with zero coefficients.
      
      All new code of the whole pull request, including one or several files
      that are either new files or modified ones, are contributed under the
      BSD-new license. I am contributing on behalf of my employer Amazon Web
      Services.
      615f4a8c
    • Oleksandr Byelkin's avatar
      new WolfSSL v5.6.6-stable · 8e337e01
      Oleksandr Byelkin authored
      8e337e01
  4. 16 Jan, 2024 1 commit
  5. 15 Jan, 2024 1 commit
  6. 11 Jan, 2024 3 commits
  7. 10 Jan, 2024 4 commits
  8. 09 Jan, 2024 2 commits
    • Sergei Golubchik's avatar
      MDEV-33148 A connection can control RAND() in following connection · c6e1ffd1
      Sergei Golubchik authored
      initialize THD::rand in THD::init() not in THD::THD(),
      because the former is also called when a THD is reused -
      in COM_CHANGE_USER and in taking a THD from the cache.
      
      Also use current cycle timer for more unpreditability
      c6e1ffd1
    • Alexander Barkov's avatar
      MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol · 9322ef03
      Alexander Barkov authored
      Item_float::neg() did not preserve the "presentation" from "this".
      So
        CAST(-1e0 AS UNSIGNED)  -- cast from double to unsigned
      changes its meaning to:
        CAST(-1 AS UNSIGNED)  -- cast signed to undigned
      
      Fixing Item_float::neg() to construct the new value for
      Item_float::presentation as follows:
      - if the old value starts with minus, then the minus is truncated:
        '-2e0' -> '2e0'
      - otherwise, minus sign followed by its old value:
        '1e0'  -> '-1e0'
      9322ef03
  9. 08 Jan, 2024 4 commits
  10. 04 Jan, 2024 1 commit
  11. 03 Jan, 2024 3 commits
    • Igor Babaev's avatar
      MDEV-31657 Crash on query using CTE with the same name as a base table · 54ed3939
      Igor Babaev authored
      If a query contained a CTE whose name coincided with the name of one of
      the base tables used in the specification of the CTE and the query had at
      least two references to this CTE in the specifications of other CTEs then
      processing of the query led to unlimited recursion that ultimately caused
      a crash of the server.
      
      Any secondary non-recursive reference to a CTE requires creation of a copy
      of the CTE specification. All the references to CTEs in this copy must be
      resolved. If the specification contains a reference to a base table whose
      name coincides with the name of then CTE then it should be ensured that
      this reference in no way can be resolved against the name of the CTE.
      54ed3939
    • Marko Mäkelä's avatar
      MDEV-33157 WSREP: Fix function pointer mismatch · 96130b18
      Marko Mäkelä authored
      wsrep_plugin_init(), wsrep_plugin_deinit(): Remove these dummy functions
      in order to fix an error that would be flagged by cmake -DWITH_UBSAN=ON
      when using clang.
      
      wsrep_show_ready(), wsrep_show_bf_aborts(): Correct the signature.
      96130b18
    • Igor Babaev's avatar
      MDEV-29362 Crash with query using constant subquery as left part of IN subquery · 832e96de
      Igor Babaev authored
      If a query has a HAVING clause that contains a predicate with a constant
      IN subquery whose lef part in its turn is a subquery and the predicate is
      subject to pushdown from HAVING to WHERE then execution of the query could
      cause a crash of the server.
      
      The cause of the problem was the missing implementation of the walk()
      method for the class Item_in_optimizer. As a result in some cases the left
      operand of the Item_in_optimizer condition could be traversed twice by
      the walk procedure. For many call-back functions used as an argument of
      this procedure it does not matter. Yet it matters for the call-back
      function cleanup_excluding_immutables_processor() used in pushdown of
      predicates from HAVING to WHERE. If the processed item is marked with
      the IMMUTABLE_FL flag then the processor just removes this flag, otherwise
      it performs cleanup of the item making it unfixed. If an item is marked
      with an the IMMUTABLE_FL and it traversed with this processor twice then
      it becomes unfixed after the second traversal though the flag indicates
      that the item should not be cleaned up.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      832e96de
  12. 27 Dec, 2023 3 commits
    • Alexander Barkov's avatar
      MDEV-33019 The database part is not case sensitive in SP names · 9695974e
      Alexander Barkov authored
      Problem:
      
      sp_cache erroneously looked up fully qualified SP names (e.g. `DB`.`SP`),
      in case insensitive style. It was wrong, because only the "name"
      part is always case insensitive, while the "db" part should be compared
      according to lower_case_table_names (case sensitively for 0,
      case insensitively for 1 and 2).
      
      Fix:
      
      Adding a "casedn_name" parameter make_qname() to tell
      if the name part should be lower cased:
        `DB1`.`SP` -> "DB1.SP"  (when casedn_name=false)
        `DB1`.`SP` -> "DB1.sp"  (when casedn_name=true)
      and using make_qname() with casedn_name=true when creating
      sp_cache hash lookup keys.
      
      Details:
      
      As a result, it now works as follows:
      - sp_head::m_db is converted to lower case if lower_case_table_names>0
        during the sp_name initialization phase. So when make_qname() is called,
        sp_head::m_db is already normalized. There are no changes in here.
      
      - The initialization phase of sp_head when creating sp_head::m_qname
        now calls make_qname() with casedn_name=true,
        so sp_head::m_name gets written to sp_head::m_qname in lower case.
      
      - sp_cache_lookup() now also calls make_qname() with casedn_name=true,
        so sp_head::m_name gets written to the temporary lookup key in lower case.
      
      - sp_cache::m_hashtable now uses case sensitive comparison
      9695974e
    • Alexander Barkov's avatar
      MDEV-33019 The database part is not case sensitive in SP names · 916caac2
      Alexander Barkov authored
      Part#1 A non-functional change
      
      Changing the signature of Identifier_chain2::make_qname() from
      
        bool make_qname(MEM_ROOT *mem_root, LEX_CSTRING *dst) const;
      
      to
      
        LEX_CSTRING make_qname(MEM_ROOT *mem_root) const;
      
      Now the result is returned as LEX_CSTRING from the function rather than
      is passed as a parameter.
      The return value {NULL,0} means "EOM".
      916caac2
    • Alexander Barkov's avatar
      A 11.3->10.4 backport for MDEV-31991 Split class Database_qualified_name · 371bf4ab
      Alexander Barkov authored
      This is a requirement step to fix and merge easier
        MDEV-33019 The database part is not case sensitive in SP names
      
      The original MDEV-31991 commit commend:
      
      - Moving some of Database_qualified_name methods into a new class
        Identifier_chain2.
      
      - Changing the data type of the following variables from
        Database_qualified_name to Identifier_chain2:
      
        * q_pkg_proc in LEX::call_statement_start()
        * q_pkg_func in LEX::make_item_func_call_generic()
      
      Rationale:
      
      The data type of Database_qualified_name::m_db will be changed
      to Lex_ident_db soon. So Database_qualified_name won't be able
      to store the `pkg.routine` part of `db.pkg.routine` any more,
      because `pkg` must not depend on lower-case-table-names.
      371bf4ab
  13. 23 Dec, 2023 1 commit
  14. 22 Dec, 2023 1 commit
  15. 21 Dec, 2023 6 commits
  16. 20 Dec, 2023 6 commits