Changeset: c8be2f14a831 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8be2f14a831
Modified Files:
monetdb5/extras/jaql/parser/jaql.l
testing/Mtest.py.in
Branch: default
Log Message:
Merge with Feb2013 branch.
diffs (155 lines):
diff --git a/monetdb5/extras/jaql/parser/jaql.l
b/monetdb5/extras/jaql/parser/jaql.l
--- a/monetdb5/extras/jaql/parser/jaql.l
+++ b/monetdb5/extras/jaql/parser/jaql.l
@@ -64,7 +64,7 @@ extern void jaqlerror(jc* j, char const
/* set line numbers each time a token is recognised */
#define YY_USER_ACTION yyextra->tokstart = yytext;
-#define YY_INPUT(buf, res, max_size) readinput(yyextra, buf, &res, max_size)
+#define YY_INPUT(buf, res, max_size) res = readinput(yyextra, buf, res,
max_size)
#define YY_NO_INPUT
/* ugly as hell, but needed to prevent flex from assigning stdin to yyin */
@@ -77,14 +77,14 @@ extern void jaqlerror(jc* j, char const
#endif
#define stdout (FILE *)0
-static void readinput(jc *j, char *buf, int *res, size_t max_size) {
+static size_t readinput(jc *j, char *buf, size_t res, size_t max_size) {
if (j->buf != NULL && j->buf[j->pos] != '\0') {
- *res = (int)strlen(j->buf + j->pos); /* FIXME: cache this */
- if ((size_t)*res > max_size)
- *res = (int)max_size;
- memcpy(buf, j->buf + j->pos, *res);
+ res = (int)strlen(j->buf + j->pos); /* FIXME: cache this */
+ if (res > max_size)
+ res = max_size;
+ memcpy(buf, j->buf + j->pos, res);
j->start = j->pos;
- j->pos += *res;
+ j->pos += res;
j->scanbuf = buf;
} else {
if (j->expect_json != ';' && j->scanstreamin != NULL) {
@@ -94,8 +94,8 @@ static void readinput(jc *j, char *buf,
if (bstream_next(bs) < 0) {
/* read failed, force shutdown next iteration */
j->scanstreameof = 1;
- *res = YY_NULL;
- return;
+ res = YY_NULL;
+ return res;
}
/* request more if we appear to be at the end of current
@@ -109,20 +109,21 @@ static void readinput(jc *j, char *buf,
if (bstream_next(bs) < 0) {
/* read failed, force shutdown next
iteration */
j->scanstreameof = 1;
- *res = YY_NULL;
- return;
+ res = YY_NULL;
+ return res;
}
}
/* did we get some query text */
if (bs->eof == 0) {
j->buf = bs->buf;
- readinput(j, buf, res, max_size);
- return;
+ res = readinput(j, buf, res, max_size);
+ return res;
}
}
- *res = YY_NULL;
+ res = YY_NULL;
}
+ return res;
}
%}
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1492,12 +1492,12 @@ def returnCode(proc, f = None):
return None # no error
def GetBitsAndOIDsAndModsAndStaticAndThreads(env) :
+ global setpgrp
rtrn = 0
cmd = splitcommand(env['exe']['Mserver'][1])
cmd.append('--dbpath=%s' % os.path.join(env['GDK_DBFARM'], TSTPREF))
if procdebug:
print 'GetBitsAndOIDsAndModsAndStaticAndThreads: starting process "%s"
(inpipe, outpipe, errpipe)\n' % '" "'.join(cmd)
- global setpgrp
setpgrp = True
proc = process.Popen(cmd, stdin = process.PIPE, stdout = process.PIPE,
stderr = process.PIPE, universal_newlines = True)
@@ -1694,6 +1694,7 @@ def CategorizeResult(TST, SockTime):
return o, e
def RunTest(env, TST, BusyPorts, COND, oktests, length) :
+ global setpgrp
Failed = F_SKIP
FailedOut = F_SKIP
FailedErr = F_SKIP
@@ -2199,7 +2200,6 @@ def RunTest(env, TST, BusyPorts, COND, o
'%s.out.diff.html' % TST])
if procdebug:
print 'RunTest: starting process "%s"\n' % '" "'.join(cmd)
- global setpgrp
setpgrp = True
proc = process.Popen(cmd, stdout = process.PIPE,
stderr = process.PIPE)
@@ -2271,7 +2271,6 @@ def RunTest(env, TST, BusyPorts, COND, o
'%s.err.diff.html' % TST])
if procdebug:
print 'RunTest: starting process "%s"\n' % '" "'.join(cmd)
- global setpgrp
setpgrp = True
proc = process.Popen(cmd, stdout = process.PIPE,
stderr = process.PIPE)
@@ -2534,6 +2533,7 @@ def killProc(proc, outfile = None, cmd =
pass
def LaunchIt(cmd, TestInput, TestOut, TestErr, TimeOut, SrvrOut = None) :
+ global setpgrp
if not SrvrOut:
SrvrOut = process.PIPE
@@ -2544,7 +2544,6 @@ def LaunchIt(cmd, TestInput, TestOut, Te
if procdebug:
print 'LaunchIt: starting process "%s" (inpipe)\n' % '" "'.join(cmd)
- global setpgrp
setpgrp = True
proc = process.Popen(cmd, stdin = process.PIPE, stdout = SrvrOut,
stderr = TestErr, universal_newlines = True)
@@ -2577,6 +2576,7 @@ def CollectIt(pOut, TestOut) :
### CollectIt(pOut, pErr, TestOut, TestErr) #
def RunIt(cmd, TestIn, TestOut, TestErr, TimeOut) :
+ global setpgrp
if type(TestIn) is type(''):
TestInput = TestIn
TestIn = process.PIPE
@@ -2588,7 +2588,6 @@ def RunIt(cmd, TestIn, TestOut, TestErr,
TestErr.flush()
if procdebug:
print 'RunIt: starting process "%s"\n' % '" "'.join(cmd)
- global setpgrp
setpgrp = True
proc = process.Popen(cmd, stdin = TestIn, stdout = TestOut, stderr =
TestErr, universal_newlines = True)
proc.killed = False
@@ -2965,9 +2964,9 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
### DoIt(env, SERVER, CALL, TST, EXT, PRELUDE, TestOut, TestErr, STIMEOUT,
CTIMEOUT, TIMEOUT, ME, MAPIsockets) #
def Check(command, input) :
+ global setpgrp
if procdebug:
print 'Check: starting process "%s" (inpipe,outpipe,errpipe)\n' % '"
"'.join(command)
- global setpgrp
setpgrp = True
proc = process.Popen(command, stdin = process.PIPE, stdout = process.PIPE,
stderr = process.PIPE, universal_newlines = True)
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list