mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Merge 10.11 into 11.0
This commit is contained in:
commit
c5fdb988b7
31 changed files with 232 additions and 157 deletions
|
@ -96,7 +96,7 @@ typedef struct casefold_info_char_t
|
|||
struct casefold_info_st
|
||||
{
|
||||
my_wc_t maxchar;
|
||||
MY_CASEFOLD_CHARACTER **page;
|
||||
const MY_CASEFOLD_CHARACTER * const *page;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (`select version() like '%valgrind%'`)
|
||||
if (`select version() like '%valgrind%' || version() like '%asan%'`)
|
||||
{
|
||||
skip Does not run with binaries built with valgrind;
|
||||
skip Does not run with binaries built with valgrind or asan;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
# Valgrind builds may block on this one
|
||||
--source include/not_valgrind.inc
|
||||
|
||||
SET @start_global_value = @@global.innodb_log_checkpoint_now;
|
||||
SELECT @start_global_value;
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
#include "mysys_priv.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
/* Put a protected barrier after every element when using my_multi_malloc() */
|
||||
#define ALLOC_BARRIER
|
||||
#endif
|
||||
|
||||
/*
|
||||
Malloc many pointers at the same time
|
||||
Only ptr1 can be free'd, and doing this will free all
|
||||
|
@ -45,6 +50,9 @@ void* my_multi_malloc(PSI_memory_key key, myf myFlags, ...)
|
|||
{
|
||||
length=va_arg(args,uint);
|
||||
tot_length+=ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
tot_length+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
|
@ -58,6 +66,10 @@ void* my_multi_malloc(PSI_memory_key key, myf myFlags, ...)
|
|||
*ptr=res;
|
||||
length=va_arg(args,uint);
|
||||
res+=ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
TRASH_FREE(res, ALIGN_SIZE(1));
|
||||
res+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
DBUG_RETURN((void*) start);
|
||||
|
@ -89,6 +101,9 @@ void *my_multi_malloc_large(PSI_memory_key key, myf myFlags, ...)
|
|||
{
|
||||
length=va_arg(args,ulonglong);
|
||||
tot_length+=ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
tot_length+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
|
@ -102,6 +117,10 @@ void *my_multi_malloc_large(PSI_memory_key key, myf myFlags, ...)
|
|||
*ptr=res;
|
||||
length=va_arg(args,ulonglong);
|
||||
res+=ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
TRASH_FREE(res, ALIGN_SIZE(1));
|
||||
res+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
DBUG_RETURN((void*) start);
|
||||
|
|
|
@ -28,6 +28,11 @@
|
|||
#undef EXTRA_DEBUG
|
||||
#define EXTRA_DEBUG
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
/* Put a protected barrier after every element when using multi_alloc_root() */
|
||||
#define ALLOC_BARRIER
|
||||
#endif
|
||||
|
||||
/* data packed in MEM_ROOT -> min_malloc */
|
||||
|
||||
/* Don't allocate too small blocks */
|
||||
|
@ -396,6 +401,9 @@ void *multi_alloc_root(MEM_ROOT *root, ...)
|
|||
{
|
||||
length= va_arg(args, uint);
|
||||
tot_length+= ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
tot_length+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
|
@ -409,6 +417,10 @@ void *multi_alloc_root(MEM_ROOT *root, ...)
|
|||
*ptr= res;
|
||||
length= va_arg(args, uint);
|
||||
res+= ALIGN_SIZE(length);
|
||||
#ifdef ALLOC_BARRIER
|
||||
TRASH_FREE(res, ALIGN_SIZE(1));
|
||||
res+= ALIGN_SIZE(1);
|
||||
#endif
|
||||
}
|
||||
va_end(args);
|
||||
DBUG_RETURN((void*) start);
|
||||
|
|
|
@ -4306,6 +4306,7 @@ bool setup_sj_materialization_part1(JOIN_TAB *sjm_tab)
|
|||
}
|
||||
|
||||
sjm->sjm_table_param.field_count= subq_select->item_list.elements;
|
||||
sjm->sjm_table_param.func_count= sjm->sjm_table_param.field_count;
|
||||
sjm->sjm_table_param.force_not_null_cols= TRUE;
|
||||
|
||||
if (!(sjm->table= create_tmp_table(thd, &sjm->sjm_table_param,
|
||||
|
@ -5922,14 +5923,14 @@ TABLE *create_dummy_tmp_table(THD *thd)
|
|||
DBUG_ENTER("create_dummy_tmp_table");
|
||||
TABLE *table;
|
||||
TMP_TABLE_PARAM sjm_table_param;
|
||||
sjm_table_param.init();
|
||||
sjm_table_param.field_count= 1;
|
||||
List<Item> sjm_table_cols;
|
||||
const LEX_CSTRING dummy_name= { STRING_WITH_LEN("dummy") };
|
||||
Item *column_item= new (thd->mem_root) Item_int(thd, 1);
|
||||
if (!column_item)
|
||||
DBUG_RETURN(NULL);
|
||||
|
||||
sjm_table_param.init();
|
||||
sjm_table_param.field_count= sjm_table_param.func_count= 1;
|
||||
sjm_table_cols.push_back(column_item, thd->mem_root);
|
||||
if (!(table= create_tmp_table(thd, &sjm_table_param,
|
||||
sjm_table_cols, (ORDER*) 0,
|
||||
|
|
|
@ -51,18 +51,19 @@ select_handler::~select_handler()
|
|||
|
||||
TABLE *select_handler::create_tmp_table(THD *thd, SELECT_LEX *select)
|
||||
{
|
||||
DBUG_ENTER("select_handler::create_tmp_table");
|
||||
List<Item> types;
|
||||
TMP_TABLE_PARAM tmp_table_param;
|
||||
TABLE *table;
|
||||
DBUG_ENTER("select_handler::create_tmp_table");
|
||||
|
||||
if (select->master_unit()->join_union_item_types(thd, types, 1))
|
||||
DBUG_RETURN(NULL);
|
||||
tmp_table_param.init();
|
||||
tmp_table_param.field_count= types.elements;
|
||||
|
||||
TABLE *table= ::create_tmp_table(thd, &tmp_table_param, types,
|
||||
(ORDER *) 0, false, 0,
|
||||
TMP_TABLE_ALL_COLUMNS, 1,
|
||||
&empty_clex_str, true, false);
|
||||
tmp_table_param.field_count= tmp_table_param.func_count= types.elements;
|
||||
table= ::create_tmp_table(thd, &tmp_table_param, types,
|
||||
(ORDER *) 0, false, 0,
|
||||
TMP_TABLE_ALL_COLUMNS, 1,
|
||||
&empty_clex_str, true, false);
|
||||
DBUG_RETURN(table);
|
||||
}
|
||||
|
||||
|
|
|
@ -4285,6 +4285,7 @@ create_result_table(THD *thd_arg, List<Item> *column_types,
|
|||
{
|
||||
DBUG_ASSERT(table == 0);
|
||||
tmp_table_param.field_count= column_types->elements;
|
||||
tmp_table_param.func_count= tmp_table_param.field_count;
|
||||
tmp_table_param.bit_fields_as_long= bit_fields_as_long;
|
||||
|
||||
if (! (table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
|
||||
|
|
|
@ -6300,6 +6300,7 @@ public:
|
|||
@see opt_sum_query, count_field_types
|
||||
*/
|
||||
uint sum_func_count;
|
||||
uint copy_func_count; // Allocated copy fields
|
||||
uint hidden_field_count;
|
||||
uint group_parts,group_length,group_null_parts;
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void Expression_cache_tmptable::init()
|
|||
|
||||
cache_table_param.init();
|
||||
/* dependent items and result */
|
||||
cache_table_param.field_count= items.elements;
|
||||
cache_table_param.field_count= cache_table_param.func_count= items.elements;
|
||||
/* postpone table creation to index description */
|
||||
cache_table_param.skip_create_table= 1;
|
||||
|
||||
|
|
|
@ -3590,7 +3590,8 @@ bool JOIN::make_aggr_tables_info()
|
|||
|
||||
if (gbh)
|
||||
{
|
||||
if (!(pushdown_query= new (thd->mem_root) Pushdown_query(select_lex, gbh)))
|
||||
if (!(pushdown_query= new (thd->mem_root) Pushdown_query(select_lex,
|
||||
gbh)))
|
||||
DBUG_RETURN(1);
|
||||
/*
|
||||
We must store rows in the tmp table if we need to do an ORDER BY
|
||||
|
@ -3610,6 +3611,7 @@ bool JOIN::make_aggr_tables_info()
|
|||
|
||||
if (!(curr_tab->tmp_table_param= new TMP_TABLE_PARAM(tmp_table_param)))
|
||||
DBUG_RETURN(1);
|
||||
curr_tab->tmp_table_param->func_count= all_fields.elements;
|
||||
TABLE* table= create_tmp_table(thd, curr_tab->tmp_table_param,
|
||||
all_fields,
|
||||
NULL, distinct,
|
||||
|
@ -20663,6 +20665,7 @@ TABLE *Create_tmp_table::start(THD *thd,
|
|||
*/
|
||||
if (param->precomputed_group_by)
|
||||
copy_func_count+= param->sum_func_count;
|
||||
param->copy_func_count= copy_func_count;
|
||||
|
||||
init_sql_alloc(key_memory_TABLE, &own_root, TABLE_ALLOC_BLOCK_SIZE, 0,
|
||||
MYF(MY_THREAD_SPECIFIC));
|
||||
|
@ -20869,8 +20872,9 @@ bool Create_tmp_table::add_fields(THD *thd,
|
|||
We here distinguish between UNION and multi-table-updates by the fact
|
||||
that in the later case group is set to the row pointer.
|
||||
|
||||
The test for item->marker == 4 is ensure we don't create a group-by
|
||||
key over a bit field as heap tables can't handle that.
|
||||
The test for item->marker == MARKER_NULL_KEY is ensure we
|
||||
don't create a group-by key over a bit field as heap tables
|
||||
can't handle that.
|
||||
*/
|
||||
DBUG_ASSERT(!param->schema_table);
|
||||
Field *new_field=
|
||||
|
@ -20937,6 +20941,7 @@ bool Create_tmp_table::add_fields(THD *thd,
|
|||
new_field->flags|= FIELD_PART_OF_TMP_UNIQUE;
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_ASSERT(fieldnr == m_field_count[other] + m_field_count[distinct]);
|
||||
DBUG_ASSERT(m_blob_count == m_blobs_count[other] + m_blobs_count[distinct]);
|
||||
share->fields= fieldnr;
|
||||
|
@ -20945,6 +20950,8 @@ bool Create_tmp_table::add_fields(THD *thd,
|
|||
share->blob_field[m_blob_count]= 0; // End marker
|
||||
copy_func[0]= 0; // End marker
|
||||
param->func_count= (uint) (copy_func - param->items_to_copy);
|
||||
DBUG_ASSERT(param->func_count <= param->copy_func_count);
|
||||
|
||||
share->column_bitmap_size= bitmap_buffer_size(share->fields);
|
||||
|
||||
thd->mem_root= mem_root_save;
|
||||
|
@ -28485,6 +28492,11 @@ bool JOIN::rollup_init()
|
|||
Item **ref_array;
|
||||
|
||||
tmp_table_param.quick_group= 0; // Can't create groups in tmp table
|
||||
/*
|
||||
Each group can potentially be replaced with Item_func_rollup_const() which
|
||||
needs a copy_func placeholder.
|
||||
*/
|
||||
tmp_table_param.func_count+= send_group_parts;
|
||||
rollup.state= ROLLUP::STATE_INITED;
|
||||
|
||||
/*
|
||||
|
@ -28509,7 +28521,6 @@ bool JOIN::rollup_init()
|
|||
|
||||
ref_array= (Item**) (rollup.ref_pointer_arrays+send_group_parts);
|
||||
|
||||
|
||||
/*
|
||||
Prepare space for field list for the different levels
|
||||
These will be filled up in rollup_make_fields()
|
||||
|
@ -28673,7 +28684,6 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
|
|||
/* Point to first hidden field */
|
||||
uint ref_array_ix= fields_arg.elements-1;
|
||||
|
||||
|
||||
/* Remember where the sum functions ends for the previous level */
|
||||
sum_funcs_end[pos+1]= *func;
|
||||
|
||||
|
|
|
@ -8403,27 +8403,34 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
|
|||
TABLE *table;
|
||||
ST_SCHEMA_TABLE *schema_table= table_list->schema_table;
|
||||
ST_FIELD_INFO *fields= schema_table->fields_info;
|
||||
bool need_all_fieds= table_list->schema_table_reformed || // SHOW command
|
||||
bool need_all_fields= table_list->schema_table_reformed || // SHOW command
|
||||
thd->lex->only_view_structure(); // need table structure
|
||||
bool keep_row_order;
|
||||
TMP_TABLE_PARAM *tmp_table_param;
|
||||
SELECT_LEX *select_lex;
|
||||
DBUG_ENTER("create_schema_table");
|
||||
|
||||
for (; !fields->end_marker(); fields++)
|
||||
field_count++;
|
||||
|
||||
TMP_TABLE_PARAM *tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
|
||||
tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
|
||||
tmp_table_param->init();
|
||||
tmp_table_param->table_charset= system_charset_info;
|
||||
tmp_table_param->field_count= field_count;
|
||||
tmp_table_param->schema_table= 1;
|
||||
SELECT_LEX *select_lex= table_list->select_lex;
|
||||
bool keep_row_order= is_show_command(thd);
|
||||
if (!(table= create_tmp_table_for_schema(thd, tmp_table_param, *schema_table,
|
||||
(select_lex->options | thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS),
|
||||
table_list->alias, !need_all_fieds, keep_row_order)))
|
||||
select_lex= table_list->select_lex;
|
||||
keep_row_order= is_show_command(thd);
|
||||
if (!(table=
|
||||
create_tmp_table_for_schema(thd, tmp_table_param, *schema_table,
|
||||
(select_lex->options |
|
||||
thd->variables.option_bits |
|
||||
TMP_TABLE_ALL_COLUMNS),
|
||||
table_list->alias, !need_all_fields,
|
||||
keep_row_order)))
|
||||
DBUG_RETURN(0);
|
||||
my_bitmap_map* bitmaps=
|
||||
(my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
|
||||
my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count);
|
||||
my_bitmap_init(&table->def_read_set, bitmaps, field_count);
|
||||
table->read_set= &table->def_read_set;
|
||||
bitmap_clear_all(table->read_set);
|
||||
table_list->schema_table_param= tmp_table_param;
|
||||
|
|
|
@ -344,6 +344,7 @@ select_unit::create_result_table(THD *thd_arg, List<Item> *column_types,
|
|||
DBUG_ASSERT(table == 0);
|
||||
tmp_table_param.init();
|
||||
tmp_table_param.field_count= column_types->elements;
|
||||
tmp_table_param.func_count= tmp_table_param.field_count;
|
||||
tmp_table_param.bit_fields_as_long= bit_fields_as_long;
|
||||
tmp_table_param.hidden_field_count= hidden;
|
||||
|
||||
|
@ -382,7 +383,8 @@ select_union_recursive::create_result_table(THD *thd_arg,
|
|||
return true;
|
||||
|
||||
incr_table_param.init();
|
||||
incr_table_param.field_count= column_types->elements;
|
||||
incr_table_param.field_count= incr_table_param.func_count=
|
||||
column_types->elements;
|
||||
incr_table_param.bit_fields_as_long= bit_fields_as_long;
|
||||
if (! (incr_table= create_tmp_table(thd_arg, &incr_table_param, *column_types,
|
||||
(ORDER*) 0, false, 1,
|
||||
|
|
|
@ -921,9 +921,8 @@ bool THD::has_temporary_tables()
|
|||
uint THD::create_tmp_table_def_key(char *key, const char *db,
|
||||
const char *table_name)
|
||||
{
|
||||
DBUG_ENTER("THD::create_tmp_table_def_key");
|
||||
|
||||
uint key_length;
|
||||
DBUG_ENTER("THD::create_tmp_table_def_key");
|
||||
|
||||
key_length= tdc_create_key(key, db, table_name);
|
||||
int4store(key + key_length, variables.server_id);
|
||||
|
@ -1172,11 +1171,10 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share,
|
|||
*/
|
||||
bool THD::find_and_use_tmp_table(const TABLE_LIST *tl, TABLE **out_table)
|
||||
{
|
||||
DBUG_ENTER("THD::find_and_use_tmp_table");
|
||||
|
||||
char key[MAX_DBKEY_LENGTH];
|
||||
uint key_length;
|
||||
bool result;
|
||||
DBUG_ENTER("THD::find_and_use_tmp_table");
|
||||
|
||||
key_length= create_tmp_table_def_key(key, tl->get_db_name(),
|
||||
tl->get_table_name());
|
||||
|
|
|
@ -969,9 +969,10 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode,
|
|||
# ifdef UNIV_SEARCH_PERF_STAT
|
||||
info->n_searches++;
|
||||
# endif
|
||||
bool ahi_enabled= btr_search_enabled;
|
||||
/* We do a dirty read of btr_search_enabled below,
|
||||
and btr_search_guess_on_hash() will have to check it again. */
|
||||
if (!btr_search_enabled);
|
||||
if (!ahi_enabled);
|
||||
else if (btr_search_guess_on_hash(index(), info, tuple, mode,
|
||||
latch_mode, this, mtr))
|
||||
{
|
||||
|
@ -1224,7 +1225,7 @@ release_tree:
|
|||
|
||||
reached_latched_leaf:
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
if (btr_search_enabled && !(tuple->info_bits & REC_INFO_MIN_REC_FLAG))
|
||||
if (ahi_enabled && !(tuple->info_bits & REC_INFO_MIN_REC_FLAG))
|
||||
{
|
||||
if (page_cur_search_with_match_bytes(tuple, mode,
|
||||
&up_match, &up_bytes,
|
||||
|
|
|
@ -1106,6 +1106,8 @@ public:
|
|||
ut_ad(!dict_operation);
|
||||
ut_ad(!apply_online_log);
|
||||
ut_ad(!is_not_inheriting_locks());
|
||||
ut_ad(check_foreigns);
|
||||
ut_ad(check_unique_secondary);
|
||||
}
|
||||
|
||||
/** This has to be invoked on SAVEPOINT or at the end of a statement.
|
||||
|
|
|
@ -398,7 +398,7 @@ static dberr_t srv_undo_delete_old_tablespaces()
|
|||
}
|
||||
|
||||
/** Recreate the undo log tablespaces */
|
||||
static dberr_t srv_undo_tablespaces_reinit()
|
||||
ATTRIBUTE_COLD static dberr_t srv_undo_tablespaces_reinit()
|
||||
{
|
||||
mtr_t mtr;
|
||||
dberr_t err;
|
||||
|
@ -431,6 +431,15 @@ static dberr_t srv_undo_tablespaces_reinit()
|
|||
if (!first_rseg_hdr)
|
||||
goto func_exit;
|
||||
|
||||
if (UNIV_UNLIKELY(mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT +
|
||||
first_rseg_hdr->page.frame)))
|
||||
trx_rseg_format_upgrade(first_rseg_hdr, &mtr);
|
||||
|
||||
mtr.write<8,mtr_t::MAYBE_NOP>(*first_rseg_hdr,
|
||||
TRX_RSEG + TRX_RSEG_MAX_TRX_ID +
|
||||
first_rseg_hdr->page.frame,
|
||||
trx_sys.get_max_trx_id() - 1);
|
||||
|
||||
/* Reset TRX_SYS page */
|
||||
err= trx_sys.reset_page(&mtr);
|
||||
|
||||
|
|
|
@ -394,6 +394,7 @@ static dberr_t
|
|||
trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr)
|
||||
{
|
||||
mtr.commit();
|
||||
log_free_check();
|
||||
mtr.start();
|
||||
|
||||
const page_id_t hdr_page_id{rseg->space->id, hdr_addr.page};
|
||||
|
@ -401,54 +402,48 @@ trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr)
|
|||
buf_block_t *rseg_hdr= rseg->get(&mtr, &err);
|
||||
if (!rseg_hdr)
|
||||
return err;
|
||||
if (buf_block_t *block= buf_page_get_gen(hdr_page_id, 0, RW_X_LATCH,
|
||||
nullptr, BUF_GET_POSSIBLY_FREED,
|
||||
&mtr, &err))
|
||||
buf_block_t *block= buf_page_get_gen(hdr_page_id, 0, RW_X_LATCH,
|
||||
nullptr, BUF_GET_POSSIBLY_FREED,
|
||||
&mtr, &err);
|
||||
if (!block)
|
||||
return err;
|
||||
|
||||
const uint32_t seg_size=
|
||||
flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + block->page.frame);
|
||||
|
||||
err= trx_purge_remove_log_hdr(rseg_hdr, block, hdr_addr.boffset, &mtr);
|
||||
if (UNIV_UNLIKELY(err != DB_SUCCESS))
|
||||
return err;
|
||||
|
||||
ut_ad(rseg->curr_size >= seg_size);
|
||||
rseg->curr_size-= seg_size;
|
||||
rseg->history_size--;
|
||||
|
||||
byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame;
|
||||
ut_ad(mach_read_from_4(hist) >= seg_size);
|
||||
mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size);
|
||||
|
||||
while (!fseg_free_step_not_header(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
|
||||
block->page.frame, &mtr))
|
||||
{
|
||||
while (!fseg_free_step_not_header(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
|
||||
block->page.frame, &mtr))
|
||||
{
|
||||
rseg_hdr->fix();
|
||||
block->fix();
|
||||
mtr.commit();
|
||||
mtr.start();
|
||||
rseg_hdr->page.lock.x_lock();
|
||||
block->page.lock.x_lock();
|
||||
mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_FIX);
|
||||
mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY);
|
||||
}
|
||||
block->fix();
|
||||
mtr.commit();
|
||||
/* NOTE: If the server is killed after the log that was produced
|
||||
up to this point was written, and before the log from the mtr.commit()
|
||||
in our caller is written, then the pages belonging to the
|
||||
undo log will become unaccessible garbage.
|
||||
|
||||
/* The page list may now be inconsistent, but the length field
|
||||
stored in the list base node tells us how big it was before we
|
||||
started the freeing. */
|
||||
const uint32_t seg_size=
|
||||
flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + block->page.frame);
|
||||
|
||||
/* We may free the undo log segment header page; it must be freed
|
||||
within the same mtr as the undo log header is removed from the
|
||||
history list: otherwise, in case of a database crash, the segment
|
||||
could become inaccessible garbage in the file space. */
|
||||
err= trx_purge_remove_log_hdr(rseg_hdr, block, hdr_addr.boffset, &mtr);
|
||||
if (UNIV_UNLIKELY(err != DB_SUCCESS))
|
||||
return err;
|
||||
byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame;
|
||||
if (UNIV_UNLIKELY(mach_read_from_4(hist) < seg_size))
|
||||
return DB_CORRUPTION;
|
||||
mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size);
|
||||
|
||||
/* Here we assume that a file segment with just the header page
|
||||
can be freed in a few steps, so that the buffer pool is not
|
||||
flooded with bufferfixed pages: see the note in fsp0fsp.cc. */
|
||||
while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
|
||||
block->page.frame, &mtr));
|
||||
|
||||
ut_ad(rseg->curr_size >= seg_size);
|
||||
|
||||
rseg->history_size--;
|
||||
rseg->curr_size -= seg_size;
|
||||
This does not matters when using multiple innodb_undo_tablespaces;
|
||||
innodb_undo_log_truncate=ON will be able to reclaim the space. */
|
||||
log_free_check();
|
||||
mtr.start();
|
||||
block->page.lock.x_lock();
|
||||
mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY);
|
||||
}
|
||||
|
||||
return err;
|
||||
while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER +
|
||||
block->page.frame, &mtr));
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
|
||||
/** Remove unnecessary history data from a rollback segment.
|
||||
|
|
|
@ -385,9 +385,10 @@ void trx_t::free()
|
|||
|
||||
dict_operation= false;
|
||||
trx_sys.deregister_trx(this);
|
||||
check_unique_secondary= true;
|
||||
check_foreigns= true;
|
||||
assert_freed();
|
||||
trx_sys.rw_trx_hash.put_pins(this);
|
||||
|
||||
mysql_thd= nullptr;
|
||||
|
||||
// FIXME: We need to avoid this heap free/alloc for each commit.
|
||||
|
@ -1377,6 +1378,8 @@ void trx_t::commit_cleanup()
|
|||
state= TRX_STATE_NOT_STARTED;
|
||||
mod_tables.clear();
|
||||
|
||||
check_foreigns= true;
|
||||
check_unique_secondary= true;
|
||||
assert_freed();
|
||||
trx_init(this);
|
||||
mutex.wr_unlock();
|
||||
|
|
|
@ -2733,10 +2733,14 @@ int ha_maria::info(uint flag)
|
|||
key < key_end ; key++)
|
||||
{
|
||||
ulong *to= key->rec_per_key;
|
||||
for (ulong *end= to+ key->user_defined_key_parts ;
|
||||
to < end ;
|
||||
to++, from++)
|
||||
*to= (ulong) (*from + 0.5);
|
||||
/* Some temporary tables does not allocate rec_per_key */
|
||||
if (to)
|
||||
{
|
||||
for (ulong *end= to+ key->user_defined_key_parts ;
|
||||
to < end ;
|
||||
to++, from++)
|
||||
*to= (ulong) (*from + 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -2780,7 +2780,8 @@ static my_bool write_block_record(MARIA_HA *info,
|
|||
const uchar *field_pos;
|
||||
ulong length;
|
||||
if ((record[column->null_pos] & column->null_bit) ||
|
||||
(row->empty_bits[column->empty_pos] & column->empty_bit))
|
||||
(column->empty_bit &&
|
||||
(row->empty_bits[column->empty_pos] & column->empty_bit)))
|
||||
continue;
|
||||
|
||||
field_pos= record + column->offset;
|
||||
|
@ -4887,7 +4888,8 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
|
|||
uchar *field_pos= record + column->offset;
|
||||
/* First check if field is present in record */
|
||||
if ((record[column->null_pos] & column->null_bit) ||
|
||||
(cur_row->empty_bits[column->empty_pos] & column->empty_bit))
|
||||
(column->empty_bit &&
|
||||
(cur_row->empty_bits[column->empty_pos] & column->empty_bit)))
|
||||
{
|
||||
bfill(record + column->offset, column->fill_length,
|
||||
type == FIELD_SKIP_ENDSPACE ? ' ' : 0);
|
||||
|
@ -4970,8 +4972,9 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
|
|||
{
|
||||
uint size_length;
|
||||
if ((record[blob_field->null_pos] & blob_field->null_bit) ||
|
||||
(cur_row->empty_bits[blob_field->empty_pos] &
|
||||
blob_field->empty_bit))
|
||||
(blob_field->empty_bit &
|
||||
(cur_row->empty_bits[blob_field->empty_pos] &
|
||||
blob_field->empty_bit)))
|
||||
continue;
|
||||
size_length= blob_field->length - portable_sizeof_char_ptr;
|
||||
blob_lengths+= _ma_calc_blob_length(size_length, length_data);
|
||||
|
@ -5827,7 +5830,8 @@ static size_t fill_insert_undo_parts(MARIA_HA *info, const uchar *record,
|
|||
const uchar *column_pos;
|
||||
size_t column_length;
|
||||
if ((record[column->null_pos] & column->null_bit) ||
|
||||
cur_row->empty_bits[column->empty_pos] & column->empty_bit)
|
||||
(column->empty_bit &&
|
||||
cur_row->empty_bits[column->empty_pos] & column->empty_bit))
|
||||
continue;
|
||||
|
||||
column_pos= record+ column->offset;
|
||||
|
@ -6008,7 +6012,8 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
|
|||
*/
|
||||
continue;
|
||||
}
|
||||
if (old_row->empty_bits[column->empty_pos] & column->empty_bit)
|
||||
if (column->empty_bit &&
|
||||
(old_row->empty_bits[column->empty_pos] & column->empty_bit))
|
||||
{
|
||||
if (new_row->empty_bits[column->empty_pos] & column->empty_bit)
|
||||
continue; /* Both are empty; skip */
|
||||
|
@ -6024,8 +6029,9 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
|
|||
log the original value
|
||||
*/
|
||||
new_column_is_empty= ((newrec[column->null_pos] & column->null_bit) ||
|
||||
(new_row->empty_bits[column->empty_pos] &
|
||||
column->empty_bit));
|
||||
(column->empty_bit &&
|
||||
(new_row->empty_bits[column->empty_pos] &
|
||||
column->empty_bit)));
|
||||
|
||||
old_column_pos= oldrec + column->offset;
|
||||
new_column_pos= newrec + column->offset;
|
||||
|
@ -7198,7 +7204,8 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn,
|
|||
column++, null_field_lengths++)
|
||||
{
|
||||
if ((record[column->null_pos] & column->null_bit) ||
|
||||
row.empty_bits[column->empty_pos] & column->empty_bit)
|
||||
(column->empty_bit &&
|
||||
row.empty_bits[column->empty_pos] & column->empty_bit))
|
||||
{
|
||||
if (column->type != FIELD_BLOB)
|
||||
*null_field_lengths= 0;
|
||||
|
|
|
@ -117,7 +117,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share,
|
|||
&info.blobs,sizeof(MARIA_BLOB)*share->base.blobs,
|
||||
&info.buff,(share->base.max_key_block_length*2+
|
||||
share->base.max_key_length),
|
||||
&info.lastkey_buff,share->base.max_key_length*2+1,
|
||||
&info.lastkey_buff,share->base.max_key_length*3,
|
||||
&info.first_mbr_key, share->base.max_key_length,
|
||||
&info.maria_rtree_recursion_state,
|
||||
share->have_rtree ? 1024 : 0,
|
||||
|
|
|
@ -187,7 +187,7 @@ static const uchar sort_order_big5[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
{
|
||||
/* A200-A20F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -380,7 +380,7 @@ static MY_CASEFOLD_CHARACTER cA2[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
/* A300-A30F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -573,7 +573,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cC7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cC7[256]=
|
||||
{
|
||||
/* C700-C70F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -766,7 +766,7 @@ static MY_CASEFOLD_CHARACTER cC7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_big5[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_big5[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -197,7 +197,7 @@ static const uchar sort_order_cp932[]=
|
|||
#define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d))
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c81[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c81[256]=
|
||||
{
|
||||
/* 8100-810F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -407,7 +407,7 @@ static MY_CASEFOLD_CHARACTER c81[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c82[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c82[256]=
|
||||
{
|
||||
/* 8200-820F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -615,7 +615,7 @@ static MY_CASEFOLD_CHARACTER c82[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c83[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c83[256]=
|
||||
{
|
||||
/* 8300-830F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -825,7 +825,7 @@ static MY_CASEFOLD_CHARACTER c83[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c84[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c84[256]=
|
||||
{
|
||||
/* 8400-840F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1035,7 +1035,7 @@ static MY_CASEFOLD_CHARACTER c84[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c87[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c87[256]=
|
||||
{
|
||||
/* 8700-870F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1245,7 +1245,7 @@ static MY_CASEFOLD_CHARACTER c87[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cEE[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cEE[256]=
|
||||
{
|
||||
/* EE00-EE0F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1456,7 +1456,7 @@ static MY_CASEFOLD_CHARACTER cEE[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cFA[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cFA[256]=
|
||||
{
|
||||
/* FA00-FA0F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1666,7 +1666,7 @@ static MY_CASEFOLD_CHARACTER cFA[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_cp932[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_cp932[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -213,7 +213,7 @@ static const uchar sort_order_euc_kr[]=
|
|||
#include "ctype-mb.inl"
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -418,7 +418,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA5[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA5[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -623,7 +623,7 @@ static MY_CASEFOLD_CHARACTER cA5[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -828,7 +828,7 @@ static MY_CASEFOLD_CHARACTER cA7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA8[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA8[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1033,7 +1033,7 @@ static MY_CASEFOLD_CHARACTER cA8[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA9[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA9[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1238,7 +1238,7 @@ static MY_CASEFOLD_CHARACTER cA9[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cAC[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cAC[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1443,7 +1443,7 @@ static MY_CASEFOLD_CHARACTER cAC[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_euckr[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_euckr[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -250,7 +250,7 @@ static const uchar sort_order_eucjpms[]=
|
|||
|
||||
/* Case info pages for JIS-X-0208 range */
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -371,7 +371,7 @@ static MY_CASEFOLD_CHARACTER cA2[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -492,7 +492,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -613,7 +613,7 @@ static MY_CASEFOLD_CHARACTER cA6[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -734,7 +734,7 @@ static MY_CASEFOLD_CHARACTER cA7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cAD[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cAD[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -857,7 +857,7 @@ static MY_CASEFOLD_CHARACTER cAD[256]=
|
|||
|
||||
/* Case info pages for JIS-X-0212 range */
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FA6[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA6[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -978,7 +978,7 @@ static MY_CASEFOLD_CHARACTER c8FA6[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1099,7 +1099,7 @@ static MY_CASEFOLD_CHARACTER c8FA7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FA9[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA9[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1220,7 +1220,7 @@ static MY_CASEFOLD_CHARACTER c8FA9[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FAA[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FAA[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1341,7 +1341,7 @@ static MY_CASEFOLD_CHARACTER c8FAA[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FAB[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FAB[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1462,7 +1462,7 @@ static MY_CASEFOLD_CHARACTER c8FAB[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FF3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FF3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1583,7 +1583,7 @@ static MY_CASEFOLD_CHARACTER c8FF3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FF4[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FF4[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1704,7 +1704,7 @@ static MY_CASEFOLD_CHARACTER c8FF4[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_eucjpms[512]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_eucjpms[512]=
|
||||
{
|
||||
/* JIS-X-0208 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
|
|
|
@ -177,7 +177,7 @@ static const uchar sort_order_gb2312[]=
|
|||
#include "ctype-mb.inl"
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -298,7 +298,7 @@ static MY_CASEFOLD_CHARACTER cA2[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -419,7 +419,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -540,7 +540,7 @@ static MY_CASEFOLD_CHARACTER cA6[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -661,7 +661,7 @@ static MY_CASEFOLD_CHARACTER cA7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA8[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA8[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -782,7 +782,7 @@ static MY_CASEFOLD_CHARACTER cA8[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_gb2312[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gb2312[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -147,7 +147,7 @@ static const uchar to_upper_gbk[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -351,7 +351,7 @@ static MY_CASEFOLD_CHARACTER cA2[256]=
|
|||
{0xA2FF,0xA2FF}
|
||||
};
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -556,7 +556,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -761,7 +761,7 @@ static MY_CASEFOLD_CHARACTER cA6[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -966,7 +966,7 @@ static MY_CASEFOLD_CHARACTER cA7[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_gbk[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gbk[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -63,10 +63,10 @@ size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str)
|
|||
}
|
||||
|
||||
|
||||
static inline MY_CASEFOLD_CHARACTER*
|
||||
static inline const MY_CASEFOLD_CHARACTER*
|
||||
get_case_info_for_ch(CHARSET_INFO *cs, uint page, uint offs)
|
||||
{
|
||||
MY_CASEFOLD_CHARACTER *p;
|
||||
const MY_CASEFOLD_CHARACTER *p;
|
||||
return cs->casefold && (p= cs->casefold->page[page]) ? &p[offs] : NULL;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ my_casefold_mb(CHARSET_INFO *cs,
|
|||
size_t mblen= my_ismbchar(cs, src, srcend);
|
||||
if (mblen)
|
||||
{
|
||||
MY_CASEFOLD_CHARACTER *ch;
|
||||
const MY_CASEFOLD_CHARACTER *ch;
|
||||
if ((ch= get_case_info_for_ch(cs, (uchar) src[0], (uchar) src[1])))
|
||||
{
|
||||
int code= is_upper ? ch->toupper : ch->tolower;
|
||||
|
|
|
@ -198,7 +198,7 @@ static const uchar sort_order_sjis[]=
|
|||
#define sjiscode(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d))
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c81[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c81[256]=
|
||||
{
|
||||
/* 8100-810F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -408,7 +408,7 @@ static MY_CASEFOLD_CHARACTER c81[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c82[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c82[256]=
|
||||
{
|
||||
/* 8200-820F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -616,7 +616,7 @@ static MY_CASEFOLD_CHARACTER c82[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c83[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c83[256]=
|
||||
{
|
||||
/* 8300-830F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -826,7 +826,7 @@ static MY_CASEFOLD_CHARACTER c83[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c84[256]=
|
||||
static const MY_CASEFOLD_CHARACTER c84[256]=
|
||||
{
|
||||
/* 8400-840F */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -1036,7 +1036,7 @@ static MY_CASEFOLD_CHARACTER c84[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_sjis[256]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_sjis[256]=
|
||||
{
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
|
|
@ -65976,7 +65976,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *cs __attribute__((unused)),
|
|||
|
||||
|
||||
/* Case info pages for JIS-X-0208 range */
|
||||
static MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA2[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66097,7 +66097,7 @@ static MY_CASEFOLD_CHARACTER cA2[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA3[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66218,7 +66218,7 @@ static MY_CASEFOLD_CHARACTER cA3[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA6[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66339,7 +66339,7 @@ static MY_CASEFOLD_CHARACTER cA6[256]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
static const MY_CASEFOLD_CHARACTER cA7[256]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66461,7 +66461,7 @@ static MY_CASEFOLD_CHARACTER cA7[256]=
|
|||
|
||||
|
||||
/* Case info pages for JIS-X-0212 range */
|
||||
static MY_CASEFOLD_CHARACTER c8FA6[]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA6[]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66582,7 +66582,7 @@ static MY_CASEFOLD_CHARACTER c8FA6[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FA7[]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA7[]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66703,7 +66703,7 @@ static MY_CASEFOLD_CHARACTER c8FA7[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FA9[]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FA9[]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66824,7 +66824,7 @@ static MY_CASEFOLD_CHARACTER c8FA9[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FAA[]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FAA[]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -66945,7 +66945,7 @@ static MY_CASEFOLD_CHARACTER c8FAA[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER c8FAB[]=
|
||||
static const MY_CASEFOLD_CHARACTER c8FAB[]=
|
||||
{
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* xx00 */
|
||||
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
|
||||
|
@ -67066,7 +67066,7 @@ static MY_CASEFOLD_CHARACTER c8FAB[]=
|
|||
};
|
||||
|
||||
|
||||
static MY_CASEFOLD_CHARACTER *my_casefold_pages_ujis[512]=
|
||||
static const MY_CASEFOLD_CHARACTER *my_casefold_pages_ujis[512]=
|
||||
{
|
||||
/* JIS-X-0208 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */
|
||||
|
@ -67155,10 +67155,10 @@ static MY_CASEFOLD_INFO my_casefold_info_ujis=
|
|||
UJIS and EUCJPMS share the same UPPER/LOWER functions.
|
||||
*/
|
||||
|
||||
static MY_CASEFOLD_CHARACTER*
|
||||
static const MY_CASEFOLD_CHARACTER*
|
||||
get_case_info_for_ch(CHARSET_INFO *cs, uint plane, uint page, uint offs)
|
||||
{
|
||||
MY_CASEFOLD_CHARACTER *p;
|
||||
const MY_CASEFOLD_CHARACTER *p;
|
||||
return (p= cs->casefold->page[page + plane * 256]) ? &p[offs & 0xFF] : NULL;
|
||||
}
|
||||
|
||||
|
@ -67180,7 +67180,7 @@ my_casefold_ujis(CHARSET_INFO *cs,
|
|||
size_t mblen= my_ismbchar(cs, src, srcend);
|
||||
if (mblen)
|
||||
{
|
||||
MY_CASEFOLD_CHARACTER *ch;
|
||||
const MY_CASEFOLD_CHARACTER *ch;
|
||||
ch= (mblen == 2) ?
|
||||
get_case_info_for_ch(cs, 0, (uchar) src[0], (uchar) src[1]) :
|
||||
get_case_info_for_ch(cs, 1, (uchar) src[1], (uchar) src[2]);
|
||||
|
|
Loading…
Reference in a new issue