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

bulk and scalar versions of mkey.rotate_xor_hash differ #3474

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

bulk and scalar versions of mkey.rotate_xor_hash differ #3474

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

Comments

@monetdb-team
Copy link

Date: 2014-04-14 17:37:50 +0200
From: @sjoerdmullender
To: SQL devs <>
Version: 11.17.13 (Jan2014-SP1)
CC: @mlkersten, @njnes

Last updated: 2014-10-31 14:13:51 +0100

Comment 19752

Date: 2014-04-14 17:37:50 +0200
From: @sjoerdmullender

The bulk and scalar versions of mkey.rotate_xor_hash differ for types whose ATOMstorage type is different from the type itself and equal to one of the numeric types.
This has dire consequences for SQL since the function is used in the calculation and maintenance of the index column for multi-column primary keys. It is easy to construct a table with duplicate primary keys:

create table x ( a clob, b clob, c timestamp);
alter table x add primary key (a,b,c);
create table y ( a clob, b clob, c timestamp);
insert into y values ('FIAM','HHZ', '2010-04-25T14:00:00.000');
insert into x (select * from y);

-- this query should fail but doesn't:
insert into x values ('FIAM','HHZ', '2010-04-25T14:00:00.000');

Comment 20249

Date: 2014-10-04 23:27:33 +0200
From: @mlkersten

Added the test duplicate_primary_keys.Bug-3474.sql

Comment 20265

Date: 2014-10-08 15:01:40 +0200
From: MonetDB Mercurial Repository <>

Changeset 362c555dffad 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=362c555dffad

Changeset description:

make sure we use the correct atom hash function for external types.
Fixes bug #3474, a cleanup of all the hash functions is still needed

Comment 20269

Date: 2014-10-08 16:10:27 +0200
From: @njnes

todo - upgrade indices (dump restore or recreate indices/keys which include types such as date, timestamp etc)

Comment 20291

Date: 2014-10-14 17:37:52 +0200
From: MonetDB Mercurial Repository <>

Changeset 56c438d0b5e4 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Fixed mkey module to use the same hash function whichever way it is called.
This should fix bug #3474 properly (except for upgrade issues).

Comment 20340

Date: 2014-10-31 14:13:51 +0100
From: @sjoerdmullender

Oct2014 has been released.

@monetdb-team monetdb-team added bug Something isn't working major SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 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 major SQL
Projects
None yet
Development

No branches or pull requests

2 participants