Changeset: f9ae4f3c04ef for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f9ae4f3c04ef
Added Files:
        sql/test/BugTracker-2016/Tests/analyze-quotes-incorrectly.Bug-4021.sql
        
sql/test/BugTracker-2016/Tests/analyze-quotes-incorrectly.Bug-4021.stable.err
        
sql/test/BugTracker-2016/Tests/analyze-quotes-incorrectly.Bug-4021.stable.out
        sql/test/BugTracker-2016/Tests/boolean-evaluation.Bug-4025.sql
        sql/test/BugTracker-2016/Tests/boolean-evaluation.Bug-4025.stable.err
        sql/test/BugTracker-2016/Tests/boolean-evaluation.Bug-4025.stable.out
        sql/test/bugs/Tests/select_select_bug.sql
        sql/test/bugs/Tests/select_select_bug.stable.err
        sql/test/bugs/Tests/select_select_bug.stable.out
Modified Files:
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        clients/Tests/exports.stable.out
        clients/odbc/driver/SQLConnect.c
        clients/odbc/driver/SQLTables.c
        gdk/ChangeLog
        gdk/gdk.h
        gdk/gdk_bat.c
        gdk/gdk_batop.c
        gdk/gdk_group.c
        geom/monetdb5/geom.c
        geom/monetdb5/geomBulk.c
        monetdb5/mal/Tests/tst903.stable.out
        monetdb5/mal/Tests/tst904.stable.out
        monetdb5/mal/Tests/tst907.stable.out
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/mal/manifold.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/tablet.c
        monetdb5/optimizer/Tests/Mexample.stable.out
        monetdb5/optimizer/Tests/inlineFunction2.stable.out
        monetdb5/optimizer/Tests/manifold2.stable.out
        monetdb5/optimizer/opt_multiplex.c
        sql/backends/monet5/UDF/cudf/Tests/udf-fuse.stable.out
        sql/backends/monet5/UDF/cudf/Tests/udf-reverse.stable.out
        sql/backends/monet5/UDF/pyapi/pyapi.c
        sql/backends/monet5/generator/generator.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_statistics.c
        sql/backends/monet5/sql_upgrades.c
        sql/backends/monet5/vaults/shp/shp.c
        sql/benchmarks/ssbm/Tests/04-explain.stable.out
        sql/benchmarks/ssbm/Tests/04-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/05-explain.stable.out
        sql/benchmarks/ssbm/Tests/05-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/06-explain.stable.out
        sql/benchmarks/ssbm/Tests/06-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/07-explain.stable.out
        sql/benchmarks/ssbm/Tests/07-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/08-explain.stable.out
        sql/benchmarks/ssbm/Tests/08-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/09-explain.stable.out
        sql/benchmarks/ssbm/Tests/09-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/10-explain.stable.out
        sql/benchmarks/ssbm/Tests/10-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/11-explain.stable.out
        sql/benchmarks/ssbm/Tests/11-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/12-explain.stable.out
        sql/benchmarks/ssbm/Tests/12-explain.stable.out.int128
        sql/benchmarks/ssbm/Tests/13-explain.stable.out
        sql/benchmarks/ssbm/Tests/13-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/01-explain.stable.out
        sql/benchmarks/tpch/Tests/01-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/01-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/02-explain.stable.out
        sql/benchmarks/tpch/Tests/03-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/04-explain.stable.out
        sql/benchmarks/tpch/Tests/04-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/05-explain.stable.out
        sql/benchmarks/tpch/Tests/05-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/05-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/07-explain.stable.out
        sql/benchmarks/tpch/Tests/07-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/08-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/09-explain.stable.out
        sql/benchmarks/tpch/Tests/09-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/10-explain.stable.out
        sql/benchmarks/tpch/Tests/10-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/11-explain.stable.out
        sql/benchmarks/tpch/Tests/11-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/12-explain.stable.out
        sql/benchmarks/tpch/Tests/12-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/13-explain.stable.out
        sql/benchmarks/tpch/Tests/15-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/16-explain.stable.out
        sql/benchmarks/tpch/Tests/16-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/18-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/20-explain.stable.out
        sql/benchmarks/tpch/Tests/20-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/20-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/21-explain.stable.out
        sql/benchmarks/tpch/Tests/21-explain.stable.out.32bit
        sql/benchmarks/tpch/Tests/22-explain.stable.out
        sql/benchmarks/tpch/Tests/22-explain.stable.out.int128
        sql/common/sql_list.c
        sql/server/rel_select.c
        sql/server/sql_parser.y
        sql/server/sql_privileges.c
        sql/test/BugTracker-2009/Tests/POWER_vs_prod.SF-2596114.stable.out
        
