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

FBDatabaseMetaData.getTables does not list tables where rdb$relation_type is null [JDBC494] #532

Closed
firebird-automations opened this issue May 16, 2017 · 13 comments

Comments

@firebird-automations
Copy link

Submitted by: A Drouard (adrouard)

Is related to CORE5543

Sometimes databases contain tables where rdb$relation_type is null.
Jaybird 2.2.9 lists such tables, Jaybird 3.0.0 does not.
May be it's a Firebird issue, but update of rdb$relations is prohibited by Firebird 3.
gfix and gbak didn't help.

Request to list tables with problem :
select rdb$relation_name from rdb$relations where rdb$relation_type is null and rdb$system_flag = 0

Commits: c9b4811 0135ded 70d97db

@firebird-automations
Copy link
Author

Commented by: A Drouard (adrouard)

Typo correction in description

@firebird-automations
Copy link
Author

Modified by: A Drouard (adrouard)

description: Sometimes databases contain tables where rdb$relation_type is null.
Jaybird 2.29 list such tables, Jaybird 3.0.0 does not.
May be it's a Firebird issue, but update of rdb$relations is prohibited by Firebird 3.
gfix and gbak didn't help.

Request to list tables with problem :
select rdb$relation_name from rdb$relations where rdb$relation_type is null and rdb$system_flag = 0

=>

Sometimes databases contain tables where rdb$relation_type is null.
Jaybird 2.2.9 lists such tables, Jaybird 3.0.0 does not.
May be it's a Firebird issue, but update of rdb$relations is prohibited by Firebird 3.
gfix and gbak didn't help.

Request to list tables with problem :
select rdb$relation_name from rdb$relations where rdb$relation_type is null and rdb$system_flag = 0

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

The logic was changed in Jaybird 3 to better identify the various table types; I will see if I can handle rdb$relation_type is null as type 0. To be honest, I do think this is a bug in Firebird: rdb$relation_type is null should never occur.

@firebird-automations
Copy link
Author

Commented by: A Drouard (adrouard)

I also think it is a firebird bug.
Do you know a solution to fix such bad tables types in Firebird 3 ?

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is related to CORE5543 [ CORE5543 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

As far as I know not at this time; I have reported it as a bug, see CORE5543. You could try an extra backup/restore to see if it corrects itself.

I will add a workaround for Jaybird 3.0.1

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Handling rdb$relation_type is null as type 0 will not be sufficient.

@firebird-automations
Copy link
Author

Commented by: A Drouard (adrouard)

Extra backup/restore in Firebird 3.0 doesn't fix the problem.
My workaround is to update null as 0 on Firebird 2.5 before backup. And then restore on Firebird 3.0.
In my case, the databases contain only user tables, so I don't risk to misidentify views.

SQL request used :
update rdb$relations set rdb$relation_type=0 where rdb$relation_type is null and (rdb$system_flag is null or rdb$system_flag=0)

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 3.0.1 [ 10831 ]

Fix Version: Jaybird 3.1 [ 10441 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Fixed in master: 0135ded
Fixed in Branch_3_0: 70d97db

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Released with Jaybird 3.0.1 : https://github.com/FirebirdSQL/jaybird/releases/tag/v3.0.1

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

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