Changeset: 4821446e3ccf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4821446e3ccf
Modified Files:
        sql/storage/store.c
        sql/test/miscellaneous/Tests/All
Branch: Jan2022
Log Message:

Merged with Jul2021


diffs (60 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -411,9 +411,9 @@ load_key(sql_trans *tr, sql_table *t, re
        }
 
        /* find idx with same name */
-       sql_base *i = os_find_name(nk->t->s->idxs, tr, nk->base.name);
-       if (i) {
-               nk->idx = (sql_idx*)i;
+       node *n = ol_find_name(t->idxs, nk->base.name);
+       if (n) {
+               nk->idx = (sql_idx*)n->data;
                nk->idx->key = nk;
        }
        return nk;
@@ -2909,12 +2909,9 @@ key_dup(sql_trans *tr, sql_key *k, sql_t
        nk->idx = NULL;
 
        if (k->idx) {
-               sql_base *b = os_find_name(nk->t->s->idxs, tr, nk->base.name);
-
-               if (b) {
-                       nk->idx = (sql_idx *)b;
-                       nk->idx->key = nk;
-               }
+               node *n = ol_find_name(t->idxs, nk->base.name);
+               nk->idx = (sql_idx *)n->data;
+               nk->idx->key = nk;
        }
 
        if (nk->type != fkey) {
diff --git a/sql/test/miscellaneous/Tests/All b/sql/test/miscellaneous/Tests/All
--- a/sql/test/miscellaneous/Tests/All
+++ b/sql/test/miscellaneous/Tests/All
@@ -25,3 +25,4 @@ NOT_ASSERT?sqlfuncnames
 sequences
 analyze_test
 blobs
+temp_tables
diff --git a/sql/test/miscellaneous/Tests/temp_tables.SQL.py 
b/sql/test/miscellaneous/Tests/temp_tables.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/miscellaneous/Tests/temp_tables.SQL.py
@@ -0,0 +1,15 @@
+from MonetDBtesting.sqltest import SQLTestCase
+
+# another temp tables test case
+with SQLTestCase() as mdb1:
+    mdb1.connect(username="monetdb", password="monetdb")
+    mdb1.execute("CREATE GLOBAL TEMPORARY TABLE t2(c0 INT, c1 TIME UNIQUE) ON 
COMMIT DELETE ROWS;").assertSucceeded()
+
+with SQLTestCase() as mdb2:
+    mdb2.connect(username="monetdb", password="monetdb")
+    mdb2.execute("INSERT INTO tmp.t2(c1) VALUES(TIME 
'13:35:22');").assertSucceeded().assertRowCount(1)
+
+with SQLTestCase() as mdb3:
+    mdb3.connect(username="monetdb", password="monetdb")
+    mdb3.execute("INSERT INTO tmp.t2(c1, c0) VALUES(TIME '13:41:34', 
66);").assertSucceeded().assertRowCount(1)
+    mdb3.execute("DROP TABLE tmp.t2;").assertSucceeded()
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to