sql/test/BugTracker-2009/Tests/segfault_when_quitting_debugger.SF-2538837.stable.out
        
sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out
        
sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out
        sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
        sql/test/BugTracker-2011/Tests/func_iter_vs_bulk.Bug-2826.stable.out
        
sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.stable.out
        sql/test/BugTracker-2013/Tests/between.Bug-3259.stable.out.int128
        sql/test/BugTracker-2014/Tests/manifold.Bug-3556.stable.out
        sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
        sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out.single
        sql/test/BugTracker-2015/Tests/useless_casts.Bug-3756.stable.out
        sql/test/BugTracker-2016/Tests/All
        sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
        
sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out.32bit
        sql/test/BugTracker/Tests/explain.SF-1739353.stable.out
        sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
        sql/test/bugs/Tests/All
        sql/test/leaks/Tests/check1.stable.out.int128
        sql/test/leaks/Tests/check2.stable.out.int128
        sql/test/leaks/Tests/check3.stable.out.int128
        sql/test/leaks/Tests/check4.stable.out.int128
        sql/test/leaks/Tests/check5.stable.out.int128
        sql/test/mergetables/Tests/mergequery.stable.out
        sql/test/remote/Tests/partition_elim.stable.out
Branch: data-vaults
Log Message:

Merge with default


diffs (truncated from 8963 to 300 lines):

diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -5281,6 +5281,7 @@ drop function pcre_replace(string, strin
 [ "alpha",     "public",       16,     "monetdb",      0       ]
 [ "date_to_str",       "public",       16,     "monetdb",      0       ]
 [ "degrees",   "public",       16,     "monetdb",      0       ]
+[ "env",       "public",       16,     NULL,   0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
diff --git a/clients/Tests/SQL-dump.stable.out.int128 
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -5648,6 +5648,7 @@ drop function pcre_replace(string, strin
 [ "alpha",     "public",       16,     "monetdb",      0       ]
 [ "date_to_str",       "public",       16,     "monetdb",      0       ]
 [ "degrees",   "public",       16,     "monetdb",      0       ]
+[ "env",       "public",       16,     NULL,   0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
 [ "epoch",     "public",       16,     "monetdb",      0       ]
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
@@ -109,7 +109,6 @@ BUN BATcount_no_nil(BAT *b);
 gdk_return BATdel(BAT *b, BAT *d);
 BAT *BATdense(oid hseq, oid tseq, BUN cnt) __attribute__((warn_unused_result));
 void BATderiveProps(BAT *b, int expensive);
-void BATderiveTailProps(BAT *b, int expensive);
 BAT *BATdiff(BAT *l, BAT *r, BAT *sl, BAT *sr, int nil_matches, BUN estimate);
 gdk_return BATextend(BAT *b, BUN newcap);
 void BATfakeCommit(BAT *b);
diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c
--- a/clients/odbc/driver/SQLConnect.c
+++ b/clients/odbc/driver/SQLConnect.c
@@ -258,9 +258,7 @@ MNDBConnect(ODBCDbc *dbc,
                mapi_setAutocommit(mid, dbc->sql_attr_autocommit == 
SQL_AUTOCOMMIT_ON);
                set_timezone(mid);
                get_serverinfo(dbc);
-               if (dbc->major > 11 ||
-                   (dbc->major == 11 && dbc->minor >= 5))
-                       mapi_set_size_header(mid, 1);
+               mapi_set_size_header(mid, 1);
                /* set timeout after we're connected */
                mapi_timeout(mid, dbc->sql_attr_connection_timeout * 1000);
        }
diff --git a/clients/odbc/driver/SQLTables.c b/clients/odbc/driver/SQLTables.c
--- a/clients/odbc/driver/SQLTables.c
+++ b/clients/odbc/driver/SQLTables.c
@@ -232,87 +232,69 @@ MNDBTables(ODBCStmt *stmt,
                strcpy(query_end, "with ot as (");
                query_end += strlen(query_end);
 
-               if (stmt->Dbc->major < 11 || (stmt->Dbc->major == 11 && 
stmt->Dbc->minor < 21)) {
-                       strcpy(query_end,
-                              "select e.value as table_cat, "
-                                     "s.name as table_schem, "
-                                     "t.name as table_name, "
-                                     "case when t.type = 0 and "
-                                               "t.system = false and "
-                                               "t.temporary = 0 and "
-                                               "s.name <> 'tmp' "
-                                          "then cast('TABLE' as varchar(20)) "
-                                          "when t.type = 0 and "
-                                               "t.system = false and "
-                                               "t.temporary = 0 and "
-                                               "s.name = 'tmp' "
-                                          "then cast('GLOBAL TEMPORARY' as 
varchar(20)) "
-                                          "when t.type = 0 and "
-                                               "t.system = true and "
-                                               "t.temporary = 0 "
-                                          "then cast('SYSTEM TABLE' as 
varchar(20)) "
-                                          "when t.type = 1 and "
-                                               "t.system = true and "
-                                               "t.temporary = 0 "
-                                          "then cast('SYSTEM VIEW' as 
varchar(20)) "
-                                          "when t.type = 1 "
-                                          "then cast('VIEW' as varchar(20)) "
-                                          "when t.type = 0 and "
-                                               "t.system = false and "
-                                               "t.temporary = 1 "
-                                          "then cast('LOCAL TEMPORARY' as 
varchar(20)) "
-                                          "else cast('INTERNAL TABLE TYPE' as 
varchar(20)) end as table_type, "
-                                     "cast(null as varchar(1)) as remarks "
-                              "from sys.schemas s, "
-                                   "sys.tables t, "
-                                   "sys.env() e "
-                              "where s.id = t.schema_id and "
-                                    "e.name = 'gdk_dbname'");
-               } else {
-                       strcpy(query_end,
-                              "select e.value as table_cat, "
-                                     "s.name as table_schem, "
-                                     "t.name as table_name, "
-                                     "case when t.type = 0 and "
-                                               "t.system = false and "
-                                               "t.temporary = 0 and "
-                                               "s.name <> 'tmp' "
-                                          "then cast('TABLE' as varchar(20)) "
-                                          "when t.type = 10 and "
-                                               "t.system = true and "
-                                               "t.temporary = 0 "
-                                          "then cast('SYSTEM TABLE' as 
varchar(20)) "
-                                          "when t.type = 11 and "
-                                               "t.system = true and "
-                                               "t.temporary = 0 "
-                                          "then cast('SYSTEM VIEW' as 
varchar(20)) "
-                                          "when t.type = 1 "
-                                          "then cast('VIEW' as varchar(20)) "
-                                          "when t.type = 3 "
-                                          "then cast('MERGE TABLE' as 
varchar(20)) "
-                                          "when t.type = 4 "
-                                          "then cast('STREAM TABLE' as 
varchar(20)) "
-                                          "when t.type = 5 "
-                                          "then cast('REMOTE TABLE' as 
varchar(20)) "
-                                          "when t.type = 6 "
-                                          "then cast('REPLICA TABLE' as 
varchar(20)) "
-                                          "when t.type = 20 and "
-                                               "t.system = false and "
-                                               "t.temporary = 1 and "
-                                               "s.name = 'tmp' "
-                                          "then cast('GLOBAL TEMPORARY' as 
varchar(20)) "
-                                          "when t.type = 30 and "
-                                               "t.system = false and "
-                                               "t.temporary = 1 "
-                                          "then cast('LOCAL TEMPORARY' as 
varchar(20)) "
-                                          "else cast('INTERNAL TABLE TYPE' as 
varchar(20)) end as table_type, "
-                                     "cast(null as varchar(1)) as remarks "
-                              "from sys.schemas s, "
-                                   "sys.tables t, "
-                                   "sys.env() e "
-                              "where s.id = t.schema_id and "
-                                    "e.name = 'gdk_dbname'");
-               }
+               strcpy(query_end,
+                      "select e.value as table_cat, "
+                             "s.name as table_schem, "
+                             "t.name as table_name, "
+                             "case when t.type = 0 and "
+                                       "t.system = false and "
+                                       "t.temporary = 0 and "
+                                       "s.name <> 'tmp' "
+                                  "then cast('TABLE' as varchar(20)) "
+/* start <= 11.21.X (at some point this code can be removed) */
+                                  "when t.type = 0 and "
+                                       "t.system = false and "
+                                       "t.temporary = 0 and "
+                                       "s.name = 'tmp' "
+                                  "then cast('GLOBAL TEMPORARY' as 
varchar(20)) "
+                                  "when t.type = 0 and "
+                                       "t.system = true and "
+                                       "t.temporary = 0 "
+                                  "then cast('SYSTEM TABLE' as varchar(20)) "
+                                  "when t.type = 0 and "
+                                       "t.system = false and "
+                                       "t.temporary = 1 "
+                                  "then cast('LOCAL TEMPORARY' as varchar(20)) 
"
+                                  "when t.type = 1 and "
+                                       "t.system = true and "
+                                       "t.temporary = 0 "
+                                  "then cast('SYSTEM VIEW' as varchar(20)) "
+/* end <= 11.21.X */
+                                  "when t.type = 1 "
+                                  "then cast('VIEW' as varchar(20)) "
+                                  "when t.type = 3 "
+                                  "then cast('MERGE TABLE' as varchar(20)) "
+                                  "when t.type = 4 "
+                                  "then cast('STREAM TABLE' as varchar(20)) "
+                                  "when t.type = 5 "
+                                  "then cast('REMOTE TABLE' as varchar(20)) "
+                                  "when t.type = 6 "
+                                  "then cast('REPLICA TABLE' as varchar(20)) "
+                                  "when t.type = 10 and "
+                                       "t.system = true and "
+                                       "t.temporary = 0 "
+                                  "then cast('SYSTEM TABLE' as varchar(20)) "
+                                  "when t.type = 11 and "
+                                       "t.system = true and "
+                                       "t.temporary = 0 "
+                                  "then cast('SYSTEM VIEW' as varchar(20)) "
+                                  "when t.type = 20 and "
+                                       "t.system = false and "
+                                       "t.temporary = 1 and "
+                                       "s.name = 'tmp' "
+                                  "then cast('GLOBAL TEMPORARY' as 
varchar(20)) "
+                                  "when t.type = 30 and "
+                                       "t.system = false and "
+                                       "t.temporary = 1 "
+                                  "then cast('LOCAL TEMPORARY' as varchar(20)) 
"
+                                  "else cast('INTERNAL TABLE TYPE' as 
varchar(20)) "
+                             "end as table_type, "
+                             "cast(null as varchar(1)) as remarks "
+                      "from sys.schemas s, "
+                           "sys.tables t, "
+                           "sys.env() e "
+                      "where s.id = t.schema_id and "
+                            "e.name = 'gdk_dbname'");
                assert(strlen(query) < 1100);
                query_end += strlen(query_end);
 
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Wed Jul  6 2016 Sjoerd Mullender <[email protected]>
+- Removed BATderiveTailProps and BATderiveProps.  Just set the properties
+  you know about, or use BATsettrivprop.
+
 * Fri Jul  1 2016 Sjoerd Mullender <[email protected]>
 - Removed the macro BUNfirst.  It can be replaced by 0.
 
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2686,8 +2686,6 @@ gdk_export void BATundo(BAT *b);
 gdk_export int ALIGNsynced(BAT *b1, BAT *b2);
 
 gdk_export void BATassertProps(BAT *b);
