1. 20 Oct, 2021 2 commits
    • Nikita Malyavin's avatar
      MDEV-20131 Assertion `!pk->has_virtual()' failed · d10c42b4
      Nikita Malyavin authored
      Assertion `!pk->has_virtual()' failed in dict_index_build_internal_clust
      while creating PRIMARY key longer than possible to store in the page.
      
      This happened because the key was wrongly deduced as Long UNIQUE supported,
      however PRIMARY KEY cannot be of that type. The main reason is that
      only 8 bytes are used to store the hash, see HA_HASH_FIELD_LENGTH.
      
      This is also why HA_NOSAME flag is removed (and caused the assertion in
      turn) in open_table_from_share:
            if (key_info->algorithm == HA_KEY_ALG_LONG_HASH)
            {
              key_part_end++;
              key_info->flags&= ~HA_NOSAME;
            }
      
      To make it unique, the additional check is done by
      check_duplicate_long_entries call from ha_write_row, and similar one from
      ha_update_row.
      
      PRIMARY key is already forbidden, which is checked by the first test in
      main.long_unique, however is_hash_field_needed was wrongly deduced to true
      in mysql_prepare_create_table in this particular case.
      
      FIX:
      
      * Improve the check for Key::PRIMARY type
      * Simplify is_hash_field_needed deduction for a more neat reading
      d10c42b4
    • Daniel Black's avatar
      MDEV-26363 Passwords incorrectly expiring after MySQL5.7 -> MariaDB10.3 -> 10.4+ upgrades · 4590f8b4
      Daniel Black authored
      MySQL-5.7 mysql.user tables have a last_password_changed field.
      
      Because before MariaDB-10.4 remained oblivious to this, the act of creating
      users or otherwise changing a users row left the last_password_field with 0.
      
      Running a MariaDB-10.4 instance on this would work correctly, until mysql_upgrade
      is run, when this 0 value immediately translates to password expired
      state.
      
      MySQL-5.7 relied on the password_expired enum to indicate password
      expiry so we aren't going to activate password that were expired in
      MySQL-5.7.
      
      Thanks Hans Borresen for the bug report and review of the fix.
      4590f8b4
  2. 18 Oct, 2021 1 commit
  3. 13 Oct, 2021 3 commits
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · a736a317
      Marko Mäkelä authored
      a736a317
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 4a7dfda3
      Marko Mäkelä authored
      4a7dfda3
    • Marko Mäkelä's avatar
      MDEV-26811: Assertion "log_sys->n_pending_flushes == 1" fails · 2bb8d7c2
      Marko Mäkelä authored
      In commit 1cb218c3 (MDEV-26450)
      we introduced the function log_write_and_flush(), which may
      compete with log_checkpoint() invoking log_write_flush_to_disk_low()
      from another thread.
      
      The assertion n_pending_flushes==1 is too strict.
      There is no possibility of a race condition here, because
      fil_flush() is protected by fil_system->mutex and the
      rest will be protected by log_sys->mutex.
      
      log_write_flush_to_disk_low(), log_write_and_flush():
      Relax the assertions to test for a nonzero count.
      2bb8d7c2
  4. 12 Oct, 2021 2 commits
  5. 11 Oct, 2021 12 commits
  6. 08 Oct, 2021 2 commits
  7. 07 Oct, 2021 5 commits
  8. 06 Oct, 2021 3 commits
    • Brandon Nesterenko's avatar
      Merge branch '10.2' into 10.3 · 00affc32
      Brandon Nesterenko authored
      00affc32
    • Brandon Nesterenko's avatar
      MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs · 1ce35c32
      Brandon Nesterenko authored
      Note: This patch backports commits 10cd2818 and 1755ea4b from 10.3.
      
      10cd2818:
      Problem:- Some binary data is inserted into the table using
      Jconnector. When binlog dump of the data is applied using mysql
      client it gives syntax error.
      
      Reason:-
      After investigating it turns out to be a issue of mysql client not
      able to properly handle  \\0 <0 in binary>. In all binary files
      where mysql client fails to insert
      these 2 bytes are common (0x5c00)
      
      Solution:-
      I have changed mysql.cc to include for the possibility that binary
      string can have \\0 in it
      
      1755ea4b:
      Changes on top of Sachin’s patch. Specifically:
       1) Refined the parsing break condition to only change the parser’s
      behavior for parsing strings in binary mode (behavior of \0 outside
      of strings is unchanged).
       2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
      associate the  purpose of the test.
       3) As the input of the test contains binary zeros (0x5c00),
      different text editors can visualize this sequence differently, and
      Github would not display it at all. Therefore, the input itself was
      consolidated into the test and created out of hex sequences to make
      it easier to understand what is happening.
       4) Extended test to validate that the rows which correspond to the
      INSERTS with 0x5c00 have the correct binary zero data.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      1ce35c32
    • mkaruza's avatar
      MDEV-22708 Assertion `!mysql_bin_log.is_open() ||... · a75813d4
      mkaruza authored
      MDEV-22708 Assertion `!mysql_bin_log.is_open() || thd.is_current_stmt_binlog_format_row()' failed in Delayed_insert::handle_inserts and in Diagnostics_area::set_eof_status
      
      Function `upgrade_lock_type` should check global binlog_format variable
      instead of thread one.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      a75813d4
  9. 05 Oct, 2021 2 commits
    • Brandon Nesterenko's avatar
      MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs · 1755ea4b
      Brandon Nesterenko authored
      Changes on top of Sachin’s patch. Specifically:
       1) Refined the parsing break condition to only change the parser’s
      behavior for parsing strings in binary mode (behavior of \0 outside
      of strings is unchanged).
       2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
      associate the  purpose of the test.
       3) As the input of the test contains binary zeros (0x5c00),
      different text editors can visualize this sequence differently, and
      Github would not display it at all. Therefore, the input itself was
      consolidated into the test and created out of hex sequences to make
      it easier to understand what is happening.
       4) Extended test to validate that the rows which correspond to the
      INSERTS with 0x5c00 have the correct binary zero data.
      
      Reviewed By:
      ===========
      Andrei Elkin <andrei.elkin@mariadb.com>
      1755ea4b
    • Sachin Kumar's avatar
      MDEV-25444 mysql --binary-mode is not able to replay some mysqlbinlog outputs · 10cd2818
      Sachin Kumar authored
      Problem:- Some binary data is inserted into the table using Jconnector. When
      binlog dump of the data is applied using mysql cleint it gives syntax error.
      
      Reason:-
      After investigating it turns out to be a issue of mysql client not able to properly
      handle  \\\0 <0 in binary>. In all binary files where mysql client fails to insert
      these 2 bytes are commom (0x5c00)
      
      Solution:-
      I have changed mysql.cc to include for the possibility that binary string can
      have \\\0 in it
      10cd2818
  10. 04 Oct, 2021 3 commits
  11. 03 Oct, 2021 1 commit
  12. 01 Oct, 2021 1 commit
    • mkaruza's avatar
      MDEV-22708 Assertion `!mysql_bin_log.is_open() ||... · 86a2e2ba
      mkaruza authored
      MDEV-22708 Assertion `!mysql_bin_log.is_open() || thd.is_current_stmt_binlog_format_row()' failed in Delayed_insert::handle_inserts and in Diagnostics_area::set_eof_status
      
      Variable wsrep_forced_binlog_format has higher priority than
      binlog_format. In situation where STATEMENT is used and DELAYED INSERT
      is executing we should fall back to non-delay INSERT.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      86a2e2ba
  13. 30 Sep, 2021 3 commits
    • mkaruza's avatar
      MDEV-25883 Galera Cluster hangs while "DELETE FROM mysql.wsrep_cluster" · 2f5ae0da
      mkaruza authored
      Using `innodb_thread_concurrency` will call `wsrep_thd_is_aborting` to
      check WSREP thread state. This call should be protected by taking
      `LOCK_thd_data` before entering function.
      Applier and TOI threads should no be affected with usage of
      `innodb_thread_concurrency` variable so returning before any checks.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      2f5ae0da
    • sjaakola's avatar
      MDEV-24978 crash with transaction on table with no PK and long fulltext column · d5a15f04
      sjaakola authored
      If a table has no unique indexes, write set key information will be collected on all columns in the table.
      The write set key information has space only for max 3500 bytes for individual column, and if a varchar colummn of such non-primary key table is longer than
       this limit, currently a crash follows.
      The fix in this commit, is to truncate key values extracted from such long varhar columns to max 3500 bytes.
      This may potentially lead to false positive certification failures for transactions, which operate on separate cluster nodes, and update/insert/delete table rows, which differ only in the part of such long columns after 3500 bytes border.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      d5a15f04
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 57fdd016
      Marko Mäkelä authored
      57fdd016