diff options
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/sql/handler.h b/sql/handler.h index e12048da18c..6eb496a38cc 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -100,7 +100,10 @@ #define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) /* If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position() - uses a primary key. Without primary key, we can't call position(). + uses a primary key given by the record argument. + Without primary key, we can't call position(). + If not set, the position is returned as the current rows position + regardless of what argument is given. */ #define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16) #define HA_CAN_RTREEKEYS (1 << 17) @@ -1037,7 +1040,7 @@ typedef struct st_ha_create_information ulong avg_row_length; ulong used_fields; ulong key_block_size; - SQL_LIST merge_list; + SQL_I_List<TABLE_LIST> merge_list; handlerton *db_type; /** Row type of the table definition. @@ -1448,6 +1451,7 @@ public: bool locked; bool implicit_emptied; /* Can be !=0 only if HEAP */ bool mark_trx_done; + bool cloned; /* 1 if this was created with clone */ const COND *pushed_cond; Item *pushed_idx_cond; uint pushed_idx_cond_keyno; /* The index which the above condition is for */ @@ -1494,7 +1498,7 @@ public: key_used_on_scan(MAX_KEY), active_index(MAX_KEY), ref_length(sizeof(my_off_t)), ft_handler(0), inited(NONE), - locked(FALSE), implicit_emptied(FALSE), mark_trx_done(FALSE), + locked(FALSE), implicit_emptied(FALSE), mark_trx_done(FALSE), cloned(0), pushed_cond(0), pushed_idx_cond(NULL), pushed_idx_cond_keyno(MAX_KEY), next_insert_id(0), insert_id_for_cur_row(0), @@ -1537,7 +1541,7 @@ public: } /* This is called after index_init() if we need to do a index scan */ virtual int prepare_index_scan() { return 0; } - int ha_rnd_init(bool scan) + int ha_rnd_init(bool scan) __attribute__ ((warn_unused_result)) { int result; DBUG_ENTER("ha_rnd_init"); @@ -1552,6 +1556,7 @@ public: inited=NONE; DBUG_RETURN(rnd_end()); } + int ha_rnd_init_with_error(bool scan) __attribute__ ((warn_unused_result)); int ha_reset(); /* Tell handler (not storage engine) this is start of a new statement */ void ha_start_of_new_statement() @@ -1591,10 +1596,10 @@ public: estimation_rows_to_insert= rows; start_bulk_insert(rows); } - int ha_end_bulk_insert(bool abort) + int ha_end_bulk_insert() { estimation_rows_to_insert= 0; - return end_bulk_insert(abort); + return end_bulk_insert(); } int ha_bulk_update_row(const uchar *old_data, uchar *new_data, uint *dup_key_found); @@ -1826,10 +1831,9 @@ private: virtual int rnd_next(uchar *buf)=0; virtual int rnd_pos(uchar * buf, uchar *pos)=0; /** - One has to use this method when to find - random position by record as the plain - position() call doesn't work for some - handlers for random position. + This function only works for handlers having + HA_PRIMARY_KEY_REQUIRED_FOR_POSITION set. + It will return the row with the PK given in the record argument. */ virtual int rnd_pos_by_record(uchar *record) { @@ -1860,6 +1864,12 @@ public: virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) { return (ha_rows) 10; } + /* + If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, then it sets ref + (reference to the row, aka position, with the primary key given in + the record). + Otherwise it set ref to the current row. + */ virtual void position(const uchar *record)=0; virtual int info(uint)=0; // see my_base.h for full description virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info, @@ -2278,7 +2288,7 @@ private: virtual int repair(THD* thd, HA_CHECK_OPT* check_opt) { return HA_ADMIN_NOT_IMPLEMENTED; } virtual void start_bulk_insert(ha_rows rows) {} - virtual int end_bulk_insert(bool abort) { return 0; } + virtual int end_bulk_insert() { return 0; } virtual int index_read(uchar * buf, const uchar * key, uint key_len, enum ha_rkey_function find_flag) { return HA_ERR_WRONG_COMMAND; } |