Commit 806f03f7 authored by unknown's avatar unknown

Remove unnecessary files

.del-univoldmysql.i~9253a6f92058c565:
  Delete: innobase/include/univoldmysql.i
.del-univold.i~4b5ed652407f63f1:
  Delete: innobase/include/univold.i
.del-tsut.c~4a154913fc9cd5c0:
  Delete: innobase/ut/ts/tsut.c
.del-makefile~9b8356bbdb8bd94e:
  Delete: innobase/ut/ts/makefile
.del-tsttrxold.c~eb6fd6091405d54e:
  Delete: innobase/trx/ts/tsttrxold.c
.del-tstrx.c~5425c98548ec1e0d:
  Delete: innobase/trx/ts/tstrx.c
.del-makefile~16d63c17c8edf62a:
  Delete: innobase/trx/ts/makefile
.del-tsthr.c~b095667070d626a9:
  Delete: innobase/thr/ts/tsthr.c
.del-makefile~d5e4661188c1939d:
  Delete: innobase/thr/ts/makefile
.del-tssync.c~fed4676cd4eb8457:
  Delete: innobase/sync/ts/tssync.c
.del-makefile~f23368879649c806:
  Delete: innobase/sync/ts/makefile
.del-tssrv.c~b8a6f5ad9ae639c8:
  Delete: innobase/srv/ts/tssrv.c
.del-tsdbc.c~d36206bdccf338f:
  Delete: innobase/srv/ts/tsdbc.c
.del-makefile~da6e87ef29c12dca:
  Delete: innobase/srv/ts/makefile
.del-tstcur.c~a9d5cf73b020ec41:
  Delete: innobase/row/ts/tstcur.c
.del-makefile~2cdfe39689004e6:
  Delete: innobase/row/ts/makefile
.del-tsrem.c~bb4e1e2e8c2ee179:
  Delete: innobase/rem/ts/tsrem.c
.del-makefile~3e48a33b4970faef:
  Delete: innobase/rem/ts/makefile
.del-tspage.c~f5baf63f9924e43b:
  Delete: innobase/page/ts/tspage.c
.del-makefile~66de73bc499566f9:
  Delete: innobase/page/ts/makefile
.del-tsosaux.c~9ec97a83392a984c:
  Delete: innobase/os/ts/tsosaux.c
.del-tsos.c~f6057d3c171f5915:
  Delete: innobase/os/ts/tsos.c
.del-makefile~9a1d210afa6d666e:
  Delete: innobase/os/ts/makefile
.del-tsmtr.c~293250c7ebfe0d3:
  Delete: innobase/mtr/ts/tsmtr.c
.del-tsbuf.c~e8d15ee095194d2c:
  Delete: innobase/mtr/ts/tsbuf.c
.del-makefile~fdf4c2a4ddb23230:
  Delete: innobase/mtr/ts/makefile
.del-tsmem.c~cc483e2ab96e625c:
  Delete: innobase/mem/ts/tsmem.c
.del-makefile~6d58ab1de0ac572:
  Delete: innobase/mem/ts/makefile
.del-tsmach.c~af65166bb53ddfe9:
  Delete: innobase/mach/ts/tsmach.c
.del-makefile~b8cbd25992ee51b:
  Delete: innobase/mach/ts/makefile
.del-tsha.c~13dd5ea03fda370c:
  Delete: innobase/ha/ts/tsha.c
.del-makefile~1bf12ce7b2dadfd5:
  Delete: innobase/ha/ts/makefile
.del-tsfsp.c~890ead1636f0eaba:
  Delete: innobase/fsp/ts/tsfsp.c
.del-makefile~a466e9eb27493a80:
  Delete: innobase/fsp/ts/makefile
.del-del.c~35c6283be580200:
  Delete: innobase/fsp/ts/del.c
.del-tsfil.c~e554b6f3c189c081:
  Delete: innobase/fil/ts/tsfil.c
.del-makefile~1df6f952a960fef4:
  Delete: innobase/fil/ts/makefile
.del-tsdyn.c~6f976764b53f3191:
  Delete: innobase/dyn/ts/tsdyn.c
.del-makefile~f64427335fafdc65:
  Delete: innobase/dyn/ts/makefile
.del-tsdict.c~5e82f7b8ac2b2e15:
  Delete: innobase/dict/ts/tsdict.c
.del-makefile~6356c424e9747647:
  Delete: innobase/dict/ts/makefile
.del-tscom.c~26aae2c5c4ca1dce:
  Delete: innobase/com/ts/tscom.c
