Commit 9ea7329f authored by unknown's avatar unknown

Bug #30094 mi_test_all: assertion failure

updated to keypart_map api


storage/myisam/mi_test2.c:
  Bug #30094 mi_test_all: assertion failure
  updated to keypart_map api
  prefix char keys are not supported anymore
parent dc68fa08
......@@ -258,7 +258,8 @@ static int run_test(const char *filename)
continue;
create_key(key,j);
my_errno=0;
if ((error = mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)))
if ((error = mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,
HA_READ_KEY_EXACT)))
{
if (verbose || (flags[j] >= 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
......@@ -285,7 +286,7 @@ static int run_test(const char *filename)
{
create_key(key,i);
my_errno=0;
error=mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT);
error=mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT);
if (verbose ||
(error == 0 && flags[i] == 0 && unique_key) ||
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
......
......@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
if (!j)
for (j=999 ; j>0 && key1[j] == 0 ; j--) ;
sprintf(key,"%6d",j);
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
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);
goto err;
......@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
if (j != 0)
{
sprintf(key,"%6d",j);
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
......@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
if (j != 0)
{
sprintf(key,"%6d",j);
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
......@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("first - next -> last - prev -> first"));
if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys);
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
if (mi_rsame(file,read_record2,-1))
goto err;
......@@ -422,7 +422,7 @@ int main(int argc, char *argv[])
}
/* Check of mi_rnext_same */
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
ant=1;
while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10)
......@@ -496,7 +496,7 @@ int main(int argc, char *argv[])
goto err;
if (bcmp(read_record2,read_record3,reclength))
printf("Can't find last record\n");
#ifdef NOT_ANYMORE
if (!silent)
puts("- Test read key-part");
strmov(key2,key);
......@@ -514,12 +514,14 @@ int main(int argc, char *argv[])
goto end;
}
}
#endif
if (dupp_keys > 2)
{
if (!silent)
printf("- Read key (first) - next - delete - next -> last\n");
DBUG_PRINT("progpos",("first - next - delete - next -> last"));
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
if (mi_rkey(file,read_record,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
if (mi_rnext(file,read_record3,0)) goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
......@@ -555,7 +557,8 @@ int main(int argc, char *argv[])
if (!silent)
printf("- Read first - delete - next -> last\n");
DBUG_PRINT("progpos",("first - delete - next -> last"));
if (mi_rkey(file,read_record3,0,key,0,HA_READ_KEY_EXACT)) goto err;
if (mi_rkey(file,read_record3,0,key,HA_WHOLE_KEY,HA_READ_KEY_EXACT))
goto err;
if (mi_delete(file,read_record3)) goto err;
opt_delete++;
ant=1;
......@@ -618,10 +621,10 @@ int main(int argc, char *argv[])
copy_key(file,(uint) i,(uchar*) read_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
min_key.key= key;
min_key.length= USE_WHOLE_KEY;
min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_KEY_EXACT;
max_key.key= key2;
max_key.length= USE_WHOLE_KEY;
max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_AFTER_KEY;
range_records= mi_records_in_range(file,(int) i, &min_key, &max_key);
......
......@@ -243,8 +243,8 @@ int test_read(MI_INFO *file,int id)
for (i=0 ; i < 100 ; i++)
{
find=rnd(100000);
if (!mi_rkey(file,record.id,1,(uchar*) &find,
sizeof(find),HA_READ_KEY_EXACT))
if (!mi_rkey(file,record.id,1,(uchar*) &find, HA_WHOLE_KEY,
HA_READ_KEY_EXACT))
found++;
else
{
......@@ -426,8 +426,8 @@ int test_update(MI_INFO *file,int id,int lock_type)
{
tmp=rnd(100000);
int4store(find,tmp);
if (!mi_rkey(file,record.id,1,(uchar*) find,
sizeof(find),HA_READ_KEY_EXACT))
if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
HA_READ_KEY_EXACT))
found++;
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment