Hello guys,

I am hitting a pretty strange problem right now. Since SQLite does not support regular expressions I added a custom function with the following declaration:

[SqliteFunction (Name = "REGEXP", Arguments = 2, FuncType = FunctionType.Scalar)]
    public class RegexpFunction : SqliteFunctionEx
    {
        public override object Invoke (object [] args)
        {
return Regex.IsMatch (Convert.ToString (args [1]), Convert.ToString (args [0]));
        }
    }

All looks good and works fine on mono and on most Andoid devices but today I got a tablet (Asus ME371MG) that is causing a really strange problem. When I try to open a connection to the SQLite db I get this exception:

Mono.Data.Sqlite.SqliteException: Library used incorrectly
 not an error
at Mono.Data.Sqlite.SQLite3.CreateFunction (System.String strFunction, Int32 nArgs, Boolean needCollSeq, Mono.Data.Sqlite.SQLiteCallback func, Mono.Data.Sqlite.SQLiteCallback funcstep, Mono.Data.Sqlite.SQLiteFinalCallback funcfinal) [0x00000] in <filename unknown>:0 at Mono.Data.Sqlite.SqliteFunction.BindFunctions (Mono.Data.Sqlite.SQLiteBase sqlbase) [0x00000] in <filename unknown>:0 at Mono.Data.Sqlite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in <filename unknown>:0 at Mono.Data.Sqlite.SqliteConnection.Open () [0x00000] in <filename unknown>:0

If I comment out the function declaration everything works fine until I need it in some query.

The problem gets even stranger as if I run the code in debug mode then everything works fine and I don't get the exception. But the problem happens only when I run the release code...!!!

I tried disabling the code optimization but the problem still appears.

Any ideas?

Thanks
 Vladimir
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to