Changeset: 5aea6b6e0ea0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5aea6b6e0ea0
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: literal_features
Log Message:
merged with default
diffs (truncated from 1090 to 300 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1484,6 +1484,8 @@ BBPtrim(bool aggressive)
if (!aggressive)
flag |= BBPHOT;
for (bat bid = 1, nbat = (bat) ATOMIC_GET(&BBPsize); bid < nbat; bid++)
{
+ if (GDKexiting())
+ return changed;
/* don't do this during a (sub)commit */
BBPtmlock();
MT_lock_set(&GDKswapLock(bid));
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2421,15 +2421,10 @@ log_cleanup_range(logger *lg, ulng id)
static void
do_rotate(logger *lg)
{
- logged_range *cur = lg->current;
- logged_range *next = cur->next;
+ logged_range *next = lg->current->next;
if (next) {
assert(ATOMIC_GET(&next->refcount) == 1);
- lg->current = next;
- if (ATOMIC_GET(&cur->refcount) == 1) {
- close_stream(cur->output_log);
- cur->output_log = NULL;
- }
+ lg->current = lg->current->next;
}
}
@@ -3104,14 +3099,7 @@ log_tflush(logger *lg, ulng file_id, uln
}
/* else somebody else has flushed our log file */
- if (ATOMIC_DEC(&frange->refcount) == 1) {
- rotation_lock(lg);
- if (frange != lg->current) {
- close_stream(frange->output_log);
- frange->output_log = NULL;
- }
- rotation_unlock(lg);
- }
+ ATOMIC_DEC(&frange->refcount);
if (ATOMIC_DEC(&lg->nr_flushers) == 0) {
/* I am the last flusher
diff --git a/monetdb5/modules/atoms/Tests/json01.maltest
b/monetdb5/modules/atoms/Tests/json01.maltest
--- a/monetdb5/modules/atoms/Tests/json01.maltest
+++ b/monetdb5/modules/atoms/Tests/json01.maltest
@@ -56,7 +56,7 @@ f:= json.filter(b,"f1[1]")
query T rowsort
io.print(f)
----
-"3"
+"[]"
statement ok
f:= json.filter(b,"f1[2]")
@@ -72,7 +72,7 @@ f:= json.filter(b,"*")
query T rowsort
io.print(f)
----
-"[1,2,3]"
+"[3,2]"
statement ok
b:= json.new("{\"f1\":{\"f12\":3},\"f2\":[2,3,4]}")
diff --git a/monetdb5/modules/atoms/Tests/json02.maltest
b/monetdb5/modules/atoms/Tests/json02.maltest
--- a/monetdb5/modules/atoms/Tests/json02.maltest
+++ b/monetdb5/modules/atoms/Tests/json02.maltest
@@ -57,8 +57,6 @@ 0
f1
1
f2
-2
-f1
statement ok
ff:= json.values(b)
@@ -67,11 +65,9 @@ query IT rowsort
io.print(ff)
----
0
-1
+3
1
2
-2
-3
statement ok
b:= json.new("{\"f1\":{\"f12\":3},\"f2\":[2,3,4]}")
diff --git a/monetdb5/modules/atoms/Tests/json05.maltest
b/monetdb5/modules/atoms/Tests/json05.maltest
--- a/monetdb5/modules/atoms/Tests/json05.maltest
+++ b/monetdb5/modules/atoms/Tests/json05.maltest
@@ -28,7 +28,7 @@ p:= json.filter(js,"..author")
query T rowsort
io.print(p)
----
-"[\"Nigel Rees\",\"Evelyn Waugh\",\"Herman Melville\",\"J. R. R. Tolkien\"]"
+"[\"J. R. R. Tolkien\"]"
statement ok
p:= json.filter(js,"..category")
@@ -36,7 +36,7 @@ p:= json.filter(js,"..category")
query T rowsort
io.print(p)
----
-"[\"reference\",\"fiction\",\"fiction\",\"fiction\"]"
+"[\"fiction\"]"
statement ok
p:= json.filter(js,"[0].book[0]")
@@ -44,7 +44,7 @@ p:= json.filter(js,"[0].book[0]")
query T rowsort
io.print(p)
----
-"{ \"category\": \"reference\", \"author\": \"Nigel Rees\", \"title\":
\"Sayings of the Century\", \"price\": 8.95 }"
+"{ \"category\": \"fiction\", \"author\": \"J. R. R. Tolkien\", \"title\":
\"The Lord of the Rings\", \"isbn\": \"0-395-19395-8\", \"price\": 22.99 }"
statement ok
p:= json.filter(js,"[0].book[1]")
@@ -52,7 +52,7 @@ p:= json.filter(js,"[0].book[1]")
query T rowsort
io.print(p)
----
-"{ \"category\": \"fiction\", \"author\": \"Evelyn Waugh\", \"title\": \"Sword
of Honour\", \"price\": 12.99 }"
+"[]"
statement ok
p:= json.filter(js,"[0].book[2]")
@@ -60,7 +60,7 @@ p:= json.filter(js,"[0].book[2]")
query T rowsort
io.print(p)
----
-"{ \"category\": \"fiction\", \"author\": \"Herman Melville\", \"title\":
\"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\": 8.99 }"
+"[]"
statement ok
p:= json.filter(js,"[0].book[3]")
@@ -68,7 +68,7 @@ p:= json.filter(js,"[0].book[3]")
query T rowsort
io.print(p)
----
-"{ \"category\": \"fiction\", \"author\": \"J. R. R. Tolkien\", \"title\":
\"The Lord of the Rings\", \"isbn\": \"0-395-19395-8\", \"price\": 22.99 }"
+"[]"
statement ok
p:= json.filter(js,"[0].book..category")
diff --git a/monetdb5/modules/atoms/Tests/json08.maltest
b/monetdb5/modules/atoms/Tests/json08.maltest
--- a/monetdb5/modules/atoms/Tests/json08.maltest
+++ b/monetdb5/modules/atoms/Tests/json08.maltest
@@ -78,7 +78,7 @@ 1
2
1
3
-1
+3
4
{"f12":3}
diff --git a/monetdb5/modules/atoms/Tests/json10.maltest
b/monetdb5/modules/atoms/Tests/json10.maltest
--- a/monetdb5/modules/atoms/Tests/json10.maltest
+++ b/monetdb5/modules/atoms/Tests/json10.maltest
@@ -51,7 +51,7 @@ f:= json.text(b)
query T rowsort
io.print(f)
----
-"1 world 3"
+"3 world"
statement ok
b:= json.new("{\"f1\":{\"f12\":3},\"f2\":[2,3,4], \"f3\":true}")
diff --git a/monetdb5/modules/atoms/Tests/json11.maltest
b/monetdb5/modules/atoms/Tests/json11.maltest
--- a/monetdb5/modules/atoms/Tests/json11.maltest
+++ b/monetdb5/modules/atoms/Tests/json11.maltest
@@ -51,7 +51,7 @@ f:= json.text(b,",")
query T rowsort
io.print(f)
----
-"1,2,3"
+"3,2"
statement ok
b:= json.new("{\"f1\":{\"f12\":3},\"f2\":[2,3,4], \"f3\":true}")
diff --git a/monetdb5/modules/atoms/Tests/json13.maltest
b/monetdb5/modules/atoms/Tests/json13.maltest
--- a/monetdb5/modules/atoms/Tests/json13.maltest
+++ b/monetdb5/modules/atoms/Tests/json13.maltest
@@ -53,7 +53,7 @@ p:= json.filter(js,".store.*")
query T rowsort
io.print(p)
----
-"[{ \"category\": \"reference\", \"author\": \"Nigel Rees\", \"title\":
\"Sayings of the Century\", \"price\": 8.95 }, { \"category\": \"fiction\",
\"author\": \"Evelyn Waugh\", \"title\": \"Sword of Honour\", \"price\": 12.99
}, { \"category\": \"fiction\", \"author\": \"Herman Melville\", \"title\":
\"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\": 8.99 }, { \"category\":
\"fiction\", \"author\": \"J. R. R. Tolkien\", \"title\": \"The Lord of the
Rings\", \"isbn\": \"0-395-19395-8\", \"price\": 22.99 },{ \"color\": \"red\",
\"price\": 19.95 }]"
+"[[ { \"category\": \"reference\", \"author\": \"Nigel Rees\", \"title\":
\"Sayings of the Century\", \"price\": 8.95 }, { \"category\": \"fiction\",
\"author\": \"Evelyn Waugh\", \"title\": \"Sword of Honour\", \"price\": 12.99
}, { \"category\": \"fiction\", \"author\": \"Herman Melville\", \"title\":
\"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\": 8.99 }, { \"category\":
\"fiction\", \"author\": \"J. R. R. Tolkien\", \"title\": \"The Lord of the
Rings\", \"isbn\": \"0-395-19395-8\", \"price\": 22.99 } ],{ \"color\":
\"red\", \"price\": 19.95 }]"
statement ok
p:= json.filter(js,".store..price")
@@ -93,5 +93,5 @@ p:= json.filter(js,"$")
query T rowsort
io.print(p)
----
-"[{ \"store\": { \"book\": [ { \"category\": \"reference\", \"author\":
\"Nigel Rees\", \"title\": \"Sayings of the Century\", \"price\": 8.95 }, {
\"category\": \"fiction\", \"author\": \"Evelyn Waugh\", \"title\": \"Sword of
Honour\", \"price\": 12.99 }, { \"category\": \"fiction\", \"author\": \"Herman
Melville\", \"title\": \"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\":
8.99 }, { \"category\": \"fiction\", \"author\": \"J. R. R. Tolkien\",
\"title\": \"The Lord of the Rings\", \"isbn\": \"0-395-19395-8\", \"price\":
22.99 } ], \"bicycle\": { \"color\": \"red\", \"price\": 19.95 } } }]"
+"{ \"store\": { \"book\": [ { \"category\": \"reference\", \"author\": \"Nigel
Rees\", \"title\": \"Sayings of the Century\", \"price\": 8.95 }, {
\"category\": \"fiction\", \"author\": \"Evelyn Waugh\", \"title\": \"Sword of
Honour\", \"price\": 12.99 }, { \"category\": \"fiction\", \"author\": \"Herman
Melville\", \"title\": \"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\":
8.99 }, { \"category\": \"fiction\", \"author\": \"J. R. R. Tolkien\",
\"title\": \"The Lord of the Rings\", \"isbn\": \"0-395-19395-8\", \"price\":
22.99 } ], \"bicycle\": { \"color\": \"red\", \"price\": 19.95 } } }"
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -637,6 +637,7 @@ JSONgetValue(JSON *jt, int idx)
return s;
}
+/* eats res and r */
static str
JSONglue(str res, str r, char sep)
{
@@ -743,8 +744,9 @@ JSONmatch(JSON *jt, int ji, pattern *ter
r = JSONgetValue(jt,
jt->elm[i].child);
if (r == NULL)
r = (str) -1;
- } else
+ } else {
r = JSONmatch(jt,
jt->elm[i].child, terms, ti + 1, terms[ti].index == INT_MAX);
+ }
if (r == (str) -1 || r == (str) -2) {
GDKfree(res);
return r;
@@ -754,7 +756,7 @@ JSONmatch(JSON *jt, int ji, pattern *ter
} else { // Keep the last matching
value
if (res)
GDKfree(res);
- res = GDKstrdup(r);
+ res = r;
}
}
cnt++;
@@ -845,9 +847,9 @@ JSONfilterInternal(json *ret, json *js,
// pattern contains the .. operator
if (terms[i].token == ANY_STEP ||
// pattern contains the [*] operator
- (terms[i].token == CHILD_STEP && terms[i].index ==
INT_MAX && terms[i].name == NULL)) {
+ (terms[i].token == CHILD_STEP && terms[i].index ==
INT_MAX && terms[i].name == NULL) ||
+ (terms[i].token == CHILD_STEP && terms[i].index ==
INT_MAX && *terms[i].name == '*')) {
- /* if (terms[i].make_array) { */
return_array = true;
break;
}
@@ -1098,7 +1100,7 @@ JSONtoken(JSON *jt, const char *j, const
return idx;
/* Search for a duplicate key */
- for(pidx = nxt - 1; pidx > idx; pidx--) {
+ for(pidx = jt->elm[idx].next; pidx != 0; pidx =
jt->elm[pidx].next) {
if (jt->elm[pidx].kind == JSON_ELEMENT &&
jt->elm[pidx].valuelen ==
jt->elm[nxt].valuelen - 2 &&
strncmp(jt->elm[pidx].value,
jt->elm[nxt].value + 1,
@@ -1108,7 +1110,7 @@ JSONtoken(JSON *jt, const char *j, const
}
/* Duplicate found: Change the value of the previous
key. */
- if (pidx > idx) {
+ if (pidx > 0) {
jt->elm[pidx].child = chld;
/* Note that we do not call JSONappend here.
*
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -8,6 +8,9 @@
information_schema.views
information_schema.columns
information_schema.character_sets
+ information_schema.check_constraints
+ information_schema.table_constraints
+ information_schema.sequences
Most views have been extended (after the standard columns) with MonetDB
specific information columns such as schema_id, table_id, column_id, etc.
diff --git a/sql/backends/monet5/sql_upgrades.c
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -6041,6 +6041,7 @@ sql_update_default(Client c, mvc *sql, s
"CREATE SCHEMA INFORMATION_SCHEMA;\n"
"COMMENT ON SCHEMA INFORMATION_SCHEMA IS 'ISO/IEC 9075-11
SQL/Schemata';\n"
"update sys.schemas set system = true where name =
'information_schema';\n"
+
"CREATE VIEW INFORMATION_SCHEMA.CHARACTER_SETS AS SELECT\n"
" cast(NULL AS varchar(1)) AS CHARACTER_SET_CATALOG,\n"
" cast(NULL AS varchar(1)) AS CHARACTER_SET_SCHEMA,\n"
@@ -6051,6 +6052,7 @@ sql_update_default(Client c, mvc *sql, s
" cast(NULL AS varchar(1)) AS DEFAULT_COLLATE_SCHEMA,\n"
" cast(NULL AS varchar(1)) AS DEFAULT_COLLATE_NAME;\n"
"GRANT SELECT ON TABLE INFORMATION_SCHEMA.CHARACTER_SETS TO
PUBLIC WITH GRANT OPTION;\n"
+
"CREATE VIEW INFORMATION_SCHEMA.SCHEMATA AS SELECT\n"
" cast(NULL AS varchar(1)) AS CATALOG_NAME,\n"
" s.\"name\" AS SCHEMA_NAME,\n"
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]