diff options
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sql/handler.h b/sql/handler.h index 3beda9f7c88..23d64681d26 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -137,6 +137,7 @@ #define HA_BINLOG_STMT_CAPABLE (LL(1) << 35) /* Has automatic checksums and uses the new checksum format */ #define HA_HAS_NEW_CHECKSUM (LL(1) << 36) +#define HA_CAN_VIRTUAL_COLUMNS (LL(1) << 37) #define HA_MRR_CANT_SORT (LL(1) << 37) #define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (LL(1) << 38) @@ -1558,16 +1559,20 @@ public: DBUG_ENTER("ha_index_init"); DBUG_ASSERT(inited==NONE); if (!(result= index_init(idx, sorted))) - inited=INDEX; - end_range= NULL; + { + inited= INDEX; + active_index= idx; + end_range= NULL; + } DBUG_RETURN(result); } int ha_index_end() { DBUG_ENTER("ha_index_end"); DBUG_ASSERT(inited==INDEX); - inited=NONE; - end_range= NULL; + inited= NONE; + active_index= MAX_KEY; + end_range= NULL; DBUG_RETURN(index_end()); } /* This is called after index_init() if we need to do a index scan */ @@ -1750,7 +1755,12 @@ public: as there may be several calls to this routine. */ virtual void column_bitmaps_signal(); - uint get_index(void) const { return active_index; } + /* + We have to check for inited as some engines, like innodb, sets + active_index during table scan. + */ + uint get_index(void) const + { return inited == INDEX ? active_index : MAX_KEY; } virtual int close(void)=0; /** @@ -2003,6 +2013,7 @@ public: { return(NULL);} /* gets tablespace name from handler */ /** used in ALTER TABLE; 1 if changing storage engine is allowed */ virtual bool can_switch_engines() { return 1; } + virtual int can_continue_handler_scan() { return 0; } /** used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */ virtual int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) { return 0; } @@ -2259,8 +2270,8 @@ private: */ virtual int open(const char *name, int mode, uint test_if_locked)=0; - virtual int index_init(uint idx, bool sorted) { active_index= idx; return 0; } - virtual int index_end() { active_index= MAX_KEY; return 0; } + virtual int index_init(uint idx, bool sorted) { return 0; } + virtual int index_end() { return 0; } /** rnd_init() can be called two times without rnd_end() in between (it only makes sense if scan=1). |