1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fix for Valgrind errors when running rt_test and ma_rt_test, and segmentation fault

in ma_rt_test -M (BUG#36321); keyinfo/recinfo/keyseg had non-initialized parts.
maria_scan() was not wrapped in maria_scan_init()/end() so "ma_rt_test -M" found no rows.
Preparing for inclusion into ma_test_all-t and ma_test_recovery.pl (still prevented by
BUG#37307 "Maria: R-tree unit test produces corrupted table").

storage/maria/ma_rt_test.c:
  Some members of keyinfo, recinfo, keyseg had non-initialized parts, led to Valgrind errors,
  and also segmentation fault when running with -M (=BLOCK_RECORD) (BUG#36321).
  We now bzero them like they are in mi_test1.
  Other problems:
  - maria_scan() was not wrapped in maria_scan_init()/end() so "ma_rt_test -M" found no rows.
  - --silent had almost no effect, now it really silences normal output.
  - Some errors were going to stdout, they now go to stderr.
  Added option for testing versioning, to fit well into ma_test_all-t.
storage/maria/unittest/ma_test_all-t:
  preparing for running ma_rt_test when ma_rt_test remaining bugs are fixed
storage/maria/unittest/ma_test_recovery.pl:
  preparing for running ma_rt_test when ma_rt_test remaining bugs are fixed
storage/myisam/rt_test.c:
  Some members of keyinfo, recinfo, keyseg were not initialized, led to Valgrind errors.
  We now bzero them like they are in mi_test1.
This commit is contained in:
Guilhem Bichot
2008-06-10 15:44:41 +02:00
parent 54b719a2c6
commit f89c61f5bb
4 changed files with 86 additions and 26 deletions

View File

@@ -112,7 +112,13 @@ static int run_test(const char *filename)
uchar read_record[MAX_REC_LENGTH];
int upd= 10;
ha_rows hrows;
bzero(&uniquedef, sizeof(uniquedef));
bzero(&create_info, sizeof(create_info));
bzero(recinfo, sizeof(recinfo));
bzero(keyinfo, sizeof(keyinfo));
bzero(keyseg, sizeof(keyseg));
/* Define a column for NULLs and DEL markers*/
recinfo[0].type=FIELD_NORMAL;
@@ -147,7 +153,6 @@ static int run_test(const char *filename)
if (!silent)
printf("- Creating isam-file\n");
bzero((char*) &create_info,sizeof(create_info));
create_info.max_rows=10000000;
if (mi_create(filename,