[PATCH] Stored Procedures support on dbpool_mssql

Alejandro Guerrieri <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
This small patch fixes dbpool_mssql so stored procedures can be  
invoked with mssql_select and mssql_update (by using "EXEC  
<my_stored_procedure> <param1> <param2>...").

It also displays the error number when an unkown result is encountered.




Objections?
--
Alejandro Guerrieri
[email protected]
patch-mssql-status-result.patch (application/octet-stream, 1.1 KB)
Index: gwlib/dbpool_mssql.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/dbpool_mssql.c,v
retrieving revision 1.1
diff -u -r1.1 dbpool_mssql.c
--- gwlib/dbpool_mssql.c	4 May 2009 21:35:53 -0000	1.1
+++ gwlib/dbpool_mssql.c	21 Jun 2009 15:30:37 -0000
@@ -263,13 +263,14 @@
                 break;
             case CS_CMD_SUCCEED:
             case CS_CMD_DONE:
-                break;
+            case CS_STATUS_RESULT:
+		break;
             case CS_CMD_FAIL:
                 error(0, "select failed!");
                 return -1;
                 break;
             default:
-                error(0, "ct_result returned unexpected result type");
+                error(0, "ct_result returned unexpected result type: %d", res_type);
                 return -1;
                 break;
         }
@@ -303,6 +304,7 @@
         switch ((int) result_type) {
             case CS_CMD_SUCCEED:
             case CS_CMD_DONE:
+            case CS_STATUS_RESULT:
                 break;
             default:
                 mssql_checkerr(result_type);
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.