1. 04 Aug, 2020 2 commits
  2. 03 Aug, 2020 10 commits
    • Oleksandr Byelkin's avatar
      Merge branch '10.3' into 10.4 · 57325e47
      Oleksandr Byelkin authored
      57325e47
    • Oleksandr Byelkin's avatar
      Merge branch '10.2' into 10.3 · c32f71af
      Oleksandr Byelkin authored
      c32f71af
    • Sachin's avatar
      MDEV-23089 rpl_parallel2 fails in 10.5 · 706a7101
      Sachin authored
      Problem:- rpl_parallel2 was failing non-deterministically
      Analysis:-
      When FLUSH TABLES WITH READ LOCK is executed, it will allow all worker
      threads to complete their ongoing transactions and then it will pause them.
      At this state FTWRL will proceed to acquire global read lock. FTWRL first
      blocks threads from starting new commits, then upgrades the lock to block
      commit of existing transactions.
        Step1:
          FLUSH TABLES WITH READ LOCK - Blocks new commits
        Step2:
          * STOP SLAVE command enables 'force_abort=1' which unblocks workers,
            they continue to execute events.
          * T1: Waits in 'record_gtid' call to update 'gtid_slave_pos' table with
            its current GTID, but it is blocked becuase of Step1.
          * T2: Holds COMMIT lock and waits for T1 to commit.
        Step3:
          FLUSH TABLES WITH READ LOCK - Waiting to get BLOCK_COMMIT.
      This results in deadlock. When STOP SLAVE command allows paused workers to
      proceed, workers should skip the execution of all further events, similar
      to 'conservative' parallel mode.
      Solution:-
      We will assign 1 to skip_event_group when we are aborted in do_ftwrl_wait.
      rpl_parallel_entry->pause_sub_id is only reset when force_abort is off in
      rpl_pause_after_ftwrl.
      706a7101
    • Oleksandr Byelkin's avatar
      Merge branch '10.1' into 10.2 · 555c6632
      Oleksandr Byelkin authored
      555c6632
    • Sergei Petrunia's avatar
      Fix the typo in fix for MDEV-21472 · 8bca92c8
      Sergei Petrunia authored
      8bca92c8
    • Sergei Golubchik's avatar
      compilation error on bintar-centos6-amd64-debug · acfc500d
      Sergei Golubchik authored
      /home/buildbot/buildbot/build/storage/xtradb/mtr/mtr0mtr.cc:97:37: error: invalid access to non-static data member ‘fil_space_t::latch’  of NULL object [-Werror=invalid-offsetof]
      acfc500d
    • Alexander Barkov's avatar
      MDEV-23366 ROUND(18446744073709551615,rand()*0) returns a wrong result · 9840bb21
      Alexander Barkov authored
      Changing that in case of *INT and hex hybrid input:
      - ROUND(x,NULL) creates a column with the same type as x.
        The old code created a DOUBLE column, which was not relevant at all.
        This change simplifies the code a lot.
      
      - ROUND(x,non_constant) creates a column of the INT, BIGINT or DECIMAL
        data type (depending on the exact type of x).
        The old code created a column of the DOUBLE data type,
        which lead to precision loss. Hence MDEV-23366.
      
      - ROUND(bigint_30,negative_constant) creates a column of the DECIMAL(30,0)
        data type. The old code created DECIMAL(29,0), which looked strange:
        the data type promoted to a higher one, but max length reduced.
        Now the length attribute is preserved.
      9840bb21
    • Rucha Deodhar's avatar
      MDEV-21017: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' · 97f7bfce
      Rucha Deodhar authored
      failed or late ER_PERIOD_FIELD_WRONG_ATTRIBUTES upon attempt to create
      existing table
      
      Analysis: Error state is not stored when field is checked in
      Table_period_info::check_field()
      Fix: Store error state by setting res to true.
      97f7bfce
    • Alexander Barkov's avatar
      MDEV-23367 ROUND(18446744073709551615,-1) returns a wrong result · 00f964ab
      Alexander Barkov authored
      This problem was fixed by MDEV-23368. Adding tests only.
      00f964ab
    • Elena Stepanova's avatar
      dc716da4
  3. 02 Aug, 2020 10 commits
  4. 01 Aug, 2020 5 commits
    • Marko Mäkelä's avatar
      MDEV-21201: Null-Merge 10.3 · 297746de
      Marko Mäkelä authored
      Sorry, this should have been pushed instead of
      7f4c749d to 10.3.
      (The push of d63631c3
      prevented required an extra merge of that fix.
      And that commit was merged to 10.4
      da78e952.)
      297746de
    • Marko Mäkelä's avatar
      MDEV-21201: Add --sorted_result to the test, for 10.4 · 7f4c749d
      Marko Mäkelä authored
      On MariaDB 10.4 (commit 4db4b773),
      the query results would not be sorted, which creates random result
      differences. Let us explicitly sort the results already in 10.3
      in order to avoid future merge trouble.
      7f4c749d
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · da78e952
      Marko Mäkelä authored
      da78e952
    • Marko Mäkelä's avatar
      MDEV-21201: Add --sorted_result to the test, for 10.4 · 976abe64
      Marko Mäkelä authored
      On MariaDB 10.4 (commit 4db4b773),
      the query results would not be sorted, which creates random result
      differences. Let us explicitly sort the results already in 10.3
      in order to avoid future merge trouble.
      976abe64
    • Alexander Barkov's avatar
      MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode · d63631c3
      Alexander Barkov authored
      - Adding optional qualifiers to data types:
          CREATE TABLE t1 (a schema.DATE);
        Qualifiers now work only for three pre-defined schemas:
      
          mariadb_schema
          oracle_schema
          maxdb_schema
      
        These schemas are virtual (hard-coded) for now, but may turn into real
        databases on disk in the future.
      
      - mariadb_schema.TYPE now always resolves to a true MariaDB data
        type TYPE without sql_mode specific translations.
      
      - oracle_schema.DATE translates to MariaDB DATETIME.
      
      - maxdb_schema.TIMESTAMP translates to MariaDB DATETIME.
      
      - Fixing SHOW CREATE TABLE to use a qualifier for a data type TYPE
        if the current sql_mode translates TYPE to something else.
      
      The above changes fix the reported problem, so this script:
      
          SET sql_mode=ORACLE;
          CREATE TABLE t2 AS SELECT mariadb_date_column FROM t1;
      
      is now replicated as:
      
          SET sql_mode=ORACLE;
          CREATE TABLE t2 (mariadb_date_column mariadb_schema.DATE);
      
      and the slave can unambiguously treat DATE as the true MariaDB DATE
      without ORACLE specific translation to DATETIME.
      
      Similar,
      
          SET sql_mode=MAXDB;
          CREATE TABLE t2 AS SELECT mariadb_timestamp_column FROM t1;
      
      is now replicated as:
      
          SET sql_mode=MAXDB;
          CREATE TABLE t2 (mariadb_timestamp_column mariadb_schema.TIMESTAMP);
      
      so the slave treats TIMESTAMP as the true MariaDB TIMESTAMP
      without MAXDB specific translation to DATETIME.
      d63631c3
  5. 31 Jul, 2020 13 commits
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 4db4b773
      Marko Mäkelä authored
      4db4b773
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 70d4500c
      Marko Mäkelä authored
      70d4500c
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 9216114c
      Marko Mäkelä authored
      9216114c
    • Alexander Barkov's avatar
      MDEV-23351 Rounding functions return wrong data types for DATE input · dc513dff
      Alexander Barkov authored
      Fixing ROUND(date,0), TRUNCATE(date,x), FLOOR(date), CEILING(date)
      to return the `int(8) unsigned` data type.
      
      Details:
      1. Cleanup: moving virtual implementations
         - Type_handler_temporal_result::Item_func_int_val_fix_length_and_dec()
         - Type_handler_temporal_result::Item_func_round_fix_length_and_dec()
         to Type_handler_date_common. Other temporal data type handlers
         override these methods anyway. So they were only DATE specific.
         This change makes the code clearer.
      2. Backporting DTCollation_numeric from 10.5, to reuse the code easier.
      3. Adding the `preferred_attrs` argument to Item_func_round::fix_arg_int(). Now
         Type_handler_xxx::Item_func_round_val_fix_length_and_dec() work as follows:
         - The INT-alike and YEAR handlers copy preferred_attrs from args[0].
         - The DATE handler passes explicit attributes, to get `int(8) unsigned`.
         - The hex hybrid handler passes NULL, so fix_arg_int() calculates attributes.
      4. Type_handler_date_common::Item_func_int_val_fix_length_and_dec()
         now sets the type handler and attributes to get `int(8) unsigned`.
      dc513dff
    • Oleksandr Byelkin's avatar
      MDEV-21201 No records produced in information_schema query, depending on projection · a8458a23
      Oleksandr Byelkin authored
      In case of NATURAL JOIN / USING mark all field (one table can not be opened
      in any case so optimisation does not worth it).
      
      IMHO table should be checked for used fields and filled after prepare,
      when we will fave whole info about used fields but it is too big change
      for a bugfix. Which will be made later by Serg patch
      a8458a23
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 78c2a5ab
      Marko Mäkelä authored
      78c2a5ab
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-14711 Fix-up · 5ec40fbb
      Thirunarayanan Balathandayuthapani authored
      5ec40fbb
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 8bb2170d
      Marko Mäkelä authored
      8bb2170d
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 66ec3a77
      Marko Mäkelä authored
      66ec3a77
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-22511 innodb.truncate_foreign failed in buildbot with wrong error code · a6066e23
      Thirunarayanan Balathandayuthapani authored
      - Adding lock_wait_timeout value as 1 make sure that truncate table
      fails instead of making MDL timeout.
      a6066e23
    • Sergei Golubchik's avatar
    • Marko Mäkelä's avatar
      MDEV-11799 Doublewrite recovery can corrupt data pages · 879ba197
      Marko Mäkelä authored
      The purpose of the InnoDB doublewrite buffer is to make InnoDB
      tolerant against cases where the server was killed in the middle
      of a page write. (In Linux, killing a process may interrupt a
      write system call, typically on a 4096-byte boundary.)
      
      There may exist multiple copies of a page number in the doublewrite
      buffer. Recovery should choose the latest valid copy of the page.
      By design, the FIL_PAGE_LSN must not precede the latest checkpoint LSN
      nor be later than the end of the recovered log.
      
      For page_compressed and encrypted pages, we were missing proper
      consistency checks. In the 10.4 data set generated for in MDEV-23231,
      the data file contained a valid page_compressed page, and an
      identical copy of that page was also present in the doublewrite
      buffer. But, recovery would incorrectly consider the page invalid
      and restore an uncompressed copy of the same page that had been
      written before the log checkpoint. (In fact, no redo log was to
      be applied to that page.)
      
      buf_dblwr_process(): Validate the FIL_PAGE_LSN in the doublewrite
      buffer pages, and always skip page 0, because those pages should
      have been recovered by Datafile::restore_from_doublewrite() if
      necessary.
      
      Datafile::restore_from_doublewrite(): Choose the latest applicable
      page from the doublewrite buffer.
      
      recv_dblwr_t::find_page(): Also validate encrypted or
      page_compressed pages.
      
      recv_dblwr_t::validate_page(): New function to validate a page,
      either a copy in a data file or in the doublewrite buffer.
      Also validate encrypted or page_compressed pages.
      
      This is joint work with Thirunarayanan Balathandayuthapani.
      879ba197
    • Marko Mäkelä's avatar
      MDEV-23198 Crash in REPLACE · f35d1721
      Marko Mäkelä authored
      row_vers_impl_x_locked_low(): clust_offsets may point to memory
      that is allocated by mem_heap_alloc() and may have been freed.
      For initializing clust_offsets, try to use the stack-allocated
      buffer instead of a pointer that may point to freed memory.
      
      This fixes a regression that was introduced in
      commit f0aa073f (MDEV-20950).
      f35d1721