Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge table unusable in other connections #6325

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Merge table unusable in other connections #6325

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2017-05-23 16:53:29 +0200
From: Richard Hughes <<richard.monetdb>>
To: SQL devs <>
Version: 11.23.13 (Jun2016-SP2)
CC: @njnes

Last updated: 2017-08-02 10:21:28 +0200

Comment 25347

Date: 2017-05-23 16:53:29 +0200
From: Richard Hughes <<richard.monetdb>>

Created attachment 551
Reproduction recipe

Reproduced on both default branch a84d813e7f57 and Jun2016 7a344a54d712

To reproduce:

  1. Create a new, blank database named 'newdb'
  2. Run the attached (change the IP address at the top if non-loopback)

Expected results:

Script prints [(0,)]

Actual results:

Traceback (most recent call last):
File "merge-multiconn.py", line 26, in
print(query(c2, 'select count(*) from mt'))
monetdb.exceptions.OperationalError: MERGE or REPLICA TABLE should have at least one table associated

Changing 'c1' to be autocommit makes it work.
Running the final select on 'c1' instead of 'c2' also works.
Restarting mserver5 makes all future selects work.

Attached file: merge-multiconn.py (text/plain, 690 bytes)
Description: Reproduction recipe

Comment 25348

Date: 2017-05-24 14:27:13 +0200
From: Richard Hughes <<richard.monetdb>>

This change makes my test pass:

diff -r a84d813e7f57 sql/storage/store.c
--- a/sql/storage/store.c Fri May 19 16:40:54 2017 +0200
+++ b/sql/storage/store.c Wed May 24 13:22:50 2017 +0100
@@ -2392,7 +2392,6 @@
if (tr->parent == gtrans)
ot->columns.nelm = NULL;
}

  •   /*
      if (ot->tables.set) {
              for (n = ot->tables.set->h; n; n = n->next) {
                      sql_table *pt = n->data;
    

@@ -2404,7 +2403,6 @@
if (tr->parent == gtrans)
ot->tables.nelm = NULL;
}

  •   */
      if (ot->idxs.set) {
              for (n = ot->idxs.set->h; n; n = n->next) {
                      sql_idx *i = n->data;
    

...but that diff scores a full eleven out of ten on the frightening-o-meter. Why was it commented out? Those lines were commented out when they were first added in 1d95d284c771

Comment 25416

Date: 2017-07-05 22:23:46 +0200
From: @njnes

fixed by keeping a list of members in each merge table (parts) instead directly tables

Comment 25537

Date: 2017-08-02 10:21:28 +0200
From: @sjoerdmullender

Fixed in Jul2017-SP1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant