Fix redundant messages when log_client_messages is enabled.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 1 Aug 2018 07:42:46 +0000 (16:42 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 1 Aug 2018 07:42:46 +0000 (16:42 +0900)
Also add missing test files in the previous commit.
Patch contributed by Takuma Hoshiai.

src/test/regression/tests/019.log_client_messages/tests/copy.data [new file with mode: 0644]
src/test/regression/tests/019.log_client_messages/tests/describe.data [new file with mode: 0644]
src/test/regression/tests/019.log_client_messages/tests/extended_query.data [new file with mode: 0644]
src/test/regression/tests/019.log_client_messages/tests/function.data [new file with mode: 0644]
src/test/regression/tests/019.log_client_messages/tests/simple.data [new file with mode: 0644]

diff --git a/src/test/regression/tests/019.log_client_messages/tests/copy.data b/src/test/regression/tests/019.log_client_messages/tests/copy.data
new file mode 100644 (file)
index 0000000..8795fc3
--- /dev/null
@@ -0,0 +1,30 @@
+# Test for copy protocol
+
+# create test table
+'Q'    "CREATE TABLE t1(a text)"
+'Y'
+
+# CopyIn
+#
+'Q'    "COPY t1 FROM STDIN"
+# CopyData
+'d'    "abc"
+# CopyDone
+'c'
+'Y'
+
+# CopyOut
+#
+'Q'    "COPY t1 TO STDOUT"
+'Y'
+
+#
+# Copy fail case
+#
+'Q'    "COPY t1 FROM STDIN"
+# CopyData
+'d'    "abc"
+# CopyFail
+'f'    "pgproto copy fail test"
+'Y'
+'X'
diff --git a/src/test/regression/tests/019.log_client_messages/tests/describe.data b/src/test/regression/tests/019.log_client_messages/tests/describe.data
new file mode 100644 (file)
index 0000000..212653f
--- /dev/null
@@ -0,0 +1,12 @@
+# Test for Describe Flush command protocol
+
+# SELECT 1 FROM pgbench_accounts
+'P'    "S4"    "SELECT 1 FROM pgbench_accounts"        0
+'B'    ""      "S4"    0       0       0
+'D'    'S'     "S4"
+'E'    ""      0
+'H'
+'y'
+'S'
+'Y'
+'X'
diff --git a/src/test/regression/tests/019.log_client_messages/tests/extended_query.data b/src/test/regression/tests/019.log_client_messages/tests/extended_query.data
new file mode 100644 (file)
index 0000000..357f09e
--- /dev/null
@@ -0,0 +1,21 @@
+# Test for extended-query protocol
+
+# Start a transaction
+'P'    "S1"    "BEGIN" 0
+'B'    ""      "S1"    0       0       0
+'E'    ""      0
+'C'    'S'     "S1"
+
+# Issue SELECT
+'P'    "S2"    "SELECT 1 FROM pgbench_accounts"        0
+'B'    "P1"    "S2"    0       0       0
+'E'    "P1"    50000
+'C'    'S'     "S2"
+# Issue COMMIT
+'P'    "S3"    "COMMIT"        0
+'B'    ""      "S3"    0       0       0
+'E'    ""      0
+'C'    'S'     "S3"
+'S'
+'Y'
+'X'
diff --git a/src/test/regression/tests/019.log_client_messages/tests/function.data b/src/test/regression/tests/019.log_client_messages/tests/function.data
new file mode 100644 (file)
index 0000000..904a50d
--- /dev/null
@@ -0,0 +1,15 @@
+# Test for FunctionCall protocol
+
+#
+# Test data example
+#
+
+# Function call (lo_creat)
+# from PostgreSQL's src/include/catalog/pg_proc.data
+# { oid => '957', descr => 'large object create',
+#  proname => 'lo_creat', provolatile => 'v', proparallel => 'u',
+#  prorettype => 'oid', proargtypes => 'int4', prosrc => 'be_lo_creat' },
+
+'F'    957     1       0       1       1       "0"     0
+'Y'
+'X'
diff --git a/src/test/regression/tests/019.log_client_messages/tests/simple.data b/src/test/regression/tests/019.log_client_messages/tests/simple.data
new file mode 100644 (file)
index 0000000..4074339
--- /dev/null
@@ -0,0 +1,4 @@
+# Test for simple-query protocol 'Q'
+'Q'    "SELECT * FROM pgbench_accounts LIMIT 1"
+'Y'
+'X'