Changeset: 8bc52cdc696f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8bc52cdc696f Removed Files: clients/examples/C/sample2.c clients/examples/C/sample3.c sql/test/mapi/Tests/sample2.SQL.bat sql/test/mapi/Tests/sample2.SQL.sh sql/test/mapi/Tests/sample2.stable.err sql/test/mapi/Tests/sample2.stable.out sql/test/mapi/Tests/sample3.SQL.bat sql/test/mapi/Tests/sample3.SQL.sh sql/test/mapi/Tests/sample3.stable.err sql/test/mapi/Tests/sample3.stable.out Modified Files: clients/Tests/exports.stable.out clients/mapilib/mapi.c clients/mapilib/mapi.h monetdb5/mal/mal_profiler.c monetdb5/modules/mal/pcre.c sql/server/sql_scan.c sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade/Tests/upgrade.stable.out sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128 sql/test/pg_regress/Tests/comments.stable.err sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out sql/test/testdb-upgrade/Tests/upgrade.stable.out sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128 Branch: protocol Log Message:
Merge again. diffs (truncated from 386 to 300 lines): diff --git a/clients/examples/C/sample2.c b/clients/examples/C/sample2.c deleted file mode 100644 --- a/clients/examples/C/sample2.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <mapi.h> - -#define die(dbh,hdl) do { \ - if (hdl) \ - mapi_explain_result(hdl,stderr); \ - else if (dbh) \ - mapi_explain(dbh,stderr); \ - else \ - fprintf(stderr,"command failed\n"); \ - exit(-1); \ - } while (0) - -int -main(int argc, char **argv) -{ - /* a parameter binding test */ - char *nme = 0; - int age = 0; - char *parm[] = { "peter", 0 }; - char *parm2[] = { "25", 0 }; - char *parm3[] = { "peter", "25", 0 }; - Mapi dbh= NULL; - MapiHdl hdl = NULL; - - if (argc != 4) { - printf("usage:%s <host> <port> <language>\n", argv[0]); - exit(-1); - } - - dbh = mapi_connect(argv[1], atoi(argv[2]), "monetdb", "monetdb", argv[3], NULL); - if (dbh == NULL || mapi_error(dbh)) - die(dbh, hdl); - - /* mapi_trace(dbh,1); */ - if (strcmp(argv[3], "sql") == 0) { - /* switch of autocommit */ - if (mapi_setAutocommit(dbh, 0) != MOK || mapi_error(dbh)) - die(dbh,NULL); - if ((hdl = mapi_query(dbh, "create table emp(name varchar(20), age int)")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query_array(dbh, "insert into emp values('?', ?)", parm3)) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_bind(hdl, 0, &nme)) - die(dbh, hdl); - if (mapi_bind_var(hdl, 1, MAPI_INT, &age)) - die(dbh, hdl); - while (mapi_fetch_row(hdl)) { - printf("%s is %d\n", nme, age); - } - } else if (strcmp(argv[3], "mal") == 0) { - if ((hdl = mapi_query(dbh, "emp := bat.new(:oid,:str);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "age := bat.new(:oid,:int);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query_array(dbh, "bat.append(emp,\"?\");", parm)) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if ((hdl = mapi_query_array(dbh, "bat.append(age,?);", parm2)) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "io.print(emp,age);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_bind(hdl, 1, &nme)) - die(dbh, hdl); - if (mapi_bind_var(hdl, 2, MAPI_INT, &age)) - die(dbh, hdl); - while (mapi_fetch_row(hdl)) { - printf("%s is %d\n", nme, age); - } - } else { - fprintf(stderr, "%s: unknown language, only mal and sql supported\n", argv[0]); - exit(1); - } - - if (mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - mapi_destroy(dbh); - - return 0; -} diff --git a/clients/examples/C/sample3.c b/clients/examples/C/sample3.c deleted file mode 100644 --- a/clients/examples/C/sample3.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <mapi.h> -#ifdef _MSC_VER -#define LLFMT "%I64d" -#else -#define LLFMT "%lld" -#endif - -#define die(dbh,hdl) do { \ - if (hdl) \ - mapi_explain_result(hdl,stderr); \ - else if (dbh) \ - mapi_explain(dbh,stderr); \ - else \ - fprintf(stderr,"command failed\n"); \ - exit(-1); \ - } while (0) - -int -main(int argc, char **argv) -{ - Mapi dbh; - MapiHdl hdl = NULL; - mapi_int64 rows, i; - char *parm[] = { "peter", 0 }; - char *parm2[] = { "25", 0 }; - int j; - - if (argc != 4) { - printf("usage:%s <host> <port> <language>\n", argv[0]); - exit(-1); - } - - dbh = mapi_connect(argv[1], atoi(argv[2]), "monetdb", "monetdb", argv[3], NULL); - if (dbh == NULL || mapi_error(dbh)) - die(dbh, hdl); - - /* mapi_trace(dbh, 1); */ - if (strcmp(argv[3], "sql") == 0) { - /* switch of autocommit */ - if (mapi_setAutocommit(dbh, 0) != MOK || mapi_error(dbh)) - die(dbh,NULL); - if ((hdl = mapi_query(dbh, "create table emp(name varchar(20), age int)")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "insert into emp values('John', 23)")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "insert into emp values('Mary', 22)")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - } else if (strcmp(argv[3], "mal") == 0) { - if ((hdl = mapi_query(dbh, "emp := bat.new(:oid,:str);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "age := bat.new(:oid,:int);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query_array(dbh, "bat.append(emp,\"?\");", parm)) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if ((hdl = mapi_query_array(dbh, "bat.append(age,?);", parm2)) == NULL || mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - if ((hdl = mapi_query(dbh, "io.print(emp,age);")) == NULL || mapi_error(dbh)) - die(dbh, hdl); - } else { - fprintf(stderr, "%s: unknown language, only mal and sql supported\n", argv[0]); - exit(1); - } - - /* Retrieve all tuples in the client cache first */ - rows = mapi_fetch_all_rows(hdl); - if (mapi_error(dbh)) - die(dbh, hdl); - printf("rows received " LLFMT " with %d fields\n", rows, mapi_get_field_count(hdl)); - - /* Interpret the cache as a two-dimensional array */ - for (i = 0; i < rows; i++) { - if (mapi_seek_row(hdl, i, MAPI_SEEK_SET) || mapi_fetch_row(hdl) == 0) - break; - for (j = 0; j < mapi_get_field_count(hdl); j++) { - printf("%s=%s ", mapi_get_name(hdl, j), mapi_fetch_field(hdl, j)); - } - printf("\n"); - } - if (mapi_error(dbh)) - die(dbh, hdl); - if (mapi_close_handle(hdl) != MOK) - die(dbh, hdl); - mapi_destroy(dbh); - - return 0; -} diff --git a/sql/test/mapi/Tests/sample2.SQL.bat b/sql/test/mapi/Tests/sample2.SQL.bat deleted file mode 100755 --- a/sql/test/mapi/Tests/sample2.SQL.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -prompt # $t $g -echo on - -sample2.exe %HOST% %MAPIPORT% sql diff --git a/sql/test/mapi/Tests/sample2.SQL.sh b/sql/test/mapi/Tests/sample2.SQL.sh deleted file mode 100755 --- a/sql/test/mapi/Tests/sample2.SQL.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -Mlog -x "sample2 $HOST $MAPIPORT sql" diff --git a/sql/test/mapi/Tests/sample2.stable.err b/sql/test/mapi/Tests/sample2.stable.err deleted file mode 100644 --- a/sql/test/mapi/Tests/sample2.stable.err +++ /dev/null @@ -1,22 +0,0 @@ -stderr of test 'sample2` in directory 'sql/test/mapi` itself: - - -# 22:25:11 > -# 22:25:11 > Mtimeout -timeout 180 Mserver "--config=/var/tmp/_PREFIX_MONET_GNU_32_d__/etc/monet.conf" --debug=10 --set "monet_mod_path=/var/tmp/_PREFIX_MONET_GNU_32_d__/lib/MonetDB" --set "gdk_dbfarm=/var/tmp/_PREFIX_MONET_GNU_32_d__/var/MonetDB/dbfarm" --set "sql_logdir=/var/tmp/_PREFIX_MONET_GNU_32_d__/var/MonetDB/log" --set mapi_port=42910 --set sql_port=52446 --set monet_prompt= --trace "--dbname=mTests_src_mapi_examples_C" "/var/tmp/_PREFIX_MONET_GNU_32_d__/lib/MonetDB/mapi.mil" ; echo ; echo Over.. -# 22:25:11 > - - -# 22:25:12 > -# 22:25:12 > Mtimeout -timeout 60 ./sample2.MAPI sample2 -# 22:25:12 > - - -# 22:25:12 > -# 22:25:12 > Mtimeout -timeout 60 Mshutdown.py "--config=/var/tmp/_PREFIX_MONET_GNU_32_d__/etc/monet.conf" --host=draco --port=42910 -# 22:25:12 > - - -# 22:25:13 > -# 22:25:13 > Done. -# 22:25:13 > - diff --git a/sql/test/mapi/Tests/sample2.stable.out b/sql/test/mapi/Tests/sample2.stable.out deleted file mode 100644 --- a/sql/test/mapi/Tests/sample2.stable.out +++ /dev/null @@ -1,31 +0,0 @@ -stdout of test 'sample2` in directory 'sql/test/mapi` itself: - - -# 21:24:02 > -# 21:24:02 > Mtimeout -timeout 180 Mserver "--config=/net/pictor.ins.cwi.nl/export/scratch1/fabian/monet-current/program/etc/MonetDB.conf" --debug=10 --set "monet_mod_path=/net/pictor.ins.cwi.nl/export/scratch1/fabian/monet-current/program/lib/MonetDB" --set "gdk_dbfarm=/net/pictor.ins.cwi.nl/export/scratch1/fabian/monet-current/program/var/MonetDB/dbfarm" --set "sql_logdir=/net/pictor.ins.cwi.nl/export/scratch1/fabian/monet-current/program/var/MonetDB/log" --set mapi_port=43642 --set sql_port=55700 --set monet_prompt= --trace "--dbname=mTests_src_backends_monet4" "/net/pictor.ins.cwi.nl/export/scratch1/fabian/monet-current/sql/build/src/test/mapi/sql_server.mil" ; echo ; echo Over.. -# 21:24:02 > - -# Monet Database Server V4.5.0 -# Copyright (c) 1993-2004, CWI. All rights reserved. -# Compiled for i686-redhat-linux-gnu/32bit; dynamically linked. -# Visit http://monetdb.cwi.nl/ for further information. - - -Ready. - - -# 21:24:03 > -# 21:24:03 > Mtimeout -timeout 60 ./sample2.SQL sample2 -# 21:24:03 > - - -# 21:24:03 > -# 21:24:03 > sample2 pictor 55700 sql -# 21:24:03 > - -peter is 25 - -# 21:24:03 > -# 21:24:03 > Done. _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list