FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 217 forks source link

FB 3.0 crashes when trying to RE_create two tables and define master-detail link between them using text fields with different character sets [CORE5680] #5946

Open firebird-automations opened 6 years ago

firebird-automations commented 6 years ago

Submitted by: @pavel-zotov

Create following script:

shell del C:\MIX\firebird\QA\fbt-repo\tmp\c2284.fdb 2>nul; create database 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\c2284.fdb' user 'SYSDBA' password 'masterkey';

recreate table test_cs__detail(x int); recreate table test_cs__master(x int); commit;

set autoddl off; recreate table test_cs__master ( str_pk varchar(32) character set UTF8 not null, --------------------- [ 1 ] primary key (str_pk) using index test_s_master_pk );

recreate table test_cs__detail ( str_pk varchar(32) character set WIN1251 not null, ------------------ [ 2 ] foreign key (str_pk) references test_cs__master (str_pk) );

set echo on;

commit; rollback;

Console output:

ISQL Version: WI-V3.0.3.32854 Firebird 3.0 Server version: WI-V3.0.3.32854 Firebird 3.0 WI-V3.0.3.32854 Firebird 3.0/tcp (csprog)/P15:C WI-V3.0.3.32854 Firebird 3.0/tcp (csprog)/P15:C

commit; Statement failed, SQLSTATE = 08001 I/O error during "WriteFile" operation for file "C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB" -Error while trying to write to file -invalid descriptor // in national codepage After line 19 in file crash-on-pk-fk-with-diff-cset.sql rollback; Statement failed, SQLSTATE = XX000 internal Firebird consistency check (can't continue after bugcheck) After line 21 in file crash-on-pk-fk-with-diff-cset.sql Statement failed, SQLSTATE = XX000 internal Firebird consistency check (can't continue after bugcheck) After line 21 in file crash-on-pk-fk-with-diff-cset.sql

Note: 1. Both tables have to be created BEFORE 'recreate table' statement, i.e. they must already exist; 2. Charsets in PK and FK fields differ.

PS.

I thought that this bug is related to CORE5677 or CORE2284, but after discussion with Vlad it was decided to create new ticket. The same result on WI-V2.5.8.27083 and WI-T4.0.0.832 -- i.e. this bug is old enough.

firebird.log

CSPROG Thu Dec 14 20:49:31 2017 Database: C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB internal Firebird consistency check (partner index description not found (175), file: idx.cpp line: 209)

CSPROG Thu Dec 14 20:49:31 2017 I/O error during "WriteFile" operation for file "C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB" Error while trying to write to file Неверный дескриптор.

CSPROG Thu Dec 14 20:49:31 2017 Database: C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB I/O error during "WriteFile" operation for file "C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB" Error while trying to write to file Неверный дескриптор.

CSPROG Thu Dec 14 20:49:31 2017 Database: C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB I/O error during "WriteFile" operation for file "C:\MIX\FIREBIRD\QA\FBT-REPO\TMP\C2284.FDB" Error while trying to write to file Неверный дескриптор.

CSPROG Thu Dec 14 20:49:31 2017 INET/inet_error: read errno = 10054, server host = localhost, address = 127.0.0.1/3400

CSPROG Thu Dec 14 20:49:31 2017 REMOTE INTERFACE/gds__detach: Unsuccesful detach from database. Uncommitted work may have been lost. Error writing data to the connection. send_packet/send

CSPROG Thu Dec 14 20:49:31 2017 setsockopt: error setting IPV6_V6ONLY to 0

