Re: mysql dlr fixes

Andreas Fink <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <p05101510b8d9c96cc824@[193.53.0.55]>
>Hi Andreas, Hi others
>
>we recently changed this in gw/dlr.c:
>
>{
>  #ifdef DLR_MYSQL
>      mysql_close(connection);
>-    if (!mysql_errno(connection))
>-        error(0,"MYSQL: %s", mysql_error(connection));
>  #endif
>  }
>
>Hmmm, don't we need some constructs to check if the mysql_close() call
>has been successfull?! And if this is not the way to do it (AFAIK,
>this has been taken from a mysql doc example by myself) how should we
>do this?

the problem here is:

mysql_close(connection) does deallocate the connection. So we can not 
call mysql_errno on a handle which doesnt exist anymore. Furthermore, 
we want to close the connection. If it fails or not is not really of 
importance. We wont use the connection anymore after that.

-- 

Andreas Fink
Fink-Consulting

------------------------------------------------------------------
Tel: +41-61-6932730 Fax: +41-61-6932729  Mobile: +41-79-2457333
Address: A. Fink, Schwarzwaldallee 16, 4058 Basel, Switzerland
E-Mail:  [email protected]  Homepage: http://www.finkconsulting.com
------------------------------------------------------------------
Something urgent? Try http://www.smsrelay.com/  Nickname afink
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.