[exim-dev] Patch to allow calling MySQL stored procedures fr…

Top Page
Delete this message
Reply to this message
Author: B. Johannessen
Date:  
To: exim-dev
Subject: [exim-dev] Patch to allow calling MySQL stored procedures from Exim
The below patch allows you to call MySQL stored procedures that return
results by adding the CLIENT_MULTI_RESULTS flag to the call to
mysql_real_connect(). For more information about this flag, see the
MySQL documentation at:

http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html

(search the page CLIENT_MULTI_RESULTS)

Unless anyone thinks this is a bad idea, I'd like to have this patch
included in the next Exim release.


    Bob


--- exim-4.69-orig/src/lookups/mysql.c  2007-08-23 12:16:51.000000000 +0200
+++ exim-4.69/src/lookups/mysql.c       2008-03-20 17:43:04.000000000 +0100
@@ -202,7 +202,7 @@
    if (mysql_real_connect(mysql_handle,
        /*  host        user         passwd     database */
        CS sdata[0], CS sdata[2], CS sdata[3], CS sdata[1],
-      port, CS socket, 0) == NULL)
+      port, CS socket, CLIENT_MULTI_RESULTS) == NULL)
      {
      *errmsg = string_sprintf("MYSQL connection failed: %s",
        mysql_error(mysql_handle));