-gdk_export void BATderiveProps(BAT *b, int expensive);
-gdk_export void BATderiveTailProps(BAT *b, int expensive);
 
 #define BATPROPS_QUICK  0      /* only derive easy (non-resource consuming) 
properties */
 #define BATPROPS_ALL   1       /* derive all possible properties; no matter 
what cost (key=hash) */
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1901,9 +1901,42 @@ BATmode(BAT *b, int mode)
 #define assert(test)   ((void) ((test) || fprintf(stderr, "!WARNING: %s:%d: 
assertion `%s' failed\n", __FILE__, __LINE__, #test)))
 #endif
 
-static void
-BATassertTailProps(BAT *b)
+/* Assert that properties are set correctly.
+ *
+ * A BAT can have a bunch of properties set.  Mostly, the property
+ * bits are set if we *know* the property holds, and not set if we
+ * don't know whether the property holds (or if we know it doesn't
+ * hold).  All properties are per column.
+ *
+ * The properties currently maintained are:
+ *
+ * dense       Only valid for TYPE_oid columns: each value in the
+ *             column is exactly one more than the previous value.
+ *             This implies sorted, key, nonil.
+ * nil         There is at least one NIL value in the column.
+ * nonil       There are no NIL values in the column.
+ * key         All values in the column are distinct.
+ * sorted      The column is sorted (ascending).  If also revsorted,
+ *             then all values are equal.
+ * revsorted   The column is reversely sorted (descending).  If
+ *             also sorted, then all values are equal.
+ *
+ * The "key" property consists of two bits.  The lower bit, when set,
+ * indicates that all values in the column are distinct.  The upper
+ * bit, when set, indicates that all values must be distinct
+ * (BOUND2BTRUE).
+ *
+ * Note that the functions BATtseqbase and BATkey also set more
+ * properties than you might suspect.  When setting properties on a
+ * newly created and filled BAT, you may want to first make sure the
+ * batCount is set correctly (e.g. by calling BATsetcount), then use
+ * BAThseqbase and BATkey, and finally set the other properties.
+ */
+
+void
+BATassertProps(BAT *b)
 {
+       int bbpstatus;
        BATiter bi = bat_iterator(b);
        BUN p, q;
        int (*cmpf)(const void *, const void *);
@@ -1911,6 +1944,21 @@ BATassertTailProps(BAT *b)
        const void *prev = NULL, *valp, *nilp;
        int seennil = 0;
 
+       /* general BAT sanity */
+       assert(b != NULL);
+       assert(b->batCacheid > 0);
+       assert(b->batCount >= b->batInserted);
+
+       /* headless */
+       assert(b->hseqbase < oid_nil); /* non-nil seqbase */
+       assert(b->hseqbase + BATcount(b) < oid_nil);
+
+       bbpstatus = BBP_status(b->batCacheid);
+       /* only at most one of BBPDELETED, BBPEXISTING, BBPNEW may be set */
+       assert(((bbpstatus & BBPDELETED) != 0) +
+              ((bbpstatus & BBPEXISTING) != 0) +
+              ((bbpstatus & BBPNEW) != 0) <= 1);
+
        assert(b != NULL);
        assert(b->ttype >= TYPE_void);
        assert(b->ttype < GDKatomcnt);
@@ -2119,290 +2167,3 @@ BATassertTailProps(BAT *b)
                assert(!b->tnil || seennil);
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to