[Mono-bugs] [Bug 77375][Wis] New - Mono 1.1.8 up to 1.1.13 get worse performance on MySqlDataAdapter.Fill method

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jan 26 20:44:11 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jlefevrep at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77375

--- shadow/77375	2006-01-26 20:44:11.000000000 -0500
+++ shadow/77375.tmp.26017	2006-01-26 20:44:11.000000000 -0500
@@ -0,0 +1,195 @@
+Bug#: 77375
+Product: Mono: Runtime
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: Fedora Core 3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: jlefevrep at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono 1.1.8 up to 1.1.13 get worse performance on MySqlDataAdapter.Fill method
+
+Description of Problem:
+The method MySqlDataAdapter.Fill works badly slow on mono release 1.1.8 and
+after. On large tables, it breaks with Exception:
+
+Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Connection
+unexpectedly terminated ---> MySql.Data.MySqlClient.MySqlException:
+Connection unexpectedly terminated
+in <0x001fd> MySql.Data.MySqlClient.PacketReader:Read (System.Byte[]
+buffer, Int64 pos, Int64 len)--- End of inner exception stack trace ---
+
+in <0x002f2> MySql.Data.MySqlClient.PacketReader:Read (System.Byte[]
+buffer, Int64 pos, Int64 len)
+in <0x00099> MySql.Data.MySqlClient.PacketReader:ReadString (Int64 length)
+in <0x0003e> MySql.Data.Types.MySqlString:ReadValue
+(MySql.Data.MySqlClient.PacketReader reader, Int64 length)
+in <0x00104> MySql.Data.MySqlClient.NativeDriver:ReadFieldValue (Int32
+index, MySql.Data.MySqlClient.MySqlField field, MySql.Data.Types.MySqlValue
+valObject)
+in <0x000be> MySql.Data.MySqlClient.CommandResult:ReadDataRow (Boolean
+loadFields)
+in <0x000b6> MySql.Data.MySqlClient.MySqlDataReader:Read ()
+
+Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Connection
+unexpectedly terminated ---> System.ObjectDisposedException: Stream is closed
+in <0x00067> System.IO.BufferedStream:CheckObjectDisposedException ()
+in <0x0001e> System.IO.BufferedStream:Read (System.Byte[] array, Int32
+offset, Int32 count)
+in <0x001bf> MySql.Data.MySqlClient.PacketReader:Read (System.Byte[]
+buffer, Int64 pos, Int64 len)--- End of inner exception stack trace ---
+
+in <0x002f2> MySql.Data.MySqlClient.PacketReader:Read (System.Byte[]
+buffer, Int64 pos, Int64 len)
+in <0x000c4> MySql.Data.MySqlClient.PacketReader:Skip (Int64 count)
+in <0x00063> MySql.Data.MySqlClient.PacketReader:OpenPacket ()
+in <0x00014> MySql.Data.MySqlClient.NativeDriver:OpenDataRow (Int32
+fieldCount, Boolean isBinary)
+in <0x0005e> MySql.Data.MySqlClient.CommandResult:Consume ()
+in <0x00032> MySql.Data.MySqlClient.MySqlDataReader:Close ()
+
+Steps to reproduce the problem:
+1. Upgrade mono (last release used: mono-1.1.13) from rpm
+
+1.1. First, stop apache server
+
+/usr/local/apache2/bin/apachectl stop
+rm -fR /tmp/apache-temp-aspnet/
+rm -fR /tmp/.wapi/
+ipcs -s | grep apache | perl -e 'while (<STDIN>) { @a=split(/\s+/); print
+`ipcrm sem $a[1]`}'
+
+1.2. Then upgrade mono
+
+rpm -Uvh mono-*.rpm bytefx-data-mysql-1.1.13-0.novell.i586.rpm
+ibm-data-db2-1.1.13-0.novell.i586.rpm
+libgdiplus-1.1.13-0.fedora3.novell.i386.rpm 
+rpm -Uvh xsp-1.1.13-0.novell.noarch.rpm
+mod_mono-1.1.13-0.fedora3.novell.i386.rpm 
+
+2. Run an adapter.Fill test on two mysql tables (a small one and a larger one)
+
+2.1. C# source code
+
+using System;
+using System.Data;
+using MySql.Data;
+using MySql.Data.MySqlClient;
+
+namespace MySQLTest
+{
+	class TestAdapter
+	{
+		[STAThread]
+		static void Main(string[] args)
+		{
+			MySqlConnection conn;
+			conn = new MySqlConnection();
+			conn.ConnectionString =
+"server=localhost;userID=myTest;password=test;database=test;pooling=false";
+			conn.Open();
+			Console.WriteLine("Connection opened. MySql version {0}",
+conn.ServerVersion);
+
+
+			MySqlDataAdapter adapter;
+			adapter = new MySqlDataAdapter();
+
+			String query;
+
+			query ="SELECT * FROM Catalog.EntidadFederativa";
+			DataSet dsTemp1 = new DataSet();
+			adapter.SelectCommand = new MySqlCommand(query, conn);
+
+			Console.WriteLine("Time before: {0}", DateTime.Now.ToString());
+			adapter.Fill (dsTemp1);
+
+			foreach (DataTable tblTemp in dsTemp1.Tables)
+			{
+				Console.WriteLine("  Table contains {0} rows and {1} columns",
+tblTemp.Rows.Count.ToString(), tblTemp.Columns.Count.ToString());
+			}
+			Console.WriteLine("Time after: {0}", DateTime.Now.ToString());
+
+
+			query ="SELECT * FROM Catalog.Localidad";
+			DataSet dsTemp2 = new DataSet();
+			adapter.SelectCommand = new MySqlCommand(query, conn);
+
+			Console.WriteLine("Time before: {0}", DateTime.Now.ToString());
+			adapter.Fill (dsTemp2);
+
+			foreach (DataTable tblTemp in dsTemp2.Tables)
+			{
+				Console.WriteLine("  Table contains {0} rows and {1} columns",
+tblTemp.Rows.Count.ToString(), tblTemp.Columns.Count.ToString());
+			}
+			Console.WriteLine("Time after: {0}", DateTime.Now.ToString());
+
+			conn.Close();
+			Console.WriteLine("end...");
+			Console.ReadLine();
+		}
+	}
+}
+
+2.2. compiled with:
+mcs -out:./fillAdapter.exe -r:./MySql.Data.dll -r:System.Data ./fillAdapter.cs 
+
+2.3. run `mono fillAdapter.exe` to show the actual results.
+
+3. Downgrade mono down to 1.1.7
+
+3.1 Uninstall mono 1.1.13
+
+rpm --erase mod_mono-1.1.13-0.fedora3.novell xsp-1.1.13-0.novell
+rpm --erase mono-web-1.1.13-0.novell mono-devel-1.1.13-0.novell
+mono-data-oracle-1.1.13-0.novell mono-complete-1.1.13-0.novell
+mono-data-1.1.13-0.novell mono-winforms-1.1.13-0.novell
+mono-basic-1.1.13-0.novell mono-jscript-1.1.13-0.novell
+mono-data-firebird-1.1.13-0.novell mono-data-postgresql-1.1.13-0.novell
+mono-data-sybase-1.1.13-0.novell mono-locale-extras-1.1.13-0.novell
+mono-nunit-1.1.13-0.novell mono-core-1.1.13-0.novell
+mono-extras-1.1.13-0.novell mono-data-sqlite-1.1.13-0.novell
+bytefx-data-mysql-1.1.13-0.novell ibm-data-db2-1.1.13-0.novell
+libgdiplus-1.1.13-0.fedora3.novell
+
+3.2 Install mono 1.1.7
+
+rpm -Uvh mono-*.rpm bytefx-data-mysql-1.1.7-1.novell.i586.rpm
+ibm-data-db2-1.1.7-1.novell.i586.rpm
+libgdiplus-1.1.7-0.fedora3.novell.i386.rpm 
+
+4. run `mono fillAdapter.exe` to show the expected results.
+
+
+Actual Results:
+Connection opened. MySql version 4.1.11-standard-log
+Time before: 26/01/2006 11:37:28
+  Table contains 32 rows and 8 columns
+Time after: 26/01/2006 11:37:29
+Time before: 26/01/2006 11:37:29
+-> exception throwed
+
+Expected Results:
+Connection opened. MySql version 4.1.11-standard-log
+Time before: 26/01/2006 11:50:00
+  Table contains 32 rows and 8 columns
+Time after: 26/01/2006 11:50:00
+Time before: 26/01/2006 11:50:00
+  Table contains 199392 rows and 11 columns
+Time after: 26/01/2006 11:50:36
+end...
+
+How often does this happen? 
+Always
+
+Additional Information:
+Using MySQL Connector/Net. 1.0.7


More information about the mono-bugs mailing list