@@ -231,6 +231,12 @@ enum enum_alter_inplace_result {
231231 */
232232#define HA_READ_OUT_OF_SYNC (LL(1 ) << 40 )
233233
234+ /*
235+ The handler don't want accesses to this table to
236+ be const-table optimized
237+ */
238+ #define HA_BLOCK_CONST_TABLE (LL(1 ) << 41 )
239+
234240/* bits in index_flags(index_number) for what you can do with index */
235241#define HA_READ_NEXT 1 /* TODO really use this flag */
236242#define HA_READ_PREV 2 /* supports ::index_prev */
@@ -480,6 +486,10 @@ typedef ulonglong my_xid; // this line is the same as in log_event.h
480486#define COMPATIBLE_DATA_YES 0
481487#define COMPATIBLE_DATA_NO 1
482488
489+ namespace AQP {
490+ class Join_plan ;
491+ };
492+
483493/* *
484494 struct xid_t is binary compatible with the XID structure as
485495 in the X/Open CAE Specification, Distributed Transaction Processing:
@@ -886,6 +896,8 @@ struct handlerton
886896 const char *wild, bool dir, List<LEX_STRING> *files);
887897 int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db,
888898 const char *name);
899+ int (*make_pushed_join)(handlerton *hton, THD* thd,
900+ const AQP::Join_plan* plan);
889901
890902 /* *
891903 List of all system tables specific to the SE.
@@ -2525,6 +2537,34 @@ class handler :public Sql_alloc
25252537 in_range_check_pushed_down= false ;
25262538 }
25272539
2540+ /* *
2541+ Reports #tables included in pushed join which this
2542+ handler instance is part of. ==0 -> Not pushed
2543+ */
2544+ virtual uint number_of_pushed_joins () const
2545+ { return 0 ; }
2546+
2547+ /* *
2548+ If this handler instance is part of a pushed join sequence
2549+ returned TABLE instance being root of the pushed query?
2550+ */
2551+ virtual const TABLE* root_of_pushed_join () const
2552+ { return NULL ; }
2553+
2554+ /* *
2555+ If this handler instance is a child in a pushed join sequence
2556+ returned TABLE instance being my parent?
2557+ */
2558+ virtual const TABLE* parent_of_pushed_join () const
2559+ { return NULL ; }
2560+
2561+ virtual int index_read_pushed (uchar * buf, const uchar * key,
2562+ key_part_map keypart_map)
2563+ { return HA_ERR_WRONG_COMMAND; }
2564+
2565+ virtual int index_next_pushed (uchar * buf)
2566+ { return HA_ERR_WRONG_COMMAND; }
2567+
25282568 /* *
25292569 Part of old, deprecated in-place ALTER API.
25302570 */
@@ -3195,6 +3235,9 @@ int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv);
31953235int ha_savepoint (THD *thd, SAVEPOINT *sv);
31963236int ha_release_savepoint (THD *thd, SAVEPOINT *sv);
31973237
3238+ /* Build pushed joins in handlers implementing this feature */
3239+ int ha_make_pushed_joins (THD *thd, const AQP::Join_plan* plan);
3240+
31983241/* these are called by storage engines */
31993242void trans_register_ha (THD *thd, bool all, handlerton *ht);
32003243
0 commit comments