developers-list
Threads by month
- ----- 2024 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
March 2012
- 5 participants
- 5 discussions
Re: [Monetdb-developers] MonetDB: default - Merge with default branch.
by Stefan Manegold 17 Mar '12
by Stefan Manegold 17 Mar '12
17 Mar '12
oop, sorry, message should have been
"Merge with Apr2012 branch."
Stefan
On Sat, Mar 17, 2012 at 03:20:38PM +0100, Stefan Manegold wrote:
> Changeset: 498e01451664 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=498e01451664
> Modified Files:
> clients/mapiclient/mclient.c
> monetdb5/mal/mal_resolve.c
> sql/backends/monet5/UDF/udf.c
> sql/backends/monet5/UDF/udf.h
> sql/test/bugs/Tests/crash_order_by.stable.out
> tools/merovingian/daemon/controlrunner.c
> tools/merovingian/daemon/merovingian.c
> Branch: default
> Log Message:
>
> Merge with default branch.
>
>
> diffs (truncated from 413 to 300 lines):
>
> diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
> --- a/clients/mapiclient/mclient.c
> +++ b/clients/mapiclient/mclient.c
> @@ -654,7 +654,9 @@ CSVrenderer(MapiHdl hdl)
> s = mapi_fetch_field(hdl, i);
> if (s == NULL)
> s = nullstring == default_nullstring ? "" : nullstring;
> - if (strchr(s, *sep) != NULL || strchr(s, '\n') != NULL || strchr(s, '"') != NULL) {
> + if (strchr(s, *sep) != NULL ||
> + strchr(s, '\n') != NULL ||
> + strchr(s, '"') != NULL) {
> mnstr_printf(toConsole, "%s\"",
> i == 0 ? "" : sep);
> while (*s) {
> @@ -675,8 +677,6 @@ CSVrenderer(MapiHdl hdl)
> mnstr_write(toConsole, "\"\"", 1, 2);
> break;
> default:
> - if (*s == *sep)
> - mnstr_write(toConsole, "\\", 1, 1);
> mnstr_write(toConsole, s, 1, 1);
> break;
> }
> diff --git a/monetdb5/mal/mal_resolve.c b/monetdb5/mal/mal_resolve.c
> --- a/monetdb5/mal/mal_resolve.c
> +++ b/monetdb5/mal/mal_resolve.c
> @@ -68,7 +68,7 @@
> * These examples give little room to achieve our prime objective, i.e.
> * a fast and early type resolution scheme. Any non-polymorphic function
> * can be type checked and marked type-safe upon completion.
> - * Type checking polymorphic functions are post-poned until a concrete
> + * Type checking polymorphic functions are postponed until a concrete
> * type instance is known. It leads to a clone, which can be type checked
> * and is entered into the symbol table.
> * The type resolution status is marked in each instruction.
> diff --git a/sql/backends/monet5/UDF/udf.c b/sql/backends/monet5/UDF/udf.c
> --- a/sql/backends/monet5/UDF/udf.c
> +++ b/sql/backends/monet5/UDF/udf.c
> @@ -3,26 +3,26 @@
> * Version 1.1 (the "License"); you may not use this file except in
> * compliance with the License. You may obtain a copy of the License at
> * http://www.monetdb.org/Legal/MonetDBLicense
> - *
> + *
> * Software distributed under the License is distributed on an "AS IS"
> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
> * License for the specific language governing rights and limitations
> * under the License.
> - *
> + *
> * The Original Code is the MonetDB Database System.
> - *
> + *
> * The Initial Developer of the Original Code is CWI.
> * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
> * Copyright August 2008-2012 MonetDB B.V.
> * All Rights Reserved.
> -*/
> -
> + */
>
> #include "monetdb_config.h"
> #include "udf.h"
>
> /* Reverse a string */
> -str UDFreverse ( str *ret , str *arg )
> +str
> +UDFreverse(str *ret, str *arg)
> {
> size_t len = 0;
> str src = NULL, dst = NULL;
> @@ -37,7 +37,8 @@ str UDFreverse ( str *ret , str *arg )
> if (src == NULL || strcmp(src, str_nil) == 0) {
> *ret = GDKstrdup(str_nil);
> if (*ret == NULL)
> - throw(MAL, "udf.reverse", "failed to create copy of str_nil");
> + throw(MAL, "udf.reverse",
> + "failed to create copy of str_nil");
>
> return MAL_SUCCEED;
> }
> @@ -46,7 +47,8 @@ str UDFreverse ( str *ret , str *arg )
> len = strlen(src);
> *ret = dst = GDKmalloc(len + 1);
> if (dst == NULL)
> - throw(MAL, "udf.reverse", "failed to allocate string of length " SZFMT, len+1);
> + throw(MAL, "udf.reverse",
> + "failed to allocate string of length " SZFMT, len + 1);
>
> /* copy characters from src to dst in reverse order */
> dst[len] = 0;
> @@ -62,7 +64,8 @@ str UDFreverse ( str *ret , str *arg )
> * Generic "type-oblivious" version,
> * using generic "type-oblivious" BAT access interface.
> */
> -str UDFBATreverse ( bat *ret , bat *bid )
> +str
> +UDFBATreverse(bat *ret, bat *bid)
> {
> BATiter li;
> BAT *bn = NULL, *left = NULL;
> @@ -78,7 +81,8 @@ str UDFBATreverse ( bat *ret , bat *bid
> /* check tail type */
> if (left->ttype != TYPE_str) {
> BBPreleaseref(left->batCacheid);
> - throw(MAL, "batudf.reverse", "tail-type of input BAT must be TYPE_str");
> + throw(MAL, "batudf.reverse",
> + "tail-type of input BAT must be TYPE_str");
> }
>
> /* allocate result BAT */
> @@ -98,6 +102,7 @@ str UDFBATreverse ( bat *ret , bat *bid
> /* the core of the algorithm, expensive due to malloc/frees */
> BATloop(left, p, q) {
> str tr = NULL, err = NULL;
> +
> /* get original head & tail value */
> ptr h = BUNhead(li, p);
> str t = (str) BUNtail(li, p);
> @@ -106,7 +111,8 @@ str UDFBATreverse ( bat *ret , bat *bid
> err = UDFreverse(&tr, &t);
> if (err != MAL_SUCCEED) {
> /* error -> bail out */
> - BATaccessEnd(left, USE_HEAD | USE_TAIL, MMAP_SEQUENTIAL);
> + BATaccessEnd(left, USE_HEAD | USE_TAIL,
> + MMAP_SEQUENTIAL);
> BBPreleaseref(left->batCacheid);
> BBPreleaseref(*ret);
> return err;
> @@ -116,7 +122,7 @@ str UDFBATreverse ( bat *ret , bat *bid
> assert(tr != NULL);
>
> /* insert original head and reversed tail in result BAT */
> - /* BUNins() takes care of all necessary admininstration */
> + /* BUNins() takes care of all necessary administration */
> BUNins(bn, h, tr, FALSE);
>
> /* free memory allocated in UDFreverse() */
> @@ -155,9 +161,9 @@ str UDFfuse_##in##_##out ( out *ret , in
> return MAL_SUCCEED; \
> }
>
> -UDFfuse_scalar_impl(bte,unsigned char ,sht, 8)
> -UDFfuse_scalar_impl(sht,unsigned short,int,16)
> -UDFfuse_scalar_impl(int,unsigned int ,lng,32)
> +UDFfuse_scalar_impl(bte, unsigned char, sht, 8)
> +UDFfuse_scalar_impl(sht, unsigned short, int, 16)
> +UDFfuse_scalar_impl(int, unsigned int, lng, 32)
>
>
> /* BAT fuse */
> @@ -165,8 +171,8 @@ UDFfuse_scalar_impl(int,unsigned int ,l
> * Type-expanded optimized version,
> * accessing value arrays directly.
> */
> -str
> -UDFBATfuse ( bat *ires , bat *ione , bat *itwo)
> + str
> +UDFBATfuse(bat *ires, bat *ione, bat *itwo)
> {
> BAT *bres = NULL, *bone = NULL, *btwo = NULL;
> bit two_tail_sorted_unsigned = FALSE;
> @@ -185,89 +191,102 @@ UDFBATfuse ( bat *ires , bat *ione , bat
> }
>
> /* check for dense & aligned heads */
> - if (!BAThdense(bone) || !BAThdense(btwo) || BATcount(bone) != BATcount(btwo) || bone->hseqbase != btwo->hseqbase) {
> + if (!BAThdense(bone) ||
> + !BAThdense(btwo) ||
> + BATcount(bone) != BATcount(btwo) ||
> + bone->hseqbase != btwo->hseqbase) {
> BBPreleaseref(bone->batCacheid);
> BBPreleaseref(btwo->batCacheid);
> - throw(MAL, "batudf.fuse", "heads of input BATs must be aligned");
> + throw(MAL, "batudf.fuse",
> + "heads of input BATs must be aligned");
> }
>
> /* check tail types */
> if (bone->ttype != btwo->ttype) {
> BBPreleaseref(bone->batCacheid);
> BBPreleaseref(btwo->batCacheid);
> - throw(MAL, "batudf.fuse", "tails of input BATs must be identical");
> + throw(MAL, "batudf.fuse",
> + "tails of input BATs must be identical");
> }
>
> /* advice on sequential scan */
> BATaccessBegin(bone, USE_TAIL, MMAP_SEQUENTIAL);
> BATaccessBegin(btwo, USE_TAIL, MMAP_SEQUENTIAL);
>
> -#define UDFBATfuse_TYPE(in,uin,out,shift) \
> -{ /* type-specific core algorithm */ \
> - in *one = NULL, *two = NULL; \
> - out *res = NULL; \
> - BUN i, n = BATcount(bone); \
> - \
> - /* allocate result BAT */ \
> - bres = BATnew(TYPE_void, TYPE_##out, n); \
> - if (bres == NULL) { \
> - BBPreleaseref(bone->batCacheid); \
> - BBPreleaseref(btwo->batCacheid); \
> - throw(MAL, "batudf.fuse", MAL_MALLOC_FAIL); \
> - } \
> - \
> - /* get direct access to the tail arrays */ \
> - one = (in *) Tloc(bone, BUNfirst(bone)); \
> - two = (in *) Tloc(btwo, BUNfirst(btwo)); \
> - res = (out*) Tloc(bres, BUNfirst(bres)); \
> - \
> - /* is tail of right/second BAT sorted, also when cast to unsigned type, */ \
> - /* i.e., are the values either all >= 0 or all < 0? */ \
> - two_tail_sorted_unsigned = BATtordered(btwo)&1 && ( two[0] >= 0 || two[n-1] < 0 ); \
> - \
> - /* iterate over all values/tuples and do the work */ \
> - for (i = 0; i < n; i++) \
> - if (one[i] == in##_nil || two[i] == in##_nil) \
> - /* NULL/nil in => NULL/nil out */ \
> - res[i] = out##_nil; \
> - else \
> - /* do the work; watch out for sign bits */ \
> - res[i] = ( ((out)((uin)one[i])) << shift ) | ((uin)two[i]); \
> - \
> - /* set number of tuples in result BAT */ \
> - BATsetcount(bres, n); \
> -}
> +#define UDFBATfuse_TYPE(in,uin,out,shift) \
> +do { /* type-specific core algorithm */ \
> + in *one = NULL, *two = NULL; \
> + out *res = NULL; \
> + BUN i, n = BATcount(bone); \
> + \
> + /* allocate result BAT */ \
> + bres = BATnew(TYPE_void, TYPE_##out, n); \
> + if (bres == NULL) { \
> + BBPreleaseref(bone->batCacheid); \
> + BBPreleaseref(btwo->batCacheid); \
> + throw(MAL, "batudf.fuse", MAL_MALLOC_FAIL); \
> + } \
> + \
> + /* get direct access to the tail arrays */ \
> + one = (in *) Tloc(bone, BUNfirst(bone)); \
> + two = (in *) Tloc(btwo, BUNfirst(btwo)); \
> + res = (out*) Tloc(bres, BUNfirst(bres)); \
> + \
> + /* is tail of right/second BAT sorted, also when cast to \
> + * unsigned type, */ \
> + /* i.e., are the values either all >= 0 or all < 0? */ \
> + two_tail_sorted_unsigned = BATtordered(btwo) & 1 && \
> + (two[0] >= 0 || two[n - 1] < 0); \
> + \
> + /* iterate over all values/tuples and do the work */ \
> + for (i = 0; i < n; i++) \
> + if (one[i] == in##_nil || two[i] == in##_nil) \
> + /* NULL/nil in => NULL/nil out */ \
> + res[i] = out##_nil; \
> + else \
> + /* do the work; watch out for sign bits */ \
> + res[i] = ((out) (uin) one[i] << shift) | (uin) two[i]; \
> + \
> + /* set number of tuples in result BAT */ \
> + BATsetcount(bres, n); \
> +} while (0)
>
> /* type expansion for core algorithm */
> switch (bone->ttype) {
> case TYPE_bte:
> - UDFBATfuse_TYPE(bte,unsigned char ,sht, 8)
> + UDFBATfuse_TYPE(bte, unsigned char, sht, 8);
> break;
> +
> case TYPE_sht:
> - UDFBATfuse_TYPE(sht,unsigned short,int,16)
> + UDFBATfuse_TYPE(sht, unsigned short, int, 16);
> break;
> +
> case TYPE_int:
> - UDFBATfuse_TYPE(int,unsigned int ,lng,32)
> + UDFBATfuse_TYPE(int, unsigned int, lng, 32);
> break;
> +
> default:
> - throw(MAL, "batudf.fuse", "tails of input BATs must be one of {bte, sht, int}");
> + throw(MAL, "batudf.fuse",
> + "tails of input BATs must be one of {bte, sht, int}");
> }
>
> BATaccessEnd(bone, USE_TAIL, MMAP_SEQUENTIAL);
> BATaccessEnd(btwo, USE_TAIL, MMAP_SEQUENTIAL);
>
> /* set result properties */
> - bres->hdense = TRUE; /* result head is dense */
> + bres->hdense = TRUE; /* result head is dense */
> BATseqbase(bres, bone->hseqbase); /* result head has same seqbase as input */
> - bres->hsorted = GDK_SORTED; /* result head is sorted */
> - BATkey(bone, TRUE); /* result head is key (unique) */
> + bres->hsorted = GDK_SORTED; /* result head is sorted */
> + BATkey(bres, TRUE); /* result head is key (unique) */
>
> - /* Result tail is sorted, if the left/first input tail is sorted and key (unique),
> _______________________________________________
> Checkin-list mailing list
> Checkin-list(a)monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
>
--
| Stefan.Manegold @ CWI.nl | DB Architectures (INS1) |
| http://CWI.nl/~manegold/ | Science Park 123 (L321) |
| Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
1
0
Re: [Monetdb-developers] MonetDB: default - Activating the new implementation of BATsample.
by Stefan Manegold 16 Mar '12
by Stefan Manegold 16 Mar '12
16 Mar '12
lsidir,
(;-))
since it now seems to be dead code (correct me if I'm wrong),
is there any reason to keep the "deprecated" implementation of BATsample
around, or shouldn't we better clean up our code and remove the old
BATsample (now BATsample_deprecated) entirely?
Thanks,
Stefan
On Fri, Mar 16, 2012 at 12:51:52PM +0100, lsidir wrote:
> Changeset: 6985c995bf66 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6985c995bf66
> Modified Files:
> gdk/gdk.h
> gdk/gdk_batop.mx
> gdk/gdk_sample.c
> monetdb5/modules/mal/sample.c
> Branch: default
> Log Message:
>
> Activating the new implementation of BATsample.
>
>
> diffs (57 lines):
>
> diff --git a/gdk/gdk.h b/gdk/gdk.h
> --- a/gdk/gdk.h
> +++ b/gdk/gdk.h
> @@ -3129,7 +3129,7 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b
> gdk_export void PROPdestroy(PROPrec *p);
> gdk_export PROPrec * BATgetprop(BAT *b, int idx);
> gdk_export void BATsetprop(BAT *b, int idx, int type, void *v);
> -gdk_export BAT *BATsample(BAT *b, BUN n);
> +gdk_export BAT *BATsample_deprecated(BAT *b, BUN n);
> gdk_export BAT *BAThistogram(BAT *b);
> gdk_export int BATtopN(BAT *b, BUN topN); /* used in monet5/src/modules/kernel/algebra.mx */
>
> @@ -3368,7 +3368,7 @@ gdk_export int BATcalcavg(BAT *b, dbl *a
> * @tab BATsample (BAT *b, n)
> * @end multitable
> */
> -gdk_export BAT *BATsample1(BAT *b, BUN n);
> +gdk_export BAT *BATsample(BAT *b, BUN n);
>
> /* generic n-ary multijoin beast, with defines to interpret retval */
> #define MULTIJOIN_SORTED(r) ((char*) &r)[0]
> diff --git a/gdk/gdk_batop.mx b/gdk/gdk_batop.mx
> --- a/gdk/gdk_batop.mx
> +++ b/gdk/gdk_batop.mx
> @@ -1374,7 +1374,7 @@ BATtopN(BAT *b, BUN topN)
> * @- Random Selections
> */
> BAT *
> -BATsample(BAT *b, BUN size)
> +BATsample_deprecated(BAT *b, BUN size)
> {
> BUN cnt, i, r = 0, n, j;
> BUN *choice = NULL, *dst;
> diff --git a/gdk/gdk_sample.c b/gdk/gdk_sample.c
> --- a/gdk/gdk_sample.c
> +++ b/gdk/gdk_sample.c
> @@ -47,7 +47,7 @@
> */
>
> BAT *
> -BATsample1(BAT *b, BUN n)
> +BATsample(BAT *b, BUN n)
> {
> BAT *bn;
> BUN cnt;
> diff --git a/monetdb5/modules/mal/sample.c b/monetdb5/modules/mal/sample.c
> --- a/monetdb5/modules/mal/sample.c
> +++ b/monetdb5/modules/mal/sample.c
> @@ -85,7 +85,7 @@ SAMPLEuniform(bat *r, bat *b, ptr s) {
> if ((bb = BATdescriptor(*b)) == NULL) {
> throw(MAL, "sample.uniform", INTERNAL_BAT_ACCESS);
> }
> - br = BATsample1(bb,*(BUN *)s);
> + br = BATsample(bb,*(BUN *)s);
> if (br == NULL)
> throw(MAL, "sample.uniform", OPERATION_FAILED);
>
> _______________________________________________
> Checkin-list mailing list
> Checkin-list(a)monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
>
>
--
| Stefan.Manegold @ CWI.nl | DB Architectures (INS1) |
| http://CWI.nl/~manegold/ | Science Park 123 (L321) |
| Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
2
2
[Monetdb-developers] Announcement: New Dec2011-SP2 Bugfix release of MonetDB suite
by Fabian Groffen 16 Mar '12
by Fabian Groffen 16 Mar '12
16 Mar '12
The MonetDB team at CWI/MonetDB BV is pleased to announce the
Dec2011-SP2 bugfix release of the MonetDB suite of programs.
More information about MonetDB can be found on our website at
http://www.monetdb.org/.
For details on this release, please see the release notes at
<http://www.monetdb.org/Downloads/ReleaseNotes>.
As usual, the download location is <http://dev.monetdb.org/downloads/>.
Dec 2011-SP2 bugfix release
Java Module * Implemented missing Number types support in
PreparedStatement.setObject()
Bug Fixes * 2915: Query (mclient or jdbc) with 2 outer joins appears
to crash connectionor server
* 2947: Queries where a "is null" clause is combined with
two equals clauses fail to produce the expected result.
* 2968: Memory Leaks
* 2974: thetajoin produces invalid/inconsistent bat
* 2988: Subquery in select part goes wrong
* 2998: Equivalent multi-way join queries give different
results
* 3002: String plus interval result in program errors upon
comparison
* 3011: count(*) in subquery results in 1 for query without
results
* 3012: bitwise comparison fails after a cast
* 3029: test sql/test/Dependencies/Tests/Dependencies.sql
fails after recent changes
* 3031: Virtually all SQL tests fail on Windows
* 3036: optimizers are not getting set correctly through set
optimizer
* 3038: ~190 SQL tests fail on Darwin, FreeBSD & Solaris
(only) since introduction of "(extended) relational
algebra"
* 3043: WITH clause is not allowed in derived table
* 3045: algebra.project(0@0,bat) fails at propcheck
* 3052: Wrong Error Code on Rollback Exception
1
0
Re: [Monetdb-developers] MonetDB: default - Remainder of group optimizer additions.
by Sjoerd Mullender 12 Mar '12
by Sjoerd Mullender 12 Mar '12
12 Mar '12
The new opt_group optimizer defines a group.new function that is not
compatible with the existing group.new functions.
In group.mx we have the definitions
command new(b:bat[:any_1,:any_2], start:int, incr:int, grpsize:int)
:bat[:any_1,:int]
command new(attr:bat[:any_1,:any_2] )
(histo:bat[:any_1,:wrd], grp:bat[:any_1,:void])
command new(attr:bat[:any_1,:any_2] )
(histo:bat[:any_1,:wrd], grp:bat[:any_1,:oid])
command new(attr:bat[:any_1,:any_2], N:int, rng:int)
(histo:bat[:any_1,:wrd],grp:bat[:any_1,:oid])
If called with a single :bat[:oid,:oid] bat as argument (as
sql.zero_or_one does), it returns two bats with types :bat[:oid,:wrd]
and :bat[:oid,:oid]
The group.new in the new opt_group optimizer is defined as
pattern
group.new(l:bat[:oid,:any]...)(grp:bat[:oid,:any],ext:bat[:oid,:any])
so if this one is called with a single :bat[:oid,:oid] bat as argument,
it returns two bats with types :bat[:oid,:oid] and :bat[:oid,:oid].
Of course, we now get the one sql.zero_or_one does *not* expect (since
it is defined later).
This causes a bunch of tests to fail.
On 2012-03-12 12:52, Martin Kersten wrote:
> Changeset: 89489d21d9bb for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=89489d21d9bb
> Added Files:
> monetdb5/optimizer/opt_groups.mx
> Removed Files:
> monetdb5/optimizer/Tests/derivePath00.mal
> monetdb5/optimizer/Tests/groupderive.mal
> monetdb5/optimizer/Tests/groupderive.stable.err
> monetdb5/optimizer/Tests/groupderive.stable.out
> monetdb5/optimizer/opt_derivepath.mx
> Modified Files:
> monetdb5/optimizer/Tests/All
> sql/test/Tests/setoptimizer.stable.err
> sql/test/Tests/setoptimizer.stable.out
> Branch: default
> Log Message:
>
> Remainder of group optimizer additions.
>
>
> diffs (truncated from 654 to 300 lines):
>
> diff --git a/monetdb5/optimizer/Tests/All b/monetdb5/optimizer/Tests/All
> --- a/monetdb5/optimizer/Tests/All
> +++ b/monetdb5/optimizer/Tests/All
> @@ -74,7 +74,7 @@ mitosis00
>
> joinpath
> leftjoinpath
> -groupderive
> +groups00
>
> ifthencst
> CXerror1
> diff --git a/monetdb5/optimizer/Tests/derivePath00.mal b/monetdb5/optimizer/Tests/derivePath00.mal
> deleted file mode 100644
> --- a/monetdb5/optimizer/Tests/derivePath00.mal
> +++ /dev/null
> @@ -1,19 +0,0 @@
> --- select distinct(A) from T
> --- only needs the group extend table, which means we can use a kunique.
> -function tst();
> -b:= bat.new(:oid,:str);
> -
> -bat.append(b,"hello");
> -bat.append(b,"hello");
> -bat.append(b,"world");
> -br:= bat.reverse(b);
> -k:= algebra.kunique(br);
> -kr:= bat.reverse(k);
> -io.print(kr);
> -(e,g):= group.new(b);
> -io.print(e);
> -end tst;
> -
> -user.tst();
> -optimizer.derivePath("user","tst");
> -mdb.List("user","tst");
> diff --git a/monetdb5/optimizer/Tests/groupderive.mal b/monetdb5/optimizer/Tests/groupderive.mal
> deleted file mode 100644
> --- a/monetdb5/optimizer/Tests/groupderive.mal
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -function tst();
> - b:= bat.new(:oid,:int);
> - c:= bat.new(:oid,:str);
> - d:= bat.new(:oid,:flt);
> - (ext1,grp1) := group.new(b);
> - (ext2,grp2) := group.derive(ext1,grp1, c);
> - (ext3,grp3) := group.derive(ext2,grp2, d);
> -end tst;
> -optimizer.derivePath("user","tst");
> -mdb.list("user","tst");
> diff --git a/monetdb5/optimizer/Tests/groupderive.stable.err b/monetdb5/optimizer/Tests/groupderive.stable.err
> deleted file mode 100644
> --- a/monetdb5/optimizer/Tests/groupderive.stable.err
> +++ /dev/null
> @@ -1,80 +0,0 @@
> -stderr of test 'groupderive` in directory 'optimizer` itself:
> -
> -
> -# 09:23:28 >
> -# 09:23:28 > mserver5 "--config=/ufs/mk/monet5//Linux/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/mk/monet5//Linux/lib/MonetDB5:/ufs/mk/monet5//Linux/lib/MonetDB5/lib:/ufs/mk/monet5//Linux/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/mk/monet5//Linux/var/MonetDB5/dbfarm" --set "sql_logdir=/ufs/mk/monet5//Linux/var/MonetDB5/sql_logs" --set mapi_open=true --set xrpc_open=true --set mapi_port=30087 --set xrpc_port=43368 --set xrpc_docroot=/ufs/mk/monet5/package/MonetDB5 --set monet_prompt= --trace --dbname=mTests_src_optimizer groupderive.mal
> -# 09:23:28 >
> -
> -# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu
> -# builtin opt gdk_version = 1.28.1
> -# builtin opt monet_pid = 10370
> -# builtin opt prefix = /ufs/mk/monet5//Linux
> -# builtin opt exec_prefix = ${prefix}
> -# builtin opt gdk_dbname = tst
> -# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB
> -# builtin opt gdk_debug = 8
> -# builtin opt gdk_mem_bigsize = 262144
> -# builtin opt gdk_alloc_map = yes
> -# builtin opt gdk_mem_pagebits = 14
> -# builtin opt gdk_vmtrim = yes
> -# builtin opt monet_admin = adm
> -# builtin opt monet_prompt = >
> -# builtin opt monet_welcome = yes
> -# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB:${exec_prefix}/lib/bin
> -# builtin opt monet_daemon = yes
> -# builtin opt host = localhost
> -# builtin opt mapi_port = 50000
> -# builtin opt mapi_noheaders = no
> -# builtin opt mapi_debug = 0
> -# builtin opt mapi_clients = 2
> -# builtin opt sql_debug = 0
> -# builtin opt sql_logdir = ${prefix}/var/MonetDB
> -# builtin opt xquery_logdir = ${prefix}/var/MonetDB
> -# builtin opt standoff_ns = http://monetdb.cwi.nl/standoff
> -# builtin opt standoff_start = start
> -# builtin opt standoff_end = end
> -# config opt prefix = /ufs/mk/monet5//Linux
> -# config opt config = ${prefix}/etc/monetdb5.conf
> -# config opt prefix = /ufs/mk/monet5//Linux
> -# config opt exec_prefix = ${prefix}
> -# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm
> -# config opt gdk_dbname = demo
> -# config opt gdk_alloc_map = no
> -# config opt gdk_embedded = no
> -# config opt gdk_debug = 0
> -# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin
> -# config opt monet_daemon = no
> -# config opt monet_welcome = yes
> -# config opt mero_msglog = ${prefix}/var/log/merovingian.log
> -# config opt mero_errlog = ${prefix}/var/log/merovingian.log
> -# config opt mero_timeinterval = 600
> -# config opt mero_pidfile = ${prefix}/var/run/merovingian.pid
> -# config opt mero_exittimeout = 7
> -# config opt mero_doproxy = yes
> -# config opt mero_discoveryttl = 600
> -# config opt mal_init = ${exec_prefix}/lib/MonetDB5/mal_init.mal
> -# config opt mal_listing = 2
> -# config opt checkpoint_dir = ${prefix}/var/MonetDB5/chkpnt
> -# config opt mapi_port = 50000
> -# config opt mapi_open = false
> -# config opt sql_logdir = ${prefix}/var/MonetDB5/sql_logs
> -# config opt sql_init = ${exec_prefix}/lib/MonetDB5/sql_init.sql
> -# cmdline opt config = /ufs/mk/monet5//Linux/etc/monetdb5.conf
> -# cmdline opt gdk_nr_threads = 0
> -# cmdline opt monet_mod_path = /ufs/mk/monet5//Linux/lib/MonetDB5:/ufs/mk/monet5//Linux/lib/MonetDB5/lib:/ufs/mk/monet5//Linux/lib/MonetDB5/bin
> -# cmdline opt gdk_dbfarm = /ufs/mk/monet5//Linux/var/MonetDB5/dbfarm
> -# cmdline opt sql_logdir = /ufs/mk/monet5//Linux/var/MonetDB5/sql_logs
> -# cmdline opt mapi_open = true
> -# cmdline opt xrpc_open = true
> -# cmdline opt mapi_port = 30087
> -# cmdline opt xrpc_port = 43368
> -# cmdline opt xrpc_docroot = /ufs/mk/monet5/package/MonetDB5
> -# cmdline opt monet_prompt =
> -# cmdline opt gdk_dbname = mTests_src_optimizer
> -#warning: please don't forget to set your vault key!
> -#(see /ufs/mk/monet5//Linux/etc/monetdb5.conf)
> -
> -# 09:23:28 >
> -# 09:23:28 > Done.
> -# 09:23:28 >
> -
> diff --git a/monetdb5/optimizer/Tests/groupderive.stable.out b/monetdb5/optimizer/Tests/groupderive.stable.out
> deleted file mode 100644
> --- a/monetdb5/optimizer/Tests/groupderive.stable.out
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -stdout of test 'groupderive` in directory 'optimizer` itself:
> -
> -
> -# 09:23:28 >
> -# 09:23:28 > mserver5 "--config=/ufs/mk/monet5//Linux/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/mk/monet5//Linux/lib/MonetDB5:/ufs/mk/monet5//Linux/lib/MonetDB5/lib:/ufs/mk/monet5//Linux/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/mk/monet5//Linux/var/MonetDB5/dbfarm" --set "sql_logdir=/ufs/mk/monet5//Linux/var/MonetDB5/sql_logs" --set mapi_open=true --set xrpc_open=true --set mapi_port=30087 --set xrpc_port=43368 --set xrpc_docroot=/ufs/mk/monet5/package/MonetDB5 --set monet_prompt= --trace --dbname=mTests_src_optimizer groupderive.mal
> -# 09:23:28 >
> -
> -# MonetDB server v5.10.1, based on kernel v1.28.1
> -# Serving database 'mTests_src_optimizer', using 4 threads
> -# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
> -# Copyright (c) 1993-July 2008 CWI.
> -# Copyright (c) August 2008- MonetDB B.V., all rights reserved
> -# Visit http://monetdb.cwi.nl/ for further information
> -# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:30087/
> -function user.tst():void;
> - b := bat.new(:oid,:int);
> - c := bat.new(:oid,:str);
> - d := bat.new(:oid,:flt);
> - (ext1,grp1) := group.new(b);
> - (ext2,grp2) := group.derive(ext1,grp1,c);
> - (ext3,grp3) := group.derive(ext2,grp2,d);
> -end tst;
> -function user.main():void;
> - mdb.list("user","tst");
> -end main;
> -function user.tst():void;
> - b := bat.new(:oid,:int);
> - c := bat.new(:oid,:str);
> - d := bat.new(:oid,:flt);
> - (ext1,grp1) := group.derivePath(b);
> - (ext2,grp2) := group.derivePath(b,c);
> - (ext3,grp3) := group.derivePath(b,c,d);
> -end tst;
> -
> -# 09:23:28 >
> -# 09:23:28 > Done.
> -# 09:23:28 >
> -
> diff --git a/monetdb5/optimizer/opt_derivepath.mx b/monetdb5/optimizer/opt_derivepath.mx
> deleted file mode 100644
> --- a/monetdb5/optimizer/opt_derivepath.mx
> +++ /dev/null
> @@ -1,239 +0,0 @@
> -@/
> -The contents of this file are subject to the MonetDB Public License
> -Version 1.1 (the "License"); you may not use this file except in
> -compliance with the License. You may obtain a copy of the License at
> -http://www.monetdb.org/Legal/MonetDBLicense
> -
> -Software distributed under the License is distributed on an "AS IS"
> -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
> -License for the specific language governing rights and limitations
> -under the License.
> -
> -The Original Code is the MonetDB Database System.
> -
> -The Initial Developer of the Original Code is CWI.
> -Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
> -Copyright August 2008-2012 MonetDB B.V.
> -All Rights Reserved.
> -@
> -
> -@f opt_derivepath
> -
> -@c
> -/*
> - * @- Group derive paths
> - * The routine @sc{optimizer.derivepaths()}
> - * walks through the program looking for grouping operations
> - * and cascades them into a single multiple group paths.
> - * To illustrate, consider
> - * @verbatim
> - * (ext1,grp1) := group.new(b);
> - * (ext2,grp2) := group.derive(ext1,grp1, c);
> - * (ext3,grp3) := group.done(ext2,grp2, d);
> - * @end verbatim
> - * The result becomes.
> - * @verbatim
> - * (ext3,grp3) := group.derivepath(b,c,d);
> - * @end verbatim
> - *
> - * The implementation of this operator can freely re-order the BATs
> - * for reduced intermediate results or as a basis for parallel scanning
> - * all BATs involved to derive their group id.
> - *
> - * The collection can be extended to immediately aim for group counting
> - * or summation, avoiding the materialisation of the group id table.
> - */
> -@mal
> -pattern optimizer.derivePath():str
> -address OPTderivePath;
> -pattern optimizer.derivePath(mod:str, fcn:str):str
> -address OPTderivePath
> -comment "Join path constructor";
> -
> -pattern group.derivePath(l:bat[:oid,:any]...)(grp:bat[:oid,:any],ext:bat[:oid,:any])
> -address ALGderivePath
> -comment "Derive a group index.";
> -
> -pattern group.deriveCount(l:bat[:oid,:any]...):bat[:oid,:wrd]
> -address ALGderiveCount
> -comment "Derive a group count.";
> -
> -pattern group.deriveSum(s:bat[:oid,:int],l:bat[:oid,:any]...):bat[:oid,:int]
> -address ALGderiveSum
> -comment "Derive a group sum.";
> -pattern group.deriveSum(s:bat[:oid,:lng],l:bat[:oid,:any]...):bat[:oid,:lng]
> -address ALGderiveSum
> -comment "Derive a group sum.";
> -pattern group.deriveSum(s:bat[:oid,:flt],l:bat[:oid,:any]...):bat[:oid,:flt]
> -address ALGderiveSum
> -comment "Derive a group sum.";
> -pattern group.deriveSum(s:bat[:oid,:dbl],l:bat[:oid,:any]...):bat[:oid,:dbl]
> -address ALGderiveSum
> -comment "Derive a group sum.";
> -@h
> -#ifndef _OPT_DERIVEPATH_
> -#define _OPT_DERIVEPATH_
> -#include "opt_prelude.h"
> -#include "opt_support.h"
> -#include "mal_interpreter.h"
> -
> -opt_export str ALGderivePath(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
> -opt_export str ALGderiveCount(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
> -opt_export str ALGderiveSum(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
> -
> -#define OPTDEBUGderivePath if ( optDebug & ((lng)1 <<DEBUG_OPT_DERIVEPATH) )
> -
> -@c
> -#include "monetdb_config.h"
> -#include "opt_derivepath.h"
> -#include "group.h"
> -
> -static int
> -OPTderivePathImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
> -{
> - int i, actions=0;
> - int *pc;
> - InstrPtr q;
> - InstrPtr *old;
> - int limit,slimit;
> - Lifespan span;
> -
> -
> -
> - (void) cntxt;
> - (void) stk;
> - span= setLifespan(mb);
> - if( span == NULL)
> - return 0;
> - if (varGetProp(mb, getArg(mb->stmt[0], 0), inlineProp) != NULL)
> - return 0;
> -
> - /* beware, new variables and instructions are introduced */
> - pc= (int*) GDKzalloc(sizeof(int)* mb->vtop * 2); /* to find last assignment */
> - if ( pc == NULL)
> - return 0;
> -
> - old= mb->stmt;
> _______________________________________________
> Checkin-list mailing list
> Checkin-list(a)monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
--
Sjoerd Mullender
1
0
Re: [Monetdb-developers] MonetDB: sciql - Be more correct with the "fixed" property of th...
by Stefan Manegold 07 Mar '12
by Stefan Manegold 07 Mar '12
07 Mar '12
Jennie,
this checkin appear to trigger different output for the following tests:
sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658
sql/test/BugTracker-2009/Tests/join_topn.SF-2654133
sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579
sql/test/BugTracker/Tests/like_exp.SF-1613949
sql/test/bugs/Tests/select_orderby_alias-bug-sf-1024615
Could you please check, whether the new output is the desired and correct
one, and if so, approve it, or otherwise check whether you can fix the code?
No hurry. I just happend to notice this and hence do report it ;-)
Stefan
On Tue, Mar 06, 2012 at 05:42:18PM +0100, Jennie Zhang wrote:
> Changeset: a27b334ae151 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a27b334ae151
> Modified Files:
> sql/backends/monet5/sql.mx
> sql/server/rel_schema.c
> sql/server/sql_mvc.c
> sql/storage/sql_storage.h
> sql/storage/store.c
> sql/test/sciql/Tests/01_create_01.sql
> sql/test/sciql/Tests/01_create_01.stable.out
> Branch: sciql
> Log Message:
>
> Be more correct with the "fixed" property of the SQL catalog
>
> renamed "fixed" into "fixed_array" in the SQL catalog and set it value to FALSE
> (i.s.o. TRUE) for all tables.
>
> added tests to check if "fixed_array" and "nr_dimensions" in the SQL catalog
> are computed correctly. apporved new stable.out
>
>
> diffs (251 lines):
>
> diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
> --- a/sql/backends/monet5/sql.mx
> +++ b/sql/backends/monet5/sql.mx
> @@ -1881,7 +1881,7 @@ create_table_or_view( mvc *sql, char *sn
> }
> }
>
> - nt = sql_trans_create_table(sql->session->tr, s, t->base.name, t->query, t->type, t->system, temp, t->commit_action, t->sz, &t->fixed, &t->ndims);
> + nt = sql_trans_create_table(sql->session->tr, s, t->base.name, t->query, t->type, t->system, temp, t->commit_action, t->sz, t->fixed, t->ndims);
>
> for (n = t->columns.set->h; n; n = n->next) {
> sql_column *c = n->data;
> diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
> --- a/sql/server/rel_schema.c
> +++ b/sql/server/rel_schema.c
> @@ -729,7 +729,9 @@ create_column(mvc *sql, symbol *s, sql_s
> cs->dim->step = GDKstrdup("");
> cs->dim->stop = GDKstrdup("");
> }
> - t->fixed = isFixedDim(cs->dim);
> + if (!(isFixedDim(cs->dim)))
> + t->fixed = 0;
> +
> /* TODO: the case "ARRAY dim_range_list" is not dealt with */
> }
> if (column_options(sql, opt_list, ss, t, cs) == SQL_ERR)
> @@ -992,6 +994,8 @@ rel_create_table(mvc *sql, sql_schema *s
> int i = 0, j = 0, cnt = 0, *N = NULL, *M = NULL;
> lng cntall = 1;
>
> + if (isArray(t))
> + t->fixed = 1;
> for (n = columns->h; n; n = n->next) {
> symbol *sym = n->data.sym;
> int res = table_element(sql, sym, s, t, 0);
> diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
> --- a/sql/server/sql_mvc.c
> +++ b/sql/server/sql_mvc.c
> @@ -87,7 +87,7 @@ mvc_init(char *dbname, int debug, store_
> mvc_create_column_(m, t, "system", "boolean", 1);
> mvc_create_column_(m, t, "commit_action", "smallint", 16);
> mvc_create_column_(m, t, "readonly", "boolean", 1);
> - mvc_create_column_(m, t, "fixed", "boolean", 1);
> + mvc_create_column_(m, t, "fixed_array", "boolean", 1);
> mvc_create_column_(m, t, "nr_dimensions", "int", 32);
> mvc_create_column_(m, t, "temporary", "smallint", 16);
>
> @@ -124,7 +124,7 @@ mvc_init(char *dbname, int debug, store_
> mvc_create_column_(m, t, "system", "boolean", 1);
> mvc_create_column_(m, t, "commit_action", "smallint", 16);
> mvc_create_column_(m, t, "readonly", "boolean", 1);
> - mvc_create_column_(m, t, "fixed", "boolean", 1);
> + mvc_create_column_(m, t, "fixed_array", "boolean", 1);
> mvc_create_column_(m, t, "nr_dimensions", "int", 32);
> mvc_create_column_(m, t, "temporary", "smallint", 16);
> if (catalog_version) {
> @@ -1029,13 +1029,13 @@ mvc_create_table(mvc *m, sql_schema *s,
> tt == tt_table? "TABLE":(tt == tt_array? "ARRAY":"OTHER_TT"),
> s->base.name, name, tt, system, persistence, commit_action);
>
> - /* FIXME: are the NULLs correct values for 'fixed' and 'ndims'? */
> if (persistence == SQL_DECLARED_TABLE && (!s || strcmp(s->base.name, dt_schema))) {
> /* declared tables should not end up in the catalog */
> - t = create_sql_table(m->sa, name, tt, system, persistence, commit_action, NULL, NULL);
> + /* actual values of 'fixed' and 'ndims' are computed later */
> + t = create_sql_table(m->sa, name, tt, system, persistence, commit_action, 0, 0);
> t->s = s;
> } else {
> - t = sql_trans_create_table(m->session->tr, s, name, NULL, tt, system, persistence, commit_action, sz, NULL, NULL);
> + t = sql_trans_create_table(m->session->tr, s, name, NULL, tt, system, persistence, commit_action, sz, 0, 0);
> }
> return t;
> }
> @@ -1049,11 +1049,11 @@ mvc_create_view(mvc *m, sql_schema *s, c
> fprintf(stderr, "#mvc_create_view %s %s %s\n", s->base.name, name, sql);
>
> if (persistence == SQL_DECLARED_TABLE) {
> - t = create_sql_table(m->sa, name, tt_view, system, persistence, 0, NULL, NULL);
> + t = create_sql_table(m->sa, name, tt_view, system, persistence, 0, 0, 0);
> t->s = s;
> t->query = sa_strdup(m->sa, sql);
> } else {
> - t = sql_trans_create_table(m->session->tr, s, name, sql, tt_view, system, SQL_PERSIST, 0, 0, NULL, NULL);
> + t = sql_trans_create_table(m->session->tr, s, name, sql, tt_view, system, SQL_PERSIST, 0, 0, 0, 0);
> }
> return t;
> }
> @@ -1067,11 +1067,11 @@ mvc_create_remote(mvc *m, sql_schema *s,
> fprintf(stderr, "#mvc_create_remote %s %s %s\n", s->base.name, name, loc);
>
> if (persistence == SQL_DECLARED_TABLE) {
> - t = create_sql_table(m->sa, name, tt_remote, 0, persistence, 0, NULL, NULL);
> + t = create_sql_table(m->sa, name, tt_remote, 0, persistence, 0, 0, 0);
> t->s = s;
> t->query = sa_strdup(m->sa, loc);
> } else {
> - t = sql_trans_create_table(m->session->tr, s, name, loc, tt_remote, 0, SQL_REMOTE, 0, 0, NULL, NULL);
> + t = sql_trans_create_table(m->session->tr, s, name, loc, tt_remote, 0, SQL_REMOTE, 0, 0, 0, 0);
> }
> return t;
> }
> @@ -1084,7 +1084,7 @@ mvc_create_generated(mvc *m, sql_schema
> if (mvc_debug)
> fprintf(stderr, "#mvc_create_generated %s %s %s\n", s->base.name, name, sql);
>
> - t = sql_trans_create_table(m->session->tr, s, name, sql, tt_generated, system, SQL_PERSIST, 0, 0, NULL, NULL);
> + t = sql_trans_create_table(m->session->tr, s, name, sql, tt_generated, system, SQL_PERSIST, 0, 0, 0, 0);
> return t;
> }
>
> diff --git a/sql/storage/sql_storage.h b/sql/storage/sql_storage.h
> --- a/sql/storage/sql_storage.h
> +++ b/sql/storage/sql_storage.h
> @@ -314,7 +314,7 @@ extern void reset_functions(sql_trans *t
> extern sql_schema *sql_trans_create_schema(sql_trans *tr, char *name, int auth_id, int owner);
> extern void sql_trans_drop_schema(sql_trans *tr, int id, int drop_action);
>
> -extern sql_table *sql_trans_create_table(sql_trans *tr, sql_schema *s, char *name, char *sql, int tt, bit system, int persistence, int commit_action, int sz, bit *fixed, int *ndims);
> +extern sql_table *sql_trans_create_table(sql_trans *tr, sql_schema *s, char *name, char *sql, int tt, bit system, int persistence, int commit_action, int sz, bit fixed, int ndims);
> extern sql_table *sql_trans_add_table(sql_trans *tr, sql_table *mt, sql_table *pt);
> extern sql_table *sql_trans_del_table(sql_trans *tr, sql_table *mt, sql_table *pt, int drop_action);
>
> @@ -368,7 +368,7 @@ extern int sql_trans_connect_catalog(sql
> extern int sql_trans_disconnect_catalog(sql_trans *tr, char *db_alias);
> extern int sql_trans_disconnect_catalog_ALL(sql_trans *tr);
>
> -extern sql_table *create_sql_table(sql_allocator *sa, char *name, sht type, bit system, int persistence, int commit_action, bit *fixed, int *ndims);
> +extern sql_table *create_sql_table(sql_allocator *sa, char *name, sht type, bit system, int persistence, int commit_action, bit fixed, int ndims);
> extern sql_column *create_sql_column(sql_allocator *sa, sql_table *t, char *name, sql_subtype *tpe);
> extern sql_ukey *create_sql_ukey(sql_allocator *sa, sql_table *t, char *nme, key_type kt);
> extern sql_fkey *create_sql_fkey(sql_allocator *sa, sql_table *t, char *nme, key_type kt, sql_key *rkey, int on_delete, int on_update );
> diff --git a/sql/storage/store.c b/sql/storage/store.c
> --- a/sql/storage/store.c
> +++ b/sql/storage/store.c
> @@ -578,7 +578,7 @@ load_table(sql_trans *tr, sql_schema *s,
> t->cleared = 0;
> v = table_funcs.column_find_value(tr, find_sql_column(tables, "readonly"),rid);
> t->readonly = *(bit *)v; _DELETE(v);
> - v = table_funcs.column_find_value(tr, find_sql_column(tables, "fixed"),rid);
> + v = table_funcs.column_find_value(tr, find_sql_column(tables, "fixed_array"),rid);
> t->fixed = *(bit *)v; _DELETE(v);
> v = table_funcs.column_find_value(tr, find_sql_column(tables, "nr_dimensions"),rid);
> t->ndims = *(int *)v; _DELETE(v);
> @@ -1127,7 +1127,7 @@ bootstrap_create_column(sql_trans *tr, s
> }
>
> sql_table *
> -create_sql_table(sql_allocator *sa, char *name, sht type, bit system, int persistence, int commit_action, bit *fixed, int *ndims)
> +create_sql_table(sql_allocator *sa, char *name, sht type, bit system, int persistence, int commit_action, bit fixed, int ndims)
> {
> sql_table *t = SA_ZNEW(sa, sql_table);
>
> @@ -1149,9 +1149,9 @@ create_sql_table(sql_allocator *sa, char
> t->pkey = NULL;
> t->sz = COLSIZE;
> t->cleared = 0;
> - /* 'fixed' and 'ndims' are ONLY used for arrays. Pass NULLs to get their defaults. */
> - t->fixed = fixed ? *fixed : 1; /* should be set to 0 if an unbounded dimension is found. */
> - t->ndims = ndims ? *ndims : 0;
> + /* 'fixed' and 'ndims' are ONLY used for arrays. For tables, their values arre always 0. */
> + t->fixed = isArray(t) ? fixed : 0; /* should be set to 1 for fixed arrays. */
> + t->ndims = isArray(t) ? ndims : 0;
> t->s = NULL;
> return t;
> }
> @@ -1188,7 +1188,7 @@ sql_table *
> dup_sql_table(sql_allocator *sa, sql_table *t)
> {
> node *n;
> - sql_table *nt = create_sql_table(sa, t->base.name, t->type, t->system, SQL_DECLARED_TABLE, t->commit_action, &t->fixed, &t->ndims);
> + sql_table *nt = create_sql_table(sa, t->base.name, t->type, t->system, SQL_DECLARED_TABLE, t->commit_action, t->fixed, t->ndims);
>
> for (n = t->columns.set->h; n; n = n->next)
> dup_sql_column(sa, nt, n->data);
> @@ -1223,7 +1223,7 @@ bootstrap_create_table(sql_trans *tr, sq
> int istmp = isTempSchema(s);
> int persistence = istmp?SQL_GLOBAL_TEMP:SQL_PERSIST;
> sht commit_action = istmp?CA_PRESERVE:CA_COMMIT;
> - sql_table *t = create_sql_table(tr->sa, name, tt_table, 1, persistence, commit_action, NULL, NULL /* we never have arrays here */);
> + sql_table *t = create_sql_table(tr->sa, name, tt_table, 1, persistence, commit_action, 0, 0 /* we never have arrays here */);
>
> if (bs_debug)
> fprintf(stderr, "#bootstrap_create_table %s\n", name );
> @@ -1411,7 +1411,7 @@ store_init(int debug, store_type store,
> bootstrap_create_column(tr, t, "system", "boolean", 1);
> bootstrap_create_column(tr, t, "commit_action", "smallint", 16);
> bootstrap_create_column(tr, t, "readonly", "boolean", 1);
> - bootstrap_create_column(tr, t, "fixed", "boolean", 1);
> + bootstrap_create_column(tr, t, "fixed_array", "boolean", 1);
> bootstrap_create_column(tr, t, "nr_dimensions", "int", 32);
>
> t = bootstrap_create_table(tr, s, "_columns");
> @@ -3863,7 +3863,7 @@ sql_trans_del_table(sql_trans *tr, sql_t
> }
>
> sql_table *
> -sql_trans_create_table(sql_trans *tr, sql_schema *s, char *name, char *sql, int tt, bit system, int persistence, int commit_action, int sz, bit *fixed, int *ndims)
> +sql_trans_create_table(sql_trans *tr, sql_schema *s, char *name, char *sql, int tt, bit system, int persistence, int commit_action, int sz, bit fixed, int ndims)
> {
> sql_table *t = create_sql_table(tr->sa, name, tt, system, persistence, commit_action, fixed, ndims);
> sql_schema *syss = find_sql_schema(tr, isGlobal(t)?"sys":"tmp");
> diff --git a/sql/test/sciql/Tests/01_create_01.sql b/sql/test/sciql/Tests/01_create_01.sql
> --- a/sql/test/sciql/Tests/01_create_01.sql
> +++ b/sql/test/sciql/Tests/01_create_01.sql
> @@ -1,5 +1,16 @@
> -- use the [size] shortcut for integer type dimensions
> CREATE ARRAY ary(x TINYINT DIMENSION[4], y BIGINT DIMENSION[-5], v FLOAT DEFAULT 3.7);
> SELECT * FROM ary;
> +
> +CREATE ARRAY ary1(x TINYINT DIMENSION, y BIGINT DIMENSION, v FLOAT DEFAULT 3.7);
> +SELECT * FROM ary1;
> +
> +CREATE ARRAY ary2(x TINYINT DIMENSION[4], y BIGINT DIMENSION, z BIGINT DIMENSION[-5], v FLOAT DEFAULT 3.7);
> +SELECT * FROM ary2;
> +
> +SELECT * FROM _tables WHERE type = 7 OR fixed_array = TRUE;
> +
> DROP ARRAY ary;
> +DROP ARRAY ary1;
> +DROP ARRAY ary2;
>
> diff --git a/sql/test/sciql/Tests/01_create_01.stable.out b/sql/test/sciql/Tests/01_create_01.stable.out
> --- a/sql/test/sciql/Tests/01_create_01.stable.out
> +++ b/sql/test/sciql/Tests/01_create_01.stable.out
> @@ -49,6 +49,26 @@ Ready.
> [ 3, -2, 3.7 ]
> [ 3, -3, 3.7 ]
> [ 3, -4, 3.7 ]
> +#CREATE ARRAY ary1(x TINYINT DIMENSION, y BIGINT DIMENSION, v FLOAT DEFAULT 3.7);
> +#SELECT * FROM ary1;
> +% sys.ary1, sys.ary1, sys.ary1 # table_name
> +% x, y, v # name
> +% tinyint, bigint, double # type
> +% 1, 1, 24 # length
> +#CREATE ARRAY ary2(x TINYINT DIMENSION[4], y BIGINT DIMENSION, z BIGINT DIMENSION[-5], v FLOAT DEFAULT 3.7);
> +#SELECT * FROM ary2;
> +% sys.ary2, sys.ary2, sys.ary2, sys.ary2 # table_name
> +% x, y, z, v # name
> +% tinyint, bigint, bigint, double # type
> +% 1, 1, 1, 24 # length
> +#SELECT * FROM _tables WHERE type = 7 OR fixed_array = TRUE;
> +% sys._tables, sys._tables, sys._tables, sys._tables, sys._tables, sys._tables, sys._tables, sys._tables, sys._tables, sys._tables # table_name
> +% id, name, schema_id, query, type, system, commit_action, readonly, fixed_array, nr_dimensions # name
> +% int, varchar, int, varchar, smallint, boolean, smallint, boolean, boolean, int # type
> +% 4, 4, 4, 0, 1, 5, 1, 5, 5, 1 # length
> +[ 6461, "ary", 2000, NULL, 7, false, 0, false, true, 2 ]
> +[ 6466, "ary1", 2000, NULL, 7, false, 0, false, false, 2 ]
> +[ 6472, "ary2", 2000, NULL, 7, false, 0, false, false, 3 ]
> #DROP ARRAY ary;
>
> # 13:50:46 >
> _______________________________________________
> Checkin-list mailing list
> Checkin-list(a)monetdb.org
> http://mail.monetdb.org/mailman/listinfo/checkin-list
--
| Stefan.Manegold @ CWI.nl | DB Architectures (INS1) |
| http://CWI.nl/~manegold/ | Science Park 123 (L321) |
| Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
2
1