mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
Merge 10.6 into 10.11
This commit is contained in:
commit
d66a74acb8
7 changed files with 71 additions and 41 deletions
|
|
@ -280,7 +280,7 @@ group_commit_lock::lock_return_code group_commit_lock::acquire(value_type num, c
|
|||
|
||||
group_commit_lock::value_type group_commit_lock::release(value_type num)
|
||||
{
|
||||
completion_callback callbacks[1000];
|
||||
completion_callback callbacks[950]; // 1000 fails with framesize 16384
|
||||
size_t callback_count = 0;
|
||||
value_type ret = 0;
|
||||
std::unique_lock<std::mutex> lk(m_mtx);
|
||||
|
|
|
|||
|
|
@ -913,12 +913,16 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo)
|
|||
|
||||
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
||||
{
|
||||
uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
|
||||
uchar *ptr=buff;
|
||||
uchar *buff, *ptr;
|
||||
uint i, keys= (uint) state->header.keys,
|
||||
key_blocks=state->header.max_block_size_index;
|
||||
key_blocks=state->header.max_block_size_index,
|
||||
key_parts= mi_uint2korr(state->header.key_parts);
|
||||
int res;
|
||||
DBUG_ENTER("mi_state_info_write");
|
||||
|
||||
buff= my_alloca(MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE(keys, key_parts));
|
||||
|
||||
ptr= buff;
|
||||
memcpy(ptr, &state->header, sizeof(state->header));
|
||||
ptr+=sizeof(state->header);
|
||||
|
||||
|
|
@ -952,7 +956,6 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
|||
}
|
||||
if (pWrite & 2) /* From isamchk */
|
||||
{
|
||||
uint key_parts= mi_uint2korr(state->header.key_parts);
|
||||
mi_int4store(ptr,state->sec_index_changed); ptr +=4;
|
||||
mi_int4store(ptr,state->sec_index_used); ptr +=4;
|
||||
mi_int4store(ptr,state->version); ptr +=4;
|
||||
|
|
@ -968,10 +971,13 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
|||
}
|
||||
|
||||
if (pWrite & 1)
|
||||
DBUG_RETURN(mysql_file_pwrite(file, buff, (size_t) (ptr-buff), 0L,
|
||||
MYF(MY_NABP | MY_THREADSAFE)) != 0);
|
||||
DBUG_RETURN(mysql_file_write(file, buff, (size_t) (ptr-buff),
|
||||
MYF(MY_NABP)) != 0);
|
||||
res= mysql_file_pwrite(file, buff, (size_t) (ptr-buff), 0L,
|
||||
MYF(MY_NABP | MY_THREADSAFE)) != 0;
|
||||
else
|
||||
res= mysql_file_write(file, buff, (size_t) (ptr-buff),
|
||||
MYF(MY_NABP)) != 0;
|
||||
my_afree(buff);
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1040,20 +1046,24 @@ uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
|
|||
|
||||
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead)
|
||||
{
|
||||
uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
|
||||
uchar *buff= my_alloca(state->state_length);
|
||||
|
||||
if (!myisam_single_user)
|
||||
{
|
||||
if (pRead)
|
||||
{
|
||||
if (mysql_file_pread(file, buff, state->state_length, 0L, MYF(MY_NABP)))
|
||||
return 1;
|
||||
goto err;
|
||||
}
|
||||
else if (mysql_file_read(file, buff, state->state_length, MYF(MY_NABP)))
|
||||
return 1;
|
||||
goto err;
|
||||
mi_state_info_read(buff, state);
|
||||
}
|
||||
my_afree(buff);
|
||||
return 0;
|
||||
err:
|
||||
my_afree(buff);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -210,6 +210,11 @@ static int run_test(const char *filename)
|
|||
if (!silent)
|
||||
printf("- Updating rows\n");
|
||||
|
||||
create_key(key, j);
|
||||
if ((mi_rkey(file, read_record, 0, key,
|
||||
HA_WHOLE_KEY, HA_READ_KEY_EXACT)))
|
||||
printf("Can't find last written row with mi_rkey\n");
|
||||
|
||||
/* Update first last row to force extend of file */
|
||||
if (mi_rsame(file,read_record,-1))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ typedef struct st_mi_state_info
|
|||
#define MI_STATE_KEY_SIZE 8U
|
||||
#define MI_STATE_KEYBLOCK_SIZE 8U
|
||||
#define MI_STATE_KEYSEG_SIZE 4U
|
||||
#define MI_STATE_EXTRA_SIZE ((MI_MAX_KEY+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + MI_MAX_KEY*HA_MAX_KEY_SEG*MI_STATE_KEYSEG_SIZE)
|
||||
#define MI_STATE_EXTRA_SIZE(K,P) (((K)+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + (P)*MI_STATE_KEYSEG_SIZE)
|
||||
|
||||
#define MI_KEYDEF_SIZE (2+ 5*2)
|
||||
#define MI_UNIQUEDEF_SIZE (2+1+1)
|
||||
#define HA_KEYSEG_SIZE (6+ 2*2 + 4*2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue