From a2a2e32c02643a0cec111511220227703fda1cd5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 1 Jul 2024 20:15:00 +0200 Subject: Merging upstream version 1:11.4.2. Signed-off-by: Daniel Baumann --- storage/maria/maria_def.h | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'storage/maria/maria_def.h') diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index b12f21e3..147dc83d 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -43,6 +43,14 @@ C_MODE_START +#ifdef _WIN32 +/* + We cannot use mmap() on Windows with Aria as mmap() can cause file + size to increase in _ma_dynmap_file(). The extra \0 data causes + the file to be regarded as corrupted. +*/ +#undef HAVE_MMAP +#endif /* Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details */ @@ -213,7 +221,6 @@ extern int maria_rsame_with_pos(MARIA_HA *file, uchar *record, extern int maria_update(MARIA_HA *file, const uchar *old, const uchar *new_record); extern int maria_write(MARIA_HA *file, const uchar *buff); -extern MARIA_RECORD_POS maria_position(MARIA_HA *file); extern int maria_status(MARIA_HA *info, MARIA_INFO *x, uint flag); extern int maria_lock_database(MARIA_HA *file, int lock_type); extern int maria_delete_table(const char *name); @@ -1018,6 +1025,7 @@ struct st_maria_handler my_bool switched_transactional; /* If transaction will autocommit */ my_bool autocommit; + my_bool has_cond_pushdown; #ifdef _WIN32 my_bool owned_by_merge; /* This Maria table is part of a merge union */ #endif @@ -1029,6 +1037,8 @@ struct st_maria_handler my_bool create_unique_index_by_sort; index_cond_func_t index_cond_func; /* Index condition function */ void *index_cond_func_arg; /* parameter for the func */ + rowid_filter_func_t rowid_filter_func; /* rowid filter check function */ + void *rowid_filter_func_arg; /* parameter for the func */ }; /* Table options for the Aria and S3 storage engine */ @@ -1070,6 +1080,7 @@ struct ha_table_option_struct #define STATE_IN_REPAIR 1024U /* We are running repair on table */ #define STATE_CRASHED_PRINTED 2048U #define STATE_DATA_FILE_FULL 4096U +#define STATE_HAS_LSN 8192U /* Some page still has LSN */ #define STATE_CRASHED_FLAGS (STATE_CRASHED | STATE_CRASHED_ON_REPAIR | STATE_CRASHED_PRINTED) @@ -1353,7 +1364,11 @@ extern int _ma_read_rnd_no_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos, my_bool skip_deleted_blocks); my_off_t _ma_no_keypos_to_recpos(MARIA_SHARE *share, my_off_t pos); - +/* Get position to last record */ +static inline MARIA_RECORD_POS maria_position(MARIA_HA *info) +{ + return info->cur_row.lastpos; +} extern my_bool _ma_ck_write(MARIA_HA *info, MARIA_KEY *key); extern my_bool _ma_enlarge_root(MARIA_HA *info, MARIA_KEY *key, MARIA_RECORD_POS *root); @@ -1739,7 +1754,25 @@ extern my_bool maria_flush_log_for_page_none(PAGECACHE_IO_HOOK_ARGS *args); extern PAGECACHE *maria_log_pagecache; extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func, void *func_arg); -check_result_t ma_check_index_cond(MARIA_HA *info, uint keynr, uchar *record); +extern void ma_set_rowid_filter_func(MARIA_HA *info, + rowid_filter_func_t check_func, + void *func_arg); +static inline void ma_reset_index_filter_functions(MARIA_HA *info) +{ + info->index_cond_func= NULL; + info->rowid_filter_func= NULL; + info->has_cond_pushdown= 0; +} +check_result_t ma_check_index_cond_real(MARIA_HA *info, uint keynr, + uchar *record); +static inline check_result_t ma_check_index_cond(MARIA_HA *info, uint keynr, + uchar *record) +{ + if (!info->has_cond_pushdown) + return CHECK_POS; + return ma_check_index_cond_real(info, keynr, record); +} + extern my_bool ma_yield_and_check_if_killed(MARIA_HA *info, int inx); extern my_bool ma_killed_standalone(MARIA_HA *); -- cgit v1.2.3