diff options
author | Brian Cully <bjc@kublai.com> | 2008-03-02 00:53:04 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2008-03-02 00:53:04 -0500 |
commit | a0c613080faf099381cd1cdd09cf139455ea40fc (patch) | |
tree | a1f78d823d9151a25ab96a9acdcdb09fc05e4b41 /src | |
parent | 2354f6f8c7ecbf336f27875131ce0efa9c1f5f7e (diff) | |
download | mysqlerl-a0c613080faf099381cd1cdd09cf139455ea40fc.tar.gz mysqlerl-a0c613080faf099381cd1cdd09cf139455ea40fc.zip |
Remove commit/rollback
Diffstat (limited to 'src')
-rw-r--r-- | src/mysqlerl.c | 40 | ||||
-rw-r--r-- | src/mysqlerl.hrl | 2 |
2 files changed, 0 insertions, 42 deletions
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; @@ -274,38 +272,6 @@ handle_sql_query(MYSQL *dbh, ETERM *cmd) } 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) { ETERM *tag; @@ -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, {}). |