diff options
Diffstat (limited to 'storage/myisam/mi_test2.c')
-rw-r--r-- | storage/myisam/mi_test2.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c index 99d0c23d2a4..902801b5e6e 100644 --- a/storage/myisam/mi_test2.c +++ b/storage/myisam/mi_test2.c @@ -37,7 +37,7 @@ static void get_options(int argc, char *argv[]); static uint rnd(uint max_value); static void fix_length(uchar *record,uint length); -static void put_blob_in_record(char *blob_pos,char **blob_buffer); +static void put_blob_in_record(uchar *blob_pos,char **blob_buffer); static void copy_key(struct st_myisam_info *info,uint inx, uchar *record,uchar *key); @@ -53,8 +53,8 @@ static uint key_cache_block_size= KEY_CACHE_BLOCK_SIZE; static uint keys=MYISAM_KEYS,recant=1000; static uint use_blob=0; static uint16 key1[1001],key3[5000]; -static char record[300],record2[300],key[100],key2[100], - read_record[300],read_record2[300],read_record3[300]; +static uchar record[300],record2[300],key[100],key2[100]; +static uchar read_record[300],read_record2[300],read_record3[300]; static HA_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS]; /* Test program */ @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) for (i=0 ; i < recant ; i++) { n1=rnd(1000); n2=rnd(100); n3=rnd(5000); - sprintf(record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); + sprintf((char*) record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); int4store(record+STANDARD_LENGTH-4,(long) i); fix_length(record,(uint) STANDARD_LENGTH+rnd(60)); put_blob_in_record(record+blob_pos,&blob_buffer); @@ -262,7 +262,7 @@ int main(int argc, char *argv[]) for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ; if (!j) for (j=999 ; j>0 && key1[j] == 0 ; j--) ; - sprintf(key,"%6d",j); + sprintf((char*) key,"%6d",j); if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) { printf("Test in loop: Can't find key: \"%s\"\n",key); @@ -290,7 +290,7 @@ int main(int argc, char *argv[]) for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ; if (j != 0) { - sprintf(key,"%6d",j); + sprintf((char*) key,"%6d",j); if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) { printf("can't find key1: \"%s\"\n",key); @@ -304,8 +304,8 @@ int main(int argc, char *argv[]) goto err; } opt_delete++; - key1[atoi(read_record+keyinfo[0].seg[0].start)]--; - key3[atoi(read_record+keyinfo[2].seg[0].start)]=0; + key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--; + key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0; } else puts("Warning: Skipping delete test because no dupplicate keys"); @@ -317,17 +317,17 @@ int main(int argc, char *argv[]) for (i=0 ; i<recant/10 ; i++) { n1=rnd(1000); n2=rnd(100); n3=rnd(5000); - sprintf(record2,"%6d:%4d:%8d:XXX: %4d ",n1,n2,n3,update); + sprintf((char*) record2,"%6d:%4d:%8d:XXX: %4d ",n1,n2,n3,update); int4store(record2+STANDARD_LENGTH-4,(long) i); fix_length(record2,(uint) STANDARD_LENGTH+rnd(60)); for (j=rnd(1000)+1 ; j>0 && key1[j] == 0 ; j--) ; if (j != 0) { - sprintf(key,"%6d",j); + sprintf((char*) key,"%6d",j); if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT)) { - printf("can't find key1: \"%s\"\n",key); + printf("can't find key1: \"%s\"\n",(char*) key); goto err; } if (use_blob) @@ -350,8 +350,8 @@ int main(int argc, char *argv[]) } else { - key1[atoi(read_record+keyinfo[0].seg[0].start)]--; - key3[atoi(read_record+keyinfo[2].seg[0].start)]=0; + key1[atoi((char*) read_record+keyinfo[0].seg[0].start)]--; + key3[atoi((char*) read_record+keyinfo[2].seg[0].start)]=0; key1[n1]++; key3[n3]=1; update++; } @@ -367,7 +367,7 @@ int main(int argc, char *argv[]) dupp_keys=key1[i]; j=i; } } - sprintf(key,"%6d",j); + sprintf((char*) key,"%6d",j); start=keyinfo[0].seg[0].start; length=keyinfo[0].seg[0].length; if (dupp_keys) @@ -652,8 +652,8 @@ int main(int argc, char *argv[]) key_range min_key, max_key; if (j > k) swap_variables(int, j, k); - sprintf(key,"%6d",j); - sprintf(key2,"%6d",k); + sprintf((char*) key,"%6d",j); + sprintf((char*) key2,"%6d",k); min_key.key= key; min_key.length= USE_WHOLE_KEY; @@ -1009,13 +1009,13 @@ static void fix_length(uchar *rec, uint length) bmove(rec+STANDARD_LENGTH, "0123456789012345678901234567890123456789012345678901234567890", length-STANDARD_LENGTH); - strfill(rec+length,STANDARD_LENGTH+60-length,' '); + strfill((char*) rec+length,STANDARD_LENGTH+60-length,' '); } /* fix_length */ /* Put maybe a blob in record */ -static void put_blob_in_record(char *blob_pos, char **blob_buffer) +static void put_blob_in_record(uchar *blob_pos, char **blob_buffer) { ulong i,length; if (use_blob) |