Changeset: 4bfc5932c334 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4bfc5932c334
Modified Files:
sql/backends/monet5/sql_cat.c
sql/test/mosaic/Tests/compression.sql
Branch: mosaic
Log Message:
Do not allow multiple mosaic parameters in the SQL STORAGE parameter string.
diffs (52 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
@@ -896,20 +896,21 @@ alter_table(Client cntxt, mvc *sql, char
// TODO check where this task is cleaned up.
task = (MOStask) GDKzalloc(sizeof(*task));
- if( c->storage_type &&
!strstr(c->storage_type,"mosaic")) {
+ if( c->storage_type) {
if( task == NULL)
- throw(MAL, "sql.alter",
MAL_MALLOC_FAIL);
+ throw(SQL, "sql.alter",
MAL_MALLOC_FAIL);
- for(int i = 0; i< MOSAIC_METHODS; i++)
- task->filter[i]=
strstr(c->storage_type,MOSfiltername[i]) != 0;
+ for(int i = 0, nr_strategies = 0; i<
MOSAIC_METHODS; i++){
+ if ( (task->filter[i] =
strstr(c->storage_type,MOSfiltername[i]) != 0) )
+ {
+ if (++nr_strategies > 1)
+ throw(SQL, "sql.alter",
"Illegal additional compression strategy: %s.", MOSfiltername[i]);
+ }
+ }
+
+ msg = MOScompressInternal(cntxt,
&b->batCacheid, task, 0);
}
else
- for(int i = 0; i< MOSAIC_METHODS; i++)
- task->filter[i]= 1;
-
- if( c->storage_type)
- msg = MOScompressInternal(cntxt,
&b->batCacheid, task, 0);
- else
msg = MOSdecompressInternal(cntxt,
&b->batCacheid);
BBPunfix(b->batCacheid);
diff --git a/sql/test/mosaic/Tests/compression.sql
b/sql/test/mosaic/Tests/compression.sql
--- a/sql/test/mosaic/Tests/compression.sql
+++ b/sql/test/mosaic/Tests/compression.sql
@@ -115,6 +115,13 @@ select * from tmp3;
select sum(i) from tmp3;
select sum(f) from tmp3;
+alter table tmp3 alter column i set storage 'runlength,dictionary';
+alter table tmp3 alter column b set storage 'mosaic';
+--explain select * from tmp3;
+--select * from tmp3;
+--select sum(i) from tmp3;
+--select sum(f) from tmp3;
+
alter table tmp3 set read write;
select * from tmp3;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list