[Monetdb-developers] Mapilib example
Hi all, Triggered by a request from a user I changed the mapilib example somewhat. In particular, I tried to make the example more "school style", e.g. don't use a define for something which could have been a function. More important, I added code to walk multi-resultset handles in case there is an error, such that it eventually gets printed. I also closed the handle in the die function as proper cleanup example. I removed some mapi_error checks that I thought were redundant, but I'm not sure. Hence, please review the attached diff and comment before I commit this. The example compiles without warnings for me now, and also works for as far as I can see.
Fabian Groffen wrote:
Hence, please review the attached diff and comment before I commit this.
I like your changes; not compiled yet though. From my first interaction with MAPI it would also been nice if a program could touch all functions with some basic inline commenting style. Because I suggest it, I might need to volunteer on it too :) Stefan
On 12-06-2009 15:27:54 +0200, Stefan de Konink wrote:
Fabian Groffen wrote:
Hence, please review the attached diff and comment before I commit this.
I like your changes; not compiled yet though. From my first interaction with MAPI it would also been nice if a program could touch all functions with some basic inline commenting style.
Because I suggest it, I might need to volunteer on it too :)
I was thinking about at least adding comments here and there, but since I'm not too confident myself that the example is doing the right thing, I refrained from that sofar...
Fabian Groffen wrote:
Hi all,
Triggered by a request from a user I changed the mapilib example somewhat. In particular, I tried to make the example more "school style", e.g. don't use a define for something which could have been a function. More important, I added code to walk multi-resultset handles in case there is an error, such that it eventually gets printed. I also closed the handle in the die function as proper cleanup example. I removed some mapi_error checks that I thought were redundant, but I'm not sure. Hence, please review the attached diff and comment before I commit this.
The example compiles without warnings for me now, and also works for as far as I can see.
The problem with your patch (as I see it) is that if you try to execute a multi query batch of which one part fails, your error handling code doesn't show the results that you get from the part(s) that succeed. How bad this is is a matter of opinion. In the cases where your code is used, there are no batches of multiple queries, so the situation does not occur. -- Sjoerd Mullender
participants (3)
-
Fabian Groffen
-
Sjoerd Mullender
-
Stefan de Konink