~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to innobase/page/ts/tspage.c

  • Committer: monty at mysql
  • Date: 2001-02-17 12:19:19 UTC
  • mto: (554.1.1)
  • mto: This revision was merged to the branch mainline in revision 556.
  • Revision ID: sp1r-monty@donna.mysql.com-20010217121919-07904
Added Innobase to source distribution

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/************************************************************************
 
2
The test for the index page
 
3
 
 
4
(c) 1994-1996 Innobase Oy
 
5
 
 
6
Created 1/31/1994 Heikki Tuuri
 
7
*************************************************************************/
 
8
 
 
9
#include "sync0sync.h"
 
10
#include "ut0mem.h"
 
11
#include "mem0mem.h"
 
12
#include "data0data.h"
 
13
#include "data0type.h"
 
14
#include "dict0dict.h"
 
15
#include "buf0buf.h"
 
16
#include "os0file.h"
 
17
#include "fil0fil.h"
 
18
#include "rem0rec.h"
 
19
#include "rem0cmp.h"
 
20
#include "mtr0mtr.h"
 
21
#include "log0log.h"
 
22
#include "..\page0page.h"
 
23
#include "..\page0cur.h"
 
24
 
 
25
os_file_t       files[1000];
 
26
 
 
27
mutex_t         ios_mutex;
 
28
ulint           ios;
 
29
ulint           n[10];
 
30
 
 
31
mutex_t         incs_mutex;
 
32
ulint           incs;
 
33
 
 
34
byte            bigbuf[1000000];
 
35
 
 
36
#define N_SPACES        1
 
37
#define N_FILES         2
 
38
#define FILE_SIZE       1000    /* must be > 512 */
 
39
#define POOL_SIZE       1000
 
40
#define COUNTER_OFFSET  1500
 
41
 
 
42
#define LOOP_SIZE       150
 
43
#define N_THREADS       5
 
44
 
 
45
 
 
46
ulint zero = 0;
 
47
 
 
48
buf_block_t*    bl_arr[POOL_SIZE];
 
49
 
 
50
/************************************************************************
 
51
Io-handler thread function. */
 
52
 
 
53
ulint
 
54
handler_thread(
 
55
/*===========*/
 
56
        void*   arg)
 
57
{
 
58
        ulint   segment;
 
59
        void*   mess;
 
60
        ulint   i;
 
61
        bool    ret;
 
62
        
 
63
        segment = *((ulint*)arg);
 
64
 
 
65
        printf("Io handler thread %lu starts\n", segment);
 
66
 
 
67
        for (i = 0;; i++) {
 
68
                ret = fil_aio_wait(segment, &mess);
 
69
                ut_a(ret);
 
70
 
 
71
                buf_page_io_complete((buf_block_t*)mess);
 
72
                
 
73
                mutex_enter(&ios_mutex);
 
74
                ios++;
 
75
                mutex_exit(&ios_mutex);
 
76
                
 
77
        }
 
78
 
 
79
        return(0);
 
80
}
 
81
 
 
82
/*************************************************************************
 
83
Creates the files for the file system test and inserts them to
 
84
the file system. */
 
85
 
 
86
void
 
87
create_files(void)
 
88
/*==============*/
 
