* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2023 PgPool Global Development Group
+ * Copyright (c) 2003-2024 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
/*
* Process Query('Q') message
* Query messages include an SQL string.
+ * If frontend == NULL, we are called in case of reset queries.
*/
POOL_STATUS
SimpleQuery(POOL_CONNECTION * frontend,
/*
* Check if extended query protocol message ended. If not, reject the
* query and raise an error to terminate the session to avoid hanging up.
+ * However if we are processing a reset query (frontend == NULL), we skip
+ * the check as we don't want to raise a error.
*/
if (SL_MODE)
{
- if (pool_is_doing_extended_query_message() ||
- pool_pending_message_head_message())
+ if (frontend != NULL &&
+ (pool_is_doing_extended_query_message() ||
+ pool_pending_message_head_message()))
ereport(FATAL,
(errmsg("simple query \"%s\" arrived before ending an extended query message",
./startall
wait_for_pgpool_startup
+# test1:
# Wait for 1 seconds before pgproto ended.
# Usually 1 seconds should be enough to finish pgproto.
# If test suceeded, pgpool emits an error message:
if [ $? != 0 ];then
# timeout happened or pgproto returned non 0 status
- echo "test failed."
+ echo "test1 failed."
./shutdownall
exit 1
fi
+
+# test2:
+# Check if reset queries can be executed even if extended query messages
+# do not end.
+timeout 1 $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto2.data
+if [ $? != 0 ];then
+# timeout happened or pgproto returned non 0 status
+ echo "test2 failed."
+ ./shutdownall
+ exit 1
+fi
+
./shutdownall
exit 0