.del-tscli.c~2f3e4b281141eac2:
  Delete: innobase/com/ts/tscli.c
.del-makefile~608fd39568db7238:
  Delete: innobase/com/ts/makefile
.del-tsos.c~1dadfc1ef69f2ba3:
  Delete: innobase/buf/ts/tsos.c
.del-tsbuf.c~b4c3feee158ef154:
  Delete: innobase/buf/ts/tsbuf.c
.del-makefile~598acb06bf1e466:
  Delete: innobase/buf/ts/makefile
.del-tscli.c~8d35740cc1f6f864:
  Delete: innobase/btr/ts/trash/tscli.c
.del-tssrv.c~ee30b746c485aec:
  Delete: innobase/btr/ts/tssrv.c
.del-tss.c~21ae628550141a68:
  Delete: innobase/btr/ts/tss.c
.del-tsrecv97.c~dbeb3bc494b241c1:
  Delete: innobase/btr/ts/tsrecv97.c
.del-tsrecv.c~3415f8a936a8d9fd:
  Delete: innobase/btr/ts/tsrecv.c
.del-tscli.c~77fc1962db99aa2e:
  Delete: innobase/btr/ts/tscli.c
.del-tsbtrold5.c~72a60e768c944904:
  Delete: innobase/btr/ts/trash/tsbtrold5.c
.del-tsbtrins.c~3e3bb3f95f058b46:
  Delete: innobase/btr/ts/tsbtrins.c
.del-TSIT.C~f53cce6fab8d325:
  Delete: innobase/btr/ts/trash/TSIT.C
.del-tsbtrfull.c~fbcbe41b64cc71b6:
  Delete: innobase/btr/ts/tsbtrfull.c
.del-tsbtr97.c~84dbb84ea9fa267c:
  Delete: innobase/btr/ts/tsbtr97.c
.del-makefile~491918b4162b927c:
  Delete: innobase/btr/ts/makefile
.del-isql.c~bc0b8cc213905175:
  Delete: innobase/btr/ts/isql.c


BitKeeper/deleted/.del-isql.c~bc0b8cc213905175:
  Delete: innobase/btr/ts/isql.c
BitKeeper/deleted/.del-makefile~491918b4162b927c:
  Delete: innobase/btr/ts/makefile
BitKeeper/deleted/.del-tsbtr97.c~84dbb84ea9fa267c:
  Delete: innobase/btr/ts/tsbtr97.c
BitKeeper/deleted/.del-tsbtrfull.c~fbcbe41b64cc71b6:
  Delete: innobase/btr/ts/tsbtrfull.c
BitKeeper/deleted/.del-TSIT.C~f53cce6fab8d325:
  Delete: innobase/btr/ts/trash/TSIT.C
BitKeeper/deleted/.del-tsbtrins.c~3e3bb3f95f058b46:
  Delete: innobase/btr/ts/tsbtrins.c
BitKeeper/deleted/.del-tsbtrold5.c~72a60e768c944904:
  Delete: innobase/btr/ts/trash/tsbtrold5.c
BitKeeper/deleted/.del-tscli.c~77fc1962db99aa2e:
  Delete: innobase/btr/ts/tscli.c
BitKeeper/deleted/.del-tsrecv.c~3415f8a936a8d9fd:
  Delete: innobase/btr/ts/tsrecv.c
BitKeeper/deleted/.del-tsrecv97.c~dbeb3bc494b241c1:
  Delete: innobase/btr/ts/tsrecv97.c
BitKeeper/deleted/.del-tss.c~21ae628550141a68:
  Delete: innobase/btr/ts/tss.c
BitKeeper/deleted/.del-tssrv.c~ee30b746c485aec:
  Delete: innobase/btr/ts/tssrv.c
BitKeeper/deleted/.del-tscli.c~8d35740cc1f6f864:
  Delete: innobase/btr/ts/trash/tscli.c
BitKeeper/deleted/.del-makefile~598acb06bf1e466:
  Delete: innobase/buf/ts/makefile
BitKeeper/deleted/.del-tsbuf.c~b4c3feee158ef154:
  Delete: innobase/buf/ts/tsbuf.c
BitKeeper/deleted/.del-tsos.c~1dadfc1ef69f2ba3:
  Delete: innobase/buf/ts/tsos.c
BitKeeper/deleted/.del-makefile~608fd39568db7238:
  Delete: innobase/com/ts/makefile
BitKeeper/deleted/.del-tscli.c~2f3e4b281141eac2:
  Delete: innobase/com/ts/tscli.c
