1. 05 May, 2023 4 commits
    • Sergei Petrunia's avatar
      MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on · a24f2bb5
      Sergei Petrunia authored
      Derived table creation code would call Field::make_new_field() which would
      memcpy the Field object from the source table, including Field::read_stats.
      
      But the temp. table as a whole had table->stats_is_read=false. Which was
      correct but not consistent with Field::read_stats and caused an assertion.
      
      Fixed by making sure that Field::read_stats=NULL for fields in the new
      temporary (i.e. work) tables.
      a24f2bb5
    • Oleksandr Byelkin's avatar
      Merge branch '10.5' into 10.6 · 1c394795
      Oleksandr Byelkin authored
      1c394795
    • Oleksandr Byelkin's avatar
      Merge branch '10.4' into 10.5 · b735ca47
      Oleksandr Byelkin authored
      b735ca47
    • Sergei Petrunia's avatar
      MDEV-31194: Server crash or assertion failure with join_cache_level=4 · 2594da7a
      Sergei Petrunia authored
      The problem, introduced in patch for MDEV-26301:
      
      When check_join_cache_usage() decides not to use join buffer, it must
      adjust the access method accordingly. For BNL-H joins this means switching
      from pseudo-"ref access"(with index=MAX_KEY) to some other access method.
      
      Failing to do this will cause assertions down the line when code that is
      not aware of BNL-H will try to initialize index use for ref access with
      index=MAX_KEY.
      
      The fix is to follow the regular code path to disable the join buffer for
      the join_tab ("goto no_join_cache") instead of just returning from
      check_join_cache_usage().
      2594da7a
  2. 04 May, 2023 10 commits
  3. 03 May, 2023 8 commits
  4. 02 May, 2023 13 commits
  5. 30 Apr, 2023 1 commit
    • Igor Babaev's avatar
      MDEV-31143 Crash for query using ROWNUM() over view with ORDER BY · 7e2e9689
      Igor Babaev authored
      When processing a query over a mergeable view at some conditions checked
      at prepare stage it may be decided to materialize the view rather than
      to merge it. Before this patch in such case the field 'derived' of the
      TABLE_LIST structure created for the view remained set to 0. As a result
      the guard condition preventing range analysis for materialized views did
      not work properly. This led to a call of some handler method for the
      temporary table created to contain the view's records that was supposed
      to be used only for opened tables. However temporary tables created for
      materialization of derived tables or views are not opened yet when range
      analysis is performed.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      7e2e9689
  6. 29 Apr, 2023 2 commits
  7. 28 Apr, 2023 2 commits
    • Angelique's avatar
      MDEV-30221: Move environmental macros to before master-slave · 1963a87b
      Angelique authored
      The fix was introduced, along with re-ordering to do other macros that check test environment capabilities before master/slave is set up.
      1963a87b
    • Sergei Petrunia's avatar
      MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram · 85cc8318
      Sergei Petrunia authored
      Variant #2.
      
      When Histogram::point_selectivity() sees that the point value of interest
      falls into one bucket, it tries to guess whether the bucket has many
      different (unpopular) values or a few popular values. (The number of
      rows is fixed, as it's a Height-balanced histogram).
      The basis for this guess is the "width" of the value range the bucket
      covers. Buckets covering wider value ranges are assumed to contain
      values with proportionally lower frequencies.
      
      This is just a [brave] guesswork. For a very narrow bucket, it may
      produce an estimate that's larger than total #rows in the bucket
      or even in the whole table.
      
      Remove the guesswork and replace it with basic logic: return
      either the per-table average selectivity of col=const, or selectivity
      of one bucket, whichever is lower.
      85cc8318