1. 27 Oct, 2023 3 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-28699 Shrink temporary tablespaces without restart · c507678b
      Thirunarayanan Balathandayuthapani authored
      - Introduced the variable "innodb_truncate_temporary_tablespace_now"
      to shrink the temporary tablespace.
      
      Steps for shrinking the temporary tablespace:
      
      1) Find the last used extent in temporary tablespace
      by iterating through the BITMAP in extent descriptor pages
      
      2) If the last used extent is lesser than user specified size
      then set desired target size to user specified size
      
      3) Store the page contents of "to be modified" extent
      descriptor pages, latches the "to be modified" extent
      descriptor pages and check for buffer pool memory availability
      
      4) Update the FSP_SIZE and FSP_FREE_LIMIT in header page
      
      5) Remove the "to be truncated" pages from FSP_FREE and
      FSP_FREE_FRAG list
      
      6) Reset the bitmap in the last descriptor pages for the
      "to be truncated" pages.
      
      7) Clear the freed range in temporary tablespace which
      are to be truncated.
      
      8) Evict the "to be truncated" temporary tablespace pages
      from LRU list.
      
      9) In case of multiple files, calculate the truncated last
      file size and do truncation in last file
      
      10) Commit the mini-transaction for shrinking the tablespace
      c507678b
    • Marko Mäkelä's avatar
      Merge 11.2 into 11.3 · 7b842f15
      Marko Mäkelä authored
      7b842f15
    • Yuchen Pei's avatar
      Merge branch '11.1' into 11.2 · d0f8dfbc
      Yuchen Pei authored
      d0f8dfbc
  2. 26 Oct, 2023 3 commits
    • Yuchen Pei's avatar
      MDEV-32525 Validate --redirect_url supplied as server flag · c4a506f0
      Yuchen Pei authored
      Like sql_mode, we factor out of ON_CHECK function for export, to be
      used in get_options() during server startup, for validation of
      --redirect_url value.
      c4a506f0
    • Yuchen Pei's avatar
      MDEV-15935 Adding global/session system var redirect_url · 5af70dec
      Yuchen Pei authored
      Adding a global/session var `redirect_url' of string type. The initial
      value is empty. Can be supplied in mysqld with --redirect-url or set
      in --init-connect. A valid redirect_url should be of the format
      
      {mysql,mariadb}://host[:port]
      
      where <host> is an arbitrary string not containing colons, and <port>
      is a number between 0 and 65535 inclusive.
      
      The variable will be used by the server to notify clients that they
      should connect to another server, specified by the value of the
      variable, if not empty.
      
      The notification is done by the inclusion of the variable in
      session_track_system_variable.
      5af70dec
    • Yuchen Pei's avatar
      cleanup: string sys_var types · 6151bde4
      Yuchen Pei authored
      Merge sys_var_charptr with sys_var_charptr_base, as well as merge
      Sys_var_session_lexstring into Sys_var_lexstring. Also refactored
      update methods of sys_var_charptr accordingly.
      
      Because the class is more generic, session_update() calls
      sys_var_charptr::session_update() which does not assume a buffer field
      associated with THD, but instead call strdup/free, we get rid of
      THD::default_master_connection_buff accordingly. This also makes THD
      smaller by ~192 bytes, and there can be many thousands of concurrent
      THDs.
      6151bde4
  3. 25 Oct, 2023 1 commit
  4. 23 Oct, 2023 1 commit
    • Brandon Nesterenko's avatar
      MDEV-27247: Add keywords "SQL_BEFORE_GTIDS" and "SQL_AFTER_GTIDS" for START SLAVE UNTIL · 0c1bf5e2
      Brandon Nesterenko authored
      New Feature:
      ============
      This patch extends the START SLAVE UNTIL command with options
      SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS to allow user control of
      whether the replica stops before or after a provided GTID state. Its
      syntax is:
      
      START SLAVE UNTIL (SQL_BEFORE_GTIDS|SQL_AFTER_GTIDS)=”<gtid_list>”
      
      When providing SQL_BEFORE_GTIDS=”<gtid_list>”, for each domain
      specified in the gtid_list, the replica will execute transactions up
      to the GTID found, and immediately stop processing events in that
      domain (without executing the transaction of the specified GTID).
      Once all domains have stopped, the replica will stop. Events
      originating from domains that are not specified in the list are not
      replicated.
      
      START SLAVE UNTIL SQL_AFTER_GTIDS=”<gtid_list>” is an alias to the
      default behavior of START SLAVE UNTIL master_gtid_pos=”<gtid_list>”.
      That is, the replica will only execute transactions originating from
      domain ids provided in the list, and will stop once all transactions
      provided in the UNTIL list have all been executed.
      
      Example:
      =========
      If a primary server has a binary log consisting of the following GTIDs:
      
      0-1-1
      1-1-1
      0-1-2
      1-1-2
      0-1-3
      1-1-3
      
      If a fresh replica (i.e. one with an empty GTID position,
      @@gtid_slave_pos='') is started with SQL_BEFORE_GTIDS, i.e.
      
      START SLAVE UNTIL SQL_BEFORE_GTIDS=”1-1-2”
      
      The resulting gtid_slave_pos of the replica will be “1-1-1”.
      This is because the replica will execute only events from domain 1
      until it sees the transaction with sequence number 2, and
      immediately stop without executing it.
      
      If the replica is started with SQL_AFTER_GTIDS, i.e.
      
      START SLAVE UNTIL SQL_AFTER_GTIDS=”1-1-2”
      
      then the resulting gtid_slave_pos of the replica will be “1-1-2”.
      This is because it will only execute events from domain 1 until it
      has executed the provided GTID.
      
      Reviewed By:
      ============
      Kristian Nielson <knielsen@knielsen-hq.org>
      0c1bf5e2
  5. 19 Oct, 2023 3 commits
  6. 18 Oct, 2023 3 commits
    • Marko Mäkelä's avatar
      Merge 10.10 into 10.11 · f833ef5a
      Marko Mäkelä authored
      f833ef5a
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.10 · c857259e
      Marko Mäkelä authored
      c857259e
    • Marko Mäkelä's avatar
      MDEV-32511 Assertion !os_aio_pending_writes() failed · bf7c6fc2
      Marko Mäkelä authored
      In MemorySanitizer builds of 10.10 and 10.11, we would rather often
      have the assertion fail in innodb_init() during mariadb-backup --prepare.
      The assertion could also fail during InnoDB startup, but less often.
      
      Before commit 685d958e in 10.8 the
      log file cleanup after a successfully applied backup is different,
      and the os_aio_pending_writes() assertion is in srv0start.cc.
      
      IORequest::write_complete(): Invoke node->complete_write() before
      releasing the page latch, so that a log checkpoint that is about to
      execute concurrently will not miss a fdatasync() or fsync() on the
      file, in case this was the first write since the last such call.
      
      create_log_file(), srv_start(): Replace the debug assertion with
      a debug check. For all intents and purposes, all writes could have
      been completed but some write_io_callback() may not have invoked
      io_slots::release() yet.
      bf7c6fc2
  7. 17 Oct, 2023 7 commits
  8. 16 Oct, 2023 2 commits
  9. 14 Oct, 2023 3 commits
    • Monty's avatar
      MDEV-32449 Server crashes in Alter_info::add_stat_drop_index upon CREATE TABLE · 1c554459
      Monty authored
      Fixed missing initialization of Alter_info()
      
      This could cause crashes in some create table like scenarios
      where some generated indexes where automatically dropped.
      
      I also added a test that we do not try to drop from index_stats for
      temporary tables.
      1c554459
    • Monty's avatar
      Do not create histograms for single column unique key · ec277a70
      Monty authored
      The intentention was always to not create histograms for single value
      unique keys (as histograms is not useful in this case), but because of
      a bug in the code this was still done.
      
      The changes in the test cases was mainly because hist_size is now NULL
      for these kind of columns.
      ec277a70
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.10 · d5e15424
      Marko Mäkelä authored
      The MDEV-29693 conflict resolution is from Monty, as well as is
      a bug fix where ANALYZE TABLE wrongly built histograms for
      single-column PRIMARY KEY.
      Also includes a fix for safe_malloc error reporting.
      
      Other things:
      - Copied main.log_slow from 10.4 to avoid mtr issue
      
      Disabled test:
      - spider/bugfix.mdev_27239 because we started to get
        +Error	1429 Unable to connect to foreign data source: localhost
        -Error	1158 Got an error reading communication packets
      - main.delayed
        - Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
          This part is disabled for now as it fails randomly with different
          warnings/errors (no corruption).
      d5e15424
  10. 13 Oct, 2023 3 commits
    • Vlad Lesin's avatar
      MDEV-32272 lock_release_on_prepare_try() does not release lock if supremum bit... · 18fa00a5
      Vlad Lesin authored
      MDEV-32272 lock_release_on_prepare_try() does not release lock if supremum bit is set along with other bits set in lock's bitmap
      
      The error is caused by MDEV-30165 fix with the following commit:
      d13a57ae
      
      There is logical error in lock_release_on_prepare_try():
      
              if (supremum_bit)
                lock_rec_unlock_supremum(*cell, lock);
              else
                lock_rec_dequeue_from_page(lock, false);
      
      Because there can be other bits set in the lock's bitmap, and the lock
      type can be suitable for releasing criteria, but the above logic
      releases only supremum bit of the lock.
      
      The fix is to release lock if it suits for releasing criteria and unlock
      supremum if supremum is locked otherwise.
      
      Tere is also the test for the case, which was reported by QA team. I
      placed it in a separate files, because it requires debug build.
      
      Reviewed by: Marko Mäkelä
      18fa00a5
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-31098 InnoDB Recovery doesn't display encryption message when no... · cbad0bcd
      Thirunarayanan Balathandayuthapani authored
      MDEV-31098  InnoDB Recovery doesn't display encryption message when no encryption configuration passed
      
      - InnoDB fails to report the error when encryption configuration
      wasn't passed. This patch addresses the issue by adding
      the error while loading the tablespace and deferring the
      tablespace creation.
      cbad0bcd
    • Yuchen Pei's avatar
      Merge branch '10.10' into 10.11 · 17810b75
      Yuchen Pei authored
      17810b75
  11. 12 Oct, 2023 2 commits
    • Daniel Black's avatar
      MDEV-18200 MariaBackup full backup failed with InnoDB: Failing assertion: success · 3b38c2f3
      Daniel Black authored
      There are many filesystem related errors that can occur with
      MariaBackup. These already outputed to stderr with a good description of
      the error. Many of these are permission or resource (file descriptor)
      limits where the assertion and resulting core crash doesn't offer
      developers anything more than the log message. To the user, assertions
      and core crashes come across as poor error handling.
      
      As such we return an error and handle this all the way up the stack.
      3b38c2f3
    • Rucha Deodhar's avatar
      MDEV-31684: More tests · 63da557e
      Rucha Deodhar authored
      63da557e
  12. 11 Oct, 2023 5 commits
    • Sergei Golubchik's avatar
      MDEV-31684 post-review changes · 6f55cb4b
      Sergei Golubchik authored
      6f55cb4b
    • Rucha Deodhar's avatar
      MDEV-31684 Add timezone information to DATE_FORMAT · 94eb8192
      Rucha Deodhar authored
      Before starting to go over the format string, prepare the current time
      zone information incase '%z' or '%Z' is encountered.
      This information can be obtained as given below:
      
      A) If timezone is not set ( meaning we are working with system timezone):
      Get the MYSQL_TIME representation for current time and GMT time using
      current thread variable for timezone and timezone variable for UTC
      respectively. This MYSQL_TIME variable will be used to calculate time
      difference. Also convert current time in second to tm structure to
      get system timezone information.
      
      B) If timezone is set as offset:
      Get timezone information using current timezone information and store
      in appropriate variable.
      
      C) If timezone is set as some place (example: Europe/Berlin)
      Get timezone information by searching the timezone. During internal
      timezone search, information like timeoffset from UTC and abbrevation
      is stored in another relevant structure. Hence use the same information.
      94eb8192
    • Marko Mäkelä's avatar
      MDEV-32364 Server crashes when starting server with high innodb_log_buffer_size · c72ddeea
      Marko Mäkelä authored
      log_t::create(), log_t::attach(): Return whether the initialisation
      succeeded. It may fail if too large an innodb_log_buffer_size is specified.
      
      recv_sys_t::close_files(): Actually close the data files so that the
      test mariabackup.huge_lsn,strict_crc32 will not fail on Microsoft Windows
      when renaming ib_logfile101 due to a leaked file handle of ib_logfile0.
      
      recv_sys_t::find_checkpoint(): Register recv_sys.files[0] as OS_FILE_CLOSED
      because the file handle has already been attached to log_sys.log and
      we do not want to close the file twice.
      
      recv_sys_t::read(): Access the first log file via log_sys.log.
      
      This is a port of commit 6e9b421f
      adapted to commit 685d958e (MDEV-14425).
      
      The test case is omitted, because it would fail to fail when the log
      is stored in persistent memory (or "fake PMEM" on Linux /dev/shm).
      c72ddeea
    • Dmitry Shulga's avatar
      MDEV-32123: require_secure_transport doesn't allow TCP connections · a05b5dd5
      Dmitry Shulga authored
      In case the option require_secure_transport is on the user can't
      establish a secure ssl connection over TCP protocol. Inability to set up
      a ssl session over TCP was caused by the fact that a type of client's
      connection was checked before ssl handshake performed (ssl handshake
      happens at the function acl_authenticate()). At that moment vio type has
      the value VIO_TYPE_TCPIP for client connection that uses TCP transport.
      In result, checking for allowable vio type for fails despite the fact
      that SSL session being established. To fix the issue move checking of
      vio type for allowable values inside the function
        parse_client_handshake_packet()
      right after client's capabilities discovered that SSL is not requested
      by the client.
      a05b5dd5
    • Yuchen Pei's avatar
      MDEV-32238 Adding a switch to disable the spider group by handler · 50784c88
      Yuchen Pei authored
      The system variable spider_disable_group_by_handler, if on, will
      disable the spider group by handler (gbh), and such disablement serves
      as workaround to bugs caused by gbh, labelled with spider-gbh on jira,
      including MDEV-26247, MDEV-28998, MDEV-29163, MDEV-30392, MDEV-31645.
      Tests for these tickets are added accordingly with the workaround in
      place.
      50784c88
  13. 10 Oct, 2023 4 commits