Changeset: db475176f076 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db475176f076 Modified Files: clients/mapilib/tests/generate.sh clients/mapilib/tests/mapi_structs.h clients/mapilib/tests/mapi_structs.py clients/mapilib/tests/runtests.py clients/mapilib/tests/test_mapi.py Branch: default Log Message:
Merge with Aug2011 branch. diffs (truncated from 2823 to 300 lines): diff --git a/clients/mapilib/tests/generate.sh b/clients/mapilib/tests/generate.sh deleted file mode 100755 --- a/clients/mapilib/tests/generate.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# this script will convert the structs in the header files to python code, so we -# can use them with ctypes. -# -# needs: -# * gccxml cvs checkout (0.9) - http://www.gccxml.org -# $ cvs -d :pserver:[email protected]:/cvsroot/GCC_XML login -# $ cvs -d :pserver:[email protected]:/cvsroot/GCC_XML co gccxml -# $ mkdir gccxml-build && cd gccxml-build -# $ cmake ../gccxml -# $ make -# # make install -# -# * ctypeslib 0.9 branch -# $ svn co http://svn.python.org/projects/ctypes/branches/ctypeslib-gccxml-0.9/ -# $ cd ctypeslib-gccxml-0.9 -# # python setup.py install - -h2xml.py mapi_structs.h -I. -I../../.. -I.. \ - -I/opt/monetdb/current/include/MonetDB \ - -I/opt/monetdb/current/include/MonetDB/common -o mapi_structs.xml || exit 1 -xml2py.py mapi_structs.xml > mapi_structs.py || exit 1 - - -# We need the MapiStruct struct definition, otherwise we could use this: -#h2xml.py ../Mapi.h -I. -I../../.. -I.. -I/opt/monetdb/current/include/MonetDB \ -# -I/opt/monetdb/current/include/MonetDB/common -o Mapi.xml || exit 1 -#xml2py.py Mapi.xml > Mapi.py || exit 1 diff --git a/clients/mapilib/tests/mapi_structs.h b/clients/mapilib/tests/mapi_structs.h deleted file mode 100644 --- a/clients/mapilib/tests/mapi_structs.h +++ /dev/null @@ -1,132 +0,0 @@ - - -/* this file contains all the structs from Mapi.c */ - -#define HAVE_LONG_LONG -#define HAVE___INT64 - -#include <mapi.h> -#include <stream.h> - - -/* information about the columns in a result set */ -struct MapiColumn { - char *tablename; - char *columnname; - char *columntype; - int columnlength; -}; - -/* information about bound columns */ -struct MapiBinding { - void *outparam; /* pointer to application variable */ - int outtype; /* type of application variable */ - int precision; - int scale; -}; - -/* information about statement parameters */ -struct MapiParam { - void *inparam; /* pointer to application variable */ - int *sizeptr; /* if string, points to length of string or -1 */ - int intype; /* type of application variable */ - int outtype; /* type of value */ - int precision; - int scale; -}; - -struct MapiRowBuf { - int rowlimit; /* maximum number of rows to cache */ - int shuffle; /* percentage of rows to shuffle upon overflow */ - int limit; /* current storage space limit */ - int writer; - int reader; - mapi_int64 first; /* row # of first tuple */ - mapi_int64 tuplecount; /* number of tuples in the cache */ - struct { - int fldcnt; /* actual number of fields in each row */ - char *rows; /* string representation of rows received */ - int tupleindex; /* index of tuple rows */ - mapi_int64 tuplerev; /* reverse map of tupleindex */ - char **anchors; /* corresponding field pointers */ - } *line; -}; - -struct BlockCache { - char *buf; - int lim; - int nxt; - int end; - int eos; /* end of sequence */ -}; - -/* A connection to a server is represented by a struct MapiStruct. An - application can have any number of connections to any number of - servers. Connections are completely independent of each other. -*/ -struct MapiStruct { - char *server; /* server version */ - char *mapiversion; /* mapi version */ - char *hostname; - int port; - char *username; - char *password; - char *language; - char *database; /* to obtain from server */ - int languageId; - int versionId; /* Monet 4 or 5 */ - char *motd; /* welcome message from server */ - - int profile; /* profile Mapi interaction */ - int trace; /* Trace Mapi interaction */ - int auto_commit; - char *noexplain; /* on error, don't explain, only print result */ - MapiMsg error; /* Error occurred */ - char *errorstr; /* error from server */ - const char *action; /* pointer to constant string */ - - struct BlockCache blk; - int connected; - MapiHdl first; /* start of doubly-linked list */ - MapiHdl active; /* set when not all rows have been received */ - - int cachelimit; /* default maximum number of rows to cache */ - int redircnt; /* redirection count, used to cut of redirect loops */ - int redirmax; /* maximum redirects before giving up */ - char *redirects[50];/* NULL-terminated list of redirects */ - - stream *tracelog; /* keep a log for inspection */ - stream *from, *to; - int index; /* to mark the log records */ -}; - -struct MapiResultSet { - struct MapiResultSet *next; - struct MapiStatement *hdl; - int tableid; /* SQL id of current result set */ - int querytype; /* type of SQL query */ - mapi_int64 row_count; - mapi_int64 last_id; - int fieldcnt; - int maxfields; - char *errorstr; /* error from server */ - struct MapiColumn *fields; - struct MapiRowBuf cache; -}; - -struct MapiStatement { - struct MapiStruct *mid; - char *template_; /* ATTENTION: template is a reserved word in C++, so renamed it to template_ */ - char *query; - int maxbindings; - struct MapiBinding *bindings; - int maxparams; - struct MapiParam *params; - struct MapiResultSet *result, *active, *lastresult; - int needmore; /* need more input */ - int *pending_close; - int npending_close; - MapiHdl prev, next; -}; - - diff --git a/clients/mapilib/tests/mapi_structs.py b/clients/mapilib/tests/mapi_structs.py deleted file mode 100644 --- a/clients/mapilib/tests/mapi_structs.py +++ /dev/null @@ -1,1464 +0,0 @@ -from ctypes import * - -STRING = c_char_p - - -_SC_THREAD_PRIO_PROTECT = 81 -_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115 -_SC_CLK_TCK = 2 -_CS_XBS5_ILP32_OFF32_CFLAGS = 1100 -SI_USER = 0 -REG_RSP = 15 -_SC_2_UPE = 97 -_PC_MAX_CANON = 1 -SI_ASYNCNL = -60 -_SC_REGEX_VERSION = 156 -_PC_LINK_MAX = 0 -_PC_ALLOC_SIZE_MIN = 18 -SS_ONSTACK = 1 -ILL_COPROC = 7 -_SC_TIMER_MAX = 35 -_SC_SYMLOOP_MAX = 173 -_SC_AVPHYS_PAGES = 86 -_SC_XOPEN_REALTIME_THREADS = 131 -CLD_TRAPPED = 4 -_SC_2_LOCALEDEF = 52 -_SC_FILE_SYSTEM = 148 -_SC_RE_DUP_MAX = 44 -_SC_THREAD_PRIO_INHERIT = 80 -_SC_THREAD_SAFE_FUNCTIONS = 68 -_CS_XBS5_ILP32_OFF32_LIBS = 1102 -_ISdigit = 2048 -_SC_THREAD_PRIORITY_SCHEDULING = 79 -_SC_PHYS_PAGES = 85 -_SC_THREAD_ATTR_STACKSIZE = 78 -_SC_TZNAME_MAX = 6 -MNSTR_NO__ERROR = 0 -REG_ERR = 19 -_SC_CHAR_BIT = 101 -_PC_PIPE_BUF = 5 -_SC_AIO_LISTIO_MAX = 23 -_SC_SPORADIC_SERVER = 160 -_SC_USHRT_MAX = 118 -_SC_BC_STRING_MAX = 39 -_SC_TIMEOUTS = 164 -_SC_V6_ILP32_OFF32 = 176 -SEGV_MAPERR = 1 -_SC_C_LANG_SUPPORT = 135 -POLL_OUT = 2 -_SC_PII_INTERNET = 56 -_SC_LEVEL2_CACHE_LINESIZE = 193 -_ISupper = 256 -_SC_SINGLE_PROCESS = 151 -_SC_TTY_NAME_MAX = 72 -_SC_NL_NMAX = 122 -_ISgraph = 32768 -FPE_FLTUND = 5 -REG_R14 = 6 -_SC_PASS_MAX = 88 -Q_BLOCK = 6 -_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 -_SC_PRIORITY_SCHEDULING = 10 -_SC_INT_MIN = 105 -_PC_SYNC_IO = 9 -_SC_DELAYTIMER_MAX = 26 -Q_PARSE = 0 -SIGEV_THREAD_ID = 4 -_SC_LINE_MAX = 43 -_SC_HOST_NAME_MAX = 180 -_SC_ARG_MAX = 0 -POLL_HUP = 6 -_SC_UIO_MAXIOV = 60 -_CS_LFS_LDFLAGS = 1001 -_SC_LEVEL4_CACHE_SIZE = 197 -_SC_REGEXP = 155 -_CS_XBS5_LP64_OFF64_LIBS = 1110 -_ISalnum = 8 -_SC_PII_OSI_COTS = 63 -_SC_XOPEN_CRYPT = 92 -_CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 -_SC_NZERO = 109 -POLL_ERR = 4 -_PC_FILESIZEBITS = 13 -ILL_ILLOPN = 2 -_SC_PAGESIZE = 30 -_SC_2_PBS = 168 -_SC_XBS5_ILP32_OFFBIG = 126 -TRAP_TRACE = 2 -_SC_2_C_BIND = 47 -Q_TRANS = 4 -_CS_LFS64_LDFLAGS = 1005 -SS_DISABLE = 2 -_SC_CHILD_MAX = 1 -_ISspace = 8192 -REG_RCX = 14 -_SC_2_C_VERSION = 96 -_SC_THREAD_THREADS_MAX = 76 -_SC_MEMLOCK_RANGE = 18 -CLD_DUMPED = 3 -_SC_SHRT_MAX = 113 -_PC_REC_XFER_ALIGN = 17 -ILL_PRVREG = 6 -_SC_SIGQUEUE_MAX = 34 -_SC_2_PBS_TRACK = 172 -CLD_EXITED = 1 -_SC_XOPEN_REALTIME = 130 -_SC_2_SW_DEV = 51 -REG_R12 = 4 -ILL_BADSTK = 8 -_SC_FILE_LOCKING = 147 -_SC_THREADS = 67 -_CS_XBS5_ILP32_OFF32_LDFLAGS = 1101 -REG_R9 = 1 -_SC_NPROCESSORS_ONLN = 84 -_CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 -_SC_STREAM_MAX = 5 -REG_CSGSFS = 18 -_SC_XOPEN_XPG4 = 100 -_PC_PATH_MAX = 4 -SI_SIGIO = -5 -_SC_FD_MGMT = 143 -_SC_SHARED_MEMORY_OBJECTS = 22 -_SC_SPAWN = 159 -_SC_2_VERSION = 46 -_SC_BC_SCALE_MAX = 38 _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
