1. 10 Nov, 2023 1 commit
  2. 27 Oct, 2023 1 commit
    • Kristian Nielsen's avatar
      MDEV-31273: Precompute binlog checksums · b8f9f796
      Kristian Nielsen authored
      Compute binlog checksums (when enabled) already when writing events
      into the statement or transaction caches, where before it was done
      when the caches are copied to the real binlog file. This moves the
      checksum computation outside of holding LOCK_log, improving
      scalabitily.
      
      At stmt/trx cache write time, the final end_log_pos values are not
      known, so with this patch these will be set to 0. Events that are
      written directly to the binlog file (not through stmt/trx cache) keep
      the correct end_log_pos value. The GTID and COMMIT/XID events at the
      start and end of event groups are written directly, so the zero
      end_log_pos is only for events in the middle of event groups, which
      do not negatively affect replication.
      
      An option --binlog-legacy-event-pos, off by default, is provided to
      disable this behavior to provide backwards compatibility with any
      external applications that might rely on end_log_pos in events in the
      middle of event groups.
      
      Checksums cannot be pre-computed when binlog encryption is enabled, as
      encryption relies on correct end_log_pos to provide part of the
      nonce/IV.
      
      Checksum pre-computation is also disabled for WSREP/Galera, as it uses
      events differently in its write-sets and so on. Extending pre-computation of
      checksums to Galera where it makes sense could be added in a future patch.
      
      The current --binlog-checksum configuration is saved in
      binlog_cache_data at transaction start and used to pre-compute
      checksums in cache, if applicable. When the cache is later copied to
      the binlog, a check is made if the saved value still matches the
      configured global value; if so, the events are block-copied directly
      into the binlog file. If --binlog-checksum was changed during the
      transaction, events are re-written to the binlog file one-by-one and
      the checksums recomputed/discarded as appropriate.
      Reviewed-by: default avatarMonty <monty@mariadb.org>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      b8f9f796
  3. 26 Oct, 2023 3 commits
    • Kristian Nielsen's avatar
      MDEV-31273: Refactor MYSQL_BIN_LOG::write_cache() · 24c923d4
      Kristian Nielsen authored
      Preparatory patch for pre-computing binlog checksums outside of holding
      LOCK_log.
      
      The existing code for MYSQL_BIN_LOG::write_cache() was needlessly complex
      and very hard to understand and modify for handling the new case where
      pre-computed checksums are already present in the IO_CACHE.
      
      Greatly simplify the logic by replacing the (implicit) state machine with
      direct code that pulls the events one by one from the IO_CACHE. This removes
      a lot of state flags and avoids duplicate code for handling full vs. split
      headers.
      
      This also removes the need for the CacheWriter class. As a bonus, this fixes
      the bug that CacheWriter::write() was completely ignoring write errors. No
      other functional changes are done with this patch, only code cleanup.
      Reviewed-by: default avatarMonty <monty@mariadb.org>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      24c923d4
    • Kristian Nielsen's avatar
      MDEV-31273: Eliminate Log_event::checksum_alg · 8eee9806
      Kristian Nielsen authored
      This is a preparatory commit for pre-computing checksums outside of
      holding LOCK_log, no functional changes.
      
      Which checksum algorithm is used (if any) when writing an event does not
      belong in the event, it is a property of the log being written to.
      
      Instead decide the checksum algorithm when constructing the
      Log_event_writer object, and store it there.
      
      Introduce a client-only Log_event::read_checksum_alg to be able to
      print the checksum read, and a
      Format_description_log_event::source_checksum_alg which is the
      checksum algorithm (if any) to use when reading events from a log.
      
      Also eliminate some redundant `enum` keywords on the enum_binlog_checksum_alg
      type.
      Reviewed-by: default avatarMonty <monty@mariadb.org>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      8eee9806
    • Kristian Nielsen's avatar
      MDEV-31273: Replace Log_event::writer with function parameter · 77bd1bea
      Kristian Nielsen authored
      This is a preparatory patch for precomputing binlog checksums outside
      of holding LOCK_log, no functional changes.
      
      Replace Log_event::writer with just passing the writer object as a
      function parameter to Log_event::write().
      
      This is mainly for code clarity. Having to set ev->writer before every
      call to ev->write() is error-prone (what if it's forgotten in some
      code place?), while passing it as parameter as usual makes it explicit
      how the dataflow is.
      
      As a minor point, it also improves the code, as the compiler now can
      save the function parameter in a register across nested calls (when it
      is a class member, compiler needs to reload across nested calls in
      case the object would be modified during the call).
      Reviewed-by: default avatarMonty <monty@mariadb.org>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      77bd1bea
  4. 09 Oct, 2023 1 commit
  5. 04 Oct, 2023 2 commits
  6. 30 Sep, 2023 13 commits
    • Sergei Golubchik's avatar
    • Sergei Golubchik's avatar
      compile-time deprecation reminders · df4bfefb
      Sergei Golubchik authored
      remove old deprecation helpers that were not used anywhere.
      
      create new deprecation helpers and enforce their usage
      
      this also removes inconsistencies in reporting deprecation:
      sometimes it was ER_WARN_DEPRECATED_SYNTAX (1287),
      sometimes ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT (1681),
      sometimes a warning, sometimes a note.
      
      it should always be
      * ER_WARN_DEPRECATED_SYNTAX
      * a warning (because it's something actionable, not purely informational)
      df4bfefb
    • Sergei Golubchik's avatar
      ceb1bd19
    • Sergei Golubchik's avatar
      remove Silence_deprecated_warning · 52a0cd3c
      Sergei Golubchik authored
      it was introduced in ff8651c4 to suppress deprecated
      warnings for CALL under the flawed logic that "It's doesn't
      make sense to print out deprecated syntax warnings when the
      routine is being executed because this kind of warning only
      matters when the routine is being created".
      
      Which is incorrect, a feature might become deprecated after
      the routine was created and a user has to know that to be able
      to update the procedure before it stops working when a
      deprecated feature is removed.
      52a0cd3c
    • Sergei Golubchik's avatar
      MDEV-31811 deprecate old_mode values · 6b9e1220
      Sergei Golubchik authored
      mark non-default values of old_mode as deprecated.
      print a warning when they're set from the command line and in SQL.
      6b9e1220
    • Sergei Golubchik's avatar
      MDEV-32104 remove deprecated features · 82174dae
      Sergei Golubchik authored
      In particular:
      
      * @@debug
        deprecated since 5.5.37
      * sr_YU locale
        deprecated since 10.0.11
      * "engine_condition_pushdown" in the @@optimizer_switch
        deprecated since 10.1.1
      * @@date_format, @@datetime_format, @@time_format, @@max_tmp_tables
        deprecated since  10.1.2
      * @@wsrep_causal_reads
        deprecated since 10.1.3
      * "parser" in mroonga table comment
        deprecated since 10.2.11
      82174dae
    • Sergei Golubchik's avatar
      MDEV-31474 KDF() function · 4f9396b9
      Sergei Golubchik authored
      KDF(key_str, salt [, {info | iterations} [, kdf_name [, width ]]])
      
      kdf_name is "hkdf" or "pbkdf2_hmac" (default).
      
      width (in bits) can be any number divisible by 8,
      by default it's taken from @@block_encryption_mode
      
      iterations must be positive, and is 1000 by default
      
      OpenSSL 1.0 doesn't support HKDF, so it'll return NULL.
      This OpenSSL version is still used in SLES 12 and CentOS 7
      4f9396b9
    • Sergei Golubchik's avatar
      ErrConvStringQ helper · 03c68f40
      Sergei Golubchik authored
      like ErrConvString, but puts the string in 'single quotes'
      03c68f40
    • Sergei Golubchik's avatar
      MDEV-31231 fix windows packaging · 3c9ecf4b
      Sergei Golubchik authored
      followup for 7ba9c7fb
      3c9ecf4b
    • Sergei Golubchik's avatar
      MDEV-31231 fixes for MariaDB-connect-engine* rpms · a8d2e230
      Sergei Golubchik authored
      * don't introduce random four-space-gaps into the middle of description
        (meaning, nicely aligned wrapped string in the code gets ugly
        in the rpm)
      * remove obsolete comment
      * MariaDB-connect-engine is a required package for MariaDB-connect-engine-jdbc
        not "recommended"
      * don't recommend both mariadb-java-client and mysql-connector-java
      * in fact, don't recommend anything, it works badly for old rpm < 4.13,
        installs something that user may not want, and install redundand deps.
        Let's rethink how to do it meaningfully. And not break tests.
      
      followup for 7ba9c7fb
      a8d2e230
    • Sergei Golubchik's avatar
      Revert "MDEV-30610 Update RocksDB to v8.1.1" · 49b5a2b3
      Sergei Golubchik authored
      Not ready yet, it fails its own test suite
      
      This reverts commit 485c9b1f
      49b5a2b3
    • Sergei Golubchik's avatar
      Merge branch '11.2' into 11.3 · 3928c7e2
      Sergei Golubchik authored
      3928c7e2
    • Sergei Golubchik's avatar
      872ed534
  7. 29 Sep, 2023 3 commits
  8. 27 Sep, 2023 1 commit
  9. 25 Sep, 2023 1 commit
  10. 24 Sep, 2023 4 commits
  11. 23 Sep, 2023 2 commits
  12. 21 Sep, 2023 4 commits
    • Nikita Malyavin's avatar
      fix rdb_i_s.cc build · e9573c05
      Nikita Malyavin authored
      e9573c05
    • Nikita Malyavin's avatar
      Merge branch '11.2' into 11.3 · 28b40372
      Nikita Malyavin authored
      28b40372
    • Alexander Barkov's avatar
      MDEV-32220 sql_yacc.yy: unify the drop_routine rule · d75ef02a
      Alexander Barkov authored
      - Removing two copies of the drop_routine.
        Adding a shared and much simplified version.
      
      - Removing LEX metods:
            bool stmt_drop_function(const DDL_options_st &options,
                                    const Lex_ident_sys_st &db,
                                    const Lex_ident_sys_st &name);
      
            bool stmt_drop_function(const DDL_options_st &options,
                                    const Lex_ident_sys_st &name);
      
            bool stmt_drop_procedure(const DDL_options_st &options,
                                     sp_name *name);
      
        The code inside the methods was very similar.
        Adding one method instead:
      
            bool stmt_drop_routine(const Sp_handler *sph,
                                const DDL_options_st &options,
                                const Lex_ident_sys_st &db,
                                const Lex_ident_sys_st &name);
      
      - Adding a new virtual method Sp_handler:sqlcom_drop().
        It helped to unify the code inside the new stmt_drop_routine().
      d75ef02a
    • Alexander Barkov's avatar
      MDEV-32219 Shift/reduce grammar conflict: GRANT .. ON FUNCTION · 19885128
      Alexander Barkov authored
      Resolving the shift/reduce conflict conflict in:
      
      GRANT ..  ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
      GRANT ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;
      
      and in
      
      REVOKE ..  ON /*ambiguity*/ FUNCTION f1 TO foo@localhost;
      REVOKE ... ON /*ambiguity*/ [TABLE] function TO foo@localhost;
      
      using a new %prec directive.
      19885128
  13. 19 Sep, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-32044 Mariadb crash after upgrading to 11.0.3 · 030ee267
      Marko Mäkelä authored
      ibuf_bitmap_buffered(): A new predicate, to check if the
      IBUF_BITMAP_BUFFERED bit for a particular page is set.
      
      ibuf_merge(): If ibuf_bitmap_buffered() does not hold,
      skip the records for the page. One reason why we might have
      this situation is the bug that was fixed in
      commit 34c283ba (MDEV-32132).
      030ee267
  14. 15 Sep, 2023 1 commit
  15. 14 Sep, 2023 2 commits