89
{
 
90
        bool            ret;
 
91
        ulint           i, k;
 
92
        char            name[20];
 
93
        os_thread_t     thr[5];
 
94
        os_thread_id_t  id[5];
 
95
 
 
96
        printf("--------------------------------------------------------\n");
 
97
        printf("Create or open database files\n");
 
98
 
 
99
        strcpy(name, "j:\\tsfile00");
 
100
 
 
101
        for (k = 0; k < N_SPACES; k++) {
 
102
        for (i = 0; i < N_FILES; i++) {
 
103
 
 
104
                name[9] = (char)((ulint)'0' + k);
 
105
                name[10] = (char)((ulint)'0' + i);
 
106
        
 
107
                files[i] = os_file_create(name, OS_FILE_CREATE,
 
108
                                        OS_FILE_TABLESPACE, &ret);
 
109
 
 
110
                if (ret == FALSE) {
 
111
                        ut_a(os_file_get_last_error() ==
 
112
                                                OS_FILE_ALREADY_EXISTS);
 
113
        
 
114
                        files[i] = os_file_create(
 
115
                                name, OS_FILE_OPEN,
 
116
                                                OS_FILE_TABLESPACE, &ret);
 
117
 
 
118
                        ut_a(ret);
 
119
                }
 
120
 
 
121
                ret = os_file_close(files[i]);
 
122
                ut_a(ret);
 
123
 
 
124
                if (i == 0) {
 
125
                        fil_space_create(name, k, OS_FILE_TABLESPACE);
 
126
                }
 
127
 
 
128
                ut_a(fil_validate());
 
129
 
 
130
                fil_node_create(name, FILE_SIZE, k);
 
131
        }
 
132
        }
 
133
 
 
134
        ios = 0;
 
135
 
 
136
        mutex_create(&ios_mutex);
 
137
        
 
138
        for (i = 0; i < 5; i++) {
 
139
                n[i] = i;
 
140
 
 
141
                thr[i] = os_thread_create(handler_thread, n + i, id + i);
 
142
        }
 
143
}
 
144
 
 
145
/*********************************************************************
 
146
Test for index page. */
 
147
 
 
148
void 
 
149
test1(void)
 
150
/*=======*/
 
