Fix extended query communication in do_query()
authorTakuma Hoshiai <hoshiai@sraoss.co.jp>
Tue, 8 Oct 2019 07:02:20 +0000 (16:02 +0900)
committerTakuma Hoshiai <hoshiai@sraoss.co.jp>
Tue, 8 Oct 2019 07:02:20 +0000 (16:02 +0900)
do_query() didn't send Describe message to PostgreSQL.
It didn't use strcasecmp() but strcasecmp() when check if query is SELECT.

src/protocol/pool_process_query.c

index a5ebe5be395283f475a7d89c9921b8222bda87cd..1e8525c023bafa70afb8052cc856429121e3af0e 100644 (file)
@@ -1971,7 +1971,7 @@ void do_query(POOL_CONNECTION *backend, char *query, POOL_SELECT_RESULT **result
                /*
                 * Send descrive message if the query is SELECT.
                 */
-               if (!strcasecmp(query, "SELECT"))
+               if (!strncasecmp(query, "SELECT", strlen("SELECT")))
                {
                        /*
                         * Send descrive message