Bug #5768 Skipping non-NULL values after first NULL occurence
Submitted: 27 Sep 2004 17:12 Modified: 30 Sep 2004 12:25
Reporter: David Cumps Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.0 OS:Windows (Windows 2003/2000)
Assigned to: Assigned Account CPU Architecture:Any

[27 Sep 2004 17:12] David Cumps
Description:
When running a LEFT JOIN query like:
SELECT usrId, usrName, usrRealName, className FROM snUsers LEFT JOIN snClasses ON classId=usrClass

Where the results are:
1, user1, User 1 Name, Class1
2, user2, User 2 Name, Class2
3, user3, User 3 Name, NULL
4, user4, User 4 Name, Class2
5, user5, User 5 Name, Class3

The connector will return an empty string for the last className field in the last 2 results.

This is encountered with the following C#:

Code to get data:

string UserSQL = "SELECT usrId, usrName, usrRealName, className FROM snUsers LEFT JOIN snClasses ON classId=usrClass;";
MySqlCommand UserCmd = new MySqlCommand(UserSQL, this.Database);
MySqlDataAdapter AdapterUser = new MySqlDataAdapter(UserCmd);
DataSet User = new DataSet();
AdapterUser.Fill(User);
return User.Tables[0];

Code to display data:

DataTable Users = (method that calls above code)
if (Users.Rows.Count != 0) {
	foreach (DataRow User in Users.Rows) {
		Response.Write(User["usrName"].ToString());
		Response.Write(User["className"].ToString());
		Response.Write("<br>");
	}
}

This will display ALL usrNames, but only the first 2 classNames, after wich all results return empty strings.

---
This behaviour happens on:
Windows 2003 with Mysql 4.0.17
Windows 2003 with Mysql 4.1.5-gamma
Windows 2000 with Mysql 3.23.49

How to repeat:
see description
[28 Sep 2004 9:50] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

This is a duplicate of a previously submitted bug.
[28 Sep 2004 21:34] David Cumps
What's the http link to the repository of the .Net Connector?

Tnx
[30 Sep 2004 12:25] Reggie Burnett
bk clone http://mysql.bkbits.com/connector-net