151
{
 
152
        page_t*         page;
 
153
        dtuple_t*       tuple;
 
154
        mem_heap_t*     heap;
 
155
        ulint           i;
 
156
        ulint           rnd     = 0;
 
157
        rec_t*          rec;
 
158
        page_cur_t      cursor;
 
159
        dict_index_t*   index;  
 
160
        dict_table_t*   table;
 
161
        buf_block_t*    block;
 
162
        buf_frame_t*    frame;
 
163
        mtr_t           mtr;
 
164
        
 
165
        printf("-------------------------------------------------\n");
 
166
        printf("TEST 1. Basic test\n");
 
167
 
 
168
        heap = mem_heap_create(0);
 
169
        
 
170
        table = dict_table_create("TS_TABLE1", 3);
 
171
 
 
172
        dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
 
173
        dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
 
174
        dict_table_add_col(table, "COL3", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
 
175
 
 
176
        ut_a(0 == dict_table_publish(table));
 
177
 
 
178
        index = dict_index_create("TS_TABLE1", "IND1", 0, 3, 0);
 
179
 
 
180
        dict_index_add_field(index, "COL1", 0);
 
181
        dict_index_add_field(index, "COL2", 0);
 
182
        dict_index_add_field(index, "COL3", 0);
 
183
 
 
184
        ut_a(0 == dict_index_publish(index));
 
185
 
 
186
        index = dict_index_get("TS_TABLE1", "IND1");
 
187
        ut_a(index);
 
188
 
 
189
        tuple = dtuple_create(heap, 3);
 
190
 
 
191
        mtr_start(&mtr);
 
192
 
 
193
        block = buf_page_create(0, 5, &mtr);
 
194
        buf_page_x_lock(block, &mtr);
 
195
 
 
196
        frame = buf_block_get_frame(block);
 
197
 
 
198
        page = page_create(frame, &mtr);
 
199
 
 
200
        for (i = 0; i < 512; i++) {
 
201
 
 
202
                rnd = (rnd + 534671) % 512;
 
203
 
 
204
                if (i % 27 == 0) {
 
205
                        ut_a(page_validate(page, index));
 
206
                }
 
207
        
 
208
                dtuple_gen_test_tuple(tuple, rnd);
 
209
 
 
210
/*              dtuple_print(tuple);*/
 
211
 
 
212
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
213
 
 
214
                rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
215
 
 
216
                ut_a(rec);
 
217
 
 
218
                rec_validate(rec);
 
219
/*              page_print_list(page, 151); */
 
220
        }
 
221
 
 
222
/*      page_print_list(page, 151); */
 
223
 
 
224
        ut_a(page_validate(page, index));
 
225
        ut_a(page_get_n_recs(page) == 512);
 
226
 
 
227
        for (i = 0; i < 512; i++) {
 
228
 
 
229
                rnd = (rnd + 7771) % 512;
 
230
        
 
231
                if (i % 27 == 0) {
 
232
                        ut_a(page_validate(page, index));
 
233
                }
 
234
 
 
235
                dtuple_gen_test_tuple(tuple, rnd);
 
236
 
 
237
/*              dtuple_print(tuple);*/
 
238
 
 
239
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
240
 
 
241
                page_cur_delete_rec(&cursor, &mtr);
 
242
 
 
243
                ut_a(rec);
 
244
 
 
245
                rec_validate(rec);
 
246
/*              page_print_list(page, 151); */
 
247
        }
 
248
 
 
249
        ut_a(page_get_n_recs(page) == 0);
 
250
 
 
251
        ut_a(page_validate(page, index));
 
252
        page = page_create(frame, &mtr);
 
253
 
 
254
        rnd = 311;
 
255
        
 
256
        for (i = 0; i < 512; i++) {
 
257
 
 
258
                rnd = (rnd + 1) % 512;
 
259
 
 
260
                if (i % 27 == 0) {
 
261
                        ut_a(page_validate(page, index));
 
262
                }
 
263
        
 
264
                dtuple_gen_test_tuple(tuple, rnd);
 
265
 
 
266
/*              dtuple_print(tuple);*/
 
267
 
 
268
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
269
 
 
270
                rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
271
 
 
272
                ut_a(rec);
 
273
 
 
274
                rec_validate(rec);
 
275
/*              page_print_list(page, 151); */
 
276
        }
 
277
 
 
278
        ut_a(page_validate(page, index));
 
279
        ut_a(page_get_n_recs(page) == 512);
 
280
 
 
281
        rnd = 217;
 
282
 
 
283
        for (i = 0; i < 512; i++) {
 
284
 
 
285
                rnd = (rnd + 1) % 512;
 
286
        
 
287
                if (i % 27 == 0) {
 
288
                        ut_a(page_validate(page, index));
 
289
                }
 
290
 
 
291
                dtuple_gen_test_tuple(tuple, rnd);
 
292
 
 
293
/*              dtuple_print(tuple);*/
 
294
 
 
295
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
296
 
 
297
                page_cur_delete_rec(&cursor, &mtr);
 
298
 
 
299
                ut_a(rec);
 
300
 
 
301
                rec_validate(rec);
 
302
/*              page_print_list(page, 151); */
 
303
        }
 
304
 
 
305
        ut_a(page_validate(page, index));
 
306
        ut_a(page_get_n_recs(page) == 0);
 
307
        page = page_create(frame, &mtr);
 
308
 
 
309
        rnd = 291;
 
310
        
 
311
        for (i = 0; i < 512; i++) {
 
312
 
 
313
                rnd = (rnd - 1) % 512;
 
314
 
 
315
                if (i % 27 == 0) {
 
316
                        ut_a(page_validate(page, index));
 
317
                }
 
318
        
 
319
                dtuple_gen_test_tuple(tuple, rnd);
 
320
 
 
321
/*              dtuple_print(tuple);*/
 
322
 
 
323
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
324
 
 
325
                rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
326
 
 
327
                ut_a(rec);
 
328
 
 
329
                rec_validate(rec);
 
330
/*              page_print_list(page, 151); */
 
331
        }
 
332
 
 
333
        ut_a(page_validate(page, index));
 
334
        ut_a(page_get_n_recs(page) == 512);
 
335
 
 
336
        rnd = 277;
 
337
 
 
338
        for (i = 0; i < 512; i++) {
 
339
 
 
340
                rnd = (rnd - 1) % 512;
 
341
        
 
342
                if (i % 27 == 0) {
 
343
                        ut_a(page_validate(page, index));
 
344
                }
 
345
 
 
346
                dtuple_gen_test_tuple(tuple, rnd);
 
347
 
 
348
/*              dtuple_print(tuple);*/
 
349
 
 
350
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
351
 
 
352
                page_cur_delete_rec(&cursor, &mtr);
 
353
 
 
354
                ut_a(rec);
 
355
 
 
356
                rec_validate(rec);
 
357
/*              page_print_list(page, 151); */
 
358
        }
 
359
 
 
360
        ut_a(page_validate(page, index));
 
361
        ut_a(page_get_n_recs(page) == 0);
 
362
 
 
363
        mtr_commit(&mtr);
 
364
        mem_heap_free(heap);
 
365
}
 
366
 
 
367
/*********************************************************************
 
368
Test for index page. */
 
369
 
 
370
void 
 
371
test2(void)
 
372
/*=======*/
 
373
{
 
374
        page_t*         page;
 
375
        dtuple_t*       tuple;
 
376
        mem_heap_t*     heap;
 
377
        ulint           i, j;
 
378
        ulint           rnd     = 0;
 
379
        rec_t*          rec;
 
380
        page_cur_t      cursor;
 
381
        dict_index_t*   index;  
 
382
        dict_table_t*   table;
 
383
        buf_block_t*    block;
 
384
        buf_frame_t*    frame;
 
385
        ulint           tm, oldtm;
 
386
        byte            buf[8];
 
387
        mtr_t           mtr;
 
388
        mtr_t           mtr2;
 
389
        
 
390
        printf("-------------------------------------------------\n");
 
391
        printf("TEST 2. Speed test\n");
 
392
        
 
393
        oldtm = ut_clock();
 
394
        
 
395
        for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
 
396
                ut_memcpy(bigbuf, bigbuf + 800, 800);
 
397
        }
 
398
 
 
399
        tm = ut_clock();
 
400
        printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
 
401
                        i, tm - oldtm);
 
