Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not a Bug
-
Affects Version/s: PHP-8.4.0
-
Fix Version/s: OLEDB-8.4.1
-
Component/s: OLEDB
-
Labels:None
-
Environment:
- Windows7
- .Net Framework3.5
- VS2008
- C#
Description
Brief:
- Actual Value is not equal to expected value when call OleDbDataReader.GetFloat() to get the max and min float data
Content:
| expected value | actual value | |
|---|---|---|
| min float | -3.40282347E+38f | -3.40282306E+38f |
| max float | 3.40282347E+38f | 3.40282306E+38f |
Test Step:
- insert into data table max float value and min float value
- call OleDbDataReader.GetFloat() to get max and min
- assert the insert value and return value
Code reference:
[Test, Description("test datareader GetFloat(db_type:float, .net_type:float)")]
[TestCase(float.MaxValue, TestName = "DataReader_GetFloat_max")]
[TestCase(float.MinValue, TestName = "DataReader_GetFloat_min")]
public void DataReader_GetFloat_float(float exp)
{
string strTable = "t_type_numeric";
string strCreateTable = string.Format("Create table {0}(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,f_float float)", strTable);
string strDropTable = string.Format("Drop table {0}", strTable);
OleDbUtil oUtil = new OleDbUtil(strConn);
OleDbCommand cmdCubrid = oUtil.CreateCommand(strDropTable);
try
{
cmdCubrid.ExecuteNonQuery();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
cmdCubrid.CommandText = strCreateTable;
cmdCubrid.ExecuteNonQuery();
string strInsert = string.Format("insert into {0} value(NULL,{1})", strTable, exp);
string strSelect = string.Format("select * from {0} order by id desc", strTable);
SqlUtil.ExecuteNonQuery(oUtil.ConnCubrid, strInsert);
OleDbDataReader reader = oUtil.CreateReader(strSelect);
Assert.AreEqual(exp, reader.GetFloat(1));
}

Issue reproduces ok: http://svn.cubrid.org/cubridapis/oledb/branches/RB-8.4.1/TestCases.NET/TestCases.NET.cs
But it is not related to the OLE DB driver, but to the CUBRID internal representation.
See attached image from CM client.