Changeset: 76cd8feacd2f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76cd8feacd2f
Modified Files:
monetdb5/mal/mal_instruction.c
sql/scripts/25_debug.sql
sql/test/malloc_fail/Tests/setmemorylimit.sql
Branch: default
Log Message:
Add debug routine to SQL scripts
diffs (39 lines):
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -1525,9 +1525,13 @@ pushInstruction(MalBlkPtr mb, InstrPtr p
GDKfree(mb->stmt);
mb->stmt = newblk;
}
- /* If the destination variable has not been set, introduce a
- * temporary variable to hold the result instead. */
- assert(p->argc == 0 || p->argv[0] >= 0);
+ /* A destination variable should be set */
+ if(p->argc > 0 && p->argv[0] < 0){
+ mb->errors++;
+ showException(GDKout, MAL, "pushInstruction", "Illegal
instruction (missing target variable)");
+ freeInstruction(p);
+ return;
+ }
if (mb->stmt[i]) {
/* if( getModuleId(mb->stmt[i] ) )
printf("Garbage collect statement %s.%s\n",
diff --git a/sql/scripts/25_debug.sql b/sql/scripts/25_debug.sql
--- a/sql/scripts/25_debug.sql
+++ b/sql/scripts/25_debug.sql
@@ -56,3 +56,7 @@ create procedure sys.flush_log ()
create function sys.debug(debug int) returns integer
external name mdb."setDebug";
+
+create procedure setmemorylimit(nbytes BIGINT)
+ external name "io"."setmemorylimit";
+
diff --git a/sql/test/malloc_fail/Tests/setmemorylimit.sql
b/sql/test/malloc_fail/Tests/setmemorylimit.sql
--- a/sql/test/malloc_fail/Tests/setmemorylimit.sql
+++ b/sql/test/malloc_fail/Tests/setmemorylimit.sql
@@ -1,4 +1,3 @@
-create procedure setmemorylimit(nbytes BIGINT) external name
"io"."setmemorylimit";
call setmemorylimit(100000000);
select name from tables where 1=0;
call setmemorylimit(-1);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list