Skip to content

Commit d66a74a

Browse files
committed
Merge 10.6 into 10.11
2 parents 4164f17 + 9ffec4c commit d66a74a

File tree

7 files changed

+71
-41
lines changed

7 files changed

+71
-41
lines changed

mysql-test/mariadb-test-run.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,7 @@ sub environment_setup {
21762176
$ENV{'LC_CTYPE'}= "C";
21772177
$ENV{'LC_COLLATE'}= "C";
21782178

2179+
$ENV{'GNUTLS_SYSTEM_PRIORITY_FILE'}='/dev/null';
21792180
$ENV{'OPENSSL_CONF'}= $mysqld_variables{'version-ssl-library'} gt 'OpenSSL 1.1.1'
21802181
? "$glob_mysql_test_dir/lib/openssl.cnf" : '/dev/null';
21812182

sql/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ ENDIF(WIN32)
524524
IF(NOT WITH_WSREP)
525525
SET(EXCL_WSREP "wsrep_[a-np-z]*.h")
526526
ENDIF()
527+
INSTALL(FILES
528+
${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
529+
${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
530+
DESTINATION ${INSTALL_INCLUDEDIR}/server/private
531+
COMPONENT Development)
527532
INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/server/private COMPONENT Development
528533
FILES_MATCHING PATTERN "*.h"
529534
PATTERN share EXCLUDE

storage/innobase/log/log0sync.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ group_commit_lock::lock_return_code group_commit_lock::acquire(value_type num, c
280280

281281
group_commit_lock::value_type group_commit_lock::release(value_type num)
282282
{
283-
completion_callback callbacks[1000];
283+
completion_callback callbacks[950]; // 1000 fails with framesize 16384
284284
size_t callback_count = 0;
285285
value_type ret = 0;
286286
std::unique_lock<std::mutex> lk(m_mtx);

storage/myisam/mi_open.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,16 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo)
913913

914914
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
915915
{
916-
uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
917-
uchar *ptr=buff;
916+
uchar *buff, *ptr;
918917
uint i, keys= (uint) state->header.keys,
919-
key_blocks=state->header.max_block_size_index;
918+
key_blocks=state->header.max_block_size_index,
919+
key_parts= mi_uint2korr(state->header.key_parts);
920+
int res;
920921
DBUG_ENTER("mi_state_info_write");
921922

923+
buff= my_alloca(MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE(keys, key_parts));
924+
925+
ptr= buff;
922926
memcpy(ptr, &state->header, sizeof(state->header));
923927
ptr+=sizeof(state->header);
924928

@@ -952,7 +956,6 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
952956
}
953957
if (pWrite & 2) /* From isamchk */
954958
{
955-
uint key_parts= mi_uint2korr(state->header.key_parts);
956959
mi_int4store(ptr,state->sec_index_changed); ptr +=4;
957960
mi_int4store(ptr,state->sec_index_used); ptr +=4;
958961
mi_int4store(ptr,state->version); ptr +=4;
@@ -968,10 +971,13 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
968971
}
969972

970973
if (pWrite & 1)
971-
DBUG_RETURN(mysql_file_pwrite(file, buff, (size_t) (ptr-buff), 0L,
972-
MYF(MY_NABP | MY_THREADSAFE)) != 0);
973-
DBUG_RETURN(mysql_file_write(file, buff, (size_t) (ptr-buff),
974-
MYF(MY_NABP)) != 0);
974+
res= mysql_file_pwrite(file, buff, (size_t) (ptr-buff), 0L,
975+
MYF(MY_NABP | MY_THREADSAFE)) != 0;
976+
else
977+
res= mysql_file_write(file, buff, (size_t) (ptr-buff),
978+
MYF(MY_NABP)) != 0;
979+
my_afree(buff);
980+
DBUG_RETURN(res);
975981
}
976982

977983

@@ -1040,20 +1046,24 @@ uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
10401046

10411047
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead)
10421048
{
1043-
uchar buff[MI_STATE_INFO_SIZE + MI_STATE_EXTRA_SIZE];
1049+
uchar *buff= my_alloca(state->state_length);
10441050

10451051
if (!myisam_single_user)
10461052
{
10471053
if (pRead)
10481054
{
10491055
if (mysql_file_pread(file, buff, state->state_length, 0L, MYF(MY_NABP)))
1050-
return 1;
1056+
goto err;
10511057
}
10521058
else if (mysql_file_read(file, buff, state->state_length, MYF(MY_NABP)))
1053-
return 1;
1059+
goto err;
10541060
mi_state_info_read(buff, state);
10551061
}
1062+
my_afree(buff);
10561063
return 0;
1064+
err:
1065+
my_afree(buff);
1066+
return 1;
10571067
}
10581068

10591069

storage/myisam/mi_test1.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ static int run_test(const char *filename)
210210
if (!silent)
211211
printf("- Updating rows\n");
212212

213+
create_key(key, j);
214+
if ((mi_rkey(file, read_record, 0, key,
215+
HA_WHOLE_KEY, HA_READ_KEY_EXACT)))
216+
printf("Can't find last written row with mi_rkey\n");
217+
213218
/* Update first last row to force extend of file */
214219
if (mi_rsame(file,read_record,-1))
215220
{

storage/myisam/myisamdef.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ typedef struct st_mi_state_info
9797
#define MI_STATE_KEY_SIZE 8U
9898
#define MI_STATE_KEYBLOCK_SIZE 8U
9999
#define MI_STATE_KEYSEG_SIZE 4U
100-
#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)
100+
#define MI_STATE_EXTRA_SIZE(K,P) (((K)+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + (P)*MI_STATE_KEYSEG_SIZE)
101+
101102
#define MI_KEYDEF_SIZE (2+ 5*2)
102103
#define MI_UNIQUEDEF_SIZE (2+1+1)
103104
#define HA_KEYSEG_SIZE (6+ 2*2 + 4*2)

unittest/sql/mf_iocache-t.cc

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ void sql_print_error(const char *format, ...)
9696

9797
/*** end of encryption tweaks and stubs ****************************/
9898

99-
PRAGMA_DISABLE_CHECK_STACK_FRAME
10099

101100
static IO_CACHE info;
102101
#define CACHE_SIZE 16384
@@ -118,8 +117,8 @@ int data_bad(const uchar *buf, size_t len)
118117
void temp_io_cache()
119118
{
120119
int res;
121-
uchar buf[CACHE_SIZE + 200];
122-
memset(buf, FILL, sizeof(buf));
120+
uchar *buf= (uchar *)malloc(CACHE_SIZE + 200);
121+
memset(buf, FILL, CACHE_SIZE + 200);
123122

124123
diag("temp io_cache with%s encryption", encrypt_tmp_files?"":"out");
125124

@@ -131,13 +130,13 @@ void temp_io_cache()
131130
res= my_b_write(&info, buf, 100);
132131
ok(res == 0 && info.pos_in_file == 0, "small write" INFO_TAIL );
133132

134-
res= my_b_write(&info, buf, sizeof(buf));
133+
res= my_b_write(&info, buf, CACHE_SIZE + 200);
135134
ok(res == 0 && info.pos_in_file == CACHE_SIZE, "large write" INFO_TAIL);
136135

137136
res= reinit_io_cache(&info, WRITE_CACHE, 250, 0, 0);
138137
ok(res == 0, "reinit with rewind" INFO_TAIL);
139138

140-
res= my_b_write(&info, buf, sizeof(buf));
139+
res= my_b_write(&info, buf, CACHE_SIZE + 200);
141140
ok(res == 0, "large write" INFO_TAIL);
142141

143142
res= my_b_flush_io_cache(&info, 1);
@@ -153,16 +152,17 @@ void temp_io_cache()
153152
res= my_b_read(&info, buf, 50) || data_bad(buf, 50);
154153
ok(res == 0 && info.pos_in_file == 0, "small read" INFO_TAIL);
155154

156-
res= my_b_read(&info, buf, sizeof(buf)) || data_bad(buf, sizeof(buf));
155+
res= my_b_read(&info, buf, CACHE_SIZE + 200) || data_bad(buf, CACHE_SIZE + 200);
157156
ok(res == 0 && info.pos_in_file == CACHE_SIZE, "large read" INFO_TAIL);
158157

159158
close_cached_file(&info);
159+
free(buf);
160160
}
161161

162162
void mdev9044()
163163
{
164164
int res;
165-
uchar buf[CACHE_SIZE + 200];
165+
uchar *buf= (uchar *)malloc(CACHE_SIZE + 200);
166166

167167
diag("MDEV-9044 Binlog corruption in Galera");
168168

@@ -190,10 +190,11 @@ void mdev9044()
190190
res= reinit_io_cache(&info, READ_CACHE, 0, 0, 0);
191191
ok(res == 0, "reinit READ_CACHE" INFO_TAIL);
192192

193-
res= my_b_read(&info, buf, sizeof(buf));
193+
res= my_b_read(&info, buf, CACHE_SIZE + 200);
194194
ok(res == 1 && strcmp((char*)buf, "second write") == 0, "read '%s'", buf);
195195

196196
close_cached_file(&info);
197+
free(buf);
197198
}
198199

199200
/* 2 Reads (with my_b_fill) in cache makes second read to fail */
@@ -294,20 +295,23 @@ void mdev14014()
294295
close_cached_file(&info);
295296
}
296297

298+
#define BUFF_SIZE17133 (1024*256)
297299
void mdev17133()
298300
{
299301
my_off_t res;
300302
int k;
301303
const int eof_iter=4, read_iter= 4;
302-
uchar buf_i[1024*256]; // read
303-
uchar buf_o[sizeof(buf_i)]; // write
304-
const size_t eof_block_size= sizeof(buf_o) / eof_iter;
304+
// read
305+
uchar *buf_i= (uchar *)malloc(BUFF_SIZE17133);
306+
// write
307+
uchar *buf_o= (uchar *)malloc(BUFF_SIZE17133);
308+
const size_t eof_block_size= BUFF_SIZE17133 / eof_iter;
305309
const size_t read_size= eof_block_size / read_iter;
306310
size_t total;
307311

308312
srand((uint) time(NULL));
309-
memset(buf_i, 0, sizeof( buf_i));
310-
memset(buf_o, FILL, sizeof(buf_o));
313+
memset(buf_i, 0, BUFF_SIZE17133);
314+
memset(buf_o, FILL, BUFF_SIZE17133);
311315

312316
diag("MDEV-17133 Dump thread reads from the past");
313317

@@ -316,10 +320,10 @@ void mdev17133()
316320
res= open_cached_file(&info, 0, 0, CACHE_SIZE, 0);
317321
ok(res == 0, "open_cached_file" INFO_TAIL);
318322

319-
res= my_b_write(&info, buf_o, sizeof(buf_o));
323+
res= my_b_write(&info, buf_o, BUFF_SIZE17133);
320324
ok(res == 0, "buffer is written" INFO_TAIL);
321325
res= my_b_tell(&info);
322-
ok(res == sizeof(buf_o), "cache size as expected");
326+
ok(res == BUFF_SIZE17133, "cache size as expected");
323327

324328
res= my_b_flush_io_cache(&info, 1);
325329
ok(res == 0, "flush" INFO_TAIL);
@@ -332,8 +336,8 @@ void mdev17133()
332336
int i;
333337
size_t curr_read_size;
334338
info.end_of_file=
335-
k == 1 ? sizeof(buf_o) :
336-
MY_MIN(sizeof(buf_o),
339+
k == 1 ? BUFF_SIZE17133 :
340+
MY_MIN(BUFF_SIZE17133,
337341
info.end_of_file + eof_block_size +
338342
// plus 25% of block for randomization to the average
339343
eof_block_size/4 - rand() % (eof_block_size/2));
@@ -342,7 +346,7 @@ void mdev17133()
342346
// the last block completes the current chunk
343347
for (i= 0; i < read_iter; i++, total += curr_read_size)
344348
{
345-
char buf_check[eof_block_size];
349+
char *buf_check= (char *)malloc(eof_block_size);
346350
size_t a,b;
347351

348352
a= (size_t)(info.end_of_file - total);
@@ -368,29 +372,33 @@ void mdev17133()
368372
memset(buf_check, FILL, curr_read_size);
369373
ok(memcmp(buf_i + total, buf_check, curr_read_size) == 0,
370374
"read correct data");
375+
free(buf_check);
371376
}
372377
ok(info.pos_in_file + (info.read_end - info.buffer) == info.end_of_file,
373378
"cache is read up to eof");
374379
ok(total == info.end_of_file, "total matches eof");
375380
}
376-
ok(total == sizeof(buf_i), "read total size match");
377-
ok(buf_i[sizeof(buf_i) - 1] == FILL, "data read correctly");
381+
ok(total == BUFF_SIZE17133, "read total size match");
382+
ok(buf_i[BUFF_SIZE17133 - 1] == FILL, "data read correctly");
378383

379384
close_cached_file(&info);
385+
free(buf_i);
386+
free(buf_o);
380387
}
381388

382389

390+
#define BUFF_SIZE10963 (1024*512)
383391
void mdev10963()
384392
{
385393
int res;
386394
uint n_checks= 8;
387-
uchar buf[1024 * 512];
388-
uint n_frag= sizeof(buf)/(2 * CACHE_SIZE);
395+
uchar *buf= (uchar *)malloc(BUFF_SIZE10963);
396+
uint n_frag= BUFF_SIZE10963/(2 * CACHE_SIZE);
389397
FILE *file;
390398
myf my_flags= MYF(MY_WME);
391399
const char *file_name="cache.log";
392400

393-
memset(buf, FILL, sizeof(buf));
401+
memset(buf, FILL, BUFF_SIZE10963);
394402
diag("MDEV-10963 Fragmented BINLOG query");
395403

396404
init_io_cache_encryption();
@@ -399,10 +407,10 @@ void mdev10963()
399407
/* copying source */
400408
res= open_cached_file(&info, 0, 0, CACHE_SIZE, 0);
401409
ok(res == 0, "open_cached_file" INFO_TAIL);
402-
res= my_b_write(&info, buf, sizeof(buf));
410+
res= my_b_write(&info, buf, BUFF_SIZE10963);
403411

404412
ulonglong total_size= my_b_tell(&info);
405-
ok(res == 0 && total_size == sizeof(buf), "cache is written");
413+
ok(res == 0 && total_size == BUFF_SIZE10963, "cache is written");
406414

407415
/* destination */
408416
file= my_fopen(file_name, O_RDWR | O_TRUNC | O_CREAT, my_flags);
@@ -436,15 +444,16 @@ void mdev10963()
436444
*/
437445
res= my_b_copy_to_file(&info, file, (size_t) total_size - copied_size);
438446
ok(res == 0, "%llu of the cache copied to file", total_size - copied_size);
439-
ok(my_ftell(file, my_flags) == sizeof(buf),
447+
ok(my_ftell(file, my_flags) == BUFF_SIZE10963,
440448
"file written in %d fragments", n_frag+1);
441449

442450
res= reinit_io_cache(&info, WRITE_CACHE, total_size, 0, 0);
443-
ok(res == 0 && my_b_tell(&info) == sizeof(buf), "cache turned to write");
451+
ok(res == 0 && my_b_tell(&info) == BUFF_SIZE10963, "cache turned to write");
444452
}
445453
close_cached_file(&info);
446454
my_fclose(file, my_flags);
447455
my_delete(file_name, MYF(MY_WME));
456+
free(buf);
448457
}
449458

450459
int main(int argc __attribute__((unused)),char *argv[])
@@ -474,4 +483,3 @@ int main(int argc __attribute__((unused)),char *argv[])
474483
return exit_status();
475484
}
476485

477-
PRAGMA_REENABLE_CHECK_STACK_FRAME

0 commit comments

Comments
 (0)