402
 
 
403
        oldtm = ut_clock();
 
404
 
 
405
        rnd = 0;
 
406
        for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
 
407
                ut_memcpy(bigbuf + rnd, bigbuf + rnd + 800, 800);
 
408
                rnd += 1600;
 
409
                if (rnd > 995000) {
 
410
                        rnd = 0;
 
411
                }
 
412
        }
 
413
 
 
414
        tm = ut_clock();
 
415
        printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
 
416
                        i, tm - oldtm);
 
417
                        
 
418
        heap = mem_heap_create(0);
 
419
        
 
420
        table = dict_table_create("TS_TABLE2", 2);
 
421
 
 
422
        dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
 
423
        dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
 
424
 
 
425
        ut_a(0 == dict_table_publish(table));
 
426
 
 
427
        index = dict_index_create("TS_TABLE2", "IND2", 0, 2, 0);
 
428
 
 
429
        dict_index_add_field(index, "COL1", 0);
 
430
        dict_index_add_field(index, "COL2", 0);
 
431
 
 
432
        ut_a(0 == dict_index_publish(index));
 
433
 
 
434
        index = dict_index_get("TS_TABLE2", "IND2");
 
435
        ut_a(index);
 
436
        
 
437
        tuple = dtuple_create(heap, 3);
 
438
 
 
439
        oldtm = ut_clock();
 
440
        
 
441
        rnd = 677;
 
442
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
443
 
 
444
                mtr_start(&mtr);
 
445
 
 
446
                block = buf_page_create(0, 5, &mtr);
 
447
                buf_page_x_lock(block, &mtr);
 
448
 
 
449
                frame = buf_block_get_frame(block);
 
450
 
 
451
                page = page_create(frame, &mtr);
 
452
 
 
453
                for (j = 0; j < 200; j++) {
 
454
                        rnd = (rnd + 54841) % 1000;
 
455
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
456
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
457
 
 
458
                        rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
459
                        ut_a(rec);
 
460
                }
 
461
                mtr_commit(&mtr);
 
462
        }
 
463
 
 
464
        tm = ut_clock();
 
465
        printf("Wall time for insertion of %lu recs %lu milliseconds\n",
 
466
                        i * j, tm - oldtm);
 
