aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-03-02 19:26:15 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2008-03-02 19:26:15 -0500
commit0c26b0b42bd9beca772aef3cab5251c0a9eb0c43 (patch)
treea8baf00f77954d0d8ca65898895a2be63ff2482e
parente6ff522a574d6a6ac87539bd1dc2814dcf57f5ad (diff)
downloadmysqlerl-0c26b0b42bd9beca772aef3cab5251c0a9eb0c43.tar.gz
mysqlerl-0c26b0b42bd9beca772aef3cab5251c0a9eb0c43.zip
Add dispatch routines.
All ODBC methods are now recognized. We still need to implement select and param_query. I'm so lazy, tho.
-rw-r--r--src/mysqlerl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mysqlerl.c b/src/mysqlerl.c
index 55ed42a..03e13f2 100644
--- a/src/mysqlerl.c
+++ b/src/mysqlerl.c
@@ -14,12 +14,12 @@
const char *QUERY_MSG = "sql_query";
const char *PARAM_QUERY_MSG = "sql_param_query";
+const char *SELECT_MSG = "sql_select";
const char *SELECT_COUNT_MSG = "sql_select_count";
const char *FIRST_MSG = "sql_first";
const char *LAST_MSG = "sql_last";
const char *NEXT_MSG = "sql_next";
const char *PREV_MSG = "sql_prev";
-const char *SELECT_MSG = "sql_select";
MYSQL_RES *results = NULL;
my_ulonglong resultoffset = 0, numrows = 0;
@@ -206,6 +206,11 @@ handle_param_query(MYSQL *dbh, ETERM *msg)
erl_free(q);
}
+void handle_select(MYSQL *dbh, ETERM *msg)
+{
+ logmsg("DEBUG: got select msg.");
+}
+
void
handle_select_count(MYSQL *dbh, ETERM *msg)
{
@@ -375,6 +380,9 @@ dispatch_db_cmd(MYSQL *dbh, ETERM *msg)
PARAM_QUERY_MSG, strlen(PARAM_QUERY_MSG)) == 0) {
handle_param_query(dbh, msg);
} else if (strncmp((char *)ERL_ATOM_PTR(tag),
+ SELECT_MSG, strlen(SELECT_MSG)) == 0) {
+ handle_select(dbh, msg);
+ } else if (strncmp((char *)ERL_ATOM_PTR(tag),
SELECT_COUNT_MSG, strlen(SELECT_COUNT_MSG)) == 0) {
handle_select_count(dbh, msg);
} else if (strncmp((char *)ERL_ATOM_PTR(tag),