[Mono-bugs] [Bug 69110][Blo] New - DataSet doesnt contain some rows returned by query

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 4 Nov 2004 17:17:16 -0500 (EST)


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 dobos_s@ibcnet.hu.

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

--- shadow/69110	2004-11-04 17:17:16.000000000 -0500
+++ shadow/69110.tmp.31665	2004-11-04 17:17:16.000000000 -0500
@@ -0,0 +1,117 @@
+Bug#: 69110
+Product: Mono: Class Libraries
+Version: 1.0
+OS: GNU/Linux [Other]
+OS Details: Slackware 9.1/2.4.22
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dobos_s@ibcnet.hu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: DataSet doesnt contain some rows returned by query
+
+Description of Problem:
+
+Query joining some tables containing primary key column
+of one of the tables in it's result column list doesnt
+return rows where the column described above contains the
+same value.
+Running the same exe with the same dlls on MS framework
+returns the correct result.
+
+Steps to reproduce the problem:
+1. 
+create tables in sql
+
+CREATE TABLE `t1` (
+  `id` bigint(20) NOT NULL auto_increment,
+  PRIMARY KEY  (`id`)
+);
+
+CREATE TABLE `t2` (
+  `id` bigint(20) NOT NULL auto_increment,
+  `t1ref` bigint(20) NOT NULL default '0',
+  PRIMARY KEY  (`id`),
+  KEY `t1ref` (`t1ref`)
+);
+
+
+INSERT INTO `t1` VALUES (1);
+INSERT INTO `t1` VALUES (2);
+INSERT INTO `t2` VALUES (1,1);
+INSERT INTO `t2` VALUES (2,1);
+INSERT INTO `t2` VALUES (3,2);
+INSERT INTO `t2` VALUES (4,2);
+
+2. 
+set <valid connection stringy, then
+compile and run the above program:
+
+using System;
+using System.Data;
+using ByteFX.Data.Common;
+using ByteFX.Data.MySqlClient;
+
+namespace ConsoleApplication1
+{
+   class Class1
+   {
+      [STAThread]
+      static void Main(string[] args)
+      {
+         DataSet dsData = ListSummary ();
+         
+         for (int i=0; i<dsData.Tables[0].Rows.Count; i++)
+         {
+            Console.WriteLine ("{0}", dsData.Tables[0].Rows[i][0]);
+         }
+
+         return;
+      }
+
+      public static DataSet ListSummary ()
+      {
+         MySqlCommand oCmd = new MySqlCommand ();
+         oCmd.Connection = new MySqlConnection ("<valid connection 
+string>");
+         oCmd.CommandText = "SELECT t1.id FROM t1 left join t2 on t1.id = 
+t1ref";
+         oCmd.CommandType = CommandType.Text;
+
+         MySqlDataAdapter oDA = new MySqlDataAdapter (oCmd);
+         DataSet dsData = new DataSet ();
+         oDA.Fill (dsData);
+
+         return dsData;
+      }
+   }
+}
+
+3. 
+no more steps
+
+Actual Results:
+1
+2
+
+Expected Results:
+1
+1
+2
+2
+
+
+How often does this happen? 
+always
+
+Additional Information:
+This happens with mono-1.0.2,4
+Running mono with trace it seems, that LoadDataRow method
+doesnt care that the result has joined tables. It finds out that
+the returned column is a primary key and recognizes, that the current 
+returned key already present in processed data, so it drops it.