Select on empty database generate: internal Firebird consistency check (cannot 
find tip page (165), file: tra.cpp line: 2369
----------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4734
                 URL: http://tracker.firebirdsql.org/browse/CORE-4734
             Project: Firebird Core
          Issue Type: Bug
    Affects Versions: 2.5.4
         Environment: Visual Studio 2013, Windows 8.1, Firebird 2.5.4 and 
Firebird ADO.NET Data provider. 4.5.0.0
            Reporter: Carl-Johan Wik
            Priority: Blocker


Hi

Below you will find the code for the connection information object that the 
test program.

This done in Visual Studio 2013, Windows 8.1, Firebird 2.5.4 and Firebird 
ADO.NET Data provider. 4.5.0.0

The thing I find is that if the database is empty and I do select, then it goes 
into a failed state that I cannot resolve and have to recreate the database.

Procedure to reproduce:
Run the program, the program will pass con.Open and throw exception on the 
cmd.ExecuteScalar and the exception says table unknown. I.e. an expected 
exception.
Re-run the program, now the con.Open will throw an exception with the 
information:  internal Firebird consistency check (cannot find tip page (165), 
file: tra.cpp line: 2369
If I try to re-run the program again the same exception happen on the con.Open 
statement. I cannot get pass this and have to recreate the database. I.e. the 
database in failed state.

New test run.
I run the program but this time execute the create table statement. No 
exception.
Re-run the program but with the select statement on a table that do not exist. 
Program will pass con.Open and throw exception on the cmd.ExecuteScalar and the 
exception says table unknown. I.e. an expected exception.
I can now re-run the program several times and the con.Open will always work 
and I get the expected exception of table unknown.

It seems that if I do a Select on at table on an empty database then this error 
happen, otherwise not.

Was not sure to report this as blocker, but it is a blocker for me as I cannot 
use Firebird with such a error in a production environment.

*************************************************************
    class ConnectionInformation
    {
        public ConnectionInformation()
        {
            this.User = "SYSDBA";
            this.Password = "masterkey";
            this.ServerType = FbServerType.Embedded;
            this.DatabaseFileName = "TaragonTrader.fdb";
            this.CharacterSet = "UTF8";
            this.ClientLibraryPath = @"fbembed.dll";
            this.Dialect = 3;

****************************************************************************************
    class Program
    {
        static void Main(string[] args)
        {

            var connectionInformation = new ConnectionInformation();

            if (File.Exists(connectionInformation.DatabaseFileName) == false)
                
FbConnection.CreateDatabase(connectionInformation.ConnectionString);

            var con = new FbConnection(connectionInformation.ConnectionString);
            try
            {
                con.Open();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            
            //string sqlStatement = @"CREATE TABLE QuoteDataProvider (" +
            //                    "Id INT Not Null Primary Key, " +
            //                    "MyCol1 VarChar(15), " +
            //                    "MyCol2 VarChar(80) " +
            //                    ")";


            string sqlStatement = "Select Count(*) From QuoteDataProvider2";

            FbCommand cmd = new FbCommand();
            cmd.CommandText = sqlStatement;
            cmd.Connection = con;

            try
            {
                var e = cmd.ExecuteScalar();
            }
            catch (Exception ex)
            {
                //this.Close();
                throw ex;
            } 

        }
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to