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

main BAT fallback creates collision #2529

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

main BAT fallback creates collision #2529

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2010-05-05 03:23:25 +0200
From: zeuner <>
To: SQL devs <>
Version: -- development
CC: @njnes, zeuner

Last updated: 2010-08-30 09:18:31 +0200

Comment 13998

Date: 2010-05-05 03:23:25 +0200
From: zeuner <>

Created attachment 1
SQL code to show the issue

By slightly changing the test submitted with bug http://bugs.monetdb.org/show_bug.cgi?id=2361, I was able
to trigger an unrelated bug (see the attached test file
fallback-bid-collision.sql). In sql/src/storage/bat/bat_storage.mx,
function delta_bind_bat, the conditional (temp || access == RD_INS ||
!bat->bid) leads to the iBAT being returned even if the main BAT is
requested by sql.bind(...,0), when there is no main BAT in the
sql_delta structure. As long as sql.bind(...,0) and sql.bind(...,1)
are combined using algebra.kunion, this doesn't seem to create
problems. But the mergetable optimizer's logic to optimize union
computations based on overlapped MAT elements does not interact
correctly with that behaviour, which leads to the data being inserted
twice in the test file.

I have attached a patch (no-fallback-ibid.diff) which avoids this
problem by disabling the iBAT fallback, creating an empty main BAT
instead.

Attached file: fallback-bid-collision.sql (text/plain, 975 bytes)
Description: SQL code to show the issue

Comment 13999

Date: 2010-05-05 03:28:34 +0200
From: zeuner <>

Created attachment 2
possible fix

Attached file: no-fallback-ibid.diff (text/plain, 600 bytes)
Description: possible fix

Comment 14207

Date: 2010-07-02 23:25:20 +0200
From: @njnes

fixed by returning empty bat, when the primary bat is gone because of a 'delete all'

Comment 14208

Date: 2010-07-02 23:27:50 +0200
From: @njnes

Changeset d8a41f812526 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=d8a41f812526

Changeset description:

fixed bug #2529

In case we did a delete all, the primary bat is gone. Before we
returned the ibat (twice). Now only when the inserts are needed and
an empty bat when the primary bat is requested.

Comment 14209

Date: 2010-07-02 23:27:51 +0200
From: @njnes

Changeset e7065770051d made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=e7065770051d

Changeset description:

added tests for bug #2529

Comment 14825

Date: 2010-08-30 09:18:31 +0200
From: @sjoerdmullender

The Jun2010-SP2 version has been released.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants