in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

AccessViolation in DELETE/UPDATE statements that use IN operator

Last post 04-19-2008 1:07 AM by KoD666. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-17-2008 6:39 AM

    • KoD666
    • Not Ranked
    • Joined on 04-17-2008
    • Posts 2

    AccessViolation in DELETE/UPDATE statements that use IN operator

    1. There is a bug in System.Data.SQLite analogous to bug presented in version 1.0.41 Beta (described at System.Data.SQLite Forum).
      This bug causes protected memory read/write exception when operator IN is used in SQL expression and right operand is SELECT statement that is made on non-existent table. This bug was confirmed in DELETE … WHERE … IN and UPDATE … WHERE … IN statements and it does not occur in SELECT … WHERE … IN statement.
      Steps to reproduce bug:
      • Create table1 with column field1 in database.
      • Open connection m_conn to database where table1 was created.
      • Following code will raise exception:
        DbCommand command   = m_conn.CreateCommand();
        command.CommandText = "DELETE FROM table1 WHERE field1 IN (SELECT field2 FROM table2)";
        command.ExecuteNonQuery();
  • 04-18-2008 2:47 PM In reply to

    Re: AccessViolation in DELETE/UPDATE statements that use IN operator

    What version of the provider are you using?  This is a bug in the underlying SQLite engine, so if confirmed, will need to be reported to SQLite.org.

     

  • 04-19-2008 1:07 AM In reply to

    • KoD666
    • Not Ranked
    • Joined on 04-17-2008
    • Posts 2

    Re: AccessViolation in DELETE/UPDATE statements that use IN operator

    I'm using version 1.0.48 of provider.

     What is more, all commans executed after buggy UPDATE/DELETE will fail with SQL exception:

    Library used incorrectly

    library routine called out of sequence 

     It seems that database connection is invalid after this bug. The same exception is raised when invalid connection is disposed.

     I've tested SQLite 3.5.7 (amalgamation) and there is no bug.

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems