Is there a bug in the MyDAC package concerning queries on FLOAT fields?
I have the following MySQL table:
CREATE TABLE `postal` (
`Lat` float default NULL,
`Lon` float default NULL,
`PostalCode` char(8) default NULL,
`PostCodeNoSpace` char(8) default NULL,
`Description` char(40) default NULL,
UNIQUE KEY `PostalCodeIndex` (`PostalCode`),
KEY `Lat` (`Lat`,`Lon`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
I would like to use the following code for updating Description field in table postal:
MyQueryCopy->Close();
MyQueryCopy->SQL->Clear();
MyQueryCopy->SQL->Add("SELECT * FROM postal WHERE PostalCode='AB10 1AA'");
MyQueryCopy->Open();
MyQueryCopy->First();
if (MyQueryCopy->Eof == false)
{
MyQueryCopy->Edit();
MyQueryCopy->FieldByName("Description")->AsString = "Test";
MyQueryCopy->Post();
}
MyQueryCopy->Close();
BUT decription field is not updated.
If I instead use the following code:
MyQueryCopy->Close();
MyQueryCopy->SQL->Clear();
MyQueryCopy->SQL->Add("UPDATE postal SET Description='test' WHERE PostalCode='AB10 1AA'");
MyQueryCopy->Execute();
MyQueryCopy->Close();
Then the Description field is updated.
If I change the field types for Lon/Lat fields to DOUBLE or DECIMAL(25,12) then the the first query also works.
I am using MyDAC v. 5.80.0.46 / Borland C++ Builder 5
Would it help to upgrade to latest version of MyDAC?
Or could it be a MySQL problem? I am using MySQL v. 5.00.22