BitKeeper/deleted/.del-tscom.c~26aae2c5c4ca1dce:
  Delete: innobase/com/ts/tscom.c
BitKeeper/deleted/.del-makefile~6356c424e9747647:
  Delete: innobase/dict/ts/makefile
BitKeeper/deleted/.del-tsdict.c~5e82f7b8ac2b2e15:
  Delete: innobase/dict/ts/tsdict.c
BitKeeper/deleted/.del-makefile~f64427335fafdc65:
  Delete: innobase/dyn/ts/makefile
BitKeeper/deleted/.del-tsdyn.c~6f976764b53f3191:
  Delete: innobase/dyn/ts/tsdyn.c
BitKeeper/deleted/.del-makefile~1df6f952a960fef4:
  Delete: innobase/fil/ts/makefile
BitKeeper/deleted/.del-tsfil.c~e554b6f3c189c081:
  Delete: innobase/fil/ts/tsfil.c
BitKeeper/deleted/.del-del.c~35c6283be580200:
  Delete: innobase/fsp/ts/del.c
BitKeeper/deleted/.del-makefile~a466e9eb27493a80:
  Delete: innobase/fsp/ts/makefile
BitKeeper/deleted/.del-tsfsp.c~890ead1636f0eaba:
  Delete: innobase/fsp/ts/tsfsp.c
BitKeeper/deleted/.del-makefile~1bf12ce7b2dadfd5:
  Delete: innobase/ha/ts/makefile
BitKeeper/deleted/.del-tsha.c~13dd5ea03fda370c:
  Delete: innobase/ha/ts/tsha.c
BitKeeper/deleted/.del-makefile~b8cbd25992ee51b:
  Delete: innobase/mach/ts/makefile
BitKeeper/deleted/.del-tsmach.c~af65166bb53ddfe9:
  Delete: innobase/mach/ts/tsmach.c
BitKeeper/deleted/.del-makefile~6d58ab1de0ac572:
  Delete: innobase/mem/ts/makefile
BitKeeper/deleted/.del-tsmem.c~cc483e2ab96e625c:
  Delete: innobase/mem/ts/tsmem.c
BitKeeper/deleted/.del-makefile~fdf4c2a4ddb23230:
  Delete: innobase/mtr/ts/makefile
BitKeeper/deleted/.del-tsbuf.c~e8d15ee095194d2c:
  Delete: innobase/mtr/ts/tsbuf.c
BitKeeper/deleted/.del-tsmtr.c~293250c7ebfe0d3:
  Delete: innobase/mtr/ts/tsmtr.c
BitKeeper/deleted/.del-makefile~9a1d210afa6d666e:
  Delete: innobase/os/ts/makefile
BitKeeper/deleted/.del-tsos.c~f6057d3c171f5915:
  Delete: innobase/os/ts/tsos.c
BitKeeper/deleted/.del-tsosaux.c~9ec97a83392a984c:
  Delete: innobase/os/ts/tsosaux.c
BitKeeper/deleted/.del-makefile~66de73bc499566f9:
  Delete: innobase/page/ts/makefile
BitKeeper/deleted/.del-tspage.c~f5baf63f9924e43b:
  Delete: innobase/page/ts/tspage.c
BitKeeper/deleted/.del-makefile~3e48a33b4970faef:
  Delete: innobase/rem/ts/makefile
BitKeeper/deleted/.del-tsrem.c~bb4e1e2e8c2ee179:
  Delete: innobase/rem/ts/tsrem.c
BitKeeper/deleted/.del-makefile~2cdfe39689004e6:
  Delete: innobase/row/ts/makefile
BitKeeper/deleted/.del-tstcur.c~a9d5cf73b020ec41:
  Delete: innobase/row/ts/tstcur.c
BitKeeper/deleted/.del-makefile~da6e87ef29c12dca:
  Delete: innobase/srv/ts/makefile
BitKeeper/deleted/.del-tsdbc.c~d36206bdccf338f:
  Delete: innobase/srv/ts/tsdbc.c
BitKeeper/deleted/.del-tssrv.c~b8a6f5ad9ae639c8:
  Delete: innobase/srv/ts/tssrv.c
BitKeeper/deleted/.del-makefile~f23368879649c806:
  Delete: innobase/sync/ts/makefile
BitKeeper/deleted/.del-tssync.c~fed4676cd4eb8457:
  Delete: innobase/sync/ts/tssync.c
BitKeeper/deleted/.del-makefile~d5e4661188c1939d:
  Delete: innobase/thr/ts/makefile
