Issue Details (XML | Word | Printable)

Key: JDBC-494
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: A Drouard
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

FBDatabaseMetaData.getTables does not list tables where rdb$relation_type is null

Created: 16/May/17 01:46 PM   Updated: 05/Jun/17 01:14 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 3.0.0
Fix Version/s: Jaybird 3.0.1, Jaybird 3.1

Environment: Windows 8, Java 8, Firebird 3
Issue Links:
Relate
 


 Description  « Hide
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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
A Drouard added a comment - 16/May/17 04:53 PM
Typo correction in description

Mark Rotteveel added a comment - 16/May/17 07:09 PM
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.

A Drouard added a comment - 17/May/17 07:52 AM
I also think it is a firebird bug.
Do you know a solution to fix such bad tables types in Firebird 3 ?

Mark Rotteveel added a comment - 17/May/17 03:26 PM
As far as I know not at this time; I have reported it as a bug, see CORE-5543. You could try an extra backup/restore to see if it corrects itself.

I will add a workaround for Jaybird 3.0.1

Mark Rotteveel added a comment - 17/May/17 03:51 PM
Handling rdb$relation_type is null as type 0 will not be sufficient.

A Drouard added a comment - 18/May/17 02:26 PM
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)


Mark Rotteveel added a comment - 05/Jun/17 01:14 PM