1. 01 Jul, 2024 2 commits
    • Alexander Barkov's avatar
      MDEV-20548 Unexpected error on CREATE..SELECT HEX(num) · d046b13e
      Alexander Barkov authored
      Item_func_hex::fix_length_and_dec() evaluated a too short data type
      for signed numeric arguments, which resulted in a 'Data too long for column'
      error on CREATE..SELECT.
      
      Fixing the code to take into account that a short negative
      numer can produce a long HEX value: -1  -> 'FFFFFFFFFFFFFFFF'
      
      Also fixing Item_func_hex::val_str_ascii_from_val_real().
      Without this change, MTR test with HEX with negative float point arguments
      failed on some platforms (aarch64, ppc64le, s390-x).
      d046b13e
    • Daniel Black's avatar
      MDEV-34437 restrict port and extra-port to tcp valid values · e7b76f87
      Daniel Black authored
      extra_port and port are 16 bit numbers and not 32 bit as they are
      tcp ports.
      
      Restrict their value.
      e7b76f87
  2. 29 Jun, 2024 1 commit
  3. 28 Jun, 2024 1 commit
  4. 27 Jun, 2024 1 commit
    • Meng-Hsiu Chiang's avatar
      [MDEV-28162] Replace PFS_atomic with std::atomic<T> · 55db59f1
      Meng-Hsiu Chiang authored
      PFS_atomic class contains wrappers around my_atomic_* operations, which
      are macros to GNU atomic operations (__atomic_*). Due to different
      implementations of compilers, clang may encounter errors when compiling
      on x86_32 architecture.
      
      The following functions are replaced with C++ std::atomic type in
      performance schema code base:
        - PFS_atomic::store_*()
            -> my_atomic_store*
              -> __atomic_store_n()
          => std::atomic<T>::store()
      
        - PFS_atomic::load_*()
            -> my_atomic_load*
              -> __atomic_load_n()
          => std::atomic<T>::load()
      
        - PFS_atomic::add_*()
            -> my_atomic_add*
              -> __atomic_fetch_add()
          => std::atomic<T>::fetch_add()
      
        - PFS_atomic::cas_*()
          -> my_atomic_cas*
            -> __atomic_compare_exchange_n()
          => std::atomic<T>::compare_exchange_strong()
      
      and PFS_atomic class could be dropped completely.
      
      Note that in the wrapper memory order passed to original GNU atomic
      extensions are hard-coded as `__ATOMIC_SEQ_CST`, which is equivalent to
      `std::memory_order_seq_cst` in C++, and is the default parameter for
      std::atomic_* functions.
      
      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.
      55db59f1
  5. 26 Jun, 2024 2 commits
    • Daniel Black's avatar
      MDEV-34313: compile WITHOUT_SERVER and WSREP=ON · d5bad490
      Daniel Black authored
      CMake WSREP=ON has some implications for client
      executables so still present this as an option
      when compiling WITHOUT_SERVER. In this case
      default to ON for maximium compatibility of
      the build client executables and libraries.
      d5bad490
    • Daniel Black's avatar
      MDEV-34313: compiler mariadb-binlog WITHOUT_SERVER · 53a48678
      Daniel Black authored
      The log_event_old.cc is included by mysqlbinlog.cc.
      
      With -DWITHOUT_SERVER the include path for the wsrep
      include headers isn't there.
      
      As these aren't needed by the mariadb-binlog, move
      these to under a ifndef MYSQL_CLIENT preprocessor.
      
      Caused by MDEV-18590
      53a48678
  6. 25 Jun, 2024 4 commits
    • Yuchen Pei's avatar
      ad0ee8cd
    • Yuchen Pei's avatar
      MDEV-34361 Split my.cnf in the spider suite. · 01289dac
      Yuchen Pei authored
      Just like the spider/bugfix suite.
      
      One caveat is that my_2_3.cnf needs something under mysqld.2.3 group,
      otherwise mtr will fail with something like:
      
      There is no group named 'mysqld.2.3' that can be used to resolve
      'port' for ...
      
      This will allow new tests under the spider suite to use what is
      needed. It also somehow fixes issues of running a test followed by
      spider.slave_trx_isolation.
      01289dac
    • Yuchen Pei's avatar
    • Dmitry Shulga's avatar
      MDEV-24411: Trigger doesn't work correctly with bulk insert · 8b169949
      Dmitry Shulga authored
      Executing an INSERT statement in PS mode having positional parameter
      bound with an array could result in incorrect number of inserted rows
      in case there is a BEFORE INSERT trigger that executes yet another
      INSERT statement to put a copy of row being inserted into some table.
      
      The reason for incorrect number of inserted rows is that a data structure
      used for binding positional argument with its actual values is stored
      in THD (this is thd->bulk_param) and reused on processing every INSERT
      statement. It leads to consuming actual values bound with top-level
      INSERT statement by other INSERT statements used by triggers' body.
      
      To fix the issue, reset the thd->bulk_param temporary to the value nullptr
      before invoking triggers and restore its value on finishing its execution.
      8b169949
  7. 24 Jun, 2024 3 commits
  8. 22 Jun, 2024 3 commits
  9. 21 Jun, 2024 1 commit
  10. 20 Jun, 2024 3 commits
    • Dave Gosselin's avatar
      MDEV-33746 Supply missing override markings · db0c28ef
      Dave Gosselin authored
      Find and fix missing virtual override markings.  Updates cmake
      maintainer flags to include -Wsuggest-override and
      -Winconsistent-missing-override.
      db0c28ef
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-34389 Avoid log overwrite in early recovery · ab448d4b
      Thirunarayanan Balathandayuthapani authored
      - InnoDB tries to write FILE_CHECKPOINT marker during
      early recovery when log file size is insufficient.
      While updating the log checkpoint at the end of the recovery,
      InnoDB must already have written out all pending changes
      to the persistent files. To complete the checkpoint, InnoDB
      has to write some log records for the checkpoint and to
      update the checkpoint header. If the server gets killed
      before updating the checkpoint header then it would lead
      the logfile to be unrecoverable.
      
      - This patch avoids FILE_CHECKPOINT marker during early
      recovery and narrows down the window of opportunity to
      make the log file unrecoverable.
      ab448d4b
    • Alexander Barkov's avatar
      MDEV-34417 Wrong result set with utf8mb4_danish_ci and BNLH join · 6cecf61a
      Alexander Barkov authored
      There were erroneous calls for charpos() in key_hashnr() and key_buf_cmp().
      These functions are never called with prefix segments.
      
      The charpos() calls were wrong. Before the change BNHL joins
      - could return wrong result sets, as reported in MDEV-34417
      - were extremely slow for multi-byte character sets, because
        the hash was calculated on string prefixes, which increased
        the amount of collisions drastically.
      
      This patch fixes the wrong result set as reported in MDEV-34417,
      as well as (partially) the performance problem reported in MDEV-34352.
      6cecf61a
  11. 19 Jun, 2024 3 commits
  12. 18 Jun, 2024 3 commits
    • Brandon Nesterenko's avatar
      MDEV-23857: replication master password length · 6cab2f75
      Brandon Nesterenko authored
      After MDEV-4013, the maximum length of replication passwords was extended to
      96 ASCII characters. After a restart, however, slaves only read the first 41
      characters of MASTER_PASSWORD from the master.info file. This lead to slaves
      unable to reconnect to the master after a restart.
      
      After a slave restart, if a master.info file is detected, use the full
      allowable length of the password rather than 41 characters.
      
      Reviewed By:
      ============
      Sergei Golubchik <serg@mariadb.com>
      6cab2f75
    • Brandon Nesterenko's avatar
      MDEV-34397: "delete si" rather than "my_free(si)" in THD::register_slave() · 0e25cc51
      Brandon Nesterenko authored
      In the error case of THD::register_slave(), there is undefined
      behavior of Slave_info si because it is allocated via malloc()
      (my_malloc), and cleaned up via delete().
      
      This patch makes these consistent by switching si's cleanup
      to use my_free.
      0e25cc51
    • Souradeep Saha's avatar
      MDEV-34168: Extend perror utility to print link to KB page · 10fbd1ce
      Souradeep Saha authored
      As all MariaDB Server errors now have a dedicated web page, the
      perror utility is extended to include a link to the KB page of
      the corresponding error code.
      
      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, Inc.
      10fbd1ce
  13. 17 Jun, 2024 4 commits
    • Sergei Petrunia's avatar
      Restore test coverage for MDEV-18956 · 2eda310b
      Sergei Petrunia authored
      (It was accidentally removed by fix for MDEV-28846)
      2eda310b
    • Sergei Petrunia's avatar
      MDEV-30651: Assertion `sel->quick' in make_range_rowid_filters, followup · 0903276e
      Sergei Petrunia authored
      Review followup: RANGE_OPT_PARAM statement_should_be_aborted()
      checks for thd->is_fatal_error and thd->is_error(). The first is
      redundant when the second is present.
      0903276e
    • Sergei Petrunia's avatar
      MDEV-30651: Assertion `sel->quick' in make_range_rowid_filters · a2066b24
      Sergei Petrunia authored
      The optimizer deals with Rowid Filters this way:
      
      1. First, range optimizer is invoked. It saves information
         about all potential range accesses.
      2. A query plan is chosen. Suppose, it uses a Rowid Filter on
         index $IDX.
      3. JOIN::make_range_rowid_filters() calls the range optimizer
      again to create a quick select on index $IDX which will be used
      to populate the rowid filter.
      
      The problem: KILL command catches the query in step #3. Quick
      Select is not created which causes a crash.
      
      Fixed by checking if query was killed. Note: the problem also
      affects 10.6, even if error handling for
      SQL_SELECT::test_quick_select is different there.
      a2066b24
    • Sergei Petrunia's avatar
      MDEV-33875: ORDER BY DESC causes ROWID Filter slowdown · b47bd3f8
      Sergei Petrunia authored
      Rowid Filter cannot be used with reverse-ordered scans, for the
      same reason as IndexConditionPushdown cannot be.
      
      test_if_skip_sort_order() already has logic to disable ICP when
      setting up a reverse-ordered scan. Added logic to also disable
      Rowid Filter in this case, factored out the code into
      prepare_for_reverse_ordered_access(), and added a comment describing
      the cause of this limitation.
      b47bd3f8
  14. 16 Jun, 2024 2 commits
    • Monty's avatar
      Change mysqldump to use DO instead of 'SELECT' for storing sequences. · 956bcf8f
      Monty authored
      This avoids a lot of SETVAL() results when applying a mysqldump with
      sequences.
      956bcf8f
    • Monty's avatar
      MDEV-34406 Enhance mariadb_upgrade to print failing query in case of error · fef32fd9
      Monty authored
      To make this possible, it was also necessary to enhance the mariadb
      client with the option --print-query-on-error.
      This option can also be very useful when running a batch of queries
      through the mariadb client and one wants to find out where things goes
      wrong.
      
      TODO: It would be good to enhance mariadb_upgrade to not call the mariadb
      client for executing queries but instead do this internally.  This
      would have made this patch much easier!
      
      Reviewed by: Sergei Golubchik <serg@mariadb.com>
      fef32fd9
  15. 14 Jun, 2024 2 commits
  16. 13 Jun, 2024 1 commit
  17. 12 Jun, 2024 1 commit
    • Brandon Nesterenko's avatar
      MDEV-34365: UBSAN runtime error: call to function io_callback(tpool::aiocb*) · d3a7e46b
      Brandon Nesterenko authored
      On an UBSAN clang-15 build, if running with UBSAN option
      halt_on_error=1 (the issue doesn't show up without it),
      MTR fails during mysqld --bootstrap with UBSAN error:
      
      call to function io_callback(tpool::aiocb*) through pointer to incorrect function type 'void (*)(void *)'
      
      This patch corrects the parameter type of io_callback
      to match its expected type defined by callback_func,
      i.e. (void*).
      
      Reviewed By:
      ============
      <TODO>
      d3a7e46b
  18. 11 Jun, 2024 1 commit
    • Vladislav Vaintroub's avatar
      MDEV-33616 workaround libmariadb bug : mysql_errno = 0 on failed connection · f2eda615
      Vladislav Vaintroub authored
      The bug can happens on macOS, if server closes the socket without sending
      error packet to client. Closing the socket on server side is legitimate,
      and happen e.g when write timeout occurs, perhaps also other situations.
      
      However mysqltest is not prepared to handle mysql_errno 0, and erroneously
      thinks connection was successfully established.
      
      The fix/workaround in mysqltest is to treat client failure with
      mysql_errno 0 the same as CR_SERVER_LOST (generic client-side
      communication error)
      
      The real fix in client library would ensure that mysql_errno is set
      on errors.
      f2eda615
  19. 10 Jun, 2024 2 commits