Skip to content

Commit 5e959bc

Browse files
committed
Fix clang -Wunused-but-set-variable
1 parent 3ab4b26 commit 5e959bc

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

storage/myisam/mi_test3.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ int test_write(MI_INFO *file,int id,int lock_type)
401401

402402
int test_update(MI_INFO *file,int id,int lock_type)
403403
{
404-
uint i,lock,found,next,prev,update;
404+
uint i,lock,update;
405405
uint32 tmp;
406406
char find[4];
407407
struct record new_record;
@@ -424,34 +424,28 @@ int test_update(MI_INFO *file,int id,int lock_type)
424424
bzero((char*) &new_record,sizeof(new_record));
425425
strmov((char*) new_record.text,"Updated");
426426

427-
found=next=prev=update=0;
427+
update=0;
428428
for (i=0 ; i < 100 ; i++)
429429
{
430430
tmp=rnd(100000);
431431
int4store(find,tmp);
432-
if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
433-
HA_READ_KEY_EXACT))
434-
found++;
435-
else
432+
if (mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
433+
HA_READ_KEY_EXACT))
436434
{
437435
if (my_errno != HA_ERR_KEY_NOT_FOUND)
438436
{
439437
fprintf(stderr,"%2d: Got error %d from read in update\n",id,my_errno);
440438
return 1;
441439
}
442-
else if (!mi_rnext(file,record.id,1))
443-
next++;
444-
else
440+
else if (mi_rnext(file,record.id,1))
445441
{
446442
if (my_errno != HA_ERR_END_OF_FILE)
447443
{
448444
fprintf(stderr,"%2d: Got error %d from rnext in update\n",
449445
id,my_errno);
450446
return 1;
451447
}
452-
else if (!mi_rprev(file,record.id,1))
453-
prev++;
454-
else
448+
else if (mi_rprev(file,record.id,1))
455449
{
456450
if (my_errno != HA_ERR_END_OF_FILE)
457451
{

0 commit comments

Comments
 (0)