-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
notice
92 lines (70 loc) · 2.13 KB
/
notice
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Test notices work as expected by creating a VIEW on a TEMP TABLE.
# Prepare the environment.
send
Query {"String": "DROP TABLE IF EXISTS t CASCADE"}
----
until ignore=NoticeResponse
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"DROP TABLE"}
{"Type":"ReadyForQuery","TxStatus":"I"}
# Start of test.
send
Query {"String": "CREATE TABLE t(x INT, y INT)"}
----
until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"CREATE TABLE"}
{"Type":"ReadyForQuery","TxStatus":"I"}
send
Query {"String": "CREATE INDEX t_x_idx ON t(x)"}
----
until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"CREATE INDEX"}
{"Type":"ReadyForQuery","TxStatus":"I"}
send
Query {"String": "CREATE INDEX t_y_idx ON t(y)"}
----
until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"CREATE INDEX"}
{"Type":"ReadyForQuery","TxStatus":"I"}
# Check that crdb reports a notice upon drop index.
send
Query {"String": "DROP INDEX t_x_idx"}
----
until crdb_only
CommandComplete
----
{"Severity":"NOTICE","SeverityUnlocalized":"","Code":"00000","Message":"the data for dropped indexes is reclaimed asynchronously","Detail":"","Hint":"The reclamation delay can be customized in the zone configuration for the table.","Position":0,"InternalPosition":0,"InternalQuery":"","Where":"","SchemaName":"","TableName":"","ColumnName":"","DataTypeName":"","ConstraintName":"","File":"drop_index.go","Line":519,"Routine":"dropIndexByName","UnknownFields":null}
{"Type":"CommandComplete","CommandTag":"DROP INDEX"}
until noncrdb_only
CommandComplete
----
{"Type":"CommandComplete","CommandTag":"DROP INDEX"}
until
ReadyForQuery
----
{"Type":"ReadyForQuery","TxStatus":"I"}
# Disable notices and assert now it is not sent.
send crdb_only
Query {"String": "SET CLUSTER SETTING sql.notices.enabled = false"}
----
until crdb_only
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"SET CLUSTER SETTING"}
{"Type":"ReadyForQuery","TxStatus":"I"}
# Check that the notice is not printed any more.
send
Query {"String": "DROP INDEX t_y_idx"}
----
until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"DROP INDEX"}
{"Type":"ReadyForQuery","TxStatus":"I"}