1. 19 Oct, 2021 2 commits
    • Vicențiu Ciorbaru's avatar
      Fix MIPS build failure: Handle unaligned buffers in connect's TYPBLK class · a33c1082
      Vicențiu Ciorbaru authored
      On MIPS platforms (and probably others) unaligned memory access results in a
      bus error. In the connect storage engine, block data for some data formats is
      stored packed in memory and the TYPBLK class is used to read values from it.
      Since TYPBLK does not have special handling for this packed memory, it can
      quite easily result in unaligned memory accesses.
      
      The simple way to fix this is to perform all accesses to the main buffer
      through memcpy. With GCC and optimizations turned on, this call to memcpy is
      completely optimized away on architectures where unaligned accesses are ok
      (like x86).
      
      Contributors:
      James Cowgill <jcowgill@debian.org>
      a33c1082
    • Vicențiu Ciorbaru's avatar
      Link with libatomic to enable C11 atomics support · f502ccbc
      Vicențiu Ciorbaru authored
      Some architectures (mips) require libatomic to support proper
      atomic operations. Check first if support is available without
      linking, otherwise use the library.
      
      Contributors:
      James Cowgill <jcowgill@debian.org>
      Jessica Clarke <jrtc27@debian.org>
      Vicențiu Ciorbaru <vicentiu@mariadb.org>
      f502ccbc
  2. 18 Oct, 2021 2 commits
  3. 13 Oct, 2021 2 commits
    • 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 1 commit
  5. 11 Oct, 2021 11 commits
  6. 08 Oct, 2021 1 commit
  7. 07 Oct, 2021 1 commit
  8. 06 Oct, 2021 2 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
  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 2 commits
  11. 03 Oct, 2021 1 commit
  12. 30 Sep, 2021 1 commit
    • 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
  13. 29 Sep, 2021 6 commits
  14. 27 Sep, 2021 3 commits
    • Vladislav Vaintroub's avatar
      MDEV-20699 mysqldump of routines causes MariaDB to get killed by oom-killer · 1f099418
      Vladislav Vaintroub authored
      The reason for this behavior is that SP get cached, per connection.
      The stored_program_cache is size of this cache, which amounts to 256
      routines by default. A compiled stored procedure can easily be several
      megabytes in size. Thus calling SHOW CREATE PROCEDURE for all stored
      procedures, like mysqldump does, can require significant amount of memory.
      
      Fixed by bypassing the cache for "SHOW CREATE". This should normally be
      fine also perfomance-wise, as cache is meant to be used for repeated
      execution, not repeated SHOW CREATEs.
      
      Added a test to verify that CREATE PROCEDURE + SHOW CREATE PROCEURE do not
      cache, i.e amount of allocated memory does not change.
      
      Note, there is a change in existing behavior in an edge case :
      If "SHOW CREATE PROCEDURE p1" called from p1, after p1 was altered, now
      this will now return altered code. Previour behavior - relied on caching
      and would return old code. The previous behavior might was not necessarily
      correct.
      1f099418
    • Oleksandr Byelkin's avatar
      MDEV-24454 Crash at change_item_tree · 3690c549
      Oleksandr Byelkin authored
      Use in_sum_func (and so nest_level) only in LEX to which SELECT lex belong to
      
      Reduce usage of current_select (because it does not always point on the correct
       SELECT_LEX, for example with prepare.
      
      Change context for all classes inherited from Item_ident (was only for Item_field) in case of pushing down it to HAVING.
      
      Now name resolution context have to have SELECT_LEX reference if the context is present.
      
      Fixed feedback plugin stack usage.
      3690c549
    • Jan Lindström's avatar
  15. 24 Sep, 2021 3 commits