Issue Details (XML | Word | Printable)

Key: CORE-1914
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 0

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

Problem creating table leave the database in inconsistent state

Created: 26/May/08 07:54 AM   Updated: 19/Jan/16 04:57 AM
Component/s: None
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.5 Initial, 2.1.0, 2.0.4
Fix Version/s: 2.5 Beta 1

QA Status: No test

 Description  « Hide
This bug was reported privatelly by Claudio some time ago... It's more problematic in 2.5, but not everything is good in previous version.

Steps to reproduce:
1) rename fbintl.conf to fbintl.ttt
2) start the server
3) isql
create database 't.fdb';
create table t (c varchar(10) character set win1252);
Statement failed, SQLCODE = -607
unsuccessful metadata update
-CHARACTER SET WIN1252 is not installed
4) stop the server
5) rename fbintl.ttt to fbintl.conf
6) start the server
7) isql t.fdb
create table t (c varchar(10) character set win1252);
insert into t values ('a');
Dynamic SQL Error
-SQL error code = -804
-Count of read-write columns does not equal count of values

drop table t;
create table t (c varchar(10) character set win1252);
insert into t values ('a');
-- ok

What's happen:

When the table fails to be created, records in RDB$PAGES was already inserted in system transaction and is not deleted in the cleanup. In V < 2.5, the problem is not visible as RDB$DATABASE.RDB$RELATION_ID is also incremented in system transaction and is not reused.

In 2.5, when looking for a relation id that has already RDB$PAGES entries, it causes no record inserted in RDB$FORMATS.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 20/Jun/08 08:22 AM
Added call, deleting table's pages in case of error at last stage of CREATE TABLE.