[Monetdb-developers] Mapi query parameter constness

Isidor Zeuner monetdb at quidecco.de
Fri Apr 9 22:47:27 CEST 2010

Dear MonetDB developers,

as I have been working on interfacing Mapi to C++ in a manner as
lightweight as possible, I have noticed that the parameter binding
interface does not interface to STL strings as seamlessly as it
probably could. Similar considerations might well apply to other
C-based string APIs:

The STL string API provides accessor functions to the string's
char data and its size. To ensure secure programming, the pointer to
the char data has to be const. Yet, the Mapi interface for passing
string parameters expects a writable char pointer. I'm not sure
how future plans for Mapi look like, but currently thsi doesn't
seem necessary to me. I have attached a patch to have Mapi treat the
data as const, which works well for me.

I also noticed that Mapi expects the string size parameter to be
passed by reference. Is this necessary? Having an interface which
supports pass-by-value would facilitate string API integration even

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapi-const.diff
Type: text/x-patch
Size: 6600 bytes
Desc: not available
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20100409/a883a577/attachment.bin>

More information about the developers-list mailing list