From a0c613080faf099381cd1cdd09cf139455ea40fc Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sun, 2 Mar 2008 00:53:04 -0500 Subject: Remove commit/rollback --- src/mysqlerl.c | 40 ---------------------------------------- src/mysqlerl.hrl | 2 -- 2 files changed, 42 deletions(-) (limited to 'src') diff --git a/src/mysqlerl.c b/src/mysqlerl.c index 686d72f..9266baa 100644 --- a/src/mysqlerl.c +++ b/src/mysqlerl.c @@ -20,8 +20,6 @@ const char *LOGPATH = "/tmp/mysqlerl.log"; static FILE *logfile = NULL; const char *QUERY_MSG = "sql_query"; -const char *COMMIT_MSG = "sql_commit"; -const char *ROLLBACK_MSG = "sql_rollback"; typedef u_int32_t msglen_t; @@ -273,38 +271,6 @@ handle_sql_query(MYSQL *dbh, ETERM *cmd) free(buf); } -void -handle_sql_commit(MYSQL *dbh, ETERM *cmd) -{ - ETERM *resp; - char *buf; - int buflen; - - resp = erl_format("{ok, commit}"); - buflen = erl_term_len(resp); - buf = (char *)malloc(buflen); - erl_encode(resp, (unsigned char *)buf); - erl_free_term(resp); - write_cmd(buf, buflen); - free(buf); -} - -void -handle_sql_rollback(MYSQL *dbh, ETERM *cmd) -{ - ETERM *resp; - char *buf; - int buflen; - - resp = erl_format("{ok, rollback}"); - buflen = erl_term_len(resp); - buf = (char *)malloc(buflen); - erl_encode(resp, (unsigned char *)buf); - erl_free_term(resp); - write_cmd(buf, buflen); - free(buf); -} - void dispatch_db_cmd(MYSQL *dbh, msg_t *msg) { @@ -314,12 +280,6 @@ dispatch_db_cmd(MYSQL *dbh, msg_t *msg) if (strncmp((char *)ERL_ATOM_PTR(tag), QUERY_MSG, strlen(QUERY_MSG)) == 0) { handle_sql_query(dbh, msg->cmd); - } else if (strncmp((char *)ERL_ATOM_PTR(tag), - COMMIT_MSG, strlen(COMMIT_MSG)) == 0) { - handle_sql_commit(dbh, msg->cmd); - } else if (strncmp((char *)ERL_ATOM_PTR(tag), - ROLLBACK_MSG, strlen(ROLLBACK_MSG)) == 0) { - handle_sql_rollback(dbh, msg->cmd); } else { logmsg("WARNING: message type %s unknown.", (char *)ERL_ATOM_PTR(tag)); erl_free_term(tag); diff --git a/src/mysqlerl.hrl b/src/mysqlerl.hrl index 3ec553d..7b681e7 100644 --- a/src/mysqlerl.hrl +++ b/src/mysqlerl.hrl @@ -6,5 +6,3 @@ -record(sql_last, {}). -record(sql_next, {}). -record(sql_prev, {}). --record(sql_commit, {}). --record(sql_rollback, {}). -- cgit v1.2.3