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

Column aliases still missing even in trivial cases. [CORE1508] #1923

Open
firebird-automations opened this issue Sep 13, 2007 · 1 comment
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Claudio Valderrama C. (robocop)

It seems that giving each unnamed column an automatic alias in FB has become a labor for Hercules since FB1 because we can't put an end to the surprises. These are trivial examples:

SQL> select 1, -1, gen_id(rdb$trigger_name, 0), -gen_id(rdb$trigger_name, 0) from rdb$database;

CONSTANT                             GEN\_ID

============ ============ ===================== =====================
1 -1 0 0

SQL> select NULL, -NULL from rdb$database;

CONSTANT
======== ============
<null> <null>

It's hard to explain the end user that because DSQL treats negatives as
neg(absolute_value)
it's seen as an expression by the server and a default column alias is not produced. Generally, each negative expression like
select -char_length('') from rdb$database;
has the same problem of being an unnamed column. I have a fix for the trivial cases of NULL and constant, only:

SQL> set list;
SQL> select 1, -1, NULL, -NULL from rdb$database;

CONSTANT 1
CONSTANT -1
CONSTANT <null>
CONSTANT <null>

Commits: 874d8bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment