mariadb/storage
Marko Mäkelä e5c4c0842d MDEV-35443: opt_search_plan_for_table() may degrade to full table scan
opt_calc_index_goodness(): Correct an inaccurate condition.
We can very well use a clustered index of a table that is subject
to online rebuild. But we must not choose an index that has not been
committed (it is a secondary index that was not fully created)
or that is corrupted or not a normal B-tree index.

opt_search_plan_for_table(): Remove some redundant code, now that
opt_calc_index_goodness() checks against corrupted indexes.

The test case allows this code to be exercised. The main observation
in the following:
	./mtr --rr innodb.stats_persistent
	rr replay var/log/mysqld.1.rr/latest-trace
should be that when opt_search_plan_for_table() is being invoked by
dict_stats_update_persistent() on the being-altered statistics table
in the 2nd call after ha_innobase::inplace_alter_table(),
and the fix in opt_calc_index_goodness() is absent,
it would choose the code path if (n_fields == 0), that is, a full
table scan, instead of searching for the record. The GDB commands to
execute in "rr replay" would be as follows:
	break ha_innobase::inplace_alter_table
	continue
	break opt_search_plan_for_table
	continue
	continue
	next
	next
	…

Reviewed by: Vladislav Lesin
2024-12-19 14:05:16 +02:00
..
archive MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
blackhole MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
cassandra MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
columnstore MDEV-33091 pcre2 headers - handle columnstore 2024-09-05 12:14:06 +10:00
connect MDEV-34700 Connect SQLite3 MTR test fails due to various charset/collation related output changes 2024-12-01 13:52:41 +04:00
csv MDEV-34348: Miscellaneous fixes 2024-11-23 08:14:23 -07:00
example MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
federated MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
federatedx MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
heap MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
innobase MDEV-35443: opt_search_plan_for_table() may degrade to full table scan 2024-12-19 14:05:16 +02:00
maria MDEV-34348: Fix casts relating to tree_walk_action 2024-11-23 08:14:23 -07:00
mroonga MDEV-35574 remove obsolete pthread_exit calls 2024-12-10 12:12:20 +11:00
myisam MDEV-34348: Fix casts relating to tree_walk_action 2024-11-23 08:14:23 -07:00
myisammrg MDEV-34348: Consolidate cmp function declarations 2024-11-23 08:14:22 -07:00
oqgraph Extract some of #3360 fixes to 10.5.x 2024-11-21 22:43:56 +11:00
perfschema MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
rocksdb MDEV-34408: Facilitate the addition of warnings into the build system 2024-11-23 08:14:23 -07:00
sequence MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
sphinx MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
spider MDEV-34716 Fix mysql.servers socket max length too short 2024-12-17 10:40:57 +11:00
test_sql_discovery MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
tokudb MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION 2024-12-05 08:17:35 +01:00