Issue Details (XML | Word | Printable)

Key: CORE-1442
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Daniel Bauten
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

fbclient.dll / gds32.dll : readonly database files on isc_attach_database (error code 0 instead of 335544727)

Created: 05/Sep/07 07:03 AM   Updated: 18/Nov/08 01:18 PM
Component/s: Engine
Affects Version/s: 2.0.1, 2.0.2, 2.0.3
Fix Version/s: 2.0.4

Time Tracking:
Not Specified

Environment:
Windows Vista and Windows XP
Delphi 7 and Delphi 2007
IBX and FIBPlus


 Description  « Hide
Since 2.0.1 in case that the database file is READONLY, the error code (335544727) isn't returned anymore (on 'isc_attach_database').

Node: As an result, IBX and even FIBPlus try to open the database. This leads in a "crash" right after connecting (e.g. on starting the first transaction)...

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 05/Sep/07 03:20 PM
I don't understand why engine must return error code (isc_net_write_err) if database file is read only ?
In this case engine worked with database in readonly mode.

Daniel Bauten added a comment - 06/Sep/07 01:54 AM
Firebird 2.0.0 (and Firebird 1.x, too) do return isc_net_write_err which is used by database components like IBX and FIBPlus to raise an exception. This exception is then used to tell the user "I/O error for file ?...". Error while trying to write to file".

I don't know if a readonly database file works (even if the user wants a readonly access) - since no transaction information can be written into the database file.

Nevertheless, as a developer I need a way to recognize that a database file is readonly. Until Firebird 2.0.1 I got this information via the mentioned error code returned by the client library. Since Firebird 2.0.1, this information isn't provided anymore by the client library. In my opinion, the handling up to Firebird 2.0.0 was "more useful".

If it's rather a "new feature" than a bug, why was it changed in 2.0.1? What can I do to recognize a readonly database file (without opening)?

Dmitry Yemanov added a comment - 06/Sep/07 02:16 AM
It appears that you're talking about read-only file (at the filesystem level) while Vlad is talking about read-only database (at the Firebird on-disk structure level). If so, it seems I can confirm the issue.

With v2.0.0 and IBExpert, I see an error dialog box:

"no permission for read-write access to database <path>".

With v2.0.1, the attachment succeeds but immediately after that I get:

"Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements. I/O error for file <path>. Error while trying to write to file. Access is denied."

This isn't a crash, but the behavior is definitely different.

Daniel Bauten added a comment - 06/Sep/07 02:32 AM
Yes, Dmitry. I am talking about the file system attribute "read-only". I thougt, that "database file" is clearly the file in the "file system". Sorry if my notions mislead anyone.

As the behaviour is different - is it a "bug" or a "feature"?

Dmitry Yemanov added a comment - 06/Sep/07 02:38 AM
This is a bug and it's already fixed.

Daniel Bauten added a comment - 06/Sep/07 03:22 AM
That's really fast. Thanks, Dmitry.