maria:bb-11.0-MDEV-30944

Last commit made on 2023-06-01
Get this branch:
git clone -b bb-11.0-MDEV-30944 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.0-MDEV-30944
Repository:
lp:maria

Recent commits

be0ba41... by Rex Johnston

MDEV-30944 Range_rowid_filter::fill() leaves file->keyread at MAX_KEY

Range_rowid_filter::fill() leaves keyread altered,
leading to assertion failure in join_tab->read_first_record().

aac88fc... by Monty <email address hidden>

MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed in make_join_readinfo

The problem was a wrong assert. I changed it to match the code in
best_access_path().

The given test case was a bit tricky for the optimizer, which first
decided on using a index scan (because of force index), but then
test_if_skip_sort_order() decided to use range anyway to handle
distinct.

6611419... by Monty <email address hidden>

MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with many joins

Problem was an overflow when calculating number of join cache refills.

209fed8... by Monty <email address hidden>

MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range query

This was caused of two minor issues:
- get_quick_record_count() returned the number of rows for range with
  least cost, when it should have returned the minum number of rows
  for any range.
- When changing REF to RANGE, we also changed records_out, which
  should not be done (number of records in the result will not
  change).

The above change can cause a small change in row estimates where the
optimizer chooses a clustered key with more rows than a range one
secondary key (unlikely case).

368dd22... by Sergey Petrunia

MDEV-31223: UBSan error: sql_select.h:969:7: runtime error: load of value...

In Loose_scan_opt::save_to_position, initialize
POSITION::firstmatch_with_join_buf.

b3edbf2... by Sergey Petrunia

MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table

The code in create_internal_tmp_table() didn't take into account that
now temporary (derived) tables may have multiple indexes:

- one index due to duplicate removal
   = In this example created by conversion of big-IN(...) into subquery
   = this index might be converted into a "unique constraint" if the key
     length is too large.
- one index added by derived_with_keys optimization.

Make create_internal_tmp_table() handle multiple indexes.

Before this patch, use of a unique constraint was indicated in
TABLE_SHARE::uniques. This was ok as unique constraint was the only index
in the table. Now it's no longer the case so TABLE_SHARE::uniques is removed
and replaced with an in-memory-only flag HA_UNIQUE_HASH.

This patch is based on Monty's patch.
Co-Author: Monty <email address hidden>

63df43a... by Monty <email address hidden>

Removed temporary test file that should not have been pushed

78f684e... by Monty <email address hidden>

Moved events tests from main to suite/events

This makes it easier to run test on just events.

ec820a3... by Monty <email address hidden>

Moved merge tests from main to suite/merge

This makes it easier to run test on just the MRG_MYISAM engine.

Other things:
- Renamed merge-big.test to flush_corruption.test as it does not
  have anything to do with merge tables.

0099c2f... by Monty <email address hidden>

MDEV-30786 SIGFPE in cost_group_min_max on EXP

The problem was that for merge tables without any underlaying tables the
block size was 0, which the code could not handle.

Fixed by ensuring that MERGE tables never have a block size of 0.
Fixed also a wrong assumption of number of seeks needed to scan
merge tables.