Page 1 of 1

RENAME in V3.013 incompatible with previous versions

Posted: Thu Jan 24, 2019 2:43 pm
by HughDarwen
This might not be a bug, but rather a change resulting from a bug fix, but I'm asking the question under this rubric for want of a more appropriate one.

In all versions up to V3.012 the following expression was legal:

rel{tup{x1 1}} rename {suffix '1' as '', x as y}

resulting in rel{tup{y 1}}

In V3.013 it gives an error message:

ERROR: RS0120: Rename from x to y found no matching 'from' attribute in {x1 INTEGER}

Line 1

I used this construct in an extremely complicated expression that I need to evaluate once a month (to check my domestic electricity consumption!). Have I been unwittingly exploiting a feature that is now regarded as a bug? If so, I realise that the following rewrite solves the problem:

rel{tup{x1 1}} rename {suffix '1' as ''} rename {x as y}

but is that what's intended by this change?

Hugh

Re: RENAME in V3.013 incompatible with previous versions

Posted: Sun Jan 27, 2019 8:56 pm
by Dave
It's an effect of making RENAME parallel. An expression like REL {TUP {X1 1}} RENAME {SUFFIX '1' AS '', X AS Y} now fails because for a parallel rename to work, the <old_name> of each <old_name> AS <new_name> pair must exist in the tuple/relation operand expression.

By the way, apologies for the slow response -- I was away most of the weekend, and unusually busy before it!

Re: RENAME in V3.013 incompatible with previous versions

Posted: Tue Jan 29, 2019 3:29 pm
by HughDarwen
Thanks for the confirmation.

I fully agree with the change. On reflection, I feel rather ashamed of exploiting what I would regard as a bug in previous versions!

Hugh