467
 
 
468
        mtr_start(&mtr);
 
469
 
 
470
        block = buf_page_get(0, 5, &mtr);
 
471
        buf_page_s_lock(block, &mtr);
 
472
 
 
473
        page = buf_block_get_frame(block);
 
474
        ut_a(page_validate(page, index));
 
475
        mtr_commit(&mtr);
 
476
        
 
477
        oldtm = ut_clock();
 
478
        
 
479
        rnd = 677;
 
480
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
481
                mtr_start(&mtr);
 
482
 
 
483
                block = buf_page_create(0, 5, &mtr);
 
484
                buf_page_x_lock(block, &mtr);
 
485
 
 
486
                frame = buf_block_get_frame(block);
 
487
 
 
488
                page = page_create(frame, &mtr);
 
489
 
 
490
                for (j = 0; j < 200; j++) {
 
491
                        rnd = (rnd + 54841) % 1000;
 
492
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
493
                }
 
494
                mtr_commit(&mtr);
 
495
        }
 
496
 
 
497
        tm = ut_clock();
 
498
        printf(
 
499
        "Wall time for %lu empty loops with page create %lu milliseconds\n",
 
500
                        i * j, tm - oldtm);
 
501
 
 
502
        oldtm = ut_clock();
 
503
        
 
504
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
505
 
 
506
        
 
507
                mtr_start(&mtr);
 
508
 
 
509
                block = buf_page_create(0, 5, &mtr);
 
510
                buf_page_x_lock(block, &mtr);
 
511
 
 
512
                frame = buf_block_get_frame(block);
 
513
 
 
514
                page = page_create(frame, &mtr);
 
515
 
 
516
                mtr_commit(&mtr);
 
517
 
 
518
                rnd = 100;
 
519
                for (j = 0; j < 200; j++) {
 
520
                        mtr_start(&mtr2);
 
521
 
 
522
                        block = buf_page_get(0, 5, &mtr2);
 
523
                        buf_page_x_lock(block, &mtr2);
 
524
 
 
525
                        page = buf_block_get_frame(block);
 
526
 
 
527
                        rnd = (rnd + 1) % 1000;
 
528
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
529
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
530
 
 
531
                        rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr2);
 
532
                        ut_a(rec);
 
533
 
 
534
                        mtr_commit(&mtr2);
 
535
                }
 
536
        }
 
537
 
 
538
        tm = ut_clock();
 
539
        printf(
 
540
        "Wall time for sequential insertion of %lu recs %lu milliseconds\n",
 
541
                        i * j, tm - oldtm);
 
542
 
 
543
        mtr_start(&mtr);
 
544
 
 
545
        block = buf_page_get(0, 5, &mtr);
 
546
        buf_page_s_lock(block, &mtr);
 
547
 
 
548
        page = buf_block_get_frame(block);
 
549
        ut_a(page_validate(page, index));
 
550
        mtr_commit(&mtr);
 
551
 
 
552
        oldtm = ut_clock();
 
553
        
 
554
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
555
                mtr_start(&mtr);
 
556
 
 
557
                block = buf_page_create(0, 5, &mtr);
 
558
                buf_page_x_lock(block, &mtr);
 
559
 
 
560
                frame = buf_block_get_frame(block);
 
561
 
 
562
                page = page_create(frame, &mtr);
 
563
 
 
564
                rnd = 500;
 
565
                for (j = 0; j < 200; j++) {
 
566
                        rnd = (rnd - 1) % 1000;
 
567
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
568
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
569
 
 
570
                        rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
571
                        ut_a(rec);
 
572
                }
 
573
                mtr_commit(&mtr);
 
574
        }
 
575
 
 
576
        tm = ut_clock();
 
577
        printf(
 
578
        "Wall time for descend. seq. insertion of %lu recs %lu milliseconds\n",
 
579
                        i * j, tm - oldtm);
 
580
 
 
581
        oldtm = ut_clock();
 
582
        
 
583
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
584
                mtr_start(&mtr);
 
