1. 29 Mar, 2022 2 commits
  2. 28 Mar, 2022 4 commits
    • mkaruza's avatar
      MDEV-25912 wsrep does not identify checksummed events correctly · 97f237e6
      mkaruza authored
      For GTID consistenty, GTID events was artificialy added before
      replication happned. This event should not contain CHECKSUM calculated.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      97f237e6
    • Vladislav Vaintroub's avatar
      MDEV-28178 Windows : sporadic ER_ERROR_ON_RENAME .. (errno: 13 "Permission denied") · 739002ee
      Vladislav Vaintroub authored
      On affected machine, the error happens sporadically in
      innodb.instant_alter_limit.
      
      Procmon shows SetRenameInformationFile failing with ERROR_ACCESS_DENIED.
      In this case, the destination file was previously opened rsp oplocked by
      Windows defender antivirus.
      
      The fix is to retry MoveFileEx on ERROR_ACCESS_DENIED.
      739002ee
    • Marko Mäkelä's avatar
      MDEV-27931: buf_page_is_corrupted() wrongly claims corruption · 303448bc
      Marko Mäkelä authored
      In commit 437da7bc (MDEV-19534),
      the default value of the global variable srv_checksum_algorithm
      in innochecksum was changed from SRV_CHECKSUM_ALGORITHM_INNODB
      to implied 0 (innodb_checksum_algorithm=crc32). As a result,
      the function buf_page_is_corrupted() would by default invoke
      buf_calc_page_crc32() in innochecksum, and crc32_inited would hold.
      
      This would cause "innochecksum" to fail on a particular page.
      
      The actual problem is older, introduced in 2011 in
      mysql/mysql-server@17e497bdb793bc6b8360aa1c626dcd8bb5cfad1b
      (MySQL 5.6.3). It should affect the validation of pages of old
      data files that were written with innodb_checksum_algorithm=innodb.
      When using innodb_checksum_algorithm=crc32 (the default setting
      since MariaDB Server 10.2), some valid pages would be rejected
      only because exactly one of the two checksum fields accidentally
      matches the innodb_checksum_algorithm=crc32 value.
      
      buf_page_is_corrupted(): Simplify the logic of non-strict
      checksum validation, by always invoking buf_calc_page_crc32().
      Remove a bogus condition that if only one of the checksum fields
      contains the value returned by buf_calc_page_crc32(), the page
      is corrupted.
      303448bc
    • hongdongjian's avatar
      MDEV-28177: server_audit; Update the offset of dbName on the aarch64 platform. · 7af133cc
      hongdongjian authored
      On the aarch64 platform, MySQL 5.7.33 cannot install this version of the audit
      plugin, but X86_64 can run well。
      7af133cc
  3. 25 Mar, 2022 6 commits
    • Igor Babaev's avatar
      MDEV-27937 Assertion failure when executing prepared statement with ? in IN list · e048289e
      Igor Babaev authored
      This bug affected queries with IN predicates that contain parameter markers
      in the value list. Such queries are executed via prepared statements.
      The problem appeared only if the number of elements in the value list
      was greater than the set value of the system variable
      in_predicate_conversion_threshold.
      
      The patch unconditionally prohibits conversion of an IN predicate to the
      equivalent IN predicand if the value list of the IN predicate contains
      parameters markers.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      e048289e
    • Rucha Deodhar's avatar
      MDEV-21873: 10.2 to 10.3 upgrade doesn't remove semi-sync reference · 549a71e7
      Rucha Deodhar authored
      from mysql.plugin table
      Fix: Since mysql_upgrade runs commands from mysql_system_tables.fix,
      added sql commands to check for semisync plugins in
      INFORMATION_SCHEMA.PLUGINS and if they aren't there then delete them
      from mysql.plugin.
      549a71e7
    • Alexander Barkov's avatar
      MDEV-19804 sql_mode=ORACLE: call procedure in packages · fbcf0225
      Alexander Barkov authored
      Adding support for the fully qualified package procedure calls:
      
      BEGIN
        CALL db.pkg.proc(args); -- SQL/PSM call style
        db.pkg.proc(args);      -- PL/SQL call style
      END;
      fbcf0225
    • Sachin Kumar's avatar
      MDEV-24667 LOAD DATA INFILE on temporary table not written to slave binlog · 9f4ba624
      Sachin Kumar authored
      Problem: In regular replication, when master binlogged using statement format
      slave might not have written an event to its binary log when the Query
      event aimed at a temporary table.
      Specifically this was observed with LOAD DATA INFILE.
      
      This effect was possible because unlike master slave holds temporary
      tables in its pool and the master side check of existence of a
      temporary table at the format bin-logging decision did not apply.
      
      Solution: replace THD::has_thd_temporary_tables() with
      THD::has_temporary_tables which allows to identify temporary table
      presence on either side.
      
      --
      Reviewed by Andrei Elkin.
      9f4ba624
    • sjaakola's avatar
      MDEV-24845 Oddities around innodb_fatal_semaphore_wait_threshold and global.innodb_disallow_writes · 9b2fa2ae
      sjaakola authored
      This commit adds a mtr test for reproducing a test scenario where despite of
      innodb_disallow_writes blocking, writes to file system can still happen.
      
      The test launches a garbd node, which triggers one of the cluster node to switch to
      SST donor state. In this state, all disk activity should be halted, and e.g.
      innodb_disallow_writes has been set. The test records md5sum aggregate over mariadb
      data directory when the node enters the donor state, and records another md5sum
      when the node leaves the donor state. If there is no IO activity in data directory, these
      hashes should be equal.
      
      For this test, the Donor state processing, has beeen instrumented so that, SST donor thread can be
      stopped when entering the donor state. The test uses this new dbug sync point,
      to control when to record the md5sums.
      
      New SST script was added: wsrep_sst_backup, and garbd uses backup method to lauch the donor
      node to call this script, and to enter in donor state.
      
      The backup script could be later extended as general purpose backup method for the cluster.
      
      This commit fixes also one race condition happening in wsrep_sst_rsync, like this:
      * wsrep_rsync_sst script requests for flush tables,
        and then waits in a loop until mariadbd has created file tables_flushed,
        as confirmation that FLUSH TABLES has completed
      * mariadbd's SST donor thread, wakes for the flush table request and then performs FTWRL,
        and after this it creates the tables_flushed file
      * note that SST script will now continue to startup rsync sending
      * mariadbd's SST donor thread now calls for sst_disallow_writes(),
        so that innodb would setup disk IO blockage, however rsyncing may already be ongoing at this point
      
      This race condition is fixed in this commit, by performing all disk IO blocking before
      creating the tables_flushed file.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      9b2fa2ae
    • Alexander Barkov's avatar
      MDEV-28166 sql_mode=ORACLE: fully qualified package function calls do not work: db.pkg.func() · 6437b304
      Alexander Barkov authored
      Also fixes MDEV-19328 sql_mode=ORACLE: Package function in VIEW
      6437b304
  4. 24 Mar, 2022 4 commits
    • Brandon Nesterenko's avatar
      DBAAS-7828: Primary/replica: configuration change of autocommit=0 can not be applied · cd88b083
      Brandon Nesterenko authored
      Problem:
      ========
      When the mysql.gtid_slave_pos table uses the InnoDB engine, and
      mysqld starts, it reads the table and begins a transaction. After
      reading the value, it should end the transaction and release all
      associated locks. The bug reported in DBAAS-7828 shows that when
      autocommit is off, the locks are not released, resulting in
      indefinite hangs on future attempts to change gtid_slave_pos. In
      particular, the transaction was not properly finalized because
      thd->server_status was not updated to reflect the end of the
      transaction.
      
      Solution:
      ========
      This patch updates the code to properly commit the transaction after
      reading gtid_slave_pos during mysqld start-up.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      cd88b083
    • Brandon Nesterenko's avatar
      MDEV-14608: mysqlbinlog lastest backupfile size is 0 · 174f1734
      Brandon Nesterenko authored
      Problem:
      ========
      When using mariadb-binlog with --raw and --stop-never, events from
      the master's currently active log file should be written to their
      respective log file specified by --result-file, and shown on-disk.
      There is a bug where mariadb-binlog does not flush the result file
      to disk when new events are received
      
      Solution:
      ========
      Add a function call to flush mariadb-binlog’s result file after
      receiving an event in --raw mode.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      174f1734
    • Brandon Nesterenko's avatar
      MDEV-25580: rpl.rpl_semi_sync_slave_compressed_protocol crashes because of wrong packet · 32ab6219
      Brandon Nesterenko authored
      Problem:
      ========
      When both semi-sync and slave compression are enabled, the numbering
      on packet headers can become out of sync between the primary and
      replica servers. More specifically, after the master flushes its
      write, it should increment the counters that track packets. The
      bug is such that the master only updates the normal packet counter
      and leaves the compressed packet counter alone.
      
      Solution:
      ========
      After the master flushes, additionally increment the compressed
      packet counter.
      
      Reviewed By:
      ============
      Andrei Elkin: <andrei.elkin@mariadb.com>
      32ab6219
    • Marko Mäkelä's avatar
      cf483a77
  5. 23 Mar, 2022 1 commit
    • Igor Babaev's avatar
      MDEV-24281 Reading from freed memory when running main.view with --ps-protocol · bbf02c85
      Igor Babaev authored
      This bug could affect prepared statements for the command CREATE VIEW with
      specification that contained unnamed basic constant in select list. If
      generation of a valid name for the corresponding view column required
      resolution of conflicts with names of other columns that were explicitly
      defined then execution of such prepared statement and following deallocation
      of this statement led to reading from freed memory.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      bbf02c85
  6. 22 Mar, 2022 3 commits
  7. 21 Mar, 2022 4 commits
    • Alexander Barkov's avatar
      MDEV-28131 Unexpected warning while selecting from information_schema.processlist · 0812d0de
      Alexander Barkov authored
      Problem:
      
      DECIMAL columns in I_S must be explicitly set of some value.
      
      I_S columns do not have `DEFAULT 0` (after MDEV-18918), so during
      restore_record() their record fragments pointed by Field::ptr are
      initialized to zero bytes 0x00.
      But an array of 0x00's is not a valid binary DECIMAL value.
      So val_decimal() called for such Field_new_decimal generated a warning
      when seeing a wrong binary encoded DECIMAL value in the record.
      
      Fix:
      
      Explicitly setting INFORMATION_SCHEMA.PROCESSLIST.PROGRESS
      to the decimal value of 0 if no progress information is available.
      0812d0de
    • Alexey Botchkov's avatar
      MDEV-22742 UBSAN: Many overflow issues in strings/decimal.c - runtime error:... · 6277e7df
      Alexey Botchkov authored
      MDEV-22742 UBSAN: Many overflow issues in strings/decimal.c - runtime error: signed integer overflow: x * y cannot be represented in type 'long long int' (on optimized builds).
      
      Avoid integer overflow, do the check before the calculation.
      6277e7df
    • Sergei Golubchik's avatar
      MDEV-27980 file-key-management plugin disabled in mysql_install_db breaks... · f54d6380
      Sergei Golubchik authored
      MDEV-27980 file-key-management plugin disabled in mysql_install_db breaks automated deployments (and container initialization)
      
      fix a 2015 typo in build scripts.
      
      --without-plugin=plugin_file_key_management translates to
      -DPLUGIN_PLUGIN_FILE_KEY_MANAGEMENT=NO
      
      replace it with a line from 10.4 that builds the plugin
      dynamically.
      f54d6380
    • Oleksandr Byelkin's avatar
      MDEV-26009 Server crash when calling twice procedure using FOR-loop · fbc1cc97
      Oleksandr Byelkin authored
      The problem was that instructions sp_instr_cursor_copy_struct and
      sp_instr_copen uses the same lex, adding and removing "tail" of
      prelocked tables and forgetting that tail of all tables is kept in
      LEX::query_tables_last. If the LEX used only by one instruction
      or the query do not have prelocked tables it is not important.
      But to work correctly in all cases LEX::query_tables_last should
      be reset to make new tables added in the correct list (after last
      table in the LEX instead after last table of the prelocking "tail"
      which was cut).
      fbc1cc97
  8. 20 Mar, 2022 1 commit
  9. 19 Mar, 2022 1 commit
  10. 18 Mar, 2022 8 commits
    • Monty's avatar
      Fixed warning for maria.maria-recovery2 about crashed table · 74e668ea
      Monty authored
      The bug was a missing va_start in eprint() which caused a wrong table
      name to be printed.
      Patch backported from 10.3.
      74e668ea
    • Jan Lindström's avatar
      MDEV-24143 : Galera nodes "randomly" crashing in Item_func_release_lock::val_int · c519aa3d
      Jan Lindström authored
      Fixed on MDEV-27713. Added additional test case.
      c519aa3d
    • mkaruza's avatar
      MDEV-27713 Crash after a conflict of applier thread with stored procedure call by event scheduler · 507030c4
      mkaruza authored
      When thread is BF aborted by high priority service, ULL (user level
      locks need to be removed and released). Calling directly release of lock for
      MDL_EXPLICIT type doesn't clear also `thd->ull_hash`. Method
      `mysql_ull_cleanup` will properly clear all information about ULL locks
      for thread.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      507030c4
    • mkaruza's avatar
      MDEV-27568 Parallel async replication hangs on a Galera node · 304f75c9
      mkaruza authored
      Using parallel slave applying can cause deadlock between between DDL and
      other events. GTID with lower seqno can be blocked in galera when node
      entered TOI mode, but DDL GTID which has higher node can be blocked
      before previous GTIDs are applied locally.
      
      Fix is to check prior commits before entering TOI.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      304f75c9
    • Daniele Sciascia's avatar
      MDEV-28055: Galera ps-protocol fixes · c63eab2c
      Daniele Sciascia authored
      * Fix test galera.MW-44 to make it work with --ps-protocol
      * Skip test galera.MW-328C under --ps-protocol This test
        relies on wsrep_retry_autocommit, which has no effect
        under ps-protocol.
      * Return WSREP related errors on COM_STMT_PREPARE commands
        Change wsrep_command_no_result() to allow sending back errors
        when a statement is prepared. For example, to handle deadlock
        error due to BF aborted transaction during prepare.
      * Add sync waiting before statement prepare
        When a statement is prepared, tables used in the statement may be
        opened and checked for existence. Because of that, some tests (for
        example galera_create_table_as_select) that CREATE a table in one node
        and then SELECT from the same table in another node may result in errors
        due to non existing table.
        To make tests behave similarly under normal and PS protocol, we add a
        call to sync wait before preparing statements that would sync wait
        during normal execution.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      c63eab2c
    • Daniele Sciascia's avatar
      Fixup for MDEV-27553 · 39ed4005
      Daniele Sciascia authored
      Update wsrep-lib which contains a fixup introduced with MDEV-27553.
      Also, adapt the corresponding test: after apply failure on ROLLBACK,
      node will disconnect from cluster
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      39ed4005
    • sjaakola's avatar
      MDEV-27649 PS conflict handling causing node crash · 97582f1c
      sjaakola authored
      Handling BF abort for prepared statement execution so that EXECUTE processing will continue
      until parameter setup is complete, before BF abort bails out the statement execution.
      
      THD class has new boolean member: wsrep_delayed_BF_abort, which is set if BF abort is observed
      in do_command() right after reading client's packet, and if the client has sent PS execute command.
      In such case, the deadlock error is not returned immediately back to client, but the PS execution
      will be started. However, the PS execution loop, will now check if wsrep_delayed_BF_abort is set, and
      stop the PS execution after the type information has been assigned for the PS.
      With this, the PS protocol type information, which is present in the first PS EXECUTE command, is not lost
      even if the first PS EXECUTE command was marked to abort.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      97582f1c
    • sjaakola's avatar
      MDEV-27649 Crash with PS execute after BF abort · 8e9e1c39
      sjaakola authored
      This commit contains a test for reproducing the issue in MDEV-27649,
      where a transaction, executing a prepared statment, is BF aborted.
      The scenario, in MDEV-27649  has a transaction which has prepared a PS,
      but not yet executed it, and this transaction is then BF aborted in this state.
      When the BF aborted transaction tries to execute the PS, it will receive deadlock error.
      But, when it tries to execute the PS second time, the node crashes.
      
      Mtr test galera.galera_bf_abort_ps_bind, exercises this scenario.
      
      However, mtr test platform does not have mechanism to control the execution of PS in required detail.
      For this purpose, mysqltetst.cc was extended to contain 4 new commands:
      PS_prepare   - to prepare a prepared statement
      PS_bind      - to bind values for parameters for the PS
      PS_execute   - to execute the PS
      PS_close     - to close the PS
      
      The support for controlling prepared statments in mtr scripts is quite minimal
      in this commit. Limitations are:
      * only one PS can be used by a connection, at a time
      * only input parameters can be bound for the PS
      * only varchar, integer or float type of parameters can be bound
      
      added the result
      
      fixes
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      8e9e1c39
  11. 17 Mar, 2022 4 commits
  12. 16 Mar, 2022 2 commits