forked from MaterializeInc/materialize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy-from-fail.pt
53 lines (44 loc) · 1.11 KB
/
copy-from-fail.pt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
send
Query {"query": "DROP TABLE IF EXISTS t"}
----
until ignore=NoticeResponse
ReadyForQuery
----
CommandComplete {"tag":"DROP TABLE"}
ReadyForQuery {"status":"I"}
send
Query {"query": "CREATE TABLE t (i INT8, t TEXT)"}
----
until
ReadyForQuery
----
CommandComplete {"tag":"CREATE TABLE"}
ReadyForQuery {"status":"I"}
# send CopyFail and check the remaining messages are ignored until Sync is sent
send
Query {"query": "COPY t FROM STDIN"}
CopyData "1\tblah\n"
CopyFail "frontend failure"
CopyData "2\t\n"
CopyData "\\.\n"
CopyDone
Sync
Query {"query": "SELECT * FROM t ORDER BY i"}
----
until ignore=RowDescription
ReadyForQuery
ReadyForQuery
----
CopyIn {"format":"text","column_formats":["text","text"]}
ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"57014"},{"typ":"M","value":"COPY from stdin failed: frontend failure"}]}
ReadyForQuery {"status":"I"}
ReadyForQuery {"status":"I"}
send
Query {"query": "DROP TABLE IF EXISTS t"}
----
until ignore=NoticeResponse
ReadyForQuery
----
RowDescription {"fields":[{"name":"i"},{"name":"t"}]}
CommandComplete {"tag":"SELECT 0"}
ReadyForQuery {"status":"I"}