Changeset: 5aa1d5812930 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5aa1d5812930
Modified Files:
MonetDB5/src/optimizer/opt_mitosis.mx
sql/src/test/sciql/Tests/errors.sql
Branch: sciql
Log Message:
A serious of error tests
diffs (107 lines):
diff -r c37f17766c6b -r 5aa1d5812930 MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx Mon Oct 25 16:36:12 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx Tue Oct 26 23:31:21 2010 +0200
@@ -576,6 +576,7 @@
#define DFLOWpending 0 /* runnable */
#define DFLOWrunning 1 /* currently in progress */
#define DFLOWwrapup 2 /* done! */
+#define DFLOWretry 3 /* reschedule */
typedef struct queue {
int size; /* size of queue */
@@ -1051,6 +1052,7 @@
mnstr_printf(GDKout,"#DFLOWrequeue
instr %d pool " LLFMT " claim "LLFMT"\n#", THRgettid(), memorypool,
argclaim+retclaim);
printInstruction(GDKstdout, mb, 0, pci,
LIST_MAL_STMT | LIST_MAPI);
}
+ /* actually should use DFLOWretry status */
throw(MAL,"DFLOWadmission","failed");
}
}
@@ -1346,6 +1348,12 @@
while(queued || todo != done){
PARDEBUG mnstr_printf(GDKstdout,"#waiting for results, queued
%d todo %d done %d\n", queued,todo,done);
f = q_dequeue(flow->done);
+ if ( f->status == DFLOWretry ){
+ /* reschedule the instruction */
+ f->status = DFLOWrunning;
+ q_requeue(flow->todo, f);
+ continue;
+ }
if ( f->flow->stk->wrapup ) /* clean up whatever is called for
*/
(*f->flow->stk->wrapup)(f->flow->cntxt, f->flow->mb,
f->flow->stk, getInstrPtr(flow->mb, abs(f->pc)));
f->status = DFLOWwrapup;
diff -r c37f17766c6b -r 5aa1d5812930 MonetDB5/src/optimizer/opt_tarantula.mx
--- a/MonetDB5/src/optimizer/opt_tarantula.mx Mon Oct 25 16:36:12 2010 +0200
+++ b/MonetDB5/src/optimizer/opt_tarantula.mx Tue Oct 26 23:31:21 2010 +0200
@@ -931,8 +931,14 @@
int otop[MAXSLICES], output[MAXSLICES][MAXSHARE];
InstrPtr *list;
int *needed;
- char *done;
+ char *done, *msg= MAL_SUCCEED;
+ /* merge table may leave some mat.new() dead code */
+ msg = OPTdeadcode(cntxt, mb, stk, 0);
+ if ( msg){
+ GDKfree(msg);
+ return 0;
+ }
if( cntxt == 0){
/* confuscate, delay for later activation */
TARinitcode(cntxt, mb);
@@ -963,6 +969,8 @@
level= (int*) GDKzalloc(VTOP * vtop * sizeof(int));
for (i = limit; i >=0 ; i--) {
p = old[i];
+ if ( p == 0)
+ continue;
if( getModuleId(p)== matRef && getFunctionId(p)== packRef)
lev=i;
if ( getModuleId(p) != sqlRef){
@@ -992,6 +1000,8 @@
for (i = 1; i < limit; i++) {
p = old[i];
+ if ( p == 0)
+ continue;
if ( p == pci){
freeInstruction(pci);
old[i]= 0;
diff -r c37f17766c6b -r 5aa1d5812930 sql/src/test/sciql/Tests/errors.sql
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/sciql/Tests/errors.sql Tue Oct 26 23:31:21 2010 +0200
@@ -0,0 +1,34 @@
+-- arrays should have at least one dimension
+create array err1( payload float);
+
+-- arrays need to have one non-dmension attribute
+create array err2( x integer dimension[1:10:1]);
+
+-- array dimension types should comply with attribute type
+create array err3( x char dimension[1:128:1], v float);
+create array err4( s varchar(25) dimension['a':'z':1], v float);
+create array err5( s varchar(25) dimension[1:3:1], v float);
+
+-- array dimensions may have undetermined step sizes
+
+create array10(x integer dimension[1:128:*], v float);
+
+-- default value expressions should be of the proper type
+
+create array15( x integer dimension[1:128:1],
+ v float default 'unknown');
+create array16( x integer dimension[1:128:1],
+ v float default v > 0);
+create array17( x integer dimension[1:128:1],
+ v float default true);
+
+drop array err1;
+drop array err2;
+drop array err3;
+drop array err4;
+drop array err5;
+drop array array10;
+drop array array15;
+drop array array16;
+drop array array17;
+
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list