Patch: literals in SQL replaced with parameters

17 posts
Re: Patch: literals in SQL replaced with parameters

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
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

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
Fixed, archive updated.
Re: Patch: literals in SQL replaced with parameters

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
What was the cause of the bug?

I'll check updated archive tonight.
Re: Patch: literals in SQL replaced with parameters

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
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

elliswr
MMEX Developer

Posts: 151
Joined: Tue May 05, 2009 2:21 am
Location: Granbury, TX
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

madhan
Site Admin

Posts: 242
Joined: Sun Nov 30, 2008 2:06 pm
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

Vadim
MMEX Developer

Posts: 159
Joined: Mon Aug 03, 2009 1:35 am
Patch applied, revision 410.
Who is online

Users browsing this forum: No registered users and 7 guests