> On 30-04-2010 22:27:24 +0200, Sjoerd Mullender wrote:
> > On Monday, May 3, 2010, we are going to move the MonetDB repository over
> > from the Sourceforge-hosted CVS repository to a Mercurial repository
> > hosted on dev.monetdb.org.  On March 18 I sent a pre announcement to the
> > monetdb-developers list (IMPORTANT: changes are afoot). [1]
> 
> Please be aware that also the SourceForge bugtracker will be migrated.
> Changes made to the bugtracker since 6:00am today will get lost.  We
> will try to close the SourceForge bugtracker ASAP for this reason.
> 

Where can I find the new bug tracker?

By slightly changing the test submitted with bug #2995671, 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.

To improve the subset of possible interactions between components
which is tested, have you considered a fuzz-testing-like approach?

Best regards,

Isidor
START TRANSACTION;
CREATE TABLE user_record (
    name VARCHAR(64),
    uid VARCHAR(32) PRIMARY KEY
);
CREATE TABLE user_record_insertion (
    name VARCHAR(64),
    uid VARCHAR(32)
);
CREATE TABLE user_record_insertion2 (
    name VARCHAR(64),
    uid VARCHAR(32)
);
COMMIT;
START TRANSACTION;
DELETE
    FROM user_record_insertion;
COPY 10 RECORDS
    INTO user_record_insertion
    FROM STDIN
    USING DELIMITERS ',','\n';
Steven Teague,d5329b8f
Chrystal Whitman,20cbc561
Elisabeth Luetten,4e0bfbea
Jimmy Roark,6b0e43bd
Vern Marrero,c2d113ad
Shelly Rankin,198118fe
Randall Kaiser,f76bfe86
Rusty Wuerzen,9c29633b
Wilfredo Rosenbaum,e5c469cb
Cecil Herrington,000c14c7
;
INSERT
    INTO user_record_insertion2 (name,uid)
    SELECT name,uid
        FROM user_record_insertion;
INSERT
    INTO user_record (name,uid)
    SELECT name,uid
        FROM user_record_insertion2;
COMMIT;
DROP TABLE user_record_insertion2;
DROP TABLE user_record_insertion;
DROP TABLE user_record;
--- a/src/storage/bat/bat_storage.mx
+++ b/src/storage/bat/bat_storage.mx
@@ -120,9 +120,15 @@ delta_bind_bat( sql_delta *bat, int access, int temp)
 	BAT *b;
 
 	assert(access == RDONLY || access == RD_INS);
-	if (temp || access == RD_INS || !bat->bid) {
+	if (temp || access == RD_INS) {
 		assert(bat->ibid);
 		b = temp_descriptor(bat->ibid);
+	} else if (!bat->bid) {
+		BAT* b_ibid = temp_descriptor(bat->ibid);
+		b = bat_new(b_ibid->htype, b_ibid->ttype, 0);
+		bat_destroy(b_ibid);
+		bat_set_access(b, BAT_READ);
+		bat->bid = temp_create(b);
 	} else {
 		b = temp_descriptor(bat->bid);
 		bat_set_access(b, BAT_READ);
------------------------------------------------------------------------------
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers

Reply via email to