Bug #84160 Connector/ODBC 5.3.6 - Memory Leakage
Submitted: 12 Dec 2016 10:02 Modified: 13 Dec 2016 12:48
Reporter: Sławomir Białkowski Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.3.6 OS:Any
Assigned to: CPU Architecture:Any

[12 Dec 2016 10:02] Sławomir Białkowski
Description:
Hello.

I found in Connector/ODBC 5.3.6 a bug.
The problem is memory leakage.
When I changed the driver ver. 5.2.7 everything works OK.

I am connectimg to MySql Server Community 5.7.16
from MS Access (Microsoft Office 365 ProPlus sobscription).
My piece of VBA code (see comment):

Set dbs = CurrentDb

countWin = 0

Set rstTemp = dbs.OpenRecordset(strSQL, dbOpenDynaset, dbReadOnly)

Do While Not rstTemp.EOF

    windowID = CInt(rstTemp.Fields(0))
    countWin = countWin + 1
    
    Forms!info!tekst.Value = "Wait! Suming Gaussians... " & countWin & " of " & maxCountWin
    Forms!info.Refresh
    
    strSQL2 = "SELECT [Single Pulses].sample_id, [Single Pulses].ampImit " & _
        "FROM [Single Pulses] " & _
        "WHERE ((([Single Pulses].window_id)=" & windowID & ")) " & _
        "ORDER BY [Single Pulses].sample_id"
    Set rstTemp2 = dbs.OpenRecordset(strSQL2, dbOpenDynaset, dbReadOnly)
    
    i = 1
    Do While Not rstTemp2.EOF
        Y(i) = CDbl(rstTemp2.Fields(1))
        rstTemp2.MoveNext
        i = i + 1
    Loop
    rstTemp2.Close
    
    
    Amplituda = CDbl(rstTemp.Fields(1)) 'amplitude
    Xpos = CDbl(rstTemp.Fields(2)) 'position x0
    stdDev = CDbl(rstTemp.Fields(3)) 'stdDev
    
    For i = 1 To maxBin
        Y(i) = Y(i) + GaussY(i, Xpos, stdDev, Amplituda)
    Next i
       
    For i = 1 To maxBin
        strSQL = "UPDATE [Single Pulses] SET [Single Pulses].ampImit = " & Y(i) & " " & _
            "WHERE ((([Single Pulses].window_id)=" & windowID & ") AND (([Single Pulses].sample_id)=" & i & "))"
        dbs.Execute strSQL '<----<<< THE MEMORY LEAKAGE OCCURS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Next i
    
    rstTemp.MoveNext
Loop

rstTemp.Close

dbs.Close

Yours
Slawomir Bialkowski
An Astronomer

How to repeat:
s.bialkowski@mega.pl

Suggested fix:
When I changed the driver ver. 5.2.7 everything works OK.
[12 Dec 2016 11:57] Chiranjeevi Battula
Hello  Sławomir Białkowski,

Thank you for the bug report.
Could you please provide repeatable test case (exact steps, create table statements and data etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[12 Dec 2016 16:53] Sławomir Białkowski
Hello Chiranjeevi,

There is no necessity to confirm this problem, 
because I checked/debug the procedure line by line.
I searched the solution for two days.
I'm sorry but I can not spend more time on this issue.

Good luck,
Slawomir
[13 Dec 2016 12:48] Chiranjeevi Battula
Hello  Sławomir Białkowski,

Thank you for your feedback.
I could not repeat this issue at my end with the provided information. 
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.
[8 Oct 2017 1:03] Nicolaos Darras
I confirm the Memory Leak problem with 5.3 driver using Office ProPlus 365 and MySQL server 5.7.

We spend many days to find a solution for the leak.

The use of 5.2.7 driver resolved the problem.

Thank you  Sławomir Białkowski for sharing your solution.
[8 Oct 2017 1:03] Nicolaos Darras
I confirm the Memory Leak problem with 5.3 driver using Office ProPlus 365 and MySQL server 5.7.

We spend many days to find a solution for the leak.

The use of 5.2.7 driver resolved the problem.

Thank you  Sławomir Białkowski for sharing your solution.