Re: Connector does not handle SUM(table_name.Column)
Posted by: Reggie Burnett
Date: October 29, 2004 09:16AM

First, why would you say that the ? syntax is non-sense?

Second, this unit test currently works perfectly with 1.0.1 beta 2.

[Test]
public void Sum()
{
execSQL("DROP TABLE IF EXISTS Test");
createTable("CREATE TABLE Test (id int, count int)");
execSQL("INSERT INTO TEST VALUES (1, 21)");
execSQL("INSERT INTO TEST VALUES (1, 33)");
execSQL("INSERT INTO TEST VALUES (1, 16)");
execSQL("INSERT INTO TEST VALUES (1, 40)");

MySqlCommand cmd = new MySqlCommand("SELECT id, SUM(count) FROM Test GROUP BY id", conn);
MySqlDataReader reader = null;
try
{
reader = cmd.ExecuteReader();
reader.Read();
Assert.AreEqual( 1, reader.GetInt32(0) );
Assert.AreEqual( 110, reader.GetDouble(1) );
}
catch (Exception ex)
{
Assert.Fail( ex.Message );
}
finally
{
if (reader != null)
reader.Close();
}
}

Options: ReplyQuote


Subject
Written By
Posted
Re: Connector does not handle SUM(table_name.Column)
October 29, 2004 09:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.