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

rdb$field_sub_type for numeric computed column [DNET423] #421

Closed
firebird-automations opened this issue Mar 26, 2012 · 2 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: @cincuranet

Directly from my thread "Wrong rdb$field_sub_type for numeric computed column" in firebird-devel:

have a table:
recreate table test (
base numeric(15,4),
test1 computed by (base+base),
test2 computed by (cast(base+base as numeric(15,4))),
foo bigint,
bar numeric(15,4)
);

If I run the query:
select rf.RDB$FIELD_NAME, f.RDB$FIELD_SCALE, f.RDB$FIELD_TYPE,
f.RDB$FIELD_SUB_TYPE
from RDB$RELATION_FIELDS rf inner join RDB$FIELDS f on
(rf.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME)
where rf.RDB$RELATION_NAME = 'TEST'
it reports:
BASE -4 16 1
TEST1 -4 16 0
TEST2 -4 16 1
FOO 0 16 0
BAR -4 16 1

Why is rdb$field_sub_type for test1 column "0"? Then it looks like
bigint. Checking the rdb$field_scale could be a solution, but is it
then numeric or decimal?

I'm happy with conclusion that if field_scale is < 0 and no particular
sub_type, imply i.e. numeric. Probably somebody from core devs should
tell us.

That is what is done in Jaybird right now.

See getDataType(...) and getDataTypeName(...) in
http://firebird.cvs.sourceforge.net/viewvc/firebird/client-java/src/main/org/firebirdsql/jdbc/AbstractDatabaseMetaData.java?view=markup

Commits: 35c3ae1

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Component: Entity Framework support [ 10110 ]

Component: http://ADO.NET Provider [ 10041 ] =>

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.7-next [ 10462 ]

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

No branches or pull requests

2 participants