Commit 0967e887 authored by serg@janus.mylan's avatar serg@janus.mylan

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
parents e73f004f 42cb8ae7
...@@ -258,7 +258,8 @@ static int run_test(const char *filename) ...@@ -258,7 +258,8 @@ static int run_test(const char *filename)
continue; continue;
create_key(key,j); create_key(key,j);
my_errno=0; 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 || if (verbose || (flags[j] >= 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND))) (error && my_errno != HA_ERR_KEY_NOT_FOUND)))
...@@ -285,7 +286,7 @@ static int run_test(const char *filename) ...@@ -285,7 +286,7 @@ static int run_test(const char *filename)
{ {
create_key(key,i); create_key(key,i);
my_errno=0; 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 || if (verbose ||
(error == 0 && flags[i] == 0 && unique_key) || (error == 0 && flags[i] == 0 && unique_key) ||
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND))) (error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
......
...@@ -263,7 +263,7 @@ int main(int argc, char *argv[]) ...@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
if (!j) if (!j)
for (j=999 ; j>0 && key1[j] == 0 ; j--) ; for (j=999 ; j>0 && key1[j] == 0 ; j--) ;
sprintf(key,"%6d",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); printf("Test in loop: Can't find key: \"%s\"\n",key);
goto err; goto err;
...@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) ...@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
if (j != 0) if (j != 0)
{ {
sprintf(key,"%6d",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("can't find key1: \"%s\"\n",key); printf("can't find key1: \"%s\"\n",key);
goto err; goto err;
...@@ -325,7 +325,7 @@ int main(int argc, char *argv[]) ...@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
if (j != 0) if (j != 0)
{ {
sprintf(key,"%6d",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("can't find key1: \"%s\"\n",key); printf("can't find key1: \"%s\"\n",key);
goto err; goto err;
...@@ -377,7 +377,7 @@ int main(int argc, char *argv[]) ...@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("first - next -> last - prev -> first")); DBUG_PRINT("progpos",("first - next -> last - prev -> first"));
if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys); 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; goto err;
if (mi_rsame(file,read_record2,-1)) if (mi_rsame(file,read_record2,-1))
goto err; goto err;
...@@ -422,7 +422,7 @@ int main(int argc, char *argv[]) ...@@ -422,7 +422,7 @@ int main(int argc, char *argv[])
} }
/* Check of mi_rnext_same */ /* 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; goto err;
ant=1; ant=1;
while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10) while (!mi_rnext_same(file,read_record3) && ant < dupp_keys+10)
...@@ -496,7 +496,7 @@ int main(int argc, char *argv[]) ...@@ -496,7 +496,7 @@ int main(int argc, char *argv[])
goto err; goto err;
if (bcmp(read_record2,read_record3,reclength)) if (bcmp(read_record2,read_record3,reclength))
printf("Can't find last record\n"); printf("Can't find last record\n");
#ifdef NOT_ANYMORE
if (!silent) if (!silent)
puts("- Test read key-part"); puts("- Test read key-part");
strmov(key2,key); strmov(key2,key);
...@@ -514,12 +514,14 @@ int main(int argc, char *argv[]) ...@@ -514,12 +514,14 @@ int main(int argc, char *argv[])
goto end; goto end;
} }
} }
#endif
if (dupp_keys > 2) if (dupp_keys > 2)
{ {
if (!silent) if (!silent)
printf("- Read key (first) - next - delete - next -> last\n"); printf("- Read key (first) - next - delete - next -> last\n");
DBUG_PRINT("progpos",("first - next - delete - next -> last")); 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_rnext(file,read_record3,0)) goto err;
if (mi_delete(file,read_record3)) goto err; if (mi_delete(file,read_record3)) goto err;
opt_delete++; opt_delete++;
...@@ -555,7 +557,8 @@ int main(int argc, char *argv[]) ...@@ -555,7 +557,8 @@ int main(int argc, char *argv[])
if (!silent) if (!silent)
printf("- Read first - delete - next -> last\n"); printf("- Read first - delete - next -> last\n");
DBUG_PRINT("progpos",("first - delete - next -> last")); 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; if (mi_delete(file,read_record3)) goto err;
opt_delete++; opt_delete++;
ant=1; ant=1;
...@@ -618,10 +621,10 @@ int main(int argc, char *argv[]) ...@@ -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_record,(uchar*) key);
copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2); copy_key(file,(uint) i,(uchar*) read_record2,(uchar*) key2);
min_key.key= key; min_key.key= key;
min_key.length= USE_WHOLE_KEY; min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_KEY_EXACT; min_key.flag= HA_READ_KEY_EXACT;
max_key.key= key2; max_key.key= key2;
max_key.length= USE_WHOLE_KEY; max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_AFTER_KEY; max_key.flag= HA_READ_AFTER_KEY;
range_records= mi_records_in_range(file,(int) i, &min_key, &max_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) ...@@ -243,8 +243,8 @@ int test_read(MI_INFO *file,int id)
for (i=0 ; i < 100 ; i++) for (i=0 ; i < 100 ; i++)
{ {
find=rnd(100000); find=rnd(100000);
if (!mi_rkey(file,record.id,1,(uchar*) &find, if (!mi_rkey(file,record.id,1,(uchar*) &find, HA_WHOLE_KEY,
sizeof(find),HA_READ_KEY_EXACT)) HA_READ_KEY_EXACT))
found++; found++;
else else
{ {
...@@ -426,8 +426,8 @@ int test_update(MI_INFO *file,int id,int lock_type) ...@@ -426,8 +426,8 @@ int test_update(MI_INFO *file,int id,int lock_type)
{ {
tmp=rnd(100000); tmp=rnd(100000);
int4store(find,tmp); int4store(find,tmp);
if (!mi_rkey(file,record.id,1,(uchar*) find, if (!mi_rkey(file,record.id,1,(uchar*) find, HA_WHOLE_KEY,
sizeof(find),HA_READ_KEY_EXACT)) HA_READ_KEY_EXACT))
found++; found++;
else 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