@@ -199,6 +199,52 @@ ReadyForQuery
199199{"Type":"CommandComplete","CommandTag":"SELECT 3"}
200200{"Type":"ReadyForQuery","TxStatus":"I"}
201201
202+ # Regression test for #119524. expect_and_ignore_not_visible_columns_in_copy
203+ # should behave correctly with inaccessible columns.
204+ send
205+ Query {"String": "CREATE TABLE t119524 (x INT PRIMARY KEY, y INT, INDEX ((x + y)))"}
206+ ----
207+
208+ until
209+ ReadyForQuery
210+ ----
211+ {"Type":"CommandComplete","CommandTag":"CREATE TABLE"}
212+ {"Type":"ReadyForQuery","TxStatus":"I"}
213+
214+ send
215+ Query {"String": "ALTER TABLE t119524 ADD COLUMN z INT NOT VISIBLE"}
216+ ----
217+
218+ until
219+ ReadyForQuery
220+ ----
221+ {"Type":"CommandComplete","CommandTag":"ALTER TABLE"}
222+ {"Type":"ReadyForQuery","TxStatus":"I"}
223+
224+ send crdb_only
225+ Query {"String": "COPY t119524 FROM STDIN"}
226+ CopyData {"Data": "1\t2\t3\n"}
227+ CopyDone
228+ ----
229+
230+ until crdb_only
231+ ReadyForQuery
232+ ----
233+ {"Type":"CopyInResponse","ColumnFormatCodes":[0,0]}
234+ {"Type":"CommandComplete","CommandTag":"COPY 1"}
235+ {"Type":"ReadyForQuery","TxStatus":"I"}
236+
237+ send crdb_only
238+ Query {"String": "SELECT *, z FROM t119524"}
239+ ----
240+
241+ until ignore=RowDescription crdb_only
242+ ReadyForQuery
243+ ----
244+ {"Type":"DataRow","Values":[{"text":"1"},{"text":"2"},null]}
245+ {"Type":"CommandComplete","CommandTag":"SELECT 1"}
246+ {"Type":"ReadyForQuery","TxStatus":"I"}
247+
202248send crdb_only
203249Query {"String": "SET expect_and_ignore_not_visible_columns_in_copy = false"}
204250----
0 commit comments