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

Assertion (m_format->fmt_length == m_data.getCount()) failure [CORE4902] #5194

Closed
firebird-issue-importer opened this issue Aug 6, 2015 · 10 comments

Comments

@firebird-issue-importer
Copy link

firebird-issue-importer commented Aug 6, 2015

Submitted by: Treeve Jelbert (treeve)

Attachments:
core-4902.tar.gz

Assert occurs while running migration scripts from old Paradox db.

ISQL Version: LI-V3.0.0.31981-dev Firebird 3.0 Release Candidate 1
Use CONNECT or CREATE DATABASE to specify a database
SQL> input build;
Unable to open build
SQL> input build.sql;
DB = /var/db/firebird/accounts.fdb
Host = Horos
Assertion (m_format->fmt_length == m_data.getCount()) failure:
/usr/src/firebird3-git/src/src/jrd/../jrd/../jrd/Record.h 121
/home/treeve/bin/fbsql: line 9: 5320 Aborted $FB -ch utf8 -fetch stdin
-user ${ME} -z

The problem statement is:
-select count(*) from expitem where doc_id =0;

            COUNT

=====================
5391
- link expitem to expense
update expitem a
set a.DOC_ID =
( select http://b.ID from expense b where a.expyr = b.yr and a.expnr = http://b.nr );
commit;
select count(*) from expitem where doc_id =0;

CRASH!!
Any access to expitem crashes after this.

SQL> show database;
Database: accounts
Owner: TREEVE
DB = /var/db/firebird/accounts.fdb
Host = Horos
PAGE_SIZE 4096
Number of DB pages allocated = 1117
Sweep interval = 20000
Forced Writes are ON
Transaction - oldest = 209
Transaction - oldest active = 224
Transaction - oldest snapshot = 224
Transaction - Next = 228
ODS = 12.0
Default Character set: UTF8

The tables are:

SQL> show table expense;
ID SMALLINT Not Null Identity (by default)
YR (D_ID) SMALLINT Not Null default 0
NR (D_ID) SMALLINT Not Null default 0
TDATE DATE Nullable
SUP (D_ID) SMALLINT Not Null default 0
COUNTRY CHAR(2) Nullable
NET (D_MONEY) DECIMAL(10, 2) Not Null default 0
VAT (D_MONEY) DECIMAL(10, 2) Not Null default 0
PRIVATE SMALLINT Nullable
CURR (D_CURR) CHAR(3) Not Null default 'EUR'
ORGID SMALLINT Nullable
QTR SMALLINT Nullable
CONSTRAINT PK_EXPENSE:
Primary key (ID)
CONSTRAINT U_EXPENSE:
Unique key (YR, NR) uses explicit ascending index IX_EXPENSE

SQL> show table expitem;
ID SMALLINT Not Null Identity (by default)
EXPYR (D_ID) SMALLINT Not Null default 0
EXPNR (D_ID) SMALLINT Not Null default 0
LINE (D_ID) SMALLINT Not Null default 0
CATEGORY INTEGER Not Null default 41110
AMOUNT (D_MONEY) DECIMAL(10, 2) Not Null default 0
DESC CHAR(40) Nullable
CURR (D_CURR) CHAR(3) Not Null default 'EUR'
DOC_ID (D_ID) SMALLINT Not Null default 0
CONSTRAINT FK_EXPI_CATEGORY:
Foreign key (CATEGORY) References EXPLAIN (ID)
CONSTRAINT PK_EXPITEM:
Primary key (ID)
CONSTRAINT U_EXPITEM:
Unique key (EXPYR, EXPNR, LINE) uses explicit ascending index IX_EXPITEM

SQL> select curr, count(*) from expense group by curr;

CURR COUNT
====== =====================
BEF 1187
EUR 1210
GBP 5
USD 4

Commits: 63ec76a FirebirdSQL/fbt-repository@a3387df

====== Test Details ======

Provided .tar.gz contains set of scripts which seems to be incomplete:
1) failed to found scripts "invoice.dml", "item.dml" and "mvt.dml" which are called from "dml.sql"
2) when invocations of these files are commented, new exceptions raises:

Statement failed, SQLSTATE = 27000
unsuccessful metadata update
-ALTER TABLE MVT failed
-action cancelled by trigger (1) to preserve data integrity
-Cannot delete column being used in an Integrity Constraint.
After line 50 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW SALARY failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 41
After line 56 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW VAT failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 38
After line 59 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW MISC failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 39
After line 60 in file alter1.sql
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE INDEX IX_MVT_REF failed
-Unknown columns in index IX_MVT_REF
After line 11 in file alter2.sql
. . .

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 6, 2015

Commented by: @hvlad

Could you provide accounts.fdb and build.sql ?

Why do you think it is UDF related ?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 6, 2015

Commented by: Treeve Jelbert (treeve)

build scripts attached
define an alias for 'accounts' then 'input build.sql;'

It is not UDF problem, should be isql or engine

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 6, 2015

Modified by: Treeve Jelbert (treeve)

Attachment: core-4902.tar.gz [ 12792 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 9, 2015

Commented by: @hvlad

I think that assert is not fully correct and could be disabled.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 9, 2015

Modified by: @hvlad

Component: Engine [ 10000 ]

Component: UDF [ 10002 ] =>

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 2, 2015

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 2, 2015

Modified by: @dyemanov

Version: 3.0 Beta 2 [ 10586 ]

Version: 3.0 RC 1 [ 10584 ] =>

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 5, 2015

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC 1 [ 10584 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 3, 2016

Modified by: @pavel-zotov

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

QA Status: No test => Not enough information

Test Details: Provided .tar.gz contains set of scripts which seems to be incomplete:
1) failed to found scripts "invoice.dml", "item.dml" and "mvt.dml" which are called from "dml.sql"
2) when invocations of these files are commented, new exceptions raises:

Statement failed, SQLSTATE = 27000
unsuccessful metadata update
-ALTER TABLE MVT failed
-action cancelled by trigger (1) to preserve data integrity
-Cannot delete column being used in an Integrity Constraint.
After line 50 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW SALARY failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 41
After line 56 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW VAT failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 38
After line 59 in file alter1.sql
Statement failed, SQLSTATE = 42S22
unsuccessful metadata update
-RECREATE VIEW MISC failed
-Dynamic SQL Error
-SQL error code = -206
-Column unknown
-CURR
-At line 1, column 39
After line 60 in file alter1.sql
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE INDEX IX_MVT_REF failed
-Unknown columns in index IX_MVT_REF
After line 11 in file alter2.sql
. . .

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