MonetDB: mosaic - Add some new style tests for delta compression.

2019-09-11 Thread Aris Koning
Changeset: 94c308c8571b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=94c308c8571b
Added Files:
monetdb5/modules/mosaic/Tests/mosaic_delta_date.malC
monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.err
monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.out
monetdb5/modules/mosaic/Tests/mosaic_delta_lng.malC
monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.err
monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.out
monetdb5/modules/mosaic/Tests/mosaic_delta_oid.malC
monetdb5/modules/mosaic/Tests/mosaic_delta_oid.stable.err
monetdb5/modules/mosaic/Tests/mosaic_delta_oid.stable.out
monetdb5/modules/mosaic/Tests/mosaic_delta_timestamp.malC
monetdb5/modules/mosaic/Tests/mosaic_delta_timestamp.stable.err
monetdb5/modules/mosaic/Tests/mosaic_delta_timestamp.stable.out
Removed Files:
monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.malC
monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.err
monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.out
Modified Files:
monetdb5/modules/mosaic/Tests/All
Branch: mosaic
Log Message:

Add some new style tests for delta compression.


diffs (154 lines):

diff --git a/monetdb5/modules/mosaic/Tests/All 
b/monetdb5/modules/mosaic/Tests/All
--- a/monetdb5/modules/mosaic/Tests/All
+++ b/monetdb5/modules/mosaic/Tests/All
@@ -35,5 +35,9 @@ mosaic_frame_oid
 mosaic_frame_date
 mosaic_frame_timestamp
 
-mosaic_delta_lng_tmp
+mosaic_delta_oid
+mosaic_delta_lng
+mosaic_delta_date
+mosaic_delta_timestamp
+
 mosaic_linear_lng_tmp
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.malC 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.malC
copy from monetdb5/modules/mosaic/Tests/mosaic_frame_date.malC
copy to monetdb5/modules/mosaic/Tests/mosaic_delta_date.malC
--- a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.malC
+++ b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.malC
@@ -29,7 +29,7 @@ bat.append(a,"2014-09-20":date);
 bat.append(a,"2014-09-25":date);
 bat.append(a,"2014-10-05":date);
 bat.append(a,"2014-10-02":date);
-mosaic.compress(a,"frame");
+mosaic.compress(a,"delta");
 c:= mosaic.decompress(a);
 eq  := batcalc.==(a,  c);
 io.print(a, c, eq);
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.err 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.err
copy from monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.err
copy to monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.err
--- a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.err
+++ b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'mosaic_frame_date` in directory 'monetdb5/modules/mosaic` 
itself:
+stderr of test 'mosaic_delta_date` in directory 'monetdb5/modules/mosaic` 
itself:
 
 
 # 17:20:28 >  
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.out
copy from monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.out
copy to monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_frame_date.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_delta_date.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'mosaic_frame_date` in directory 'monetdb5/modules/mosaic` 
itself:
+stdout of test 'mosaic_delta_date` in directory 'monetdb5/modules/mosaic` 
itself:
 
 
 # 17:20:28 >  
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.malC 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_lng.malC
rename from monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.malC
rename to monetdb5/modules/mosaic/Tests/mosaic_delta_lng.malC
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.err 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.err
rename from monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.err
rename to monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.err
--- a/monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.err
+++ b/monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'mosaic_delta_lng_tmp` in directory 'monetdb5/modules/mosaic` 
itself:
+stderr of test 'mosaic_delta_lng` in directory 'monetdb5/modules/mosaic` 
itself:
 
 
 # 13:19:01 >  
diff --git a/monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.out 
b/monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.out
rename from monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.out
rename to monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.out
--- a/monetdb5/modules/mosaic/Tests/mosaic_delta_lng_tmp.stable.out
+++ b/monetdb5/modules/mosaic/Tests/mosaic_delta_lng.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'mosaic_delta_lng_tmp` in directory 'monetdb5/modules/mosaic` 
itself:
+stdout of test 'mosaic_delta_lng` in directory 'monetdb5/modules/mosaic` 
itself:
 
 
 # 13:19:01 >  

MonetDB: mosaic - Simplify logic:

2019-09-11 Thread Aris Koning
Changeset: e7a9ecdef821 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e7a9ecdef821
Modified Files:
monetdb5/modules/mosaic/mosaic_frame.c
Branch: mosaic
Log Message:

Simplify logic:
time-like type behave like primitive integer types.


diffs (166 lines):

diff --git a/monetdb5/modules/mosaic/mosaic_frame.c 
b/monetdb5/modules/mosaic/mosaic_frame.c
--- a/monetdb5/modules/mosaic/mosaic_frame.c
+++ b/monetdb5/modules/mosaic/mosaic_frame.c
@@ -36,11 +36,10 @@ bool MOStypes_frame(BAT* b) {
 #ifdef HAVE_HGE
case TYPE_hge: return true;
 #endif
-   default: {
-   if (b->ttype == TYPE_date) {return true;}
-   if (b->ttype == TYPE_daytime) {return true;}
-   if (b->ttype == TYPE_timestamp) {return true;}
-   }
+   default:
+   if (b->ttype == TYPE_date) {return true;} // Will be mapped to 
int
+   if (b->ttype == TYPE_daytime) {return true;} // Will be mapped 
to lng
+   if (b->ttype == TYPE_timestamp) {return true;} // Will be 
mapped to lng
}
 
