mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into example.com:/work/bug24395-v2/my50 myisam/mi_open.c: Auto merged sql/sql_table.cc: Auto merged
This commit is contained in:
commit
65da49e6a8
4 changed files with 306 additions and 5 deletions
|
|
@ -1264,13 +1264,30 @@ int mi_enable_indexes(MI_INFO *info)
|
|||
RETURN
|
||||
0 indexes are not disabled
|
||||
1 all indexes are disabled
|
||||
[2 non-unique indexes are disabled - NOT YET IMPLEMENTED]
|
||||
2 non-unique indexes are disabled
|
||||
*/
|
||||
|
||||
int mi_indexes_are_disabled(MI_INFO *info)
|
||||
{
|
||||
MYISAM_SHARE *share= info->s;
|
||||
|
||||
return (! mi_is_any_key_active(share->state.key_map) && share->base.keys);
|
||||
/*
|
||||
No keys or all are enabled. keys is the number of keys. Left shifted
|
||||
gives us only one bit set. When decreased by one, gives us all all bits
|
||||
up to this one set and it gets unset.
|
||||
*/
|
||||
if (!share->base.keys ||
|
||||
(mi_is_all_keys_active(share->state.key_map, share->base.keys)))
|
||||
return 0;
|
||||
|
||||
/* All are disabled */
|
||||
if (mi_is_any_key_active(share->state.key_map))
|
||||
return 1;
|
||||
|
||||
/*
|
||||
We have keys. Some enabled, some disabled.
|
||||
Don't check for any non-unique disabled but return directly 2
|
||||
*/
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue