1. 07 May, 2024 1 commit
    • Yuchen Pei's avatar
      MDEV-32640 Reset thd->lex->mi.connection_name.str towards the end of mysql_execute_command · b86a2f03
      Yuchen Pei authored
      Reset the connection_name to contain a null string, if the pointer
      points to the same space as that of the system variable
      default_master_connection.
      
      We do this because the system variable may be updated which could free
      the pointer and create a new one, causing use-after-free for
      re-execution of prepared statements and stored procedures where the
      LEX may be reused.
      
      This allows connection_name to be set again be to the system variable
      pointer in the next call of this function (see earlier in this
      function), after any possible updates to the system variable.
      b86a2f03
  2. 06 May, 2024 1 commit
    • Alexander Barkov's avatar
      MDEV-34085 Server crash ASAN used-after-poison upon 2nd execution of PS with... · 0e8e1575
      Alexander Barkov authored
      MDEV-34085 Server crash ASAN used-after-poison upon 2nd execution of PS with erroneous timestamp conversion
      
      The optimization code replacing DATETIME comparison to TIMESTAMP comparison
      in conditions like:
      - WHERE timestamp_col=const_expr
      - WHERE const_expr IN (SELECT timestamp_column FROM t1)
      worked as follows:
      
      - Install an internal condition handler (suppressing and counting warnings).
      - Convert const_expr from its data type to TIMESTAMP
      - Check the warning count collected by the internal condition handler:
        * If any warnings happened during the constant conversion,
          then continue with DATETIME comparison.
        * Otherwise, go to the next stage of switching to TIMESTAMP comparison.
      
      This scenario did not take into account that in some cases warnings
      are escalated to errors. Errors were not caught by the internal handler,
      so Type_handler_datetime_common::convert_item_for_comparison()
      returned with an SQL error in the diagnostics area.
      The calling code did not expect this.
      
      Fixing the code to suppress and count both errors and warnings, to make sure
      Type_handler_datetime_common::convert_item_for_comparison() returns without
      adding any errors to DA if the conversion to TIMESTAMP fails and it decides
      to go with DATETIME comparison.
      0e8e1575
  3. 30 Apr, 2024 1 commit
  4. 24 Apr, 2024 1 commit
  5. 15 Apr, 2024 1 commit
  6. 11 Apr, 2024 1 commit
  7. 12 Mar, 2024 1 commit
  8. 08 Mar, 2024 2 commits
  9. 26 Feb, 2024 1 commit
  10. 22 Feb, 2024 2 commits
  11. 20 Feb, 2024 1 commit
  12. 19 Feb, 2024 2 commits
  13. 17 Feb, 2024 1 commit
  14. 15 Feb, 2024 1 commit
  15. 14 Feb, 2024 9 commits
    • Sergei Golubchik's avatar
      update 32bit rdiffs · 3ae6680e
      Sergei Golubchik authored
      3ae6680e
    • Yuchen Pei's avatar
      MDEV-33441 Do not deinit plugin variables when retry requested · 068a6819
      Yuchen Pei authored
      After MDEV-31400, plugins are allowed to ask for retries when failing
      initialisation. However, such failures also cause plugin system
      variables to be deleted (plugin_variables_deinit()) before retrying
      and are not re-added during retry.
      
      We fix this by checking that if the plugin has requested a retry the
      variables are not deleted. Because plugin_deinitialize() also calls
      plugin_variables_deinit(), if the retry fails, the variables will
      still be deleted.
      
      Alternatives considered:
      
      - remove the plugin_variables_deinit() from plugin_initialize() error
      handling altogether. We decide to take a more conservative approach
      here.
      
      - re-add the system variables during retry. It is more complicated
      than simply iterating over plugin->system_vars and call
      my_hash_insert(). For example we will need to assign values to
      the test_load field and extract more code from test_plugin_options(),
      if that is possible.
      068a6819
    • Sergei Golubchik's avatar
      MDEV-31857 fix galera.MW-284 · fe07ac31
      Sergei Golubchik authored
      followup for abcd23ad
      fe07ac31
    • Sergei Golubchik's avatar
      MDEV-31857 fix galera.galera_var_notify_ssl_ipv6 · 8dee23cd
      Sergei Golubchik authored
      it was able to enable --ssl-verify-server-cert if explicily requested,
      now it can also disable it, if explicitly requested.
      8dee23cd
    • Monty's avatar
      Improve error message in mysqltest when sync_with_master fails · d6794aa4
      Monty authored
      In case of failure, the something like the following is now printed:
      
      Slave position:  file: binary.000004  position: 3647
      Master position: file: binary.000004  position: 3647
      d6794aa4
    • Monty's avatar
      MDEV-31404 Implement binlog_space_limit · 18dfcfde
      Monty authored
      binlog_space_limit is a variable in Percona server used to limit the total
      size of all binary logs.
      
      This implementation is based on code from Percona server 5.7.
      
      In MariaDB we decided to call the variable max-binlog-total-size to be
      similar to max-binlog-size. This makes it easier to find in the output
      from 'mariadbd --help --verbose'). MariaDB will also support
      binlog_space_limit for compatibility with Percona.
      
      Some internal notes to explain implementation notes:
      
      - When running MariaDB does not delete binary logs that are either
        used by slaves or have active xid that are not yet committed.
      
      Some implementation notes:
      
      - max-binlog-total-size is by default 0 (no limit).
      - max-binlog-total-size can be changed without server restart.
      - Binlog file sizes are checked on startup, or if
        max-binlog-total-size is set to a value > 0, not for every log write.
        The total size of all binary logs is cached and dynamically updated
        when updating the binary log on binary log rotation.
      - max-binlog-total-size is checked against existing log files during
        serverstart, binlog rotation, FLUSH LOGS, when writing to binary log
        or when max-binlog-total-size changes value.
      - Option --slave-connections-needed-for-purge with 1 as default added.
        This allows one to ensure that we do not delete binary logs if there
        is less than 'slave-connections-needed-for-purge' connected.
        Without this option max-binlog-total-size would potentially delete
        binlogs needed by slaves on server startup or when a slave disconnects
        as there are then no connected slaves to protect active binlogs.
      - PURGE BINARY LOGS TO ... will be executed as if
        slave-connectitons-needed-for-purge would be zero. In other words
        it will do the purge even if there is no slaves connected. If there
        are connected slaves working on the logs, these will be protected.
      - If binary log is on and max-binlog-total_size <> 0 then the status
        variable 'Binlog_disk_use' shows the current size of all old binary
        logs + the state of the current one.
      - Removed test of strcmp(log_file_name, log_info.log_file_name) in
        purge_logs_before_date() as this is tested in can_purge_logs()
      - To avoid expensive calls of log_in_use() we cache the result for the
        last log that is in use by a slave. Future calls to can_purge_logs()
        for this binary log will be quickly detected and false will be returned
        until a slave starts working on a new log.
      - Note that after a binary log rotation caused by max_binlog_size,
        the last log will not be purged directly as it is still in use
        internally. The next binary log write will purge binlogs if needed.
      
      Reviewer:Kristian Nielsen <knielsen@knielsen-hq.org>
      18dfcfde
    • Sergei Golubchik's avatar
      update C/C · 9933a8cc
      Sergei Golubchik authored
      9933a8cc
    • Sergei Golubchik's avatar
      fix debian dependencies for mariadb-test · 2c445b59
      Sergei Golubchik authored
      libnet-ssleay-perl wasn't auto-detected
      2c445b59
    • Sergei Golubchik's avatar
      MDEV-33326 Port Spider/ODBC from ES · eeb5cbae
      Sergei Golubchik authored
      Revert "Deb: Stop shipping mariadb-plugin-spider separately, include in server"
      
      This reverts commit 9945d482.
      eeb5cbae
  16. 13 Feb, 2024 1 commit
  17. 12 Feb, 2024 12 commits
  18. 09 Feb, 2024 1 commit
    • Vladislav Vaintroub's avatar
      MDEV-33430 - Fix self-signed certificate errors on Windows · 4eac842c
      Vladislav Vaintroub authored
      Adjust test after fixing the C/C.
      
      On Windows, use --host=127.0.0.2 to fake "insecure" transport
      with TCP connection for test purposes. 127.0.0.2 is loopback address,
      that can be used instead of usual 127.0.0.1
      
      Unfortunately, this technique does not work on all *nixes the same,
      notably neither on BSDs nor Solaris. Thus default --host=localhost
      remains "insecure" transport,when TCP is used. but it is not that critical,
      the "self-signed" is not nearly as annoying on *nixes as it is on Windows.
      4eac842c