[Mono-bugs] [Bug 75707][Nor] New - Different DataTable behaviour between Mono and .NET

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Aug 4 07:21:04 EDT 2005


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 ernasm at gmail.com.

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

--- shadow/75707	2005-08-04 07:21:04.000000000 -0400
+++ shadow/75707.tmp.4235	2005-08-04 07:21:04.000000000 -0400
@@ -0,0 +1,109 @@
+Bug#: 75707
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: ernasm at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Different DataTable behaviour between Mono and .NET 
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+I found there is difference behaviour between Mono and .NET on handling 
+dataset that filled from joined query and does not have spesific primary 
+key. 
+On .NET the number returned from adapter.Fill and DataTable.Rows.Count is 
+equal, but on Mono is different.
+
+Steps to reproduce the problem:
+1. Create Database
+2. Compile and run test case
+
+Actual Results:
+
+here count 11
+here count 6
+
+Expected Results:
+
+here count 11
+here count 11
+
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+Test case
+--------------------------------------
+String connectionString = null;
+MySqlConnection con;
+
+try
+{
+       connectionString =
+               "Server=localhost;" +
+               "Database=test;" +
+               "User ID=user;" +
+               "Password=password";
+       con = new MySqlConnection(connectionString);
+       MySqlDataAdapter myadapter = new MySqlDataAdapter("SELECT t0.* FROM
+user t0, db t1 WHERE t0.user = t1.user;",con);
+
+       con.Open ();
+       DataTable dt = new DataTable();
+       int count = myadapter.Fill(dt);
+       Console.WriteLine("here count {0}",count);
+       Console.WriteLine("here count {0}",dt.Rows.Count);
+       con.Close();
+}
+catch (Exception e)
+{
+       Console.WriteLine("exception {0}",e);
+
+}
+--------------------------------------
+
+
+Here is sampe database I use:
+
+DROP TABLE IF EXISTS "db";
+CREATE TABLE "db" (
+  "Host" char(60) NOT NULL default '',
+  "Db" char(64) NOT NULL default '',
+  "User" char(16) NOT NULL default '',
+  PRIMARY KEY  ("Host","Db","User"),
+  KEY "User" ("User")
+);
+
+
+LOCK TABLES "db" WRITE;
+INSERT INTO "db" VALUES ('%','test',''),('%','test\\_%',''),
+('localhost','monotest_dw','mysqldba'),('localhost','testdb_ap','dwkp'),
+('localhost','testdb_dw','dwkp'),('localhost','testdb_case_ap','dwkp'),
+('localhost','testdb_case_dw','dwkp');
+UNLOCK TABLES;
+
+DROP TABLE IF EXISTS "user";
+CREATE TABLE "user" (
+  "Host" varchar(60) NOT NULL default '',
+  "User" varchar(16) NOT NULL default '',
+  PRIMARY KEY  ("Host","User")
+);
+
+LOCK TABLES "user" WRITE;
+INSERT INTO "user" VALUES ('%','mysqldba'),('localhost',''),
+('localhost','dwkp'),('localhost','mysqldba'),('localhost','root'),
+('turtle',''),('turtle','mysqldba'),('turtle','root');
+UNLOCK TABLES;


More information about the mono-bugs mailing list