diff options
-rw-r--r-- | sql/handler.h | 7 | ||||
-rw-r--r-- | sql/lock.cc | 1 | ||||
-rw-r--r-- | sql/opt_subselect.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 14 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 7 | ||||
-rw-r--r-- | sql/temporary_tables.cc | 9 | ||||
-rw-r--r-- | sql/unireg.h | 35 | ||||
-rw-r--r-- | storage/oqgraph/ha_oqgraph.cc | 5 |
9 files changed, 23 insertions, 59 deletions
diff --git a/sql/handler.h b/sql/handler.h index a74e61479fd..8cc1f3973d9 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -370,16 +370,9 @@ enum enum_alter_inplace_result { */ #define HA_OPEN_KEYFILE 1 -#define HA_OPEN_RNDFILE 2 -#define HA_GET_INDEX 4 -#define HA_GET_INFO 8 /* do a ha_info() after open */ #define HA_READ_ONLY 16 /* File opened as readonly */ /* Try readonly if can't open with read and write */ #define HA_TRY_READ_ONLY 32 -#define HA_WAIT_IF_LOCKED 64 /* Wait if locked on open */ -#define HA_ABORT_IF_LOCKED 128 /* skip if locked on open.*/ -#define HA_BLOCK_LOCK 256 /* unlock when reading some records */ -#define HA_OPEN_TEMPORARY 512 /* Some key definitions */ #define HA_KEY_NULL_LENGTH 1 diff --git a/sql/lock.cc b/sql/lock.cc index 8aebc1f30d9..2de2a80c95a 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -411,7 +411,6 @@ static int lock_external(THD *thd, TABLE **tables, uint count) } else { - (*tables)->db_stat &= ~ HA_BLOCK_LOCK; (*tables)->current_lock= lock_type; } } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index a09826ac2f0..a9222cbca42 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4000,7 +4000,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) table->alias.set("weedout-tmp", sizeof("weedout-tmp")-1, table_alias_charset); table->reginfo.lock_type=TL_WRITE; /* Will be updated */ - table->db_stat=HA_OPEN_KEYFILE+HA_OPEN_RNDFILE; + table->db_stat=HA_OPEN_KEYFILE; table->map=1; table->temp_pool_slot = temp_pool_slot; table->copy_blobs= 1; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e1d788ba367..6e448c00748 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1855,12 +1855,8 @@ retry_share: goto err_lock; error= open_table_from_share(thd, share, alias, - (uint) (HA_OPEN_KEYFILE | - HA_OPEN_RNDFILE | - HA_GET_INDEX | - HA_TRY_READ_ONLY), - (READ_KEYINFO | COMPUTE_TYPES | - EXTRA_RECORD), + HA_OPEN_KEYFILE | HA_TRY_READ_ONLY, + EXTRA_RECORD, thd->open_options, table, FALSE); if (error) @@ -2694,10 +2690,8 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list) DBUG_ASSERT(! share->is_view); if (open_table_from_share(thd, share, table_list->alias, - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX | - HA_TRY_READ_ONLY), - READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, + HA_OPEN_KEYFILE | HA_TRY_READ_ONLY, + EXTRA_RECORD, ha_open_options | HA_OPEN_FOR_REPAIR, entry, FALSE) || ! entry->file || (entry->file->is_crashed() && entry->file->ha_check_and_repair(thd))) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ea24223c8eb..e76b6a5a48a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -17133,7 +17133,7 @@ bool open_tmp_table(TABLE *table) table->db_stat= 0; return 1; } - table->db_stat= HA_OPEN_KEYFILE+HA_OPEN_RNDFILE; + table->db_stat= HA_OPEN_KEYFILE; (void) table->file->extra(HA_EXTRA_QUICK); /* Faster */ if (!table->is_created()) { diff --git a/sql/table.cc b/sql/table.cc index 2aaa05b5ae6..1e3bc161c6f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3261,13 +3261,8 @@ partititon_err: /* The table struct is now initialized; Open the table */ if (db_stat) { - if (db_stat & HA_OPEN_TEMPORARY) - ha_open_flags|= HA_OPEN_TMP_TABLE; - else if ((db_stat & HA_WAIT_IF_LOCKED) || - (specialflag & SPECIAL_WAIT_IF_LOCKED)) + if (specialflag & SPECIAL_WAIT_IF_LOCKED) ha_open_flags|= HA_OPEN_WAIT_IF_LOCKED; - else if (db_stat & (HA_ABORT_IF_LOCKED | HA_GET_INFO)) - ha_open_flags|= HA_OPEN_ABORT_IF_LOCKED; else ha_open_flags|= HA_OPEN_IGNORE_IF_LOCKED; diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 9a85c09b08e..c05fc632a94 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1116,13 +1116,8 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share, } if (open_table_from_share(this, share, alias, - (open_in_engine) ? - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX) : 0, - (uint) (READ_KEYINFO | COMPUTE_TYPES | - EXTRA_RECORD), - ha_open_options, - table, + open_in_engine ? (uint)HA_OPEN_KEYFILE : 0, + EXTRA_RECORD, ha_open_options, table, open_in_engine ? false : true)) { my_free(table); diff --git a/sql/unireg.h b/sql/unireg.h index 4a287853438..b1cab841092 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -83,64 +83,53 @@ /* Defines for use with openfrm, openprt and openfrd */ -#define READ_ALL 1 /* openfrm: Read all parameters */ -#define CHANGE_FRM 2 /* openfrm: open .frm as O_RDWR */ -#define READ_KEYINFO 4 /* L{s nyckeldata fr}n filen */ -#define EXTRA_RECORD 8 /* Reserve space for an extra record */ -#define DONT_OPEN_TABLES 8 /* Don't open database-files (frd) */ -#define DONT_OPEN_MASTER_REG 16 /* Don't open first reg-file (prt) */ -#define EXTRA_LONG_RECORD 16 /* Plats f|r dubbel s|k-record */ -#define COMPUTE_TYPES 32 /* Kontrollera type f|r f{ltena */ -#define SEARCH_PRG 64 /* S|k efter registret i 'prg_dev' */ -#define READ_USED_NAMES 128 /* L{s anv{nda formul{rnamn */ -#define DONT_GIVE_ERROR 256 /* Don't do frm_error on openfrm */ -#define READ_SCREENS 1024 /* Read screens, info and helpfile */ -#define DELAYED_OPEN 4096 /* Open table later */ -#define OPEN_VIEW 8192 /* Allow open on view */ -#define OPEN_VIEW_NO_PARSE 16384 /* Open frm only if it's a view, - but do not parse view itself */ +#define READ_ALL (1 << 0) /* openfrm: Read all parameters */ +#define EXTRA_RECORD (1 << 3) /* Reserve space for an extra record */ +#define DELAYED_OPEN (1 << 12) /* Open table later */ +#define OPEN_VIEW_NO_PARSE (1 << 14) /* Open frm only if it's a view, + but do not parse view itself */ /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to open FRM file only to get necessary data. */ -#define OPEN_FRM_FILE_ONLY 32768 +#define OPEN_FRM_FILE_ONLY (1 << 15) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to process tables only to get necessary data. Views are not processed. */ -#define OPEN_TABLE_ONLY (OPEN_FRM_FILE_ONLY*2) +#define OPEN_TABLE_ONLY (1 << 16) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine The flag means that we need to process views only to get necessary data. Tables are not processed. */ -#define OPEN_VIEW_ONLY (OPEN_TABLE_ONLY*2) +#define OPEN_VIEW_ONLY (1 << 17) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that we need to open a view using open_normal_and_derived_tables() function. */ -#define OPEN_VIEW_FULL (OPEN_VIEW_ONLY*2) +#define OPEN_VIEW_FULL (1 << 18) /** This flag is used in function get_all_tables() which fills I_S tables with data which are retrieved from frm files and storage engine. The flag means that I_S table uses optimization algorithm. */ -#define OPTIMIZE_I_S_TABLE (OPEN_VIEW_FULL*2) +#define OPTIMIZE_I_S_TABLE (1 << 19) /** This flag is used to instruct tdc_open_view() to check metadata version. */ -#define CHECK_METADATA_VERSION (OPEN_TRIGGER_ONLY*2) +#define CHECK_METADATA_VERSION (1 << 20) /* The flag means that we need to process trigger files only. */ -#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2) +#define OPEN_TRIGGER_ONLY (1 << 21) /* Minimum length pattern before Turbo Boyer-Moore is used diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 6e6377b7068..b55619a6fa5 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -623,9 +623,8 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked) } if (enum open_frm_error err= open_table_from_share(thd, share, "", - (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | - HA_GET_INDEX | HA_TRY_READ_ONLY), - READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD, + (uint) (HA_OPEN_KEYFILE | HA_TRY_READ_ONLY), + EXTRA_RECORD, thd->open_options, edges, FALSE)) { open_table_error(share, err, EMFILE); // NOTE - EMFILE is probably bogus, it reports as too many open files (!) |