Hi All,

Problem now understood. (BTW same problem occurs in 3.19.3)

I made a descendant of TSQLite3Connectionto allow my application to define 
field value types by providing an OnFieldDefInit handler.  In preparation for 
calling that handler I call sqlite3_column_database_name, 
sqlite3_column_table_name and sqlite3_column_origin_name and provide their 
results to sqlite3_table_column_metadata. For the SQL statement I was executing 
 ("select Max(Entry_No), Max(Field_Str + 0) from Plants") the first 3 functions 
all returned nil for both columns and the subsequent call to 
sqlite3_table_column_metadata did not fail gracefully.

For the moment I'm using a workaround to prevent the failing call but it's not 
the best solution. In version 3.11.1 sqlite3_table_column_metadata failed with 
a non-zero exit code which was  easier to deal with.

Hope you consider this worthy of correcting.

Here's the code fragment:

-------------------------------

      cdn := sqlite3_column_database_name(st, i);
      ColumnDatabaseName := cdn;
      ctn := sqlite3_column_table_name(st, i);
      ColumnTableName := ctn;
      con := sqlite3_column_origin_name(st, i);
      ColumnOriginName := con;

      // After version 3.11.1 sqlite3_table_column_metadata does not fail 
gracefully
      // if no tablename is supplied in the call
      if not ((ctn = nil) or (con = nil)) then
      begin
        ok := 0 = sqlite3_table_column_metadata(hndl, cdn, ctn, con, nil, nil, 
@NotNull, @PrimaryKey, @AutoInc);
        if ok then
        begin
          Col.ColumnNotNull := NotNull <> 0;
          Col.ColumnIsPrimaryKey := PrimaryKey <> 0;
          Col.ColumnIsKey := AutoInc <> 0;
        end;
      end;
    end;

-----------------------------------

Cheers,

Martin

On 08/06/2017 18:20, Richard Hipp wrote:

Can you get us a backtrace?

On 6/8/17, Martin Lowry <m.lo...@hull.ac.uk><mailto:m.lo...@hull.ac.uk> wrote:


Hi All,

I've been using SQLite3 for several years but recently installed version
3.19.2 and now my application fails to open the database.  I was using
3.11.1 and had no problems. Now no matter how I try to open the DB my
app always fails with a SIGSEGV in sqlite3_result_subtype (#14324).  The
app is written FPC 3.0.0 with Lazarus 1.6 using the TSQLite3Connection
component and queried using a TSQLQuery.

Any help resolving this issue would be much appreciated.

Cheers

Martin







**************************************************
To view the terms under which this email is 
distributed, please go to 
http://www2.hull.ac.uk/legal/disclaimer.aspx
**************************************************
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to