diff --git a/pgproto/CMakeLists.txt b/pgproto/CMakeLists.txt index 169ffd50f6e7aa71c9f317596367560d9e3b06e9..4bf7a5ba4bf3fbb12a2a13e903f6c30e167456a5 100644 --- a/pgproto/CMakeLists.txt +++ b/pgproto/CMakeLists.txt @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 2.8) project(protocol C) +add_compile_options( + -Wunused-label + # -Wunused-macros + -Wunused-parameter + -Wunused-variable +) + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_INCLUDE_PATH}) diff --git a/pgproto/src/postgres/postgres.c b/pgproto/src/postgres/postgres.c index 1bf8f6041b036465254a79f8c029b37553ac49e1..ad845ba47cf8a3b16e5afaa1ee1781e7a43cf17c 100644 --- a/pgproto/src/postgres/postgres.c +++ b/pgproto/src/postgres/postgres.c @@ -12,24 +12,6 @@ #include "attributes.h" #include "tarantool/trivia/util.h" -/** - * Format of ReadyForQuery message. - * ReadyForQuery informs the frontend that it can safely send a new command. -*/ -struct ready_for_query_message { - /** Type byte, equals 'Z' */ - uint8_t type; - /** Packet length without the type byte, including len field itself. */ - uint32_t len; - /** - * Current backend transaction status indicator. - * Possible values are 'I' if idle (not in a transaction block); - * 'T' if in a transaction block; or 'E' if in a failed transaction - * block (queries will be rejected until block is ended). - */ - uint8_t transaction_status; -}; - /** * Send ReadyForQuery message. * ReadyForQuery informs the frontend that it can safely send a new command. @@ -45,16 +27,6 @@ send_ready_for_query(struct pg_port *port) pg_flush(port); } -/** Query message format. */ -struct query_message { - /** Type byte. Equals 'Q' */ - uint8_t type; - /** Message length, including the len field. */ - uint32_t len; - /** The query string. */ - const char *query; -}; - #define COMPARE_AND_RETURN_IF_EQUALS(query, tag) \ if (strncasecmp(query, tag, strlen(tag)) == 0) \ return tag @@ -267,6 +239,7 @@ send_data_row(struct pg_port *port, const char **data, const struct row_description *row_desc, uint16_t format) { + (void)format; pg_begin_msg(port, 'D'); pg_write_uint16(port, row_desc->natts); const struct pg_attribute *atts = row_desc->atts; diff --git a/pgproto/src/server/server.c b/pgproto/src/server/server.c index 60bb8e0622e1502a20bc37090f42e213d7d1b550..9e026f3c672f54b2fdbecce05dd6f9a4a5a6ce5e 100644 --- a/pgproto/src/server/server.c +++ b/pgproto/src/server/server.c @@ -270,6 +270,7 @@ server_should_try_again(int err) static int server_worker(va_list args) { + (void)args; say_info("server has been started"); while (! fiber_is_cancelled()) { if (server_wait_for_connection()) {