Page 1 of 1

Re: Patch: literals in SQL replaced with parameters

Posted: Thu Sep 10, 2009 11:11 am
by elliswr
Lost 22 of the 28 errors. Now only six remain. All related to st.Bind(i++, numRepeats) or st.Bind(2, numRepeats);

Error is "Call of overloaded 'Bind(int, long int&)' is ambiguous in dbwrapper.cpp / bills depositsdialog.cpp"

Re: Patch: literals in SQL replaced with parameters

Posted: Thu Sep 10, 2009 11:57 am
by Vadim
Fixed, archive updated.

Re: Patch: literals in SQL replaced with parameters

Posted: Thu Sep 10, 2009 1:26 pm
by elliswr
What was the cause of the bug?

I'll check updated archive tonight.

Re: Patch: literals in SQL replaced with parameters

Posted: Thu Sep 10, 2009 1:51 pm
by Vadim
That was not a bug. It's just a different compiler :-)
Signatures of Bind are
Bind(int, int)
Bind(int, wxLongLong).

On Win32 sizeof(long) == sizeof(int), thus call to Bind(int, long) matches Bind(int, int).
On Mac call to Bind(int, long) may be matches Bind(int, int) and Bind(int, wxLongLong).
You can check yourself :-)

Re: Patch: literals in SQL replaced with parameters

Posted: Thu Sep 10, 2009 10:00 pm
by elliswr
Vadim,
Works perfectly! And thanks for taking the time to explain the reason I was getting errors. You clearly have a better understanding of all this than I do, and I hope you don't mind if I come to you when I get stuck.

Re: Patch: literals in SQL replaced with parameters

Posted: Fri Sep 11, 2009 2:34 am
by madhan
Hello Vadim, I think this is quite a significant patch to MMEX and I welcome the change as well as the reasons to do it.
MMEX started when I was working with databases the first time so naturally the code is crufty and definitely has room for improvement.

Having said that, I think the best way to get this patch is not me managing writing these changes in SVN and ensuring the fixes go in related to changes to this patch, which will get fairly inefficient and laborious.
It might be better if you or other people can be added to the MMEX project as contributors with SVN write access. I will send email to discuss this in greater detail.

Re: Patch: literals in SQL replaced with parameters

Posted: Mon Sep 14, 2009 9:44 am
by Vadim
Patch applied, revision 410.