[Mono-list] Bug in Mono.Data.SqliteClient?

Thomas Zoechling thomas.zoechling at gmx.at
Thu Jan 4 13:45:31 EST 2007


I tried your query and it seems to work for me.

 From Mono.Data.SqliteClient/SqliteCommand.cs:

        public SqliteDataReader ExecuteReader ()
        {
            return ExecuteReader (CommandBehavior.Default);
        }
       
        public SqliteDataReader ExecuteReader (CommandBehavior behavior)
        {
            int r;
            return ExecuteReader (behavior, true, out r);
        }
       
        public SqliteDataReader ExecuteReader (CommandBehavior behavior, 
bool want_results, out int rows_affected)
        {
            Prepare ();
           
            // The SQL string may contain multiple sql commands, so the 
main
            // thing to do is have Sqlite iterate through the commands.
            // If want_results, only the last command is returned as a
            // DataReader.  Otherwise, no command is returned as a
            // DataReader.


As you can see, the default behavior supports multiple commands.
I attached a simple test case, that contains your query.
On Mac OS 10.4.8,  mono 1.2.2.1 intel 32bit and the latest sqlite 
version my test case works as expected.
Both commands get executed, and ExecuteReader() returns a DataReader 
containing the results.

--Thomas

Chris Seaton wrote:
> Does anyone have experience using Mono.Data.SqliteClient?
>
> It works fine for me apart from when I have multiple Sql statements  
> in a single command. If I run something like
>
> command = database.CreateCommand();
> command.CommandText = "update films set year = year + 10; select  
> year, title from films where year >= 1980;";
> reader = command.ExecuteReader();
>
> I expect both statements to be executed and to read results from the  
> second statement. This is what the source code seems to imply is what  
> should happen. When I try it, only the first statement is executed.
>
> Any ideas?
>
> Thanks
>
> Chris Seaton
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqliteMultipleCommands.cs
Type: text/x-csharp
Size: 2376 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20070104/4ff239f9/attachment.bin 


More information about the Mono-list mailing list