585
 
 
586
                block = buf_page_create(0, 5, &mtr);
 
587
                buf_page_x_lock(block, &mtr);
 
588
 
 
589
                frame = buf_block_get_frame(block);
 
590
 
 
591
                page = page_create(frame, &mtr);
 
592
 
 
593
                rnd = 677;
 
594
 
 
595
                for (j = 0; j < 200; j++) {
 
596
                        rnd = (rnd + 54841) % 1000;
 
597
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
598
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
599
 
 
600
                        rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
601
                        ut_a(rec);
 
602
                }
 
603
 
 
604
                rnd = 677;
 
605
                for (j = 0; j < 200; j++) {
 
606
                        rnd = (rnd + 54841) % 1000;
 
607
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
608
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
609
 
 
610
                        page_cur_delete_rec(&cursor, &mtr);
 
611
                }
 
612
                ut_a(page_get_n_recs(page) == 0);
 
613
 
 
614
                mtr_commit(&mtr);
 
615
        }
 
616
 
 
617
        tm = ut_clock();
 
618
        printf("Wall time for insert and delete of %lu recs %lu milliseconds\n",
 
619
                        i * j, tm - oldtm);
 
620
 
 
621
        mtr_start(&mtr);
 
622
 
 
623
        block = buf_page_create(0, 5, &mtr);
 
624
        buf_page_x_lock(block, &mtr);
 
625
 
 
626
        frame = buf_block_get_frame(block);
 
627
 
 
628
        page = page_create(frame, &mtr);
 
629
 
 
630
        rnd = 677;
 
631
 
 
632
        for (j = 0; j < 200; j++) {
 
633
                rnd = (rnd + 54841) % 1000;
 
634
                dtuple_gen_test_tuple3(tuple, rnd, buf);
 
635
                page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
636
 
 
637
                rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
 
638
                ut_a(rec);
 
639
        }
 
640
        ut_a(page_validate(page, index));
 
641
        mtr_print(&mtr);
 
642
        
 
643
        oldtm = ut_clock();
 
644
        
 
645
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
646
                rnd = 677;
 
647
                for (j = 0; j < 200; j++) {
 
648
/*                      rnd = (rnd + 54841) % 1000;*/
 
649
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
650
                        page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
 
651
                }
 
652
        }
 
653
 
 
654
        tm = ut_clock();
 
655
        printf("Wall time for search of %lu recs %lu milliseconds\n",
 
656
                        i * j, tm - oldtm);
 
657
 
 
658
        oldtm = ut_clock();
 
659
        
 
660
        for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
 
661
                rnd = 677;
 
662
                for (j = 0; j < 200; j++) {
 
663
                        rnd = (rnd + 54841) % 1000;
 
664
                        dtuple_gen_test_tuple3(tuple, rnd, buf);
 
665
                }
 
666
        }
 
667
 
 
668
        tm = ut_clock();
 
669
        printf("Wall time for %lu empty loops %lu milliseconds\n",
 
670
                        i * j, tm - oldtm);
 
671
        mtr_commit(&mtr);
 
672
}
 
673
 
 
674
/********************************************************************
 
675
Main test function. */
 
676
 
 
677
void 
 
678
main(void) 
 
679
/*======*/
 
680
{
 
681
        ulint   tm, oldtm;
 
682
 
 
683
        sync_init();
 
684
        mem_init();
 
685
        os_aio_init(160, 5);
 
686
        fil_init(25);
 
687
        buf_pool_init(100, 100);
 
688
        dict_init();
 
689
        log_init();
 
690
        
 
691
        create_files();
 
692
        
 
693
        oldtm = ut_clock();
 
694
        
 
695
        ut_rnd_set_seed(19);
 
696
 
 
697
        test1();
 
698
        test2();
 
699
 
 
700
        mem_print_info();
 
701
        
 
702
        tm = ut_clock();
 
703
        printf("Wall time for test %lu milliseconds\n", tm - oldtm);
 
704
        printf("TESTS COMPLETED SUCCESSFULLY!\n");
 
705