MonetDB: Oct2014 - Relegate HEAPfree to private part of gdk.
Changeset: 7db12a145375 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7db12a145375 Modified Files: gdk/gdk.h gdk/gdk_private.h Branch: Oct2014 Log Message: Relegate HEAPfree to private part of gdk. diffs (23 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1060,7 +1060,6 @@ typedef int (*GDKfcn) (); * These routines should be used to alloc free or extend heaps; they * isolate you from the different ways heaps can be accessed. */ -gdk_export int HEAPfree(Heap *h); gdk_export int HEAPextend(Heap *h, size_t size, int mayshare); gdk_export size_t HEAPvmsize(Heap *h); gdk_export size_t HEAPmemsize(Heap *h); diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -152,6 +152,8 @@ int HEAPcopy(Heap *dst, Heap *src) __attribute__((__visibility__(hidden))); int HEAPdelete(Heap *h, const char *o, const char *ext) __attribute__((__visibility__(hidden))); +int HEAPfree(Heap *h) + __attribute__((__visibility__(hidden))); int HEAPload(Heap *h, const char *nme, const char *ext, int trunc) __attribute__((__visibility__(hidden))); int HEAPsave(Heap *h, const char *nme, const char *ext) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Use a define instead of a magic number.
Changeset: 400b5c599dfc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=400b5c599dfc Modified Files: gdk/gdk.h gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_join.c gdk/gdk_storage.c Branch: Oct2014 Log Message: Use a define instead of a magic number. diffs (145 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1647,6 +1647,8 @@ gdk_export int BATmmap(BAT *b, int hb, i gdk_export int BATdelete(BAT *b); gdk_export size_t BATmemsize(BAT *b, int dirty); +#define NOFARM (-1) /* indicate to GDKfilepath to create relative path */ + gdk_export char *GDKfilepath(int farmid, const char *dir, const char *nme, const char *ext); gdk_export int GDKcreatedir(const char *nme); diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -152,20 +152,20 @@ BATcreatedesc(int ht, int tt, int heapna const char *nme = BBP_physical(bn-batCacheid); if (ht) { - bn-H-heap.filename = GDKfilepath(-1, NULL, nme, head); + bn-H-heap.filename = GDKfilepath(NOFARM, NULL, nme, head); if (bn-H-heap.filename == NULL) goto bailout; } if (tt) { - bn-T-heap.filename = GDKfilepath(-1, NULL, nme, tail); + bn-T-heap.filename = GDKfilepath(NOFARM, NULL, nme, tail); if (bn-T-heap.filename == NULL) goto bailout; } if (ATOMneedheap(ht)) { if ((bn-H-vheap = (Heap *) GDKzalloc(sizeof(Heap))) == NULL || - (bn-H-vheap-filename = GDKfilepath(-1, NULL, nme, hheap)) == NULL) + (bn-H-vheap-filename = GDKfilepath(NOFARM, NULL, nme, hheap)) == NULL) goto bailout; bn-H-vheap-parentid = bn-batCacheid; bn-H-vheap-farmid = BBPselectfarm(role, bn-htype, varheap); @@ -173,7 +173,7 @@ BATcreatedesc(int ht, int tt, int heapna if (ATOMneedheap(tt)) { if ((bn-T-vheap = (Heap *) GDKzalloc(sizeof(Heap))) == NULL || - (bn-T-vheap-filename = GDKfilepath(-1, NULL, nme, theap)) == NULL) + (bn-T-vheap-filename = GDKfilepath(NOFARM, NULL, nme, theap)) == NULL) goto bailout; bn-T-vheap-parentid = bn-batCacheid; bn-T-vheap-farmid = BBPselectfarm(role, bn-ttype, varheap); @@ -715,7 +715,7 @@ heapcopy(BAT *bn, char *ext, Heap *dst, if (src-filename src-newstorage != STORE_MEM) { const char *nme = BBP_physical(bn-batCacheid); - if ((dst-filename = GDKfilepath(-1, NULL, nme, ext)) == NULL) + if ((dst-filename = GDKfilepath(NOFARM, NULL, nme, ext)) == NULL) return -1; } return HEAPcopy(dst, src); diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -519,7 +519,7 @@ fixoidheapcolumn(BAT *b, const char *src for BAT %d failed\n, bid); /* create new string heap */ - b-H-heap.filename = GDKfilepath(-1, NULL, nme, headtail); + b-H-heap.filename = GDKfilepath(NOFARM, NULL, nme, headtail); if (b-H-heap.filename == NULL) GDKfatal(fixoidheap: GDKmalloc failed\n); w = b-H-width; /* remember old width */ @@ -530,7 +530,7 @@ fixoidheapcolumn(BAT *b, const char *src for BAT %d failed\n, headtail, bid); b-H-heap.dirty = TRUE; - b-H-vheap-filename = GDKfilepath(-1, NULL, nme, htheap); + b-H-vheap-filename = GDKfilepath(NOFARM, NULL, nme, htheap); if (b-H-vheap-filename == NULL) GDKfatal(fixoidheap: GDKmalloc failed\n); if (ATOMheap(TYPE_str, b-H-vheap, b-batCapacity)) @@ -580,7 +580,7 @@ fixoidheapcolumn(BAT *b, const char *src for BAT %d failed\n, headtail, bid); /* create new heap */ - b-H-heap.filename = GDKfilepath(-1, NULL, nme, headtail); + b-H-heap.filename = GDKfilepath(NOFARM, NULL, nme, headtail); if (b-H-heap.filename == NULL) GDKfatal(fixoidheap: GDKmalloc failed\n); b-H-width = SIZEOF_OID; @@ -1790,7 +1790,7 @@ BBPinsert(BATstore *bs) BBPgetsubdir(dirname, i); nme = BBPphysicalname(name, 64, i); - BBP_physical(i) = GDKfilepath(-1, dirname, nme, NULL); + BBP_physical(i) = GDKfilepath(NOFARM, dirname, nme, NULL); BATDEBUG
MonetDB: Oct2014 - Approved leaks tests.
Changeset: 07ba9980d8eb for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07ba9980d8eb Modified Files: sql/test/leaks/Tests/check0_nogeom.stable.out sql/test/leaks/Tests/check3_nogeom.stable.out sql/test/leaks/Tests/check4_nogeom.stable.out sql/test/leaks/Tests/check5_nogeom.stable.out sql/test/leaks/Tests/select1_nogeom.stable.out sql/test/leaks/Tests/select2_nogeom.stable.out sql/test/leaks/Tests/temp2_nogeom.stable.out sql/test/leaks/Tests/temp3_nogeom.stable.out Branch: Oct2014 Log Message: Approved leaks tests. diffs (114 lines): diff --git a/sql/test/leaks/Tests/check0_nogeom.stable.out b/sql/test/leaks/Tests/check0_nogeom.stable.out --- a/sql/test/leaks/Tests/check0_nogeom.stable.out +++ b/sql/test/leaks/Tests/check0_nogeom.stable.out @@ -79,7 +79,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 390 ] +[ transient, 318 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name diff --git a/sql/test/leaks/Tests/check3_nogeom.stable.out b/sql/test/leaks/Tests/check3_nogeom.stable.out --- a/sql/test/leaks/Tests/check3_nogeom.stable.out +++ b/sql/test/leaks/Tests/check3_nogeom.stable.out @@ -199,7 +199,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 187 ] +[ transient, 169 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name diff --git a/sql/test/leaks/Tests/check4_nogeom.stable.out b/sql/test/leaks/Tests/check4_nogeom.stable.out --- a/sql/test/leaks/Tests/check4_nogeom.stable.out +++ b/sql/test/leaks/Tests/check4_nogeom.stable.out @@ -199,7 +199,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 187 ] +[ transient, 169 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name diff --git a/sql/test/leaks/Tests/check5_nogeom.stable.out b/sql/test/leaks/Tests/check5_nogeom.stable.out --- a/sql/test/leaks/Tests/check5_nogeom.stable.out +++ b/sql/test/leaks/Tests/check5_nogeom.stable.out @@ -199,7 +199,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 187 ] +[ transient, 169 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name diff --git a/sql/test/leaks/Tests/select1_nogeom.stable.out b/sql/test/leaks/Tests/select1_nogeom.stable.out --- a/sql/test/leaks/Tests/select1_nogeom.stable.out +++ b/sql/test/leaks/Tests/select1_nogeom.stable.out @@ -37,7 +37,7 @@ Ready. % L1 # name % wrd # type % 3 # length -[ 348 ] +[ 330 ] #select 1; % .L # table_name % single_value # name @@ -49,7 +49,7 @@ Ready. % L1 # name % wrd # type % 3 # length -[ 348 ] +[ 330 ] # 16:21:19 # 16:21:19 Done. diff --git a/sql/test/leaks/Tests/select2_nogeom.stable.out b/sql/test/leaks/Tests/select2_nogeom.stable.out --- a/sql/test/leaks/Tests/select2_nogeom.stable.out +++ b/sql/test/leaks/Tests/select2_nogeom.stable.out @@ -37,7 +37,7 @@ Ready. % L1 # name % wrd # type % 3 # length -[ 348 ] +[ 330 ] #select 1; % .L # table_name % single_value # name @@ -49,7 +49,7 @@ Ready. % L1 # name % wrd # type % 3 # length -[ 348 ] +[ 330 ] # 16:21:20 # 16:21:20 Done. diff --git a/sql/test/leaks/Tests/temp2_nogeom.stable.out b/sql/test/leaks/Tests/temp2_nogeom.stable.out --- a/sql/test/leaks/Tests/temp2_nogeom.stable.out +++ b/sql/test/leaks/Tests/temp2_nogeom.stable.out @@ -33,7 +33,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 169 ] +[ transient, 172 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name diff --git a/sql/test/leaks/Tests/temp3_nogeom.stable.out b/sql/test/leaks/Tests/temp3_nogeom.stable.out --- a/sql/test/leaks/Tests/temp3_nogeom.stable.out +++ b/sql/test/leaks/Tests/temp3_nogeom.stable.out @@ -32,7 +32,7 @@ Ready. % L1, L2 # name % char,wrd # type % 9, 3 # length -[ transient, 174 ] +[ transient, 172 ] #select 'persistent', count(*) from bbp() as bbp where kind like 'pers%'; % .L1, .L2 # table_name % L1, L2 # name ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Formatting.
Changeset: f82cf6b75543 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f82cf6b75543 Modified Files: sql/backends/monet5/Tests/All Branch: Oct2014 Log Message: Formatting. diffs (18 lines): diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All --- a/sql/backends/monet5/Tests/All +++ b/sql/backends/monet5/Tests/All @@ -10,11 +10,11 @@ HAVE_LIBR?rapi06 HAVE_LIBR?rapi07 # this one will require significant work in the SQL layer, so disabled for now # HAVE_LIBR?rapi08 - HAVE_LIBR?rapi09 - HAVE_LIBR?rapi10 +HAVE_LIBR?rapi09 +HAVE_LIBR?rapi10 # should this work? #inlineUDF # disabled for now -#Mbeddedsql5--help +#Mbeddedsql5--help ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Oct2014 branch.
Changeset: 37e5932e9998 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37e5932e9998 Modified Files: clients/Tests/exports.stable.out gdk/gdk.h gdk/gdk_align.c gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_group.c gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_join.c gdk/gdk_private.h gdk/gdk_search.c gdk/gdk_select.c gdk/gdk_storage.c gdk/gdk_unique.c sql/backends/monet5/Tests/All sql/backends/monet5/generator/generator.c sql/test/leaks/Tests/check0_nogeom.stable.out sql/test/leaks/Tests/check3_nogeom.stable.out sql/test/leaks/Tests/check4_nogeom.stable.out sql/test/leaks/Tests/check5_nogeom.stable.out sql/test/leaks/Tests/select1_nogeom.stable.out sql/test/leaks/Tests/select2_nogeom.stable.out sql/test/leaks/Tests/temp2_nogeom.stable.out sql/test/leaks/Tests/temp3_nogeom.stable.out Branch: default Log Message: Merge with Oct2014 branch. diffs (truncated from 841 to 300 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -289,7 +289,6 @@ void HEAP_free(Heap *heap, var_t block); void HEAP_initialize(Heap *heap, size_t nbytes, size_t nprivate, int alignment); var_t HEAP_malloc(Heap *heap, size_t nbytes); int HEAPextend(Heap *h, size_t size, int mayshare); -int HEAPfree(Heap *h); size_t HEAPmemsize(Heap *h); size_t HEAPvmsize(Heap *h); lng IMPSimprintsize(BAT *b); diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1043,7 +1043,7 @@ typedef int (*GDKfcn) (); * HEAPalloc (Heap *h, size_t nitems, size_t itemsize); * @item int * @tab - * HEAPfree (Heap *h); + * HEAPfree (Heap *h, int remove); * @item int * @tab * HEAPextend (Heap *h, size_t size, int mayshare); @@ -1068,7 +1068,6 @@ typedef int (*GDKfcn) (); * These routines should be used to alloc free or extend heaps; they * isolate you from the different ways heaps can be accessed. */ -gdk_export int HEAPfree(Heap *h); gdk_export int HEAPextend(Heap *h, size_t size, int mayshare); gdk_export size_t HEAPvmsize(Heap *h); gdk_export size_t HEAPmemsize(Heap *h); @@ -1656,6 +1655,8 @@ gdk_export int BATmmap(BAT *b, int hb, i gdk_export int BATdelete(BAT *b); gdk_export size_t BATmemsize(BAT *b, int dirty); +#define NOFARM (-1) /* indicate to GDKfilepath to create relative path */ + gdk_export char *GDKfilepath(int farmid, const char *dir, const char *nme, const char *ext); gdk_export int GDKcreatedir(const char *nme); diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -500,7 +500,7 @@ BATmaterializeh(BAT *b) BATsetcount(b, cnt); /* cleanup the old heaps */ - HEAPfree(head); + HEAPfree(head, 0); return b; } @@ -756,10 +756,10 @@ VIEWreset(BAT *b) BBPreclaim(v); if (n != NULL) BBPunfix(n-batCacheid); - HEAPfree(head); - HEAPfree(tail); - HEAPfree(hh); - HEAPfree(th); + HEAPfree(head, 0); + HEAPfree(tail, 0); + HEAPfree(hh, 0); + HEAPfree(th, 0); return NULL; } @@ -810,13 +810,13 @@ VIEWdestroy(BAT *b) VIEWunlink(b); if (b-htype !b-H-heap.parentid) { - HEAPfree(b-H-heap); + HEAPfree(b-H-heap, 0); } else { b-H-heap.base = NULL; b-H-heap.filename = NULL; } if (b-ttype !b-T-heap.parentid) { - HEAPfree(b-T-heap); + HEAPfree(b-T-heap, 0); } else { b-T-heap.base = NULL; b-T-heap.filename = NULL; diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -152,20 +152,20 @@ BATcreatedesc(int ht, int tt, int heapna const char *nme = BBP_physical(bn-batCacheid); if (ht) { - bn-H-heap.filename = GDKfilepath(-1, NULL, nme, head); + bn-H-heap.filename = GDKfilepath(NOFARM, NULL, nme, head); if (bn-H-heap.filename == NULL) goto bailout; } if (tt) { - bn-T-heap.filename = GDKfilepath(-1, NULL, nme, tail); + bn-T-heap.filename = GDKfilepath(NOFARM, NULL, nme, tail); if (bn-T-heap.filename == NULL) goto bailout; } if (ATOMneedheap(ht)) { if ((bn-H-vheap = (Heap *) GDKzalloc(sizeof(Heap))) == NULL || - (bn-H-vheap-filename = GDKfilepath(-1, NULL, nme, hheap)) == NULL) + (bn-H-vheap-filename = GDKfilepath(NOFARM, NULL, nme, hheap)) == NULL)
MonetDB: Oct2014 - Combat skew in lengths of BAT free lists.
Changeset: 66bea195802e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=66bea195802e Modified Files: gdk/gdk_bbp.c Branch: Oct2014 Log Message: Combat skew in lengths of BAT free lists. See comment in code. diffs (73 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1702,6 +1702,47 @@ BBPcurstamp(void) return ATOMIC_GET(BBP_curstamp, BBP_curstampLock, BBPcurstamp) 0x7fff; } +/* There are BBP_THREADMASK+1 (64) free lists, and ours (idx) is + * empty. Here we find the longest free list, and if it is long + * enough ( 20 entries) we take one entry from that list. If the + * longest list isn't long enough, we create a new entry by either + * just increasing BBPsize (up to BBPlimit) or extending the BBP + * (which increases BBPlimit). */ +static void +maybeextend(int idx) +{ + int t, m; + int n, l; + bat i; + + l = 0; /* length of longest list */ + m = 0; /* index of longest list */ + /* find longest free list */ + for (t = 0; t = BBP_THREADMASK; t++) { + n = 0; + for (i = BBP_free(t); i != 0; i = BBP_next(i)) + n++; + if (n l) { + m = t; + l = n; + } + } + if (l 20) { + /* longest list is long enough, get an entry from there */ + i = BBP_free(m); + BBP_free(m) = BBP_next(i); + BBP_next(i) = 0; + BBP_free(idx) = i; + } else { + /* let the longest list alone, get a fresh entry */ + if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { + BBPextend(idx, TRUE); + } else { + BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; + } + } +} + bat BBPinsert(BATstore *bs) { @@ -1738,11 +1779,7 @@ BBPinsert(BATstore *bs) /* check again in case some other thread extended * while we were waiting */ if (BBP_free(idx) = 0) { - if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { - BBPextend(idx, TRUE); - } else { - BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; - } + maybeextend(idx); } MT_lock_unset(GDKnameLock, BBPinsert); if (lock) @@ -1752,7 +1789,7 @@ BBPinsert(BATstore *bs) } i = BBP_free(idx); assert(i 0); - BBP_free(idx) = BBP_next(BBP_free(idx)); + BBP_free(idx) = BBP_next(i); if (lock) { MT_lock_unset(GDKcacheLock(idx), BBPinsert); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Update Lahman package, too.
Changeset: 275cda5aeab0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=275cda5aeab0 Modified Files: clients/R/Tests/install-dependencies.sh Branch: Oct2014 Log Message: Update Lahman package, too. diffs (7 lines): diff --git a/clients/R/Tests/install-dependencies.sh b/clients/R/Tests/install-dependencies.sh --- a/clients/R/Tests/install-dependencies.sh +++ b/clients/R/Tests/install-dependencies.sh @@ -1,2 +1,2 @@ #!/bin/sh -R --vanilla --quiet -e install.packages(c('dplyr','sqlsurvey','DBI','digest'),repos=c('http://r-forge.r-project.org','http://cran.rstudio.com/'),type='source') +R --vanilla --quiet -e install.packages(c('dplyr','survey','sqlsurvey','DBI','digest','Lahman'),repos=c('http://download.r-forge.r-project.org','http://cran.rstudio.com/'),type='source') ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - More merge table tests
Changeset: 91402f5bf77d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=91402f5bf77d Added Files: sql/test/mergetables/Tests/alter.sql sql/test/mergetables/Tests/emptymergequery.sql sql/test/mergetables/Tests/types.sql Modified Files: sql/backends/monet5/sql_scenario.c sql/test/mergetables/Tests/All Branch: default Log Message: More merge table tests diffs (82 lines): diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -1298,7 +1298,7 @@ SQLinitClient(Client c) } /* add missing features needed beyond Oct 2014 */ sql_find_subtype(tp, timestamp, 0, 0); - if ( !sql_bind_func(m-sa, mvc_bind_schema(m, sys), epoch, tp, NULL, F_FUNC) ){ + if ( 0 !sql_bind_func(m-sa, mvc_bind_schema(m, sys), epoch, tp, NULL, F_FUNC) ){ if ((err = sql_update_feb2015(c)) !=NULL) { fprintf(stderr, !%s\n, err); GDKfree(err); diff --git a/sql/test/mergetables/Tests/All b/sql/test/mergetables/Tests/All --- a/sql/test/mergetables/Tests/All +++ b/sql/test/mergetables/Tests/All @@ -1,6 +1,9 @@ mergeinit mergeload mergequery +emptymergequery +altertable +types forex #mergedrop corrupts the database #crash0 crashes the server diff --git a/sql/test/mergetables/Tests/alter.sql b/sql/test/mergetables/Tests/alter.sql new file mode 100644 --- /dev/null +++ b/sql/test/mergetables/Tests/alter.sql @@ -0,0 +1,22 @@ +create merge table smalltable(i integer, j integer); + +alter table smalltable add table unknowntable; + +drop table smalltable; + +create schema mys; +set schema mys; + +create merge table mys.smalltable(i integer, j integer); + +create table mys.part (i integer, j integer); +insert into mys.part values(1,2); + +alter table mys.smalltable add table part1; +alter table mys.smalltable add table mys.part1; + +select * from mys.smalltable; + + +drop table mys.smalltable; +drop table mys.part; diff --git a/sql/test/mergetables/Tests/emptymergequery.sql b/sql/test/mergetables/Tests/emptymergequery.sql new file mode 100644 --- /dev/null +++ b/sql/test/mergetables/Tests/emptymergequery.sql @@ -0,0 +1,5 @@ +create merge table emptym(i integer, j integer); + +select * from emptym; + +drop table emptym; diff --git a/sql/test/mergetables/Tests/types.sql b/sql/test/mergetables/Tests/types.sql new file mode 100644 --- /dev/null +++ b/sql/test/mergetables/Tests/types.sql @@ -0,0 +1,15 @@ + +CREATE TABLE part1 ( x double, y decimal(12,3), z double); + +CREATE TABLE part2 ( x int, y double, z double); + +CREATE MERGE TABLE complete ( x double, y double, z double); + +ALTER TABLE complete ADD TABLE part1; +ALTER TABLE complete ADD TABLE part2; + +SELECT * FROM COMPLETE; + +DROP TABLE complete; +DROP TABLE part1; +DROP TABLE part2; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Oct2014 branch.
Changeset: a11cec59c809 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a11cec59c809 Modified Files: clients/R/Tests/install-dependencies.sh gdk/gdk_bbp.c Branch: default Log Message: Merge with Oct2014 branch. diffs (80 lines): diff --git a/clients/R/Tests/install-dependencies.sh b/clients/R/Tests/install-dependencies.sh --- a/clients/R/Tests/install-dependencies.sh +++ b/clients/R/Tests/install-dependencies.sh @@ -1,2 +1,2 @@ #!/bin/sh -R --vanilla --quiet -e install.packages(c('dplyr','sqlsurvey','DBI','digest'),repos=c('http://r-forge.r-project.org','http://cran.rstudio.com/'),type='source') +R --vanilla --quiet -e install.packages(c('dplyr','survey','sqlsurvey','DBI','digest','Lahman'),repos=c('http://download.r-forge.r-project.org','http://cran.rstudio.com/'),type='source') diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1710,6 +1710,47 @@ BBPcurstamp(void) return ATOMIC_GET(BBP_curstamp, BBP_curstampLock, BBPcurstamp) 0x7fff; } +/* There are BBP_THREADMASK+1 (64) free lists, and ours (idx) is + * empty. Here we find the longest free list, and if it is long + * enough ( 20 entries) we take one entry from that list. If the + * longest list isn't long enough, we create a new entry by either + * just increasing BBPsize (up to BBPlimit) or extending the BBP + * (which increases BBPlimit). */ +static void +maybeextend(int idx) +{ + int t, m; + int n, l; + bat i; + + l = 0; /* length of longest list */ + m = 0; /* index of longest list */ + /* find longest free list */ + for (t = 0; t = BBP_THREADMASK; t++) { + n = 0; + for (i = BBP_free(t); i != 0; i = BBP_next(i)) + n++; + if (n l) { + m = t; + l = n; + } + } + if (l 20) { + /* longest list is long enough, get an entry from there */ + i = BBP_free(m); + BBP_free(m) = BBP_next(i); + BBP_next(i) = 0; + BBP_free(idx) = i; + } else { + /* let the longest list alone, get a fresh entry */ + if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { + BBPextend(idx, TRUE); + } else { + BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; + } + } +} + bat BBPinsert(BATstore *bs) { @@ -1746,11 +1787,7 @@ BBPinsert(BATstore *bs) /* check again in case some other thread extended * while we were waiting */ if (BBP_free(idx) = 0) { - if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { - BBPextend(idx, TRUE); - } else { - BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; - } + maybeextend(idx); } MT_lock_unset(GDKnameLock, BBPinsert); if (lock) @@ -1760,7 +1797,7 @@ BBPinsert(BATstore *bs) } i = BBP_free(idx); assert(i 0); - BBP_free(idx) = BBP_next(BBP_free(idx)); + BBP_free(idx) = BBP_next(i); if (lock) { MT_lock_unset(GDKcacheLock(idx), BBPinsert); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - approved output
Changeset: 2884636d735e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2884636d735e Modified Files: sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/05-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/06-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/07-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/08-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/09-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/10-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/11-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/12-explain.stable.out.int128 sql/benchmarks/ssbm/Tests/13-explain.stable.out.int128 Branch: default Log Message: approved output diffs (truncated from 471 to 300 lines): diff --git a/sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128 b/sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128 --- a/sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128 +++ b/sql/benchmarks/ssbm/Tests/01-explain.stable.out.int128 @@ -54,9 +54,9 @@ function user.s2_1{autoCommit=true}(A0:i X_16:bat[:oid,:int] := sql.bind(X_6,sys,lineorder,lo_quantity,1); X_99 := algebra.thetasubselect(X_16,X_23,A3,); X_25 := sql.subdelta(X_96,X_23,X_13,X_97,X_99); -X_27 := sql.bind_idxbat(X_6,sys,lineorder,lineorder_lo_orderdate_fkey,0); +X_27:bat[:oid,:oid] := sql.bind_idxbat(X_6,sys,lineorder,lineorder_lo_orderdate_fkey,0); (X_29,r1_36) := sql.bind_idxbat(X_6,sys,lineorder,lineorder_lo_orderdate_fkey,2); -X_31 := sql.bind_idxbat(X_6,sys,lineorder,lineorder_lo_orderdate_fkey,1); +X_31:bat[:oid,:oid] := sql.bind_idxbat(X_6,sys,lineorder,lineorder_lo_orderdate_fkey,1); X_32 := sql.projectdelta(X_25,X_27,X_29,r1_36,X_31); X_36:bat[:oid,:int] := sql.bind(X_6,sys,dwdate,d_year,0); X_33:bat[:oid,:oid] := sql.tid(X_6,sys,dwdate); diff --git a/sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128 b/sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128 --- a/sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128 +++ b/sql/benchmarks/ssbm/Tests/02-explain.stable.out.int128 @@ -54,9 +54,9 @@ function user.s2_1{autoCommit=true}(A0:i X_17:bat[:oid,:int] := sql.bind(X_7,sys,lineorder,lo_quantity,1); X_99 := algebra.subselect(X_17,X_24,A3,A4,true,true,false); X_26 := sql.subdelta(X_96,X_24,X_14,X_97,X_99); -X_27 := sql.bind_idxbat(X_7,sys,lineorder,lineorder_lo_orderdate_fkey,0); +X_27:bat[:oid,:oid] := sql.bind_idxbat(X_7,sys,lineorder,lineorder_lo_orderdate_fkey,0); (X_29,r1_37) := sql.bind_idxbat(X_7,sys,lineorder,lineorder_lo_orderdate_fkey,2); -X_31 := sql.bind_idxbat(X_7,sys,lineorder,lineorder_lo_orderdate_fkey,1); +X_31:bat[:oid,:oid] := sql.bind_idxbat(X_7,sys,lineorder,lineorder_lo_orderdate_fkey,1); X_32 := sql.projectdelta(X_26,X_27,X_29,r1_37,X_31); X_36:bat[:oid,:int] := sql.bind(X_7,sys,dwdate,d_yearmonthnum,0); X_33:bat[:oid,:oid] := sql.tid(X_7,sys,dwdate); diff --git a/sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128 b/sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128 --- a/sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128 +++ b/sql/benchmarks/ssbm/Tests/03-explain.stable.out.int128 @@ -54,9 +54,9 @@ function user.s2_1{autoCommit=true}(A0:i X_18:bat[:oid,:int] := sql.bind(X_8,sys,lineorder,lo_quantity,1); X_110 := algebra.subselect(X_18,X_25,A4,A5,true,true,false); X_27 := sql.subdelta(X_107,X_25,X_15,X_108,X_110); -X_28 := sql.bind_idxbat(X_8,sys,lineorder,lineorder_lo_orderdate_fkey,0); +X_28:bat[:oid,:oid] := sql.bind_idxbat(X_8,sys,lineorder,lineorder_lo_orderdate_fkey,0); (X_30,r1_38) := sql.bind_idxbat(X_8,sys,lineorder,lineorder_lo_orderdate_fkey,2); -X_32 := sql.bind_idxbat(X_8,sys,lineorder,lineorder_lo_orderdate_fkey,1); +X_32:bat[:oid,:oid] := sql.bind_idxbat(X_8,sys,lineorder,lineorder_lo_orderdate_fkey,1); X_33 := sql.projectdelta(X_27,X_28,X_30,r1_38,X_32); X_37:bat[:oid,:int] := sql.bind(X_8,sys,dwdate,d_weeknuminyear,0); X_45:bat[:oid,:int] := sql.bind(X_8,sys,dwdate,d_year,0); diff --git a/sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128 b/sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128 --- a/sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128 +++ b/sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128 @@ -43,9 +43,9 @@ Ready. function user.s2_1{autoCommit=true}(A0:str,A1:str):void; X_4 := sql.mvc(); X_5:bat[:oid,:oid] := sql.tid(X_4,sys,lineorder); -X_8 := sql.bind_idxbat(X_4,sys,lineorder,lineorder_lo_partkey_fkey,0); +X_8:bat[:oid,:oid] := sql.bind_idxbat(X_4,sys,lineorder,lineorder_lo_partkey_fkey,0); (X_11,r1_11) :=
MonetDB: Oct2014 - Fix calling sequence of SQLinitEnvironment.
Changeset: 46c64884f6cb for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46c64884f6cb Modified Files: sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_scenario.h Branch: Oct2014 Log Message: Fix calling sequence of SQLinitEnvironment. diffs (49 lines): diff --git a/sql/backends/monet5/datacell/petrinet.c b/sql/backends/monet5/datacell/petrinet.c --- a/sql/backends/monet5/datacell/petrinet.c +++ b/sql/backends/monet5/datacell/petrinet.c @@ -474,7 +474,7 @@ PNcontroller(void *dummy) cntxt = mal_clients; /* run as admin in SQL mode*/ if( strcmp(cntxt-scenario, sql) ) - SQLinitEnvironment(cntxt); +SQLinitEnvironment(cntxt, NULL, NULL, NULL); /* At this point we know what is the total number of factories. * The most extremely case is when ALL factories are enable to fire * so the maximum space we could ever need is = #factories (=pnettop)*/ diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -1320,8 +1320,11 @@ SQLexitClient(Client c) * execution */ str -SQLinitEnvironment(Client cntxt) +SQLinitEnvironment(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) { + (void) mb; + (void) stk; + (void) pci; return SQLinitClient(cntxt); } @@ -1371,7 +1374,7 @@ SQLstatementIntern(Client c, str *expr, mnstr_printf(c-fdout, #SQLstatement:%s\n, *expr); #endif if (!sql) { - msg = SQLinitEnvironment(c); + msg = SQLinitEnvironment(c, NULL, NULL, NULL); sql = (backend *) c-sqlcontext; } if (msg){ diff --git a/sql/backends/monet5/sql_scenario.h b/sql/backends/monet5/sql_scenario.h --- a/sql/backends/monet5/sql_scenario.h +++ b/sql/backends/monet5/sql_scenario.h @@ -41,7 +41,7 @@ sql5_export str SQLassertInt(Client cntx sql5_export str SQLassertWrd(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); sql5_export str SQLassertLng(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); -sql5_export str SQLinitEnvironment(Client cntxt); +sql5_export str SQLinitEnvironment(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); sql5_export str SQLstatement(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); sql5_export str SQLstatementIntern(Client c, str *expr, str nme, int execute, bit output); sql5_export str SQLcompile(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Layout.
Changeset: 56c3d4577d9f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=56c3d4577d9f Modified Files: gdk/gdk_imprints.c Branch: Oct2014 Log Message: Layout. diffs (51 lines): diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c --- a/gdk/gdk_imprints.c +++ b/gdk/gdk_imprints.c @@ -412,7 +412,7 @@ do { \ uint##B##_t *im = (uint##B##_t *) imps; \ TYPE *col = (TYPE *) Tloc(b, b-batFirst); \ TYPE *bins = (TYPE *) inbins; \ - TYPE nil = TYPE##_nil; \ + TYPE nil = TYPE##_nil; \ prvmask = mask = 0; \ new = (IMPS_PAGE/sizeof(TYPE))-1; \ for (i = 0; i b-batCount; i++) { \ @@ -453,23 +453,23 @@ do { \ } \ GETBIN##B(bin,col[i]); \ mask = IMPSsetBit(B,mask,bin); \ - if (!cnt_bins[bin]++) { \ + if (!cnt_bins[bin]++) { \ min_bins[bin] = max_bins[bin] = i; \ - } else { \ + } else {\ /* nil value can not be min */ \ - if ((bin == 0) (col[i] != nil)) { \ - /* in case the first value was nil and min_bin[0] \ -* has been initialized with it */ \ - if (col[min_bins[0]] == nil) { \ - min_bins[0] = i; \ - } else if (col[i] col[min_bins[0]]) { \ - min_bins[0] = i; \ - } \ - } else { \ - if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ - } \ - if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ - } \ + if ((bin == 0) (col[i] != nil)) {\ + /* in case the first value was nil and min_bin[0] \ +* has been initialized with it */ \ + if (col[min_bins[0]] == nil) { \ + min_bins[0] = i;\ + } else if (col[i] col[min_bins[0]]) { \ + min_bins[0] = i;\ + } \ + } else { \ + if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ + } \ + if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ + } \ } \ /* one last left */ \ if (prvmask == mask dcnt 0 \ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - merged
Changeset: fe22eeb7284e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fe22eeb7284e Modified Files: clients/R/Tests/install-dependencies.sh gdk/gdk_bbp.c gdk/gdk_imprints.c sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_scenario.h Branch: Oct2014 Log Message: merged diffs (180 lines): diff --git a/clients/R/Tests/install-dependencies.sh b/clients/R/Tests/install-dependencies.sh --- a/clients/R/Tests/install-dependencies.sh +++ b/clients/R/Tests/install-dependencies.sh @@ -1,2 +1,2 @@ #!/bin/sh -R --vanilla --quiet -e install.packages(c('dplyr','sqlsurvey','DBI','digest'),repos=c('http://r-forge.r-project.org','http://cran.rstudio.com/'),type='source') +R --vanilla --quiet -e install.packages(c('dplyr','survey','sqlsurvey','DBI','digest','Lahman'),repos=c('http://download.r-forge.r-project.org','http://cran.rstudio.com/'),type='source') diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1702,6 +1702,47 @@ BBPcurstamp(void) return ATOMIC_GET(BBP_curstamp, BBP_curstampLock, BBPcurstamp) 0x7fff; } +/* There are BBP_THREADMASK+1 (64) free lists, and ours (idx) is + * empty. Here we find the longest free list, and if it is long + * enough ( 20 entries) we take one entry from that list. If the + * longest list isn't long enough, we create a new entry by either + * just increasing BBPsize (up to BBPlimit) or extending the BBP + * (which increases BBPlimit). */ +static void +maybeextend(int idx) +{ + int t, m; + int n, l; + bat i; + + l = 0; /* length of longest list */ + m = 0; /* index of longest list */ + /* find longest free list */ + for (t = 0; t = BBP_THREADMASK; t++) { + n = 0; + for (i = BBP_free(t); i != 0; i = BBP_next(i)) + n++; + if (n l) { + m = t; + l = n; + } + } + if (l 20) { + /* longest list is long enough, get an entry from there */ + i = BBP_free(m); + BBP_free(m) = BBP_next(i); + BBP_next(i) = 0; + BBP_free(idx) = i; + } else { + /* let the longest list alone, get a fresh entry */ + if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { + BBPextend(idx, TRUE); + } else { + BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; + } + } +} + bat BBPinsert(BATstore *bs) { @@ -1738,11 +1779,7 @@ BBPinsert(BATstore *bs) /* check again in case some other thread extended * while we were waiting */ if (BBP_free(idx) = 0) { - if ((bat) ATOMIC_ADD(BBPsize, 1, BBPsizeLock, BBPinsert) = BBPlimit) { - BBPextend(idx, TRUE); - } else { - BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock, BBPinsert) - 1; - } + maybeextend(idx); } MT_lock_unset(GDKnameLock, BBPinsert); if (lock) @@ -1752,7 +1789,7 @@ BBPinsert(BATstore *bs) } i = BBP_free(idx); assert(i 0); - BBP_free(idx) = BBP_next(BBP_free(idx)); + BBP_free(idx) = BBP_next(i); if (lock) { MT_lock_unset(GDKcacheLock(idx), BBPinsert); diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c --- a/gdk/gdk_imprints.c +++ b/gdk/gdk_imprints.c @@ -412,7 +412,7 @@ do { \ uint##B##_t *im = (uint##B##_t *) imps; \ TYPE *col = (TYPE *) Tloc(b, b-batFirst); \ TYPE *bins = (TYPE *) inbins; \ - TYPE nil = TYPE##_nil; \ + TYPE nil = TYPE##_nil; \ prvmask = mask = 0; \ new = (IMPS_PAGE/sizeof(TYPE))-1; \ for (i = 0; i b-batCount; i++) { \ @@ -453,23 +453,23 @@ do { \ } \ GETBIN##B(bin,col[i]); \ mask = IMPSsetBit(B,mask,bin); \ - if (!cnt_bins[bin]++) { \ + if (!cnt_bins[bin]++) { \ min_bins[bin] = max_bins[bin] = i;
MonetDB: Oct2014 - correct implementation of scalar identity
Changeset: f4ae6e2a833a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f4ae6e2a833a Modified Files: sql/backends/monet5/sql.c sql/backends/monet5/sql.h Branch: Oct2014 Log Message: correct implementation of scalar identity diffs (35 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 @@ -3141,16 +3141,10 @@ not_unique_oids(bat *ret, const bat *bid /* row case */ str -SQLidentity(bat *ret, const bat *bid) +SQLidentity(oid *ret, const void *i) { - BAT *bn, *b; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(SQL, batcalc.identity, Cannot access descriptor); - } - bn = VIEWhead(b); - BBPunfix(b-batCacheid); - BBPkeepref(*ret = bn-batCacheid); + (void)i; + *ret = 0; return MAL_SUCCEED; } 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 @@ -160,7 +160,7 @@ sql5_export str sql_rank_grp(bat *rid, c sql5_export str sql_rank(bat *rid, const bat *bid); sql5_export str sql_dense_rank_grp(bat *rid, const bat *bid, const bat *gid, const bat *gpe); sql5_export str sql_dense_rank(bat *rid, const bat *bid); -sql5_export str SQLidentity(bat *rid, const bat *bid); +sql5_export str SQLidentity(oid *rid, const void *i); sql5_export str BATSQLidentity(bat *rid, const bat *bid); sql5_export str PBATSQLidentity(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Removed unused function STRfindUnescapedOccur...
Changeset: 2e83e371093e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2e83e371093e Modified Files: monetdb5/modules/atoms/str.c monetdb5/modules/atoms/str.h Branch: Oct2014 Log Message: Removed unused function STRfindUnescapedOccurrence. diffs (34 lines): diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c --- a/monetdb5/modules/atoms/str.c +++ b/monetdb5/modules/atoms/str.c @@ -1515,19 +1515,6 @@ STRSQLLength(int *res, str *s) */ #include mal_exception.h -str -STRfindUnescapedOccurrence(str b, str c, str esc){ - str t; - - t= strstr(b,c); - while( t){ - /* check for escaped version */ - if (tb *esc == *(t-1) ) { - t= strstr(t+1,c); - } else return t; - } - return 0; -} /* * The SQL like function return a boolean */ diff --git a/monetdb5/modules/atoms/str.h b/monetdb5/modules/atoms/str.h --- a/monetdb5/modules/atoms/str.h +++ b/monetdb5/modules/atoms/str.h @@ -71,7 +71,6 @@ str_export str STRmax(str *res, str *lef str_export str STRSubstitute(str *res, str *arg1, str *arg2, str *arg3, bit *g); str_export str STRSQLLength(int *res, str *s); -str_export str STRfindUnescapedOccurrence(str b, str c, str esc); str_export str STRsubstringTail(str *ret, str *s, int *start); str_export str STRsubstring(str *ret, str *s, int *start, int *l); str_export str STRlikewrap2(bit *ret, str *s, str *pat); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Oct2014 branch.
Changeset: 1285a1adb76b for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1285a1adb76b Modified Files: gdk/gdk_imprints.c monetdb5/modules/atoms/str.c monetdb5/modules/atoms/str.h monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/batstr.c monetdb5/modules/mal/pcre.c sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_scenario.h Branch: default Log Message: Merge with Oct2014 branch. diffs (truncated from 1673 to 300 lines): diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c --- a/gdk/gdk_imprints.c +++ b/gdk/gdk_imprints.c @@ -412,7 +412,7 @@ do { \ uint##B##_t *im = (uint##B##_t *) imps; \ TYPE *col = (TYPE *) Tloc(b, b-batFirst); \ TYPE *bins = (TYPE *) inbins; \ - TYPE nil = TYPE##_nil; \ + TYPE nil = TYPE##_nil; \ prvmask = mask = 0; \ new = (IMPS_PAGE/sizeof(TYPE))-1; \ for (i = 0; i b-batCount; i++) { \ @@ -453,23 +453,23 @@ do { \ } \ GETBIN##B(bin,col[i]); \ mask = IMPSsetBit(B,mask,bin); \ - if (!cnt_bins[bin]++) { \ + if (!cnt_bins[bin]++) { \ min_bins[bin] = max_bins[bin] = i; \ - } else { \ + } else {\ /* nil value can not be min */ \ - if ((bin == 0) (col[i] != nil)) { \ - /* in case the first value was nil and min_bin[0] \ -* has been initialized with it */ \ - if (col[min_bins[0]] == nil) { \ - min_bins[0] = i; \ - } else if (col[i] col[min_bins[0]]) { \ - min_bins[0] = i; \ - } \ - } else { \ - if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ - } \ - if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ - } \ + if ((bin == 0) (col[i] != nil)) {\ + /* in case the first value was nil and min_bin[0] \ +* has been initialized with it */ \ + if (col[min_bins[0]] == nil) { \ + min_bins[0] = i;\ + } else if (col[i] col[min_bins[0]]) { \ + min_bins[0] = i;\ + } \ + } else { \ + if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ + } \ + if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ + } \ } \ /* one last left */ \ if (prvmask == mask dcnt 0 \ diff --git a/monetdb5/modules/atoms/str.c
MonetDB: Oct2014 - Added const qualifier.
Changeset: bfb593ddbbc4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bfb593ddbbc4 Modified Files: monetdb5/modules/atoms/str.c monetdb5/modules/atoms/str.h monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/batstr.c monetdb5/modules/mal/pcre.c Branch: Oct2014 Log Message: Added const qualifier. diffs (truncated from 1532 to 300 lines): diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c --- a/monetdb5/modules/atoms/str.c +++ b/monetdb5/modules/atoms/str.c @@ -1453,7 +1453,9 @@ convertCase(BAT *from, BAT *to, str *res BATiter toi = bat_iterator(to); BATiter fromi = bat_iterator(BATmirror(from)); /* hashes work on head columns */ size_t len = strlen(s); - unsigned char *dst, *src = (unsigned char *) s, *end = (unsigned char *) (src + len); + unsigned char *dst; + const unsigned char *src = (const unsigned char *) s; + const unsigned char *end = (const unsigned char *) (src + len); BUN UTF8_CONV_r; if (strNil(s)) { @@ -1497,7 +1499,7 @@ convertCase(BAT *from, BAT *to, str *res } str -STRSQLLength(int *res, str *s) +STRSQLLength(int *res, const str *s) { str r = NULL; str msg; @@ -1519,48 +1521,54 @@ STRSQLLength(int *res, str *s) * The SQL like function return a boolean */ static int -STRlike(str s, str pat, str esc){ - str t,p; +STRlike(const char *s, const char *pat, const char *esc) +{ + const char *t, *p; - t= s; - for( p= pat; *p *t; p++){ - if(esc *p == *esc) { + t = s; + for (p = pat; *p *t; p++) { + if (esc *p == *esc) { p++; - if( *p != *t) return FALSE; + if (*p != *t) + return FALSE; t++; - } else - if( *p == '_') t++; + } else if (*p == '_') + t++; + else if (*p == '%') { + p++; + while (*p == '%') + p++; + if (*p == 0) + return TRUE;/* tail is acceptable */ + for (; *p *t; t++) + if (STRlike(t, p, esc)) + return TRUE; + if (*p == 0 *t == 0) + return TRUE; + return FALSE; + } else if (*p == *t) + t++; else - if( *p == '%'){ - p++; - while(*p == '%') p++; - if( *p == 0) return TRUE; /* tail is acceptable */ - for(; *p *t; t++) - if( STRlike(t,p,esc)) - return TRUE; - if( *p == 0 *t == 0) return TRUE; return FALSE; - } else - if( *p == *t) t++; - else return FALSE; } - if( *p == '%' *(p+1)==0) return TRUE; + if (*p == '%' *(p + 1) == 0) + return TRUE; return *t == 0 *p == 0; } str -STRlikewrap(bit *ret, str *s, str *pat, str *esc){ +STRlikewrap(bit *ret, const str *s, const str *pat, const str *esc){ *ret = STRlike(*s,*pat,*esc); return MAL_SUCCEED; } str -STRlikewrap2(bit *ret, str *s, str *pat){ +STRlikewrap2(bit *ret, const str *s, const str *pat){ *ret = STRlike(*s,*pat,0); return MAL_SUCCEED; } str -STRtostr(str *res, str *src) +STRtostr(str *res, const str *src) { if( *src == 0) *res= GDKstrdup(str_nil); @@ -1572,7 +1580,7 @@ STRtostr(str *res, str *src) * The concatenate operator requires a type in most cases. */ str -STRConcat(str *res, str *val1, str *val2) +STRConcat(str *res, const str *val1, const str *val2) { size_t l1, l2; const char *s1 = *val1; @@ -1595,7 +1603,7 @@ STRConcat(str *res, str *val1, str *val2 } str -STRLength(int *res, str *arg1) +STRLength(int *res, const str *arg1) { size_t l; const char *s = *arg1; @@ -1611,7 +1619,7 @@ STRLength(int *res, str *arg1) } str -STRBytes(int *res, str *arg1) +STRBytes(int *res, const str *arg1) { size_t l; @@ -1622,7 +1630,7 @@ STRBytes(int *res, str *arg1) } str -STRTail(str *res, str *arg1, int *offset) +STRTail(str *res, const str *arg1, const int *offset) { int off = *offset; const char *s = *arg1; @@ -1653,7 +1661,7 @@ STRTail(str *res, str *arg1, int *offset } str -STRSubString(str *res, str *arg1, int *offset, int *length) +STRSubString(str *res, const str *arg1, const int *offset, const int *length) { int len, off = *offset, l = *length;
MonetDB: default - use dbl for cost(s)
Changeset: 2333dda76eb0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2333dda76eb0 Modified Files: sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/server/rel_planner.c Branch: default Log Message: use dbl for cost(s) diffs (58 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 @@ -3149,16 +3149,10 @@ not_unique_oids(bat *ret, const bat *bid /* row case */ str -SQLidentity(bat *ret, const bat *bid) +SQLidentity(oid *ret, const void *i) { - BAT *bn, *b; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(SQL, batcalc.identity, Cannot access descriptor); - } - bn = VIEWhead(b); - BBPunfix(b-batCacheid); - BBPkeepref(*ret = bn-batCacheid); + (void)i; + *ret = 0; return MAL_SUCCEED; } 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 @@ -160,7 +160,7 @@ sql5_export str sql_rank_grp(bat *rid, c sql5_export str sql_rank(bat *rid, const bat *bid); sql5_export str sql_dense_rank_grp(bat *rid, const bat *bid, const bat *gid, const bat *gpe); sql5_export str sql_dense_rank(bat *rid, const bat *bid); -sql5_export str SQLidentity(bat *rid, const bat *bid); +sql5_export str SQLidentity(oid *rid, const void *i); sql5_export str BATSQLidentity(bat *rid, const bat *bid); sql5_export str PBATSQLidentity(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); diff --git a/sql/server/rel_planner.c b/sql/server/rel_planner.c --- a/sql/server/rel_planner.c +++ b/sql/server/rel_planner.c @@ -807,8 +807,8 @@ memo_compute_cost(list *memo) memoitem *mi = n-data; if (mi-joins) { - lng cnt = 0, cost = 0; - lng width = 1; + lng cnt = 0, width = 1; + dbl cost = 0; /* cost minimum of join costs */ for ( m = mi-joins-h; m; m = m-next ) { @@ -817,7 +817,7 @@ memo_compute_cost(list *memo) lng mincnt = MIN(mj-l-count, mj-r-count); dbl nsel = mj-sel; lng ocnt = MAX((lng) (mincnt*nsel), 1); - lng ncost = 0; + dbl ncost = 0; /* mincnt*mincnt_size_width*hash_const_cost + mincnt * output_width(for now just sum of width) * memaccess const */ /* current consts are 1 and 1 */ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - merged
Changeset: b664769e2c4d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b664769e2c4d Modified Files: gdk/gdk_imprints.c monetdb5/modules/atoms/str.c monetdb5/modules/atoms/str.h monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/batstr.c monetdb5/modules/mal/pcre.c sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/sql.c sql/backends/monet5/sql.h sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_scenario.h Branch: default Log Message: merged diffs (truncated from 1638 to 300 lines): diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c --- a/gdk/gdk_imprints.c +++ b/gdk/gdk_imprints.c @@ -412,7 +412,7 @@ do { \ uint##B##_t *im = (uint##B##_t *) imps; \ TYPE *col = (TYPE *) Tloc(b, b-batFirst); \ TYPE *bins = (TYPE *) inbins; \ - TYPE nil = TYPE##_nil; \ + TYPE nil = TYPE##_nil; \ prvmask = mask = 0; \ new = (IMPS_PAGE/sizeof(TYPE))-1; \ for (i = 0; i b-batCount; i++) { \ @@ -453,23 +453,23 @@ do { \ } \ GETBIN##B(bin,col[i]); \ mask = IMPSsetBit(B,mask,bin); \ - if (!cnt_bins[bin]++) { \ + if (!cnt_bins[bin]++) { \ min_bins[bin] = max_bins[bin] = i; \ - } else { \ + } else {\ /* nil value can not be min */ \ - if ((bin == 0) (col[i] != nil)) { \ - /* in case the first value was nil and min_bin[0] \ -* has been initialized with it */ \ - if (col[min_bins[0]] == nil) { \ - min_bins[0] = i; \ - } else if (col[i] col[min_bins[0]]) { \ - min_bins[0] = i; \ - } \ - } else { \ - if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ - } \ - if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ - } \ + if ((bin == 0) (col[i] != nil)) {\ + /* in case the first value was nil and min_bin[0] \ +* has been initialized with it */ \ + if (col[min_bins[0]] == nil) { \ + min_bins[0] = i;\ + } else if (col[i] col[min_bins[0]]) { \ + min_bins[0] = i;\ + } \ + } else { \ + if (col[i] col[min_bins[bin]]) min_bins[bin] = i; \ + } \ + if (col[i] col[max_bins[bin]]) max_bins[bin] = i; \ + } \ } \ /* one last left */ \ if (prvmask == mask dcnt 0 \ diff --git a/monetdb5/modules/atoms/str.c