BitKeeper/deleted/.del-tsthr.c~b095667070d626a9:
  Delete: innobase/thr/ts/tsthr.c
BitKeeper/deleted/.del-makefile~16d63c17c8edf62a:
  Delete: innobase/trx/ts/makefile
BitKeeper/deleted/.del-tstrx.c~5425c98548ec1e0d:
  Delete: innobase/trx/ts/tstrx.c
BitKeeper/deleted/.del-tsttrxold.c~eb6fd6091405d54e:
  Delete: innobase/trx/ts/tsttrxold.c
BitKeeper/deleted/.del-makefile~9b8356bbdb8bd94e:
  Delete: innobase/ut/ts/makefile
BitKeeper/deleted/.del-tsut.c~4a154913fc9cd5c0:
  Delete: innobase/ut/ts/tsut.c
BitKeeper/deleted/.del-univold.i~4b5ed652407f63f1:
  Delete: innobase/include/univold.i
BitKeeper/deleted/.del-univoldmysql.i~9253a6f92058c565:
  Delete: innobase/include/univoldmysql.i
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent 78a466b7
......@@ -55,6 +55,7 @@ konstantin@mysql.com
kostja@oak.local
lenz@kallisto.mysql.com
lenz@mysql.com
marko@hundin.mysql.fi
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local
......
/************************************************************************
Test for the client: interactive SQL
(c) 1996-1997 Innobase Oy
Created 2/16/1996 Heikki Tuuri
*************************************************************************/
#include "univ.i"
#include "ib_odbc.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "os0thread.h"
#include "os0proc.h"
#include "os0sync.h"
#include "srv0srv.h"
ulint n_exited = 0;
char cli_srv_endpoint_name[100];
char cli_user_name[100];
ulint n_warehouses = ULINT_MAX;
ulint n_customers_d = ULINT_MAX;
bool is_tpc_d = FALSE;
ulint n_rounds = ULINT_MAX;
ulint n_users = ULINT_MAX;
ulint startdate = 0;
ulint enddate = 0;
bool own_warehouse = FALSE;
ulint mem_pool_size = ULINT_MAX;
/*************************************************************************
Reads a keywords and a values from an initfile. In case of an error, exits
from the process. */
static
void
cli_read_initfile(
/*==============*/
FILE* initfile) /* in: file pointer */
{
char str_buf[10000];
ulint ulint_val;
srv_read_init_val(initfile, FALSE, "SRV_ENDPOINT_NAME", str_buf,
&ulint_val);
ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
ut_memcpy(cli_srv_endpoint_name, str_buf, COM_MAX_ADDR_LEN);
srv_read_init_val(initfile, FALSE, "USER_NAME", str_buf,
&ulint_val);
ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
ut_memcpy(cli_user_name, str_buf, COM_MAX_ADDR_LEN);
srv_read_init_val(initfile, TRUE, "MEM_POOL_SIZE", str_buf,
&mem_pool_size);
srv_read_init_val(initfile, TRUE, "N_WAREHOUSES", str_buf,
&n_warehouses);
srv_read_init_val(initfile, TRUE, "N_CUSTOMERS_D", str_buf,
&n_customers_d);
srv_read_init_val(initfile, TRUE, "IS_TPC_D", str_buf,
&is_tpc_d);
srv_read_init_val(initfile, TRUE, "N_ROUNDS", str_buf,
&n_rounds);
srv_read_init_val(initfile, TRUE, "N_USERS", str_buf,
&n_users);
srv_read_init_val(initfile, TRUE, "STARTDATE", str_buf,
&startdate);
srv_read_init_val(initfile, TRUE, "ENDDATE", str_buf,
&enddate);
srv_read_init_val(initfile, TRUE, "OWN_WAREHOUSE", str_buf,
&own_warehouse);
}
/*************************************************************************
Reads configuration info for the client. */
static
void
cli_boot(
/*=====*/
char* name) /* in: the initialization file name */
{
FILE* initfile;
initfile = fopen(name, "r");
if (initfile == NULL) {
printf(
"Error in client booting: could not open initfile whose name is %s!\n",
name);
os_process_exit(1);
}
cli_read_initfile(initfile);
fclose(initfile);
}
/*********************************************************************
Interactive SQL loop. */
static
void
isql(
/*=*/
FILE* inputfile) /* in: input file containing SQL strings,
or stdin */
{
HENV env;
HDBC conn;
RETCODE ret;
HSTMT sql_query;
ulint tm, oldtm;
char buf[1000];
char* str;
ulint count;
ulint n_begins;
ulint len;
ulint n;
ulint i;
ulint n_lines;
ret = SQLAllocEnv(&env);
ut_a(ret == SQL_SUCCESS);
ret = SQLAllocConnect(env, &conn);
ut_a(ret == SQL_SUCCESS);
ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
(SWORD)ut_strlen(cli_srv_endpoint_name),
cli_user_name,
(SWORD)ut_strlen(cli_user_name),
(UCHAR*)"password", 8);
ut_a(ret == SQL_SUCCESS);
printf("Connection established\n");
printf("Interactive SQL performs queries by first making a stored\n");
printf("procedure from them, and then calling the procedure.\n");
printf("Put a semicolon after each statement and\n");
printf("end your query with two <enter>s.\n\n");
printf("You can also give a single input file\n");
printf("as a command line argument to isql.\n\n");
printf("In the file separate SQL queries and procedure bodies\n");
printf("by a single empty line. Do not write the final END; into\n");
printf("a procedure body.\n\n");
count = 0;
loop:
count++;
n = 0;
n_lines = 0;
sprintf(buf, "PROCEDURE P%s%lu () IS\nBEGIN ", cli_user_name,
count);
for (;;) {
len = ut_strlen(buf + n) - 1;
n += len;
if (len == 0) {
break;
} else {
sprintf(buf + n, "\n");
n++;
n_lines++;
}
str = fgets(buf + n, 1000, inputfile);
if ((str == NULL) && (inputfile != stdin)) {
/* Reached end-of-file: switch to input from
keyboard */
inputfile = stdin;
break;
}
ut_a(str);
}
if (n_lines == 1) {
/* Empty procedure */
goto loop;
}
/* If the statement is actually the body of a procedure,
erase the first BEGIN from the string: */
n_begins = 0;
for (i = 0; i < n - 5; i++) {
if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
n_begins++;
}
}
if (n_begins > 1) {
for (i = 0; i < n - 5; i++) {
if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
/* Erase the first BEGIN: */
ut_memcpy(buf + i, " ", 5);
break;
}
}
}
sprintf(buf + n, "END;\n");
printf("SQL procedure to execute:\n%s\n", buf);
ret = SQLAllocStmt(conn, &sql_query);
ut_a(ret == SQL_SUCCESS);
ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
ut_a(ret == SQL_SUCCESS);
ret = SQLExecute(sql_query);
ut_a(ret == SQL_SUCCESS);
sprintf(buf, "{P%s%lu ()}", cli_user_name, count);
ret = SQLAllocStmt(conn, &sql_query);
ut_a(ret == SQL_SUCCESS);
ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
ut_a(ret == SQL_SUCCESS);
printf("Starting to execute the query\n");
oldtm = ut_clock();
ret = SQLExecute(sql_query);
tm = ut_clock();
printf("Wall time for query %lu milliseconds\n\n", tm - oldtm);
ut_a(ret == SQL_SUCCESS);
goto loop;
}
/********************************************************************
Main test function. */
void
main(int argc, char* argv[])
/*========================*/
{
ulint tm, oldtm;
FILE* inputfile;
if (argc > 2) {
printf("Only one input file allowed\n");
os_process_exit(1);
} else if (argc == 2) {
inputfile = fopen(argv[1], "r");
if (inputfile == NULL) {
printf(
"Error: could not open the inputfile whose name is %s!\n",
argv[1]);
os_process_exit(1);
}
} else {
inputfile = stdin;
}
cli_boot("cli_init");
sync_init();
mem_init(mem_pool_size);
oldtm = ut_clock();
isql(inputfile);
tm = ut_clock();
printf("Wall time for test %lu milliseconds\n", tm - oldtm);
printf("TESTS COMPLETED SUCCESSFULLY!\n");
}
include ..\..\makefile.i
doall: tssrv tscli isql
tssrv: ..\btr.lib tssrv.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tssrv.c $(LFL)
tscli: ..\btr.lib tscli.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tscli.c $(LFL)
isql: ..\btr.lib isql.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib isql.c $(LFL)
tsrecv: ..\btr.lib tsrecv.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsrecv.c $(LFL)
/************************************************************************
The test module for the record manager of MVB.
(c) 1994 Heikki Tuuri
Created 1/25/1994 Heikki Tuuri
*************************************************************************/
#include "rm0phr.h"
#include "rm0lgr.h"
#include "ut0ut.h"
#include "buf0mem.h"
#include "rm0ipg.h"
#include "../it0it.h"
#include "../it0hi.h"
#include "../it0ads.h"
byte buf[100];
byte buf2[100];
lint lintbuf[2048];
byte numbuf[6000];
byte numlogrecbuf[100];
phr_record_t* qs_table[100000];
lint qs_comp = 0;
extern
void
test1(void);
#ifdef NOT_DEFINED
void
q_sort(lint low, lint up)
{
phr_record_t* temp, *pivot;
lint i, j;
pivot = qs_table[(low + up) / 2];
i = low;
j = up;
while (i < j) {
qs_comp++;
if (cmp_phr_compare(qs_table[i], pivot)<= 0) {
i++;
} else {
j--;
temp = qs_table[i];
qs_table[i] = qs_table[j];
qs_table[j] = temp;
}
}
if (j == up) {
temp = qs_table[(low + up) / 2];
qs_table[(low + up) / 2] = qs_table[up - 1];
qs_table[up - 1] = temp;
j--;
}
if (j - low <= 1) {
/* do nothing */
} else if (j - low == 2) {
qs_comp++;
if (cmp_phr_compare(qs_table[low],
qs_table[low + 1])
<= 0) {
/* do nothing */
} else {
temp = qs_table[low];
qs_table[low] = qs_table[low + 1];
qs_table[low + 1] = temp;
}
} else {
q_sort(low, j);
}
if (up - j <= 1) {
/* do nothing */
} else if (up - j == 2) {
qs_comp++;
if (cmp_phr_compare(qs_table[j],
qs_table[j + 1])
<= 0) {
/* do nothing */
} else {
temp = qs_table[j];
qs_table[j] = qs_table[j + 1];
qs_table[j + 1] = temp;
}
} else {
q_sort(j, up);
}
}
#endif
extern
void
test1(void)
{
phr_record_t* physrec;
phr_record_t* rec1;
phr_record_t* rec2;
lgr_record_t* logrec;
lgrf_field_t* logfield;
lint len;
byte* str;
lint len2;
lint tm;
lint oldtm;
lint i, j, k, l, m;
bool b;
it_cur_cursor_t cursor;
ipg_cur_cursor_t* page_cursor;
ipg_page_t* page;
byte c4, c3, c2, c1, c0;
lint rand, rnd1, rnd2;
byte* nb;
lgr_record_t* numlogrec;
byte* pgbuf;
mem_stream_t* stream;
lint tree1, tree2, tree3;
lint dummy1, dummy2;
pgbuf = (byte*)lintbuf;
stream = mem_stream_create(0);
printf("-------------------------------------------\n");
printf("TEST 1. Speed and basic tests.\n");
logrec = lgr_create_logical_record(stream, 2);
nb = numbuf;
c4 = '0';
c3 = '0';
for (c2 = '0'; c2 <= '9'; c2++) {
for (c1 = '0'; c1 <= '9'; c1++) {
for (c0 = '0'; c0 <= '9'; c0++) {
*nb = c4; nb++;
*nb = c3; nb++;
*nb = c2; nb++;
*nb = c1; nb++;
*nb = c0; nb++;
*nb = '\0'; nb++;
}
}
}
numlogrec = lgr_create_logical_record(stream, 2);
tree1 = it_create_index_tree();
oldtm = ut_clock();
rand = 99900;
rnd1 = 67;
for (j = 0; j < 1; j++) {
for (i = 0 ; i < 100000; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
/*
it_insert(tree1, numlogrec);
*/
it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
/*
it_cur_set_to_first(tree1, &cursor);
*/
it_cur_insert_record(&cursor, numlogrec);
}
}
tm = ut_clock();
printf("Time for inserting %ld recs = %ld \n", i* j, tm - oldtm);
/* it_print_tree(tree1, 10);*/
hi_print_info();
ads_print_info();
/*
oldtm = ut_clock();
rand = 11113;
for (i = 0; i < 5000; i++) {
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
}
tm = ut_clock();
printf("Time for searching %ld recs = %ld \n", i, tm - oldtm);
*/
it_cur_set_to_first(tree1, &cursor);
rec1 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
for (i = 0;; i++) {
it_cur_move_to_next(&cursor);
if (it_cur_end_of_level(&cursor)) {
break;
}
rec2 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
ut_a(cmp_phr_compare(rec1, rec2) == -1);
rec1 = rec2;
}
printf("tree1 checked for right sorted order!\n");
#ifdef not_defined
oldtm = ut_clock();
for (j = 0; j < 1; j++) {
rand = 11113;
for (i = 0; i < 3000; i++) {
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
physrec = hi_search(numlogrec);
ut_a(physrec);
}
}
ut_a(physrec);
tm = ut_clock();
printf("Time for hi_search %ld recs = %ld \n", i * j,
tm - oldtm);
oldtm = ut_clock();
for (i = 0; i < 100000; i++) {
/* j += lgr_fold(numlogrec, -1, -1);*/
/* b += phr_lgr_equal(physrec, numlogrec, -1);*/
k += ut_hash_lint(j, HI_TABLE_SIZE);
}
/* ut_a(b);*/
tm = ut_clock();
printf("Time for fold + equal %ld recs %s = %ld \n", i, physrec,
tm - oldtm);
printf("%ld %ld %ld\n", j, b, k);
hi_print_info();
tree2 = it_create_index_tree();
rand = 90000;
for (i = 0; i < 300; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
oldtm = ut_clock();
rand = 10000;
for (i = 0; i < 3000; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
tm = ut_clock();
printf("Time for inserting sequentially %ld recs = %ld \n",
i, tm - oldtm);
/* it_print_tree(tree2, 10); */
tree3 = it_create_index_tree();
rand = 0;
for (i = 0; i < 300; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
oldtm = ut_clock();
rand = 100000;
for (i = 0; i < 3000; i++) {
rand = (rand - 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
tm = ut_clock();
printf("Time for inserting sequentially downw. %ld recs = %ld \n",
i, tm - oldtm);
/* it_print_tree(tree3, 10); */
#endif
}
#ifdef NOT_DEFINED
/* Test of quicksort */
void
test2(void)
{
mem_stream_t* stream;
byte* stbuf;
lgrf_field_t* logfield;
lint tm;
lint oldtm;
lint i, j, k, l, m;
lint rand;
lgr_record_t* numlogrec;
phr_record_t* ph_rec;
stream = mem_stream_create(1000);
numlogrec = lgr_create_logical_record(stream, 2);
oldtm = ut_clock();
rand = 11113;
for (i = 0; i < 50000; i++) {
stbuf = mem_stream_alloc(stream, 30);
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
ph_rec = phr_create_physical_record(stbuf, 30, numlogrec);
qs_table[i] = ph_rec;
}
tm = ut_clock();
printf("Time for inserting %ld recs to mem stream = %ld \n",
i, tm - oldtm);
oldtm = ut_clock();
q_sort(0, 50000);
tm = ut_clock();
printf("Time for quicksort of %ld recs = %ld, comps: %ld \n",
i, tm - oldtm, qs_comp);
for (i = 1; i < 49999; i++) {
ut_a(-1 ==
cmp_phr_compare(qs_table[i], qs_table[i+1]
));
}
tm = ut_clock();
oldtm = ut_clock();
for (i = 1; i < 50000; i++) {
k += cmp_phr_compare(qs_table[i & 0xF],
qs_table[5]);
}
tm = ut_clock();
printf("%ld\n", k);
printf("Time for cmp of %ld ph_recs = %ld \n",
i, tm - oldtm);
mem_stream_free(stream);
}
#endif
void
main(void)
{
test1();
/* test2(); */
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
include ..\..\makefile.i
doall: tsbuf
tsbuf: ..\buf.lib tsbuf.c
$(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsbuf.c $(LFL)
tsos: ..\buf.lib tsos.c
$(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\mach.lib ..\..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsos.c $(LFL)
This diff is collapsed.
/************************************************************************
The test module for the operating system interface
(c) 1995 Innobase Oy
Created 9/27/1995 Heikki Tuuri
*************************************************************************/
#include "../os0thread.h"
#include "../os0shm.h"
#include "../os0proc.h"
#include "../os0sync.h"
#include "../os0file.h"
#include "ut0ut.h"
#include "sync0sync.h"
#include "mem0mem.h"
ulint last_thr = 1;
byte global_buf[1000000];
os_file_t file;
os_file_t file2;
os_event_t gl_ready;
mutex_t ios_mutex;
ulint ios;
/************************************************************************
Io-handler thread function. */
ulint
handler_thread(
/*===========*/
void* arg)
{
ulint segment;
void* mess;
ulint i;
bool ret;
segment = *((ulint*)arg);
printf("Thread %lu starts\n", segment);
for (i = 0;; i++) {
ret = os_aio_wait(segment, &mess);
mutex_enter(&ios_mutex);
ios++;
mutex_exit(&ios_mutex);
ut_a(ret);
/* printf("Message for thread %lu %lu\n", segment,
(ulint)mess); */
if ((ulint)mess == 3333) {
os_event_set(gl_ready);
}
}
return(0);
}
/************************************************************************
Test of io-handler threads */
void
test4(void)
/*=======*/
{
ulint i;
bool ret;
void* buf;
ulint rnd;
ulint tm, oldtm;
os_thread_t thr[5];
os_thread_id_t id[5];
ulint n[5];
printf("-------------------------------------------\n");
printf("OS-TEST 4. Test of asynchronous file io\n");
/* Align the buffer for file io */
buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
gl_ready = os_event_create(NULL);
ios = 0;
sync_init();
mem_init();
mutex_create(&ios_mutex);
for (i = 0; i < 5; i++) {
n[i] = i;
thr[i] = os_thread_create(handler_thread, n + i, id + i);
}
rnd = 0;
oldtm = ut_clock();
for (i = 0; i < 4096; i++) {
ret = os_aio_read(file, (byte*)buf + 8192 * (rnd % 100),
8192 * (rnd % 4096), 0,
8192, (void*)i);
ut_a(ret);
rnd += 1;
}
ret = os_aio_read(file, buf, 8192 * (rnd % 1024), 0, 8192,
(void*)3333);
ut_a(ret);
ut_a(!os_aio_all_slots_free());
tm = ut_clock();
printf("All ios queued! N ios: %lu\n", ios);
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
os_event_wait(gl_ready);
tm = ut_clock();
printf("N ios: %lu\n", ios);
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
os_thread_sleep(2000000);
printf("N ios: %lu\n", ios);
ut_a(os_aio_all_slots_free());
}
/*************************************************************************
Initializes the asyncronous io system for tests. */
void
init_aio(void)
/*==========*/
{
bool ret;
void* buf;
buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
os_aio_init(160, 5);
file = os_file_create("j:\\tsfile4", OS_FILE_CREATE, OS_FILE_TABLESPACE,
&ret);
if (ret == FALSE) {
ut_a(os_file_get_last_error() == OS_FILE_ALREADY_EXISTS);
file = os_file_create("j:\\tsfile4", OS_FILE_OPEN,
OS_FILE_TABLESPACE, &ret);
ut_a(ret);
}
}
/************************************************************************
Main test function. */
void
main(void)
/*======*/
{
ulint tm, oldtm;
oldtm = ut_clock();
init_aio();
test4();
tm = ut_clock();
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
printf("TESTS COMPLETED SUCCESSFULLY!\n");
}
include ..\..\makefile.i
doall: tscom tscli
tscom: ..\com.lib tscom.c makefile
$(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscom.c $(LFL)
tscli: ..\com.lib tscli.c makefile
$(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscli.c $(LFL)
This diff is collapsed.
/************************************************************************
The test module for communication
(c) 1995 Innobase Oy
Created 9/26/1995 Heikki Tuuri
*************************************************************************/
#include "../com0com.h"
#include "../com0shm.h"
#include "ut0ut.h"
#include "mem0mem.h"
#include "os0thread.h"
#include "sync0ipm.h"
#include "sync0sync.h"
byte buf[10000];
char addr[150];
void
test1(void)
/*=======*/
{
com_endpoint_t* ep;
ulint ret;
ulint size;
ulint len;
ulint addr_len;
ulint i;
ep = com_endpoint_create(COM_SHM);
ut_a(ep);
size = 8192;
ret = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
(byte*)&size, 0);
ut_a(ret == 0);
ret = com_bind(ep, "SRV", 3);
ut_a(ret == 0);
printf("Server endpoint created!\n");
for (i = 0; i < 50000; i++) {
ret = com_recvfrom(ep, buf, 10000, &len, addr, 150, &addr_len);
ut_a(ret == 0);
buf[len] = '\0';
addr[addr_len] = '\0';
/*
printf(
"Message of len %lu\n%s \nreceived from address %s of len %lu\n",
len, buf, addr, addr_len);
*/
ret = com_sendto(ep, (byte*)"Hello from server!\n", 18, "CLI", 3);
ut_a(ret == 0);
}
ret = com_endpoint_free(ep);
ut_ad(ret == 0);
printf("Count of extra system calls in com_shm %lu\n",
com_shm_system_call_count);
printf("Count of extra system calls in ip_mutex %lu\n",
ip_mutex_system_call_count);
}
void
main(void)
/*======*/
{
ulint tm, oldtm;
sync_init();
mem_init();
oldtm = ut_clock();
test1();
ut_ad(mem_all_freed());
tm = ut_clock();
printf("Wall clock time for test %ld milliseconds\n", tm - oldtm);
printf("TESTS COMPLETED SUCCESSFULLY!\n");
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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