return false;
@@ -203,7 +202,7 @@ do {\
 flt
 MOSestimate_frame(MOStask task) {
 
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_bte: estimateFrame(task, bte, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
case TYPE_sht: estimateFrame(task, sht, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
case TYPE_int: estimateFrame(task, int, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
@@ -212,11 +211,6 @@ MOSestimate_frame(MOStask task) {
 #ifdef HAVE_HGE
case TYPE_hge: estimateFrame(task, hge, uhge, 
GET_DELTA_FOR_SIGNED_TYPE); break;
 #endif
-   default: {
-   if (task->type == TYPE_date) {estimateFrame(task, int, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;}
-   if (task->type == TYPE_daytime) {estimateFrame(task, lng, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;}
-   if (task->type == TYPE_timestamp) {estimateFrame(task, lng, 
ulng, GET_DELTA_FOR_SIGNED_TYPE); break;}
-   }
}
 
return task->factor[MOSAIC_FRAME];
@@ -249,7 +243,7 @@ MOScompress_frame(MOStask task)
MOSsetTag(blk,MOSAIC_FRAME);
MOSsetCnt(blk, 0);
 
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_bte: FRAMEcompress(task, bte, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
case TYPE_sht: FRAMEcompress(task, sht, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
case TYPE_int: FRAMEcompress(task, int, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;
@@ -258,11 +252,6 @@ MOScompress_frame(MOStask task)
 #ifdef HAVE_HGE
case TYPE_hge: FRAMEcompress(task, hge, uhge, 
GET_DELTA_FOR_SIGNED_TYPE); break;
 #endif
-   default: {
-   if (task->type == TYPE_date) {FRAMEcompress(task, int, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;}
-   if (task->type == TYPE_daytime) {FRAMEcompress(task, lng, ulng, 
GET_DELTA_FOR_SIGNED_TYPE); break;}
-   if (task->type == TYPE_timestamp) {FRAMEcompress(task, lng, 
ulng, GET_DELTA_FOR_SIGNED_TYPE); break;}
-   }
}
 }
 
@@ -288,7 +277,7 @@ do {\
 void
 MOSdecompress_frame(MOStask task)
 {
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_bte: FRAMEdecompress(task, bte); break;
case TYPE_sht: FRAMEdecompress(task, sht); break;
case TYPE_int: FRAMEdecompress(task, int); break;
@@ -297,11 +286,6 @@ MOSdecompress_frame(MOStask task)
 #ifdef HAVE_HGE
case TYPE_hge: FRAMEdecompress(task, hge); break;
 #endif
-   default: {
-   if (task->type == TYPE_date) {FRAMEdecompress(task, int); 
break;}
-   if (task->type == TYPE_daytime) {FRAMEdecompress(task, lng); 
break;}
-   if (task->type == TYPE_timestamp) {FRAMEdecompress(task, lng); 
break;}
-   }
}
 }
 
@@ -421,7 +405,7 @@ MOSselect_frame( MOStask task, void *low
}
o = task->lb;
 
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_bte: select_frame(task, bte, ulng); break;
case TYPE_sht: select_frame(task, sht, ulng); break;
case TYPE_int: select_frame(task, int, ulng); break;
@@ -430,11 +414,6 @@ MOSselect_frame( MOStask task, void *low
 #ifdef HAVE_HGE
case TYPE_hge: select_frame(task, hge, uhge); break;
 #endif
-   default: {
-   if (task->type == TYPE_date) {select_frame(task, int, ulng); 
break;}
-   if (task->type == TYPE_daytime) {select_frame(task, lng, ulng); 
break;}
-   if (task->type == TYPE_timestamp) {select_frame(task, lng, 
ulng); break;}
-   }
}
MOSskip_frame(task);
task->lb = o;
@@ -563,7 +542,7 @@ MOSthetaselect_frame( MOStask task, void
}
o = task->lb;
 
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_bte: thetaselect_frame(bte, ulng, GET_DELTA_FOR_SIGNED_TYPE); 
break;
   

MonetDB: mosaic - Support for time-like types in delta.

2019-09-11 Thread Aris Koning
Changeset: 5a3c1ee90c90 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a3c1ee90c90
Modified Files:
monetdb5/modules/mosaic/mosaic_delta.c
Branch: mosaic
Log Message:

Support for time-like types in delta.


diffs (230 lines):

diff --git a/monetdb5/modules/mosaic/mosaic_delta.c 
b/monetdb5/modules/mosaic/mosaic_delta.c
--- a/monetdb5/modules/mosaic/mosaic_delta.c
+++ b/monetdb5/modules/mosaic/mosaic_delta.c
@@ -19,7 +19,7 @@
 //#define _DEBUG_MOSAIC_
 
 bool MOStypes_delta(BAT* b) {
-   switch(ATOMbasetype(getBatType(b->ttype))){
+   switch(ATOMstorage(getBatType(b->ttype))){
case TYPE_sht: return true;
case TYPE_int: return true;
case TYPE_lng: return true;
@@ -48,7 +48,7 @@ MOSadvance_delta(MOStask task)
 
task->start += MOSgetCnt(blk);
task->stop = task->stop;
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_sht: task->blk = (MosaicBlk)( ((char*) blk)+ 
wordaligned(MosaicBlkSize + sizeof(sht) + MOSgetCnt(blk)-1,sht)); break ;
case TYPE_int: task->blk = (MosaicBlk)( ((char*) blk)+ 
wordaligned(MosaicBlkSize + sizeof(int) + MOSgetCnt(blk)-1,int)); break ;
case TYPE_oid: task->blk = (MosaicBlk)( ((char*) blk)+ 
wordaligned(MosaicBlkSize + sizeof(oid) + MOSgetCnt(blk)-1,oid)); break ;
@@ -64,13 +64,6 @@ MOSadvance_delta(MOStask task)
case 8: task->blk = (MosaicBlk)( ((char*) blk) + 
wordaligned(MosaicBlkSize + sizeof(lng)+ MOSgetCnt(blk)-1,lng)); break ;
}
break;
-   default:
-   if( task->type == TYPE_timestamp)
-   task->blk = (MosaicBlk)( ((char*) blk) + MosaicBlkSize 
+ wordaligned(sizeof(timestamp) + MOSgetCnt(blk)-1,timestamp)); 
-   if( task->type == TYPE_date)
-   task->blk = (MosaicBlk)( ((char*) blk) + MosaicBlkSize 
+ wordaligned(sizeof(date) + MOSgetCnt(blk)-1,date)); 
-   if( task->type == TYPE_daytime)
-   task->blk = (MosaicBlk)( ((char*) blk) + MosaicBlkSize 
+ wordaligned(sizeof(daytime) + MOSgetCnt(blk)-1,daytime)); 
}
 }
 
@@ -82,7 +75,7 @@ MOSlayout_delta(MOStask task, BAT *btech
lng cnt = MOSgetCnt(blk), input=0, output= 0;
 
input = cnt * ATOMsize(task->type);
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_sht: output = wordaligned(MosaicBlkSize + sizeof(sht) + 
MOSgetCnt(blk)-1,sht); break ;
case TYPE_int: output = wordaligned(MosaicBlkSize + sizeof(int) + 
MOSgetCnt(blk)-1,int); break ;
case TYPE_oid: output = wordaligned(MosaicBlkSize + sizeof(oid) + 
MOSgetCnt(blk)-1,oid); break ;
@@ -156,8 +149,7 @@ MOSestimate_delta(MOStask task)
case 4: Estimate_delta(int, (delta < -127 || delta > 
127)); break;
case 8: Estimate_delta(lng, (delta < -127 || delta > 
127)); break;
}
-   break;
-   //case TYPE_flt: case TYPE_dbl: to be looked into.
+   break;
}
task->factor[MOSAIC_DELTA] = factor;
task->range[MOSAIC_DELTA] = task->start + i;
@@ -196,8 +188,8 @@ MOScompress_delta(MOStask task)
//case TYPE_bte: case TYPE_bit: no compression achievable
case TYPE_sht: DELTAcompress(sht,(delta < -127 || delta >127)); break;
case TYPE_int: DELTAcompress(int,(delta < -127 || delta >127)); break;
-   case TYPE_oid: DELTAcompress(oid,(delta > 127)); break;
-   case TYPE_lng: DELTAcompress(lng,(delta > 127)); break;
+   case TYPE_oid: DELTAcompress(oid,(delta > 255)); break;
+   case TYPE_lng: DELTAcompress(lng,(delta < -127 || delta >127)); break;
 #ifdef HAVE_HGE
case TYPE_hge: DELTAcompress(hge,(delta < -127 || delta < -127 || delta 
>127)); break;
 #endif
@@ -209,7 +201,6 @@ MOScompress_delta(MOStask task)
case 4: DELTAcompress(int,(delta < 0 || delta > 127)); break;
case 8: DELTAcompress(lng,(delta < 0 || delta > 127)); break;
}
-   //case TYPE_flt: case TYPE_dbl: to be looked into.
}
 }
 
@@ -342,7 +333,7 @@ MOSselect_delta( MOStask task, void *low
}
o = task->lb;
 
-   switch(task->type){
+   switch(ATOMstorage(task->type)){
case TYPE_sht: select_delta(sht); break;
case TYPE_lng: select_delta(lng); break;
case TYPE_oid: select_delta(oid); break;
@@ -358,77 +349,6 @@ MOSselect_delta( MOStask task, void *low
case 8: break;
}
break;
-   default:
-   if( task->type == TYPE_daytime)
-   select_delta(daytime);
-   if( task->type == TYPE_date)
-   select_delta(date);
-   if( task->type == TYPE_timestamp)
-   {   lng val= *(lng*) (((char*) task->blk) + 
MosaicBlkSize);
-   int lownil = 

MonetDB: mosaic - Clean up storage handling of compression.

2019-09-11 Thread Aris Koning
Changeset: 5408b32c2f4b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5408b32c2f4b
Modified Files:
sql/backends/monet5/sql_cat.c
Branch: mosaic
Log Message:

Clean up storage handling of compression.


diffs (57 lines):

diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -888,12 +888,9 @@ alter_table(Client cntxt, mvc *sql, char
mvc_default(sql, nc, c->def);
 
if (c->storage_type != nc->storage_type) {
-   bat bid = 0;
BAT *b;
size_t cnt;
-   sql_delta *d;
char *msg = MAL_SUCCEED;
-   int filter[MOSAIC_METHODS];
 /* no restriction
if (c->t->access == TABLE_WRITABLE)
return sql_message("40002!ALTER TABLE: SET 
STORAGE for column %s.%s only allowed on READ or INSERT ONLY tables", 
c->t->base.name, c->base.name);
@@ -908,17 +905,20 @@ alter_table(Client cntxt, mvc *sql, char
}
 
if( c->storage_type) {
-   memset(filter,0, sizeof(filter));
 
if (strstr(c->storage_type,"mosaic") != 0)
throw(SQL,
"sql.alter", 
MOSAIC_STRATEGY_NOT_ALLOWED);
 
+   int contains_explicit_raw = 
strstr(c->storage_type,"raw") != NULL ? 1 : 0;
+
for(int i = 0, nr_strategies = 0; i< 
MOSAIC_METHODS-1; i++){
-   if ( (filter[i] = 
strstr(c->storage_type,MOSfiltername[i]) != 0 && type_allowed(i, b) ))
+   if ( 
(strstr(c->storage_type,MOSfiltername[i]) && type_allowed(i, b) ))
{
-   if 
(strstr(c->storage_type,"raw") == 0 && ++nr_strategies > 1)
+   if ( (++nr_strategies - 
contains_explicit_raw) > 1) {
+   BBPunfix(b->batCacheid);
throw(SQL, "sql.alter", 
NON_TRIVIAL_MIX_NOT_ALLOWED);
+   }
}
}
 
@@ -926,14 +926,10 @@ alter_table(Client cntxt, mvc *sql, char
}
BBPunfix(b->batCacheid);
 
-   if (msg)
+   if (msg) {
return msg;
+   }
 
-   store_funcs.clear_col(sql->session->tr, nc);
-   assert(nc->base.allocated == 1);
-   d = nc->data;
-   d->bid = bid;
-   d->cnt = cnt;
mvc_storage(sql, nc, c->storage_type);
}
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - Fix type check for delta.

2019-09-11 Thread Aris Koning
Changeset: ff358b945a45 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff358b945a45
Modified Files:
monetdb5/modules/mosaic/mosaic_delta.c
Branch: mosaic
Log Message:

Fix type check for delta.


diffs (23 lines):

diff --git a/monetdb5/modules/mosaic/mosaic_delta.c 
b/monetdb5/modules/mosaic/mosaic_delta.c
--- a/monetdb5/modules/mosaic/mosaic_delta.c
+++ b/monetdb5/modules/mosaic/mosaic_delta.c
@@ -19,7 +19,7 @@
 //#define _DEBUG_MOSAIC_
 
 bool MOStypes_delta(BAT* b) {
-   switch(ATOMstorage(getBatType(b->ttype))){
+   switch(b->ttype) {
case TYPE_sht: return true;
case TYPE_int: return true;
case TYPE_lng: return true;
@@ -36,6 +36,10 @@ bool MOStypes_delta(BAT* b) {
case 8: return true;
}
break;
+   default:
+   if (b->ttype == TYPE_date) {return true;} // Will be mapped to 
int
+   if (b->ttype == TYPE_daytime) {return true;} // Will be mapped 
to lng
+   if (b->ttype == TYPE_timestamp) {return true;} // Will be 
mapped to lng
}
 
return false;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-java: default - In DatabaseMetaData methods which accept...

2019-09-11 Thread Martin van Dinther
Changeset: 8701024a9bb0 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=8701024a9bb0
Modified Files:
src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
Branch: default
Log Message:

In DatabaseMetaData methods which accept name match patterns, optimise the SQL 
generation when the pattern equals a: %
In those cases no additional  AND name LIKE '%'  condition is generated anymore.


diffs (242 lines):

diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java 
b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -20,7 +20,8 @@ import java.sql.Types;
 /**
  * A DatabaseMetaData object suitable for the MonetDB database.
  *
- * @author Fabian Groffen, Martin van Dinther
+ * @author Fabian Groffen
+ * @author Martin van Dinther
  * @version 0.8
  */
 public class MonetDatabaseMetaData
@@ -1737,10 +1738,10 @@ public class MonetDatabaseMetaData
// as we do not support catalogs this always results in 
no rows returned
query.append(" AND 1 = 0");
} else {
-   if (schemaPattern != null) {
+   if (schemaPattern != null && 
!schemaPattern.equals("%")) {
query.append(" AND s.\"name\" 
").append(composeMatchPart(schemaPattern));
}
-   if (procedureNamePattern != null) {
+   if (procedureNamePattern != null && 
!procedureNamePattern.equals("%")) {
query.append(" AND f.\"name\" 
").append(composeMatchPart(procedureNamePattern));
}
}
@@ -1862,13 +1863,13 @@ public class MonetDatabaseMetaData
// as we do not support catalogs this always results in 
no rows returned
query.append(" AND 1 = 0");
} else {
-   if (schemaPattern != null) {
+   if (schemaPattern != null && 
!schemaPattern.equals("%")) {
query.append(" AND s.\"name\" 
").append(composeMatchPart(schemaPattern));
}
-   if (procedureNamePattern != null) {
+   if (procedureNamePattern != null && 
!procedureNamePattern.equals("%")) {
query.append(" AND f.\"name\" 
").append(composeMatchPart(procedureNamePattern));
}
-   if (columnNamePattern != null) {
+   if (columnNamePattern != null && 
!columnNamePattern.equals("%")) {
query.append(" AND a.\"name\" 
").append(composeMatchPart(columnNamePattern));
}
}
@@ -1971,10 +1972,10 @@ public class MonetDatabaseMetaData
// as we do not support catalogs this always results in 
no rows returned
query.append(" AND 1 = 0");
} else {
-   if (schemaPattern != null) {
+   if (schemaPattern != null && 
!schemaPattern.equals("%")) {
query.append(" AND s.\"name\" 
").append(composeMatchPart(schemaPattern));
}
-   if (tableNamePattern != null) {
+   if (tableNamePattern != null && 
!tableNamePattern.equals("%")) {
query.append(" AND t.\"name\" 
").append(composeMatchPart(tableNamePattern));
}
}
@@ -2034,7 +2035,7 @@ public class MonetDatabaseMetaData
// as we do not support catalogs this always results in 
no rows returned
query.append(" WHERE 1 = 0");
} else {
-   if (schemaPattern != null) {
+   if (schemaPattern != null && 
!schemaPattern.equals("%")) {
query.append(" WHERE \"name\" 
").append(composeMatchPart(schemaPattern));
}
}
@@ -2218,13 +2219,13 @@ public class MonetDatabaseMetaData
// as we do not support catalogs this always results in 
no rows returned
query.append(" AND 1 = 0");
} else {
-   if (schemaPattern != null) {
+   if (schemaPattern != null && 
!schemaPattern.equals("%")) {
query.append(" AND s.\"name\" 
").append(composeMatchPart(schemaPattern));
}
-   if (tableNamePattern != null) {
+   if (tableNamePattern != null && 
!tableNamePattern.equals("%")) {
query.append(" AND t.\"name\" 

MonetDB: Nov2019 - Sqlite test queries with wrong results

2019-09-11 Thread Pedro Ferreira
Changeset: bf4055f54eb9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bf4055f54eb9
Modified Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
Branch: Nov2019
Log Message:

Sqlite test queries with wrong results


diffs (34 lines):

diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
@@ -1,4 +1,7 @@
 CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER);
 INSERT INTO tab2 VALUES (64,77,40), (75,67,58), (46,51,23);
 SELECT * FROM tab2 WHERE col2 NOT IN ( - + col1, col2 * + col1, + - col0 * + + 
36, + + col2, 84 * + + col0 ) AND NOT NULL IS NULL;
+SELECT DISTINCT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS 
BIGINT ) FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL; --NULL
+SELECT ALL + + MIN ( DISTINCT - - 14 ) AS col1, CAST ( - SUM ( DISTINCT 74 ) 
AS BIGINT ) col0 FROM tab2 AS cor0 
+WHERE NULL BETWEEN col0 AND NULL; --NULL, NULL
 DROP TABLE tab2;
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
@@ -31,6 +31,19 @@ stdout of test 'sqlitelogictest-algebra-
 % col0,col1,   col2 # name
 % int, int,int # type
 % 1,   1,  1 # length
+#SELECT DISTINCT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS 
BIGINT ) FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL; --NULL
+% .L4 # table_name
+% L4 # name
+% bigint # type
+% 1 # length
+[ NULL ]
+#SELECT ALL + + MIN ( DISTINCT - - 14 ) AS col1, CAST ( - SUM ( DISTINCT 74 ) 
AS BIGINT ) col0 FROM tab2 AS cor0
+#WHERE NULL BETWEEN col0 AND NULL; --NULL, NULL
+% .L3, .L6 # table_name
+% col1,col0 # name
+% tinyint, bigint # type
+% 1,   1 # length
+[ NULL,NULL]
 #DROP TABLE tab2;
 
 # 16:19:09 >  
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - merged

2019-09-11 Thread Niels Nes
Changeset: 65f2efc82ede for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=65f2efc82ede
Modified Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
Branch: Nov2019
Log Message:

merged


diffs (29 lines):

diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql
@@ -33,8 +33,8 @@ SELECT DISTINCT * FROM tab2 AS cor0 WHER
 
 SELECT * FROM tab1, tab0 AS cor0 WHERE NULL NOT IN ( cor0.col2 ); --6 columns 
in the output
 
-SELECT DISTINCT MAX ( DISTINCT CAST ( NULL AS INTEGER ) ) * COUNT ( * ) + 
COUNT ( * ) * + ( - COUNT ( * ) ) + - 
-COUNT ( * ) + ( CAST ( NULL AS INTEGER ) ) + + MAX ( DISTINCT 20 ) / 55 + - 
COUNT ( * ) AS col1 
+SELECT DISTINCT CAST ( MAX ( DISTINCT CAST ( NULL AS INTEGER ) ) * COUNT ( * ) 
+ COUNT ( * ) * + ( - COUNT ( * ) ) + - 
+COUNT ( * ) + ( CAST ( NULL AS INTEGER ) ) + + MAX ( DISTINCT 20 ) / 55 + - 
COUNT ( * ) AS BIGINT ) AS col1 
 FROM tab1 AS cor0; --Single null value
 
 ROLLBACK;
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
@@ -86,9 +86,9 @@ stdout of test 'sqlitelogictest-cast-nul
 #SELECT DISTINCT MAX ( DISTINCT CAST ( NULL AS INTEGER ) ) * COUNT ( * ) + 
COUNT ( * ) * + ( - COUNT ( * ) ) + - 
 #COUNT ( * ) + ( CAST ( NULL AS INTEGER ) ) + + MAX ( DISTINCT 20 ) / 55 + - 
COUNT ( * ) AS col1 
 #FROM tab1 AS cor0; --Single null value
-% .L13 # table_name
+% .L14 # table_name
 % col1 # name
-% hugeint # type
+% bigint # type
 % 1 # length
 [ NULL ]
 #ROLLBACK;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - approved output

2019-09-11 Thread Niels Nes
Changeset: babdb70c6a74 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=babdb70c6a74
Modified Files:
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out.int128
Branch: Nov2019
Log Message:

approved output


diffs (truncated from 53721 to 300 lines):

diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out 
b/sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out
--- a/sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out
@@ -92,8 +92,8 @@ stdout of test 'select3.test` in directo
 #SELECT CASE WHEN c>(SELECT avg(c) FROM t1) THEN a*2 ELSE b*10 END
 #  FROM t1
 #;
-% sys.L6 # table_name
-% L6 # name
+% sys.L3 # table_name
+% L3 # name
 % bigint # type
 % 4 # length
 [ NULL ]
@@ -130,8 +130,8 @@ stdout of test 'select3.test` in directo
 #  FROM t1
 # ORDER BY 1
 #;
-% sys.L6 # table_name
-% L6 # name
+% sys.L3 # table_name
+% L3 # name
 % bigint # type
 % 4 # length
 [ NULL ]
@@ -826,8 +826,8 @@ stdout of test 'select3.test` in directo
 # WHERE b>c
 #OR a>b
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 2 # length
 [ -1   ]
@@ -860,8 +860,8 @@ stdout of test 'select3.test` in directo
 #OR a>b
 # ORDER BY 1
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 2 # length
 [ NULL ]
@@ -2105,17 +2105,17 @@ stdout of test 'select3.test` in directo
 #   abs(b-c)
 #  FROM t1
 #;
-% sys.L6,  .L12,   sys.L14 # table_name
-% L6,  L12,L14 # name
+% sys.L3,  .L5,sys.L6 # table_name
+% L3,  L5, L6 # name
 % bigint,  bigint, bigint # type
 % 4,   2,  1 # length
 [ 1120,1,  1   ]
+[ NULL,0,  NULL]
+[ 1050,0,  1   ]
 [ 1240,2,  1   ]
 [ 1290,3,  4   ]
+[ NULL,0,  NULL]
 [ 1300,4,  4   ]
-[ NULL,0,  NULL]
-[ NULL,0,  NULL]
-[ 1050,0,  1   ]
 [ 1390,5,  2   ]
 [ 1430,6,  2   ]
 [ 1450,7,  2   ]
@@ -2145,8 +2145,8 @@ stdout of test 'select3.test` in directo
 #  FROM t1
 # ORDER BY 3,2,1
 #;
-% sys.L6,  .L12,   sys.L14 # table_name
-% L6,  L12,L14 # name
+% sys.L3,  .L5,sys.L6 # table_name
+% L3,  L5, L6 # name
 % bigint,  bigint, bigint # type
 % 4,   2,  1 # length
 [ NULL,0,  NULL]
@@ -3036,8 +3036,8 @@ stdout of test 'select3.test` in directo
 #WHEN ab
 #;
-% sys.L2,  sys.t1, sys.t1 # table_name
-% L2,  a,  c # name
+% sys.L1,  sys.t1, sys.t1 # table_name
+% L1,  a,  c # name
 % bigint,  int,int # type
 % 1,   3,  3 # length
 [ 2,   107,106 ]
@@ -3197,8 +3197,8 @@ stdout of test 'select3.test` in directo
 #   AND a>b
 # ORDER BY 1,3,2
 #;
-% sys.L2,  sys.t1, sys.t1 # table_name
-% L2,  a,  c # name
+% sys.L1,  sys.t1, sys.t1 # table_name
+% L1,  a,  c # name
 % bigint,  int,int # type
 % 1,   3,  3 # length
 [ 1,   131,134 ]
@@ -3216,8 +3216,8 @@ stdout of test 'select3.test` in directo
 # WHERE a>b
 #   AND c BETWEEN b-2 AND d+2
 #;
-% sys.L2,  sys.t1, sys.t1 # table_name
-% L2,  a,  c # name
+% sys.L1,  sys.t1, sys.t1 # table_name
+% L1,  a,  c # name
 % bigint,  int,int # type
 % 1,   3,  3 # length
 [ 2,   107,106 ]
@@ -3236,8 +3236,8 @@ stdout of test 'select3.test` in directo
 #   AND c BETWEEN b-2 AND d+2
 # ORDER BY 2,3,1
 #;
-% sys.L2,  sys.t1, sys.t1 # table_name
-% L2,  a,  c # name
+% sys.L1,  sys.t1, sys.t1 # table_name
+% L1,  a,  c # name
 % bigint,  int,int # type
 % 1,   3,  3 # length
 [ 2,   107,106 ]
@@ -3369,8 +3369,8 @@ stdout of test 'select3.test` in directo
 # WHERE e+d BETWEEN a+b-10 AND c+130
 #OR a>b
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 3 # length
 [ 317  ]
@@ -3397,8 +3397,8 @@ stdout of test 'select3.test` in directo
 #OR a>b
 # ORDER BY 1
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 3 # length
 [ 317  ]
@@ -3424,8 +3424,8 @@ stdout of test 'select3.test` in directo
 # WHERE a>b
 #OR e+d BETWEEN a+b-10 AND c+130
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 3 # length
 [ 317  ]
@@ -3452,8 +3452,8 @@ stdout of test 'select3.test` in directo
 #OR e+d BETWEEN a+b-10 AND c+130
 # ORDER BY 1
 #;
-% sys.L2 # table_name
-% L2 # name
+% sys.L1 # table_name
+% L1 # name
 % bigint # type
 % 3 # length
 [ 317  ]
@@ -3837,8 +3837,8 @@ stdout of test 'select3.test` in directo
 #WHEN ab
 #OR c BETWEEN b-2 AND d+2
 #;
-% sys.L2 # table_name
-% L2 # name
+% 

MonetDB: Nov2019 - Mostly documentation and sending errors prope...

2019-09-11 Thread Martin Kersten
Changeset: 535fc010773c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=535fc010773c
Modified Files:
sql/backends/monet5/wlr.c
sql/test/wlcr/Tests/wlc01.py
Branch: Nov2019
Log Message:

Mostly documentation and sending errors proper way.


diffs (truncated from 378 to 300 lines):

diff --git a/sql/backends/monet5/wlr.c b/sql/backends/monet5/wlr.c
--- a/sql/backends/monet5/wlr.c
+++ b/sql/backends/monet5/wlr.c
@@ -7,13 +7,12 @@
  */
 
 /*
- * A master can be replicated by taking a binary copy of the 'bat' directory.
- * This should be done under control of the program monetdb, e.g.
- * monetdb replica  +
+ * A master can be replicated by taking a binary copy of the 'bat' directory
+ * when in quiescent mode or a more formal snapshot..
  * Alternatively you start with an empty database.
  * 
  * After restart of a mserver against the newly created image,
- * the log files from the master are processed.
+ * the log files from the master are processed by calling
  *
  * In replay mode also all queries are executed if they surpass
  * the latest threshold set for by the master.
@@ -39,21 +38,24 @@
 #define WLC_ERROR 60
 
 #define _WLR_DEBUG_
+  
+MT_Lock wlr_lock = MT_LOCK_INITIALIZER("wlr_lock");
 
 /* The current status of the replica  processing */
 static char wlr_master[IDLENGTH];
-static char wlr_error[FILENAME_MAX];   // errors should stop the 
process
-static int wlr_batches;// the next file to be processed
-static lng wlr_tag;// the next transaction id to be 
processed
-static lng wlr_limit = -1; // stop re-processing transactions when 
limit is reached
-static char wlr_timelimit[26]; // stop re-processing transactions when 
time limit is reached
-static char wlr_read[26];  // stop re-processing transactions when 
time limit is reached
-static int wlr_state;  // which state RUN/PAUSE
-static int wlr_beat;   // period between successive synchronisations 
with master
+static char wlr_error[FILENAME_MAX];   // errors should stop the process
+static int wlr_batches;// the next file to be 
processed
+static lng wlr_tag;// the next 
transaction id to be processed
+static lng wlr_limit = -1; // stop re-processing 
transactions when limit is reached
+static char wlr_timelimit[26]; // stop re-processing 
transactions when time limit is reached
+static char wlr_read[26];  // stop re-processing 
transactions when time limit is reached
+static int wlr_state;  // which state 
RUN/PAUSE
+static int wlr_beat;   // period 
between successive synchronisations with master
 static MT_Id wlr_thread;
 
 #define MAXLINE 2048
 
+/* Simple read the configuration file */
 static str
 WLRgetConfig(void){
char *path;
@@ -62,8 +64,10 @@ WLRgetConfig(void){
int len;
str msg = MAL_SUCCEED;
 
-   if((path = GDKfilepath(0,0,"wlr.config",0)) == NULL)
-   throw(MAL,"wlr.getConfig","Could not access wlr.config file\n");
+   if((path = GDKfilepath(0, 0, "wlr.config", 0)) == NULL){
+   msg = createException(MAL, "wlr.getConfig","Could not access 
wlr.config file\n");
+   return msg;
+   }
fd = fopen(path,"r");
GDKfree(path);
if( fd == NULL)
@@ -95,11 +99,14 @@ WLRgetConfig(void){
}
}
}
+   if (msg == MAL_SUCCEED && wlr_limit < wlr_tag)
+   msg = createException(MAL, "wlr.getConfig", 
"inconsistent config record");
 bailout:
fclose(fd);
return msg;
 }
 
+/* Keep the current status in the config file */
 static str
 WLRsetConfig(void){
char *path;
@@ -109,9 +116,9 @@ WLRsetConfig(void){
throw(MAL,"wlr.setMaster","Could not access wlr.config file\n");
fd = open_wastream(path);
GDKfree(path);
-   if( fd == NULL){
-   return MAL_SUCCEED;
-   }
+   if( fd == NULL)
+   throw(MAL,"wlr.setMaster","Could not create wlr.config file\n");
+
mnstr_printf(fd,"master=%s\n", wlr_master);
mnstr_printf(fd,"batches=%d\n", wlr_batches);
mnstr_printf(fd,"tag="LLFMT"\n", wlr_tag);
@@ -129,14 +136,14 @@ WLRsetConfig(void){
  * When the master database exist, we should set the replica administration.
  * But only once.
  *
- * The log files are identified by a range. It starts with 0 when an empty
- * database was used to bootstrap. Otherwise it is the range of the dbmaster.
+ * The log files are identified by a range. It starts with 0 when an empty 
databas
+ * was used to bootstrap. Otherwise it is the range received from the dbmaster.
  * At any time we should be able to restart the synchronization
  * process by grabbing a new 

MonetDB: Nov2019 - allow passing obscure features to the mserver...

2019-09-11 Thread Niels Nes
Changeset: cd5d207d4978 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cd5d207d4978
Modified Files:
tools/merovingian/daemon/forkmserver.c
Branch: Nov2019
Log Message:

allow passing obscure features to the mserver using an environment variable 
MSERVER5_EXTRA_ARGS


diffs (36 lines):

diff --git a/tools/merovingian/daemon/forkmserver.c 
b/tools/merovingian/daemon/forkmserver.c
--- a/tools/merovingian/daemon/forkmserver.c
+++ b/tools/merovingian/daemon/forkmserver.c
@@ -177,6 +177,9 @@ terminateProcess(pid_t pid, char *dbname
  * to see if forking makes sense, or whether it is necessary at all, or
  * forbidden by restart policy, e.g. when in maintenance.
  */
+
+#define MAX_NR_ARGS 511
+
 err
 forkMserver(char *database, sabdb** stats, int force)
 {
@@ -212,7 +215,9 @@ forkMserver(char *database, sabdb** stat
char *embeddedc = NULL;
char *ipv6 = NULL;
char *dbextra = NULL;
-   char *argv[512];/* for the exec arguments */
+   char *mserver5_extra = NULL;
+   char *mserver5_extra_token = NULL;
+   char *argv[MAX_NR_ARGS+1];  /* for the exec arguments */
char property_other[1024];
int c = 0;
unsigned int mport;
@@ -602,6 +607,11 @@ forkMserver(char *database, sabdb** stat
list++;
}
 
+   /* Let's get extra mserver5 args from the environment */
+   mserver5_extra = getenv("MSERVER5_EXTRA_ARGS");
+   while (c < MAX_NR_ARGS && (mserver5_extra_token = 
strsep(_extra, " ")))
+   argv[c++] = mserver5_extra_token;
+
argv[c++] = NULL;
 
freeConfFile(ckv);
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Added similar queries to test

2019-09-11 Thread Pedro Ferreira
Changeset: 8a03f203babf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8a03f203babf
Modified Files:

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
Branch: Nov2019
Log Message:

Added similar queries to test


diffs (38 lines):

diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql
@@ -1,6 +1,8 @@
 CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER);
 INSERT INTO tab2 VALUES (64,77,40), (75,67,58), (46,51,23);
 SELECT * FROM tab2 WHERE col2 NOT IN ( - + col1, col2 * + col1, + - col0 * + + 
36, + + col2, 84 * + + col0 ) AND NOT NULL IS NULL;
+SELECT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS BIGINT ) 
FROM tab2 AS cor0 WHERE NOT NULL; --NULL
+SELECT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS BIGINT ) 
FROM tab2 AS cor0 WHERE NULL; --NULL
 SELECT DISTINCT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS 
BIGINT ) FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL; --NULL
 SELECT ALL + + MIN ( DISTINCT - - 14 ) AS col1, CAST ( - SUM ( DISTINCT 74 ) 
AS BIGINT ) col0 FROM tab2 AS cor0 
 WHERE NULL BETWEEN col0 AND NULL; --NULL, NULL
diff --git 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
--- 
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
+++ 
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out
@@ -31,6 +31,22 @@ stdout of test 'sqlitelogictest-algebra-
 % col0,col1,   col2 # name
 % int, int,int # type
 % 1,   1,  1 # length
+#SELECT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS BIGINT ) 
FROM tab2 AS cor0 WHERE NOT NULL; --NULL
+% . # table_name
+# .L4 # table_name
+% L # name
+# L4 # name
+% bigint # type
+% 1 # length
+[ NULL ]
+#SELECT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS BIGINT ) 
FROM tab2 AS cor0 WHERE NULL; --NULL
+% . # table_name
+# .L4 # table_name
+% L # name
+# L4 # name
+% bigint # type
+% 1 # length
+[ NULL ]
 #SELECT DISTINCT CAST ( SUM ( DISTINCT 23 ) * - COUNT ( DISTINCT + - col1 ) AS 
BIGINT ) FROM tab2 AS cor0 WHERE NOT ( NULL ) IS NULL; --NULL
 % .L4 # table_name
 % L4 # name
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - lookup the level of deltas from the global tr...

2019-09-11 Thread Niels Nes
Changeset: 04940d20cf74 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04940d20cf74
Modified Files:
sql/backends/monet5/sql.c
Branch: Nov2019
Log Message:

lookup the level of deltas from the global transaction


diffs (203 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -,6 +,51 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb
  *  If the table is cleared, the values RDONLY, RD_INS and RD_UPD_ID and the 
number of deletes will be 0.
  */
 
+static str
+mvc_insert_delta_values(mvc *m, BAT *col1, BAT *col2, BAT *col3, BAT *col4, 
BAT *col5, BAT *col6, BAT *col7, sql_column *c, bit cleared, lng deletes)
+{
+   int level = 0;
+
+   lng inserted = (lng) store_funcs.count_col(m->session->tr, c, 0);
+   lng all = (lng) store_funcs.count_col(m->session->tr, c, 1);
+   lng updates = (lng) store_funcs.count_col_upd(m->session->tr, c);
+   lng readonly = all - inserted;
+
+   assert(all >= inserted);
+
+   if (BUNappend(col1, >base.id, false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   if (BUNappend(col2, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   if (BUNappend(col3, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   if (BUNappend(col4, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   if (BUNappend(col5, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   if (BUNappend(col6, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   /* compute level using global transaction */
+   if (gtrans) {
+   sql_column *oc = tr_find_column(gtrans, c);
+
+   if (oc) {
+   for(sql_delta *d = oc->data; d; d = d->next) 
+   level++;
+   }
+   }
+   if (BUNappend(col7, , false) != GDK_SUCCEED) {
+   return createException(SQL,"sql.delta", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
+   }
+   return MAL_SUCCEED;
+}
+
 str
 mvc_delta_values(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
@@ -1127,15 +1172,13 @@ mvc_delta_values(Client cntxt, MalBlkPtr
*b5 = getArgReference_bat(stk, pci, 4),
*b6 = getArgReference_bat(stk, pci, 5),
*b7 = getArgReference_bat(stk, pci, 6);
-   sql_trans *tr;
sql_schema *s = NULL;
sql_table *t = NULL;
sql_column *c = NULL;
node *n;
bit cleared;
-   int level = 0;
BUN nrows = 0;
-   lng all, readonly, inserted, updates, deletes;
+   lng deletes;
 
if ((msg = getSQLContext(cntxt, mb, , NULL)) != NULL)
goto cleanup;
@@ -1203,85 +1246,17 @@ mvc_delta_values(Client cntxt, MalBlkPtr
}
 
if (nrows) {
-   tr = m->session->tr;
-   while((tr = tr->parent)) level++;
-
if (tname) {
cleared = (t->cleared != 0);
deletes = (lng) store_funcs.count_del(m->session->tr, 
t);
if (cname) {
-   inserted = (lng) 
store_funcs.count_col(m->session->tr, c, 0);
-   all = (lng) 
store_funcs.count_col(m->session->tr, c, 1);
-   updates = (lng) 
store_funcs.count_col_upd(m->session->tr, c);
-   assert(all >= inserted);
-   readonly = all - inserted;
-
-   if (BUNappend(col1, >base.id, false) != 
GDK_SUCCEED) {
-   msg = createException(SQL,"sql.delta", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
-   goto cleanup;
-   }
-   if (BUNappend(col2, , false) != 
GDK_SUCCEED) {
-   msg = createException(SQL,"sql.delta", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
-   goto cleanup;
-   }
-   if (BUNappend(col3, , false) != 
GDK_SUCCEED) {
-   msg = createException(SQL,"sql.delta", 
SQLSTATE(HY001) MAL_MALLOC_FAIL);
+   if ((msg=mvc_insert_delta_values(m, col1, col2, 
col3, col4, col5, col6, col7, c, cleared, deletes)) != NULL)
goto cleanup;
-   }
-   if 

MonetDB: grouping-analytics - Writing another test query

2019-09-11 Thread Pedro Ferreira
Changeset: a055cf0d0445 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a055cf0d0445
Modified Files:
sql/test/analytics/Tests/analytics11.sql
sql/test/analytics/Tests/analytics11.stable.out
Branch: grouping-analytics
Log Message:

Writing another test query


diffs (33 lines):

diff --git a/sql/test/analytics/Tests/analytics11.sql 
b/sql/test/analytics/Tests/analytics11.sql
--- a/sql/test/analytics/Tests/analytics11.sql
+++ b/sql/test/analytics/Tests/analytics11.sql
@@ -187,6 +187,17 @@ FROM another_T
 GROUP BY ROLLUP(col1);
 
 SELECT
+col1 IN (SELECT ColID + col2 FROM tbl_ProductSales),
+col1 < ANY (SELECT MAX(ColID + col2) FROM tbl_ProductSales),
+col5 = ALL (SELECT 1 FROM tbl_ProductSales HAVING MIN(col8) IS NULL),
+EXISTS (SELECT col2 FROM tbl_ProductSales WHERE tbl_ProductSales.ColID = 
another_T.col1),
+col1 + col5 = (SELECT MIN(ColID) FROM tbl_ProductSales),
+SUM(DISTINCT CASE WHEN col5 - col8 = (SELECT MIN(ColID / col2) FROM 
tbl_ProductSales) THEN col2 - 5 ELSE ABS(col1) END),
+(SELECT MAX(ColID + col2) FROM tbl_ProductSales) * DENSE_RANK() OVER 
(PARTITION BY AVG(col5))
+FROM another_T
+GROUP BY CUBE(col1, col2, col5, col8);
+
+SELECT
 col1 IN (SELECT ColID + col2 FROM tbl_ProductSales)
 FROM another_T
 GROUP BY ROLLUP(col1); --error, col2 is not a grouping column
diff --git a/sql/test/analytics/Tests/analytics11.stable.out 
b/sql/test/analytics/Tests/analytics11.stable.out
--- a/sql/test/analytics/Tests/analytics11.stable.out
+++ b/sql/test/analytics/Tests/analytics11.stable.out
@@ -324,7 +324,7 @@ stdout of test 'analytics11` in director
 #INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), 
(111,222,333,444,555,666,777,888), (,,,,,,,);
 [ 4]
 #SELECT
-#GROUPING(col1, col2, col3, col4, col5, col6, col7, col8)
+#col1 IN (SELECT ColID FROM tbl_ProductSales)
 #FROM another_T
 #GROUP BY ROLLUP(col1);
 % .L10 # table_name
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: grouping-analytics - Move groupings generation after un...

2019-09-11 Thread Pedro Ferreira
Changeset: 96b0ffbdf640 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=96b0ffbdf640
Added Files:
sql/server/rel_groupings.c
sql/server/rel_groupings.h
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_statement.c
sql/server/Makefile.ag
sql/server/rel_exp.c
sql/server/rel_prop.c
sql/server/rel_prop.h
sql/server/rel_select.c
sql/server/rel_updates.c
sql/server/sql_partition.c
sql/test/analytics/Tests/analytics11.stable.err
sql/test/analytics/Tests/analytics11.stable.out
Branch: grouping-analytics
Log Message:

Move groupings generation after unnesting subqueries. This should fix the 
remaining failing queries


diffs (truncated from 657 to 300 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -3296,7 +3296,9 @@ sql_parse(backend *be, sql_allocator *sa
sql_query *query = query_create(m);
sql_rel *r = rel_semantic(query, m->sym);
 
-   if (r && (r = rel_unnest(m,r)) != NULL && (r = rel_optimizer(m, 
r, 1)) != NULL)
+   if (r)
+   r = sql_processrelation(m, r, 1);
+   if (r)
sq = rel_bin(be, r);
}
 
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -25,6 +25,7 @@
 #include "sql_datetime.h"
 #include "sql_partition.h"
 #include "rel_unnest.h"
+#include "rel_groupings.h"
 #include "rel_optimizer.h"
 #include "rel_partition.h"
 #include "rel_distribute.h"
@@ -113,23 +114,33 @@ rel_need_distinct_query(sql_rel *rel)
 }
 
 sql_rel *
-sql_symbol2relation(mvc *c, symbol *sym)
+sql_processrelation(mvc *sql, sql_rel* rel, int value_based_opt)
+{
+   if (rel)
+   rel = rel_unnest(sql, rel);
+   if (rel)
+   rel = rel_generate_groupings(sql, rel);
+   if (rel)
+   rel = rel_optimizer(sql, rel, value_based_opt);
+   return rel;
+}
+
+sql_rel *
+sql_symbol2relation(mvc *sql, symbol *sym)
 {
-   sql_rel *r;
-   sql_query *query = query_create(c);
-
-   r = rel_semantic(query, sym);
-   if (r)
-   r = rel_unnest(c, r);
-   if (r)
-   r = rel_optimizer(c, r, 1);
-   if (r)
-   r = rel_distribute(c, r);
-   if (r)
-   r = rel_partition(c, r);
-   if (r && (rel_no_mitosis(r) || rel_need_distinct_query(r)))
-   c->no_mitosis = 1;
-   return r;
+   sql_rel *rel;
+   sql_query *query = query_create(sql);
+
+   rel = rel_semantic(query, sym);
+   if (rel)
+   rel = sql_processrelation(sql, rel, 1);
+   if (rel)
+   rel = rel_distribute(sql, rel);
+   if (rel)
+   rel = rel_partition(sql, rel);
+   if (rel && (rel_no_mitosis(rel) || rel_need_distinct_query(rel)))
+   sql->no_mitosis = 1;
+   return rel;
 }
 
 /*
@@ -434,12 +445,9 @@ create_table_or_view(mvc *sql, char* sna
}
r = rel_parse(sql, s, nt->query, m_deps);
if (r)
-   r = rel_unnest(sql, r);
-   if (r)
-   r = rel_optimizer(sql, r, 0);
+   r = sql_processrelation(sql, r, 0);
if (r) {
list *id_l = rel_dependencies(sql, r);
-
mvc_create_dependencies(sql, id_l, nt->base.id, 
VIEW_DEPENDENCY);
}
sa_destroy(sql->sa);
diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -55,7 +55,8 @@
 #include "bat/bat_utils.h"
 
 extern int sqlcleanup(mvc *c, int err);
-extern sql_rel *sql_symbol2relation(mvc *c, symbol *sym);
+extern sql_rel *sql_processrelation(mvc *m, sql_rel* rel, int value_based_opt);
+extern sql_rel *sql_symbol2relation(mvc *m, symbol *sym);
 
 extern BAT *mvc_bind(mvc *m, const char *sname, const char *tname, const char 
*cname, int access);
 extern BAT *mvc_bind_idxbat(mvc *m, const char *sname, const char *tname, 
const char *iname, int access);
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -447,12 +447,9 @@ create_trigger(mvc *sql, char *sname, ch
throw(SQL, "sql.catalog",SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
r = rel_parse(sql, s, buf, m_deps);
if (r)
-   r = rel_unnest(sql, r);
-   if (r)
-   r = 

MonetDB: default - Merge with Nov2019 branch.

2019-09-11 Thread Sjoerd Mullender
Changeset: 6de0a2989c79 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6de0a2989c79
Added Files:
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.timeout
sql/test/SQLite_regress/sqllogictest/sqllogictest.py
Removed Files:
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.timeout
Modified Files:
sql/backends/monet5/sql.c
sql/backends/monet5/wlr.c
sql/server/rel_optimizer.c

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-algebra-join-not-in.Bug-6519.stable.out

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.sql

sql/test/BugTracker-2018/Tests/sqlitelogictest-cast-null-not-in.Bug-6605.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/All
sql/test/subquery/Tests/subquery2.sql
  

MonetDB: Nov2019 - Updated test with failing aggregate queries w...

2019-09-11 Thread Pedro Ferreira
Changeset: 91c348d46f63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=91c348d46f63
Modified Files:
sql/test/subquery/Tests/subquery2.sql
Branch: Nov2019
Log Message:

Updated test with failing aggregate queries with subqueries


diffs (27 lines):

diff --git a/sql/test/subquery/Tests/subquery2.sql 
b/sql/test/subquery/Tests/subquery2.sql
--- a/sql/test/subquery/Tests/subquery2.sql
+++ b/sql/test/subquery/Tests/subquery2.sql
@@ -23,3 +23,23 @@ SELECT name, major FROM students s WHERE
 
 drop table students;
 drop table exams;
+
+CREATE TABLE tbl_ProductSales (ColID int, Product_Category  varchar(64), 
Product_Name  varchar(64), TotalSales int); 
+INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO 
Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100);
+CREATE TABLE another_T (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 
INT, col7 INT, col8 INT);
+INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), 
(111,222,333,444,555,666,777,888), (,,,,,,,);
+SELECT col1 IN (SELECT ColID + col1 FROM tbl_ProductSales) FROM another_T 
GROUP BY col1; 
+   -- False
+   -- False
+   -- False
+   -- False
+
+INSERT INTO tbl_ProductSales VALUES (0, 'a', 'b', 0);
+SELECT col1 IN (SELECT ColID + col1 FROM tbl_ProductSales) FROM another_T 
GROUP BY col1; 
+   -- True
+   -- True
+   -- True
+   -- True
+
+DROP TABLE tbl_ProductSales;
+DROP TABLE another_T;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Use original test scripts for testing and che...

2019-09-11 Thread Sjoerd Mullender
Changeset: 34412183b29e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=34412183b29e
Added Files:
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.timeout
sql/test/SQLite_regress/sqllogictest/sqllogictest.py
Removed Files:
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select3.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select3.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select4.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select4.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/select5.test.timeout
Modified Files:
sql/test/SQLite_regress/sqllogictest/Tests/All
Branch: Nov2019
Log Message:

Use original test scripts for testing and checking that tests succeed.
We parse the test script and use the embedded results (MD5 hashes
(possibly with sorting result) or actual result lines) to check
whether the tests succeeded.
The outputs are essentially empty and therefore should not be approved
again.


diffs (truncated from 2092174 to 300 lines):

diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/All 
b/sql/test/SQLite_regress/sqllogictest/Tests/All
--- 

MonetDB: Nov2019 - Remove options no longer needed in this version.

2019-09-11 Thread Sjoerd Mullender
Changeset: c34f316c6809 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c34f316c6809
Modified Files:
testing/process.py
Branch: Nov2019
Log Message:

Remove options no longer needed in this version.


diffs (14 lines):

diff --git a/testing/process.py b/testing/process.py
--- a/testing/process.py
+++ b/testing/process.py
@@ -311,9 +311,7 @@ def server(args=[], stdin=None, stdout=N
 if not cmd:
 cmd = ['mserver5',
'--set', 'mapi_open=true',
-   '--set', 'gdk_nr_threads=1',
-   '--set', 'monet_prompt=']
-cmd.extend(['--set', 'monet_daemon=yes'])
+   '--set', 'gdk_nr_threads=1']
 if verbose:
 sys.stdout.write('Default server: ' + ' '.join(cmd +  args) + '\n')
 if notrace and '--trace' in cmd:
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Fix some quoting; use Python 3 for testing wi...

2019-09-11 Thread Sjoerd Mullender
Changeset: f56b8f83e70a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f56b8f83e70a
Modified Files:
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
testing/Mtest.py.bat
Branch: Nov2019
Log Message:

Fix some quoting; use Python 3 for testing with Mtest.py.bat on Windows.


diffs (54 lines):

diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat 
b/sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
--- a/sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
@@ -1,1 +1,4 @@
-"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% "--database=%TSTDB% %TSTSRCBASE%/%TSTDIR%/select1.test"
+@prompt # $t $g
+@echo on
+
+"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% --database=%TSTDB% "%TSTSRCBASE%/%TSTDIR%/select1.test"
diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat 
b/sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
--- a/sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
@@ -1,1 +1,4 @@
-"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% "--database=%TSTDB% %TSTSRCBASE%/%TSTDIR%/select2.test"
+@prompt # $t $g
+@echo on
+
+"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% --database=%TSTDB% "%TSTSRCBASE%/%TSTDIR%/select2.test"
diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat 
b/sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
--- a/sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
@@ -1,1 +1,4 @@
-"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% "--database=%TSTDB% %TSTSRCBASE%/%TSTDIR%/select3.test"
+@prompt # $t $g
+@echo on
+
+"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% --database=%TSTDB% "%TSTSRCBASE%/%TSTDIR%/select3.test"
diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat 
b/sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
--- a/sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
@@ -1,1 +1,4 @@
-"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% "--database=%TSTDB% %TSTSRCBASE%/%TSTDIR%/select4.test"
+@prompt # $t $g
+@echo on
+
+"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% --database=%TSTDB% "%TSTSRCBASE%/%TSTDIR%/select4.test"
diff --git a/sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat 
b/sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
--- a/sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
+++ b/sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
@@ -1,1 +1,4 @@
-"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% "--database=%TSTDB% %TSTSRCBASE%/%TSTDIR%/select5.test"
+@prompt # $t $g
+@echo on
+
+"%PYTHON3%" "%TSTSRCBASE%/%TSTDIR%/sqllogictest.py" --host=localhost 
--port=%MAPIPORT% --database=%TSTDB% "%TSTSRCBASE%/%TSTDIR%/select5.test"
diff --git a/testing/Mtest.py.bat b/testing/Mtest.py.bat
--- a/testing/Mtest.py.bat
+++ b/testing/Mtest.py.bat
@@ -4,4 +4,4 @@
 @REM
 @REM Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
-@python "%~dpn0" %*
+@python3 "%~dpn0" %*
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


monetdb-java: default - Optimized parse method of TupleLineParse...

2019-09-11 Thread Martin van Dinther
Changeset: 0fcf338ce0b4 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=0fcf338ce0b4
Modified Files:
ChangeLog
src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java
src/main/java/nl/cwi/monetdb/mcl/parser/TupleLineParser.java
Branch: default
Log Message:

Optimized parse method of TupleLineParser by creating less helper objects and 
replacing method calls by direct operations on variables.
We now only create a StringBuilder object uesc when it is needed (when an 
escaped character is detected in the tuple line).
In most tuple data lines no escape characters are used and thus the 
StringBuilder object was not used/needed.
Also increased the default capacity of StringBuilder uesc such that it is not 
enlarged so often.
Also made StringBuilder object uesc now part of the TupleLineParser object, 
such that it can be reused by
many parse() calls, again reducing the number of created StringBuilder objects.


diffs (226 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog file for monetdb-java
 # This file is updated with Maddlog
 
+* Wed Sep 11 2019 Martin van Dinther 
+- Optimized parse() method of TupleLineParser by creating less helper objects
+  and replacing method calls by direct operations on variables.
+
 * Wed Sep  4 2019 Martin van Dinther 
 - The jar files are now named according to Java version compatibility.
   For example, the monetdb-jdbc-2.29.jre7.jar file should be used with
diff --git a/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java 
b/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java
--- a/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java
+++ b/src/main/java/nl/cwi/monetdb/mcl/parser/MCLParser.java
@@ -26,7 +26,7 @@ package nl.cwi.monetdb.mcl.parser;
 public abstract class MCLParser {
/** The String values found while parsing.  Public, you may touch it. */
public final String values[];
-   protected int colnr;
+   protected int colnr = 0;
 
/**
 * Creates an MCLParser targetted at a given number of field values.
diff --git a/src/main/java/nl/cwi/monetdb/mcl/parser/TupleLineParser.java 
b/src/main/java/nl/cwi/monetdb/mcl/parser/TupleLineParser.java
--- a/src/main/java/nl/cwi/monetdb/mcl/parser/TupleLineParser.java
+++ b/src/main/java/nl/cwi/monetdb/mcl/parser/TupleLineParser.java
@@ -9,15 +9,21 @@
 package nl.cwi.monetdb.mcl.parser;
 
 /**
- * The TupleLineParser extracts the values from a given tuple.  The
- * number of values that are expected are known upfront to speed up
+ * The TupleLineParser extracts the values from a given tuple.
+ * The number of values that are expected are known upfront to speed up
  * allocation and validation.
  *
  * @author Fabian Groffen
+ * @author Martin van Dinther
  */
 public final class TupleLineParser extends MCLParser {
+   private StringBuilder uesc = null;  // used for building field 
string value when an escape is present in the field value
+
/**
 * Constructs a TupleLineParser which expects columncount columns.
+* The columncount argument is used for allocation of the public values 
array.
+* While this seems illogical, the caller should know this size, since 
the
+* StartOfHeader contains this information.
 *
 * @param columncount the number of columns in the to be parsed string
 */
@@ -26,22 +32,22 @@ public final class TupleLineParser exten
}
 
/**
-* Parses the given String source as tuple line.  If source cannot
-* be parsed, a ParseException is thrown.  The columncount argument
-* is used for allocation of the returned array.  While this seems
-* illogical, the caller should know this size, since the
-* StartOfHeader contains this information.
+* Parses the given String source as tuple line.
+* If source cannot be parsed, a MCLParseException is thrown.
 *
-* @param source a String which should be parsed
+* @param source a String representing a tuple line which should be 
parsed
 * @return 0, as there is no 'type' of TupleLine
-* @throws MCLParseException if an error occurs during parsing
+* @throws MCLParseException if source is not compliant to expected 
tuple/single value format
 */
@Override
public int parse(final String source) throws MCLParseException {
final int len = source.length();
-   // first detect whether this is a single value line (=) or a
-   // real tuple ([)
-   if (len >= 1 && source.charAt(0) == '=') {
+   if (len <= 0)
+   throw new MCLParseException("Missing tuple data");
+
+   // first detect whether this is a single value line (=) or a 
real tuple ([)
+   char chr = source.charAt(0);
+   if (chr == '=') {

MonetDB: default - Correcting typos in Exception strings

2019-09-11 Thread Martin van Dinther
Changeset: 258e892ad1b2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=258e892ad1b2
Modified Files:
monetdb5/modules/mal/sysmon.c
Branch: default
Log Message:

Correcting typos in Exception strings
(recently added in 
https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=74e74fc25bec)


diffs (30 lines):

diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c
--- a/monetdb5/modules/mal/sysmon.c
+++ b/monetdb5/modules/mal/sysmon.c
@@ -13,7 +13,7 @@
 #include "mtime.h"
 
 /* (c) M.L. Kersten
- * The query runtime monitor facility is hardwired 
+ * The query runtime monitor facility is hardwired
 */
 
 str
@@ -177,7 +177,7 @@ SYSMONresume(Client cntxt, MalBlkPtr mb,
throw(MAL, "SYSMONresume", "type hge not handled, yet");
 #endif
default:
-   throw(MAL, "SYSMONpause", "Pause requires integer");
+   throw(MAL, "SYSMONresume", "Resume requires integer");
}
MT_lock_set(_delayLock);
for ( i = 0; QRYqueue[i].tag; i++)
@@ -207,7 +207,7 @@ SYSMONstop(Client cntxt, MalBlkPtr mb, M
throw(MAL, "SYSMONstop", "type hge not handled, yet");
 #endif
default:
-   throw(MAL, "SYSMONpause", "Pause requires integer");
+   throw(MAL, "SYSMONstop", "Stop requires integer");
}
MT_lock_set(_delayLock);
for ( i = 0; QRYqueue[i].tag; i++)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list