firebird-automations commented 6 years ago
Modified by: @pavel-zotov description: Create following script: ================== shell del C:\\MIX\\firebird\\QA\\fbt\-repo\\tmp\\c2284\.fdb 2\>nul; create database 'localhost:C:\\MIX\\firebird\\QA\\fbt\-repo\\tmp\\c2284\.fdb' user 'SYSDBA' password 'masterkey'; recreate table test\_cs\_\_detail\(x int\); recreate table test\_cs\_\_master\(x int\); commit; set autoddl off; recreate table test\_cs\_\_master \( str\_pk varchar\(32\) character set UTF8 not null, \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \[ 1 \] primary key \(str\_pk\) using index test\_s\_master\_pk \); recreate table test\_cs\_\_detail \( str\_pk varchar\(32\) character set WIN1251 not null, \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \[ 2 \] foreign key \(str\_pk\) references test\_cs\_\_master \(str\_pk\) \); set echo on; commit; rollback; Console output: ============= ISQL Version: WI\-V3\.0\.3\.32854 Firebird 3\.0 Server version: WI\-V3\.0\.3\.32854 Firebird 3\.0 WI\-V3\.0\.3\.32854 Firebird 3\.0/tcp \(csprog\)/P15:C WI\-V3\.0\.3\.32854 Firebird 3\.0/tcp \(csprog\)/P15:C commit; Statement failed, SQLSTATE = 08001 I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" \-Error while trying to write to file \-invalid descriptor // in national codepage After line 19 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql rollback; Statement failed, SQLSTATE = XX000 internal Firebird consistency check \(can't continue after bugcheck\) After line 21 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql Statement failed, SQLSTATE = XX000 internal Firebird consistency check \(can't continue after bugcheck\) After line 21 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql === Note: 1\. Both tables have to be created BEFORE 'recreate table' statement, i\.e\. they must already exist; 2\. Charsets in PK and FK fields differ\. PS\. I thought that this bug is related to [CORE5677](https://github.com/FirebirdSQL/firebird/issues?q=CORE5677+in%3Atitle) or [CORE2284](https://github.com/FirebirdSQL/firebird/issues?q=CORE2284+in%3Atitle), but after discussion with Vlal it was decided to create new ticket\. The same result on WI\-V2\.5\.8\.27083 and WI\-T4\.0\.0\.832 \-\- i\.e\. this bug is old enough\. firebird\.log ========= CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB internal Firebird consistency check \(partner index description not found \(175\), file: idx\.cpp line: 209\) CSPROG Thu Dec 14 20:49:31 2017 I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 INET/inet\_error: read errno = 10054, server host = localhost, address = 127\.0\.0\.1/3400 CSPROG Thu Dec 14 20:49:31 2017 REMOTE INTERFACE/gds\_\_detach: Unsuccesful detach from database\. Uncommitted work may have been lost\. Error writing data to the connection\. send\_packet/send CSPROG Thu Dec 14 20:49:31 2017 setsockopt: error setting IPV6\_V6ONLY to 0 =\> Create following script: ================== shell del C:\\MIX\\firebird\\QA\\fbt\-repo\\tmp\\c2284\.fdb 2\>nul; create database 'localhost:C:\\MIX\\firebird\\QA\\fbt\-repo\\tmp\\c2284\.fdb' user 'SYSDBA' password 'masterkey'; recreate table test\_cs\_\_detail\(x int\); recreate table test\_cs\_\_master\(x int\); commit; set autoddl off; recreate table test\_cs\_\_master \( str\_pk varchar\(32\) character set UTF8 not null, \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \[ 1 \] primary key \(str\_pk\) using index test\_s\_master\_pk \); recreate table test\_cs\_\_detail \( str\_pk varchar\(32\) character set WIN1251 not null, \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \[ 2 \] foreign key \(str\_pk\) references test\_cs\_\_master \(str\_pk\) \); set echo on; commit; rollback; Console output: ============= ISQL Version: WI\-V3\.0\.3\.32854 Firebird 3\.0 Server version: WI\-V3\.0\.3\.32854 Firebird 3\.0 WI\-V3\.0\.3\.32854 Firebird 3\.0/tcp \(csprog\)/P15:C WI\-V3\.0\.3\.32854 Firebird 3\.0/tcp \(csprog\)/P15:C commit; Statement failed, SQLSTATE = 08001 I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" \-Error while trying to write to file \-invalid descriptor // in national codepage After line 19 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql rollback; Statement failed, SQLSTATE = XX000 internal Firebird consistency check \(can't continue after bugcheck\) After line 21 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql Statement failed, SQLSTATE = XX000 internal Firebird consistency check \(can't continue after bugcheck\) After line 21 in file crash\-on\-pk\-fk\-with\-diff\-cset\.sql === Note: 1\. Both tables have to be created BEFORE 'recreate table' statement, i\.e\. they must already exist; 2\. Charsets in PK and FK fields differ\. PS\. I thought that this bug is related to [CORE5677](https://github.com/FirebirdSQL/firebird/issues?q=CORE5677+in%3Atitle) or [CORE2284](https://github.com/FirebirdSQL/firebird/issues?q=CORE2284+in%3Atitle), but after discussion with Vlad it was decided to create new ticket\. The same result on WI\-V2\.5\.8\.27083 and WI\-T4\.0\.0\.832 \-\- i\.e\. this bug is old enough\. firebird\.log ========= CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB internal Firebird consistency check \(partner index description not found \(175\), file: idx\.cpp line: 209\) CSPROG Thu Dec 14 20:49:31 2017 I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 Database: C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB I/O error during "WriteFile" operation for file "C:\\MIX\\FIREBIRD\\QA\\FBT\-REPO\\TMP\\C2284\.FDB" Error while trying to write to file Неверный дескриптор\. CSPROG Thu Dec 14 20:49:31 2017 INET/inet\_error: read errno = 10054, server host = localhost, address = 127\.0\.0\.1/3400 CSPROG Thu Dec 14 20:49:31 2017 REMOTE INTERFACE/gds\_\_detach: Unsuccesful detach from database\. Uncommitted work may have been lost\. Error writing data to the connection\. send\_packet/send CSPROG Thu Dec 14 20:49:31 2017 setsockopt: error setting IPV6\_V6ONLY to 0