Page 1 of 1

possible rename problem

Posted: Mon Jun 21, 2010 6:51 am
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

Re: possible rename problem

Posted: Mon Jun 21, 2010 10:05 pm
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.

Re: possible rename problem

Posted: Tue Jun 22, 2010 8:38 am
by tjerkheijboer
keep up the good work :D