possible rename problem

This forum is to report technical problems with Rel.
Post Reply
tjerkheijboer
Posts: 9
Joined: Thu Jun 10, 2010 12:12 pm

possible rename problem

Post by tjerkheijboer »

Hi,

I am not sure whether this is a bug or a feature, but maybe you can check this on your machine:

Given the following:

TYPE Pt POSSREP {X RATIONAL, Y RATIONAL};

TYPE L# POSSREP {L# CHAR};



VAR P BASE RELATION {Pt Pt} KEY {Pt};



P := RELATION {

TUPLE {Pt Pt(0.0,0.0)},

TUPLE {Pt Pt(0.0,1.0)},

TUPLE {Pt Pt(1.0,0.0)},

TUPLE {Pt Pt(1.0,1.0)}

};





VAR L BASE RELATION {L# L#} KEY {L#};



L := RELATION {

TUPLE {L# L#("L1")},

TUPLE {L# L#("L2")},

TUPLE {L# L#("L3")},

TUPLE {L# L#("L4")}

};





VAR LP BASE RELATION {L# L#, P# P#} KEY {L#, P#};



LP := RELATION {

TUPLE {L# L#("L1"),Pt Pt(0.0,0.0)},

TUPLE {L# L#("L1"), Pt Pt(0.0,1.0)},

TUPLE {L# L#("L2"), Pt Pt(0.0,1.0)},

TUPLE {L# L#("L2"), Pt Pt(1.0,1.0)},

TUPLE {L# L#("L3"), Pt Pt(1.0,1.0)},

TUPLE {L# L#("L3"), Pt Pt(1.0,0.0)},

TUPLE {L# L#("L4"), Pt Pt(1.0,0.0)},

TUPLE {L# L#("L4"), Pt Pt(0.0,0.0)}

};



CONSTRAINT LP_L_KEY LP {L#} <= L {L#};

CONSTRAINT LP_P_KEY LP {Pt} <= P {Pt};

when I do the following query:

((LP rename (L# as Ll) join LP){Ll,L#} where not (Ll = L#)) rename (Ll as L#)

I get a relation which has two times the same attribute name of the same type:

RELATION {L# L#, L# L#} {
TUPLE {L# L#("L1"), L# L#("L4")},
TUPLE {L# L#("L1"), L# L#("L2")},
TUPLE {L# L#("L2"), L# L#("L1")},
TUPLE {L# L#("L2"), L# L#("L3")},
TUPLE {L# L#("L3"), L# L#("L4")},
TUPLE {L# L#("L3"), L# L#("L2")},
TUPLE {L# L#("L4"), L# L#("L1")},
TUPLE {L# L#("L4"), L# L#("L3")}
}

cheers,

Tjerk
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: possible rename problem

Post by Dave »

It's a bug, nicely caught! :)

It turns out the following creates duplicate column names too:

Code: Select all

sys.Catalog RENAME (Definition AS Name)
This will be fixed in the next update.
tjerkheijboer
Posts: 9
Joined: Thu Jun 10, 2010 12:12 pm

Re: possible rename problem

Post by tjerkheijboer »

keep up the good work :D
Post Reply