Changeset: ab0c3fefa3cb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ab0c3fefa3cb
Modified Files:
monetdb5/mal/mal_profiler.c
Branch: Jun2023
Log Message:
merged with Sep2022
diffs (113 lines):
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -234,8 +234,8 @@ format_val2json(const ValPtr res) {
char *buf = NULL;
size_t sz = 0;
- if (BATatoms[res->vtype].atomNull &&
- BATatoms[res->vtype].atomCmp(VALget(res),
BATatoms[res->vtype].atomNull) == 0)
+ if (BATatoms[res->vtype].atomNull && (!VALget(res) ||
+ BATatoms[res->vtype].atomCmp(VALget(res),
BATatoms[res->vtype].atomNull) == 0))
return GDKstrdup("\"nil\"");
bool use_external = true;
diff --git a/monetdb5/optimizer/opt_emptybind.c
b/monetdb5/optimizer/opt_emptybind.c
--- a/monetdb5/optimizer/opt_emptybind.c
+++ b/monetdb5/optimizer/opt_emptybind.c
@@ -135,8 +135,9 @@ OPTemptybindImplementation(Client cntxt,
q= updated[j];
if(q && getModuleId(q) == sqlRef &&
isUpdateInstruction(q)){
int c = getFunctionId(q) == claimRef;
/* claim has 2 results */
- if (
strcmp(getVarConstant(mb,getArg(q,2+c)).val.sval, sch) == 0 &&
-
strcmp(getVarConstant(mb,getArg(q,3+c)).val.sval, tbl) == 0 ){
+ int cl = getFunctionId(q) ==
clear_tableRef; /* clear table has no mvc dependency */
+ if (
strcmp(getVarConstant(mb,getArg(q,2-cl+c)).val.sval, sch) == 0 &&
+
strcmp(getVarConstant(mb,getArg(q,3-cl+c)).val.sval, tbl) == 0 ){
empty[getArg(p,0)] = 0;
if( p->retc == 2){
empty[getArg(p,1)] = 0;
diff --git a/sql/test/BugTracker-2023/Tests/All
b/sql/test/BugTracker-2023/Tests/All
--- a/sql/test/BugTracker-2023/Tests/All
+++ b/sql/test/BugTracker-2023/Tests/All
@@ -1,7 +1,9 @@
ambiguous-identifiers-7372
temp-table-foreign-key-crash-7378
+blob-crash-7380
add-drop-column-crash-7381
temp-on-savepoint-truncate-rollback-crash-7382
recursive-trigger-crash-7383
+empty-optimizer-crash-7384
view-on-alias-crash-7386
alter-inc-seq-crash-7387
diff --git a/sql/test/BugTracker-2023/Tests/blob-crash-7380.test
b/sql/test/BugTracker-2023/Tests/blob-crash-7380.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2023/Tests/blob-crash-7380.test
@@ -0,0 +1,8 @@
+statement ok
+CREATE TABLE a (p_id INT, p_name BLOB)
+
+statement ok
+INSERT INTO a VALUES (1,NULL);
+
+statement error
+select * from a where p_name='Lilu'
diff --git a/sql/test/BugTracker-2023/Tests/empty-optimizer-crash-7384.test
b/sql/test/BugTracker-2023/Tests/empty-optimizer-crash-7384.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2023/Tests/empty-optimizer-crash-7384.test
@@ -0,0 +1,53 @@
+statement ok
+create schema test
+
+statement ok
+drop schema test cascade
+
+statement ok
+create schema test
+
+statement ok
+set schema test
+
+statement ok
+CREATE TABLE test (sect int NOT NULL auto_increment, PRIMARY KEY (sect))
+
+statement ok
+create trigger count after delete on test for each row insert into test values
(1)
+
+statement ok
+delete from test
+
+statement ok
+set schema sys
+
+statement ok
+drop schema test cascade
+
+statement ok
+create schema test
+
+statement ok
+drop schema test cascade
+
+statement ok
+create schema test
+
+statement ok
+set schema test
+
+statement ok
+CREATE TABLE test (sect int NOT NULL auto_increment, PRIMARY KEY (sect))
+
+statement ok
+create trigger count after delete on test for each row insert into test values
(1)
+
+statement ok
+delete from test
+
+statement ok
+set schema sys
+
+statement ok
+drop schema test cascade
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]