Bug #8788 Visual C++ 6.0 float Update/Delete problem
Submitted: 24 Feb 2005 17:53 Modified: 1 Mar 2005 23:42
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.10 OS:Windows (Windows NT)
Assigned to: CPU Architecture:Any

[24 Feb 2005 17:53] [ name withheld ]
Description:
During working on Visual C++ 6.0 with MyODBC installed, using MyODBC, I encountered a problem: I have table with float values and I'm updating this table with CRecordset class (Edit and Update methods). And when setting float value to specific values (in my case 21.54 - many other do this too) I can't modify (and delete with Delete method) this row further. I can modify this values by ExecuteSQL method. In other words: I can change float column value few times but when I set some specific value it stops working further. I tried this with 5.0 version and it behaves similar. But with 4.0 version all is working ok.
Maybe it is something with MyODBC...but 4.0.23 version is working with the same ODBC.

How to repeat:
Explained in description.
[24 Feb 2005 18:00] MySQL Verification Team
Could you please submit a small test case with preference the
.dsw or .dsp project files and table dump. You can attach
them using the Files tab.

Thanks in advance.
[24 Feb 2005 18:35] [ name withheld ]
table creation file

Attachment: tworz (text/plain), 4.12 KiB.

[24 Feb 2005 18:40] [ name withheld ]
Part of project .cpp file

Attachment: project.txt (text/plain), 250 bytes.

[24 Feb 2005 18:41] [ name withheld ]
m_set class

Attachment: TowarSet.h (text/plain), 1.53 KiB.

[24 Feb 2005 18:53] [ name withheld ]
I sent some files. Hope this is enough.
[24 Feb 2005 19:41] MySQL Verification Team
Thank you for the update but the line of code I would like to
see isn't present in your files:

If db is your CDatabase I would like to see the correspondent
line of code:

db->OpenEx(...parameters used...);

Thansk in advance
[24 Feb 2005 19:49] [ name withheld ]
I just use Open() without any parameters.

And this is GetDefaultConnect function:

CString CTowarSet::GetDefaultConnect()
{
	CString str;
	str.LoadString(IDS_DSN_NAME);
	return _T("ODBC;DSN="+str+";UID="+m_login+";PASSWORD="+m_password);
}
[24 Feb 2005 20:56] MySQL Verification Team
Could you please try to modify your code or the DSN for to have
the cursor library support.. in code something like this:

try{
        CDatabase  * db = NULL;
        if(1){
            db = new CDatabase; 
         db->OpenEx("DSN=xxxx", CDatabase::noOdbcDialog |
CDatabase::useCursorLib);
              }

The use of CDatabase::useCursorLib it is the actual test.

Thanks in advance
[24 Feb 2005 21:27] [ name withheld ]
I checked it - standard Open function uses useCursorLib option.
[24 Feb 2005 21:35] [ name withheld ]
Do you encounter this problem on your computer, anyway, now, when you checked it? I haven't tried it on other computers yet.
[24 Feb 2005 22:10] MySQL Verification Team
Ok. Thank you I will ahead with my test.
[1 Mar 2005 18:38] Mauricio Volkweis Astiazara
I have same problem.
[1 Mar 2005 19:00] Mauricio Volkweis Astiazara
I'm using Visual Basic 6 and my connection has options =1 + 2 + 8 + 32 + 2048 + 16384. My "problematic values": 33.9 and 101.6.
[1 Mar 2005 20:30] Mauricio Volkweis Astiazara
I think there is a float point problem.
This is sql update statement generated by ODBC (I got from MySql log file):

UPDATE  <dont care, new values or same values>
WHERE 
`Id`=2 AND 
`Descricao`='Carta TK49' AND 
`Marca`='Pimaco 6282 com 14' AND 
`MargemHorizontal`=3.00000000000000
000e+000 AND 
`MargemVertical`=2.00000000000000000e+000 AND 
`MargemLinhas`=0.00000000000000000e+000 AND 
`MargemColunas`=5.00000000000000000e+000 AND 
`Colunas`=2 AND 
`Linhas`=7 AND 
`EtiquetaAltura`=3.38999999999999990e+001 AND 
`EtiquetaLargura`=1.01599999999999990e+002 AND 
`EtiquetaMargemVertical`=1.00000000000000000e+001 AND 
`EtiquetaMargemHorizontal`=5.00000000000000000e+000 AND 
`Fonte` IS NULL

But my data values are (exported as csv file by MySql Query Browser):

"Id","Descricao","Marca","MargemHorizontal","MargemVertical","MargemLinhas","MargemColunas","Colunas","Linhas","EtiquetaAltura","EtiquetaLargura","EtiquetaMargemVertical","EtiquetaMargemHorizontal","Fonte"
2,"Carta TK49","Pimaco 6282 com 14",3,2,0,5,2,7,33.9,101.6,10,5,(null)

Can I force MyODBC use for update the primary keys only?
[1 Mar 2005 21:00] [ name withheld ]
You can update columns manually - by using ExecuteSQL statement. But when you have big program, changing everything requires lot of work. And on the other hand this is working on 4.0 version, so it shouldn't be happening.
[1 Mar 2005 23:42] MySQL Verification Team
Playing with my own small MFC application using float columns
I wasn't able to repeat. For to be able to repeat I ask you
for to create a small and complete test case for.

The issue presented by Mauricio maybe is related to the
bug:

http://bugs.mysql.com/bug.php?id=7840

that will be fixed in next release. Please look it if
can be related to you too.

Thanks in advance.