Issues with mono/osx

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
mamcx
Posts: 7
Joined: Mon 12 Mar 2012 19:04

Issues with mono/osx

Post by mamcx » Mon 12 Mar 2012 19:16

I have the 3.70.311.0 free version that work well on Win7/64. However my app will be deployed on OSX/linux.

On OSX Lion + Last mono I get this error:

SQLite error

Code: Select all

Error: Devart.Data.SQLite.SQLiteException: SQLite error
  at Devart.Data.SQLite.a3.a (System.Byte[] A_0, UInt32 A_1, System.Byte[]& A_2) [0x00000] in :0 
  at Devart.Data.SQLite.bs.a (System.Byte[] A_0) [0x00000] in :0 
  at Devart.Data.SQLite.t.b () [0x00000] in :0 
  at Devart.Data.SQLite.SQLiteDataReader.c () [0x00000] in :0 
  at (wrapper remoting-invoke-with-check) Devart.Data.SQLite.SQLiteDataReader:c ()
  at Devart.Data.SQLite.SQLiteCommand.InternalExecute (CommandBehavior behavior, IDisposable statement, Int32 startRecord, Int32 maxRecords) [0x00000] in :0 

Or (executing the same code again):

SQLite error\r\nunrecognized token: "\x01"

Code: Select all

Error: Devart.Data.SQLite.SQLiteException: SQLite error
unrecognized token: ""
  at Devart.Data.SQLite.a3.a (System.Byte[] A_0, UInt32 A_1, System.Byte[]& A_2) [0x00000] in :0 
  at Devart.Data.SQLite.bs.a (System.Byte[] A_0) [0x00000] in :0 
  at Devart.Data.SQLite.t.b () [0x00000] in :0 
  at Devart.Data.SQLite.SQLiteDataReader.c () [0x00000] in :0 
  at (wrapper remoting-invoke-with-check) Devart.Data.SQLite.SQLiteDataReader:c ()
  at Devart.Data.SQLite.SQLiteCommand.InternalExecute (CommandBehavior behavior, IDisposable statement, Int32 startRecord, Int32 maxRecords) [0x00000] in :0 
I'm loading a sqlite script that build the database:

Code: Select all

       public Binary newClientDatabase()
        {
            string fileName = Path.GetTempFileName();
            string conStr = string.Format("DateTime Format=ISO8601;Pooling=false;Data Source={0}", fileName);
            SQLiteConnection con = new SQLiteConnection(conStr);
            
            con.Open();
            try
            {
                SQLiteCommand exe = con.CreateCommand();
                exe.CommandText = this.loadClientScript(); <-- UTF8: File.ReadAllText(script, System.Text.Encoding.UTF8);
                exe.CommandType = CommandType.Text;

                exe.ExecuteNonQuery(); <-- HERE ERROR

            }
            finally
            {
                con.Close();
            }

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Tue 20 Mar 2012 08:24

Could you please specify the following:
1. Does the issue persist when you perform a simple SQL command?
2. Does the issue persist if you specify command text directly in code, not when you load it from a file?

mamcx
Posts: 7
Joined: Mon 12 Mar 2012 19:04

Post by mamcx » Tue 20 Mar 2012 15:37

Pinturiccio wrote:Could you please specify the following:
1. Does the issue persist when you perform a simple SQL command?
2. Does the issue persist if you specify command text directly in code, not when you load it from a file?
Only when the script is loaded this happend. The script is too big for put it manually. Can I send it to you by email?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Thu 22 Mar 2012 07:51

Yes, please Send us the script.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Fri 23 Mar 2012 14:25

Thank you for the test project. We have reproduced the issue. Please change SQLiteCommand to SQLiteScript for executing the list of queries. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... cript.html

When we change SQLiteCommand to SQLiteScript a new issue occurs. All sql statements which use the block CASE ... WHEN, raise an exception. For example, the following statement:

Code: Select all

CREATE TRIGGER Order_bi_fk_Customer
BEFORE INSERT
ON "Order"BEGIN  SELECT CASE
WHEN (SELECT 1 FROM Customer WHERE Customer.id = NEW.IdCustomer) IS NULL
THEN RAISE(ABORT, 'INSERT statement conflicted with COLUMN REFERENCE constraint [Order -> Customer].')
END;
END;
We will investigate this issue and notify you about the results as soon as possible.
As a workaround, you can delete all sql statements which contain the block WHEN ... THEN from your file and use this file as the source for SQLiteScript.ScriptText parameter. All Deleted statements can be put in separate files and be used as sources for SQLiteCommand.CommandText.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Tue 27 Mar 2012 13:28

We have fixed the bug with parsing SQLiteScript.ScriptText under Mono. We will post here when the corresponding build of dotConnect for SQLite is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Thu 29 Mar 2012 14:20

The new build of dotConnect for SQLite 3.80.332 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/sqlite/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23778

Post Reply