github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/pgwire/testdata/pgtest/char (about) 1 # Prepare the environment. 2 3 send 4 Query {"String": "DROP TABLE IF EXISTS a"} 5 ---- 6 7 until 8 ReadyForQuery 9 ---- 10 {"Type":"CommandComplete","CommandTag":"DROP TABLE"} 11 {"Type":"ReadyForQuery","TxStatus":"I"} 12 13 # Start of test. 14 15 send 16 Query {"String": "CREATE TABLE a (a INT PRIMARY KEY)"} 17 ---- 18 19 until 20 ReadyForQuery 21 ---- 22 {"Type":"CommandComplete","CommandTag":"CREATE TABLE"} 23 {"Type":"ReadyForQuery","TxStatus":"I"} 24 25 send 26 Query {"String": "INSERT INTO a VALUES(1)"} 27 ---- 28 29 until 30 ReadyForQuery 31 ---- 32 {"Type":"CommandComplete","CommandTag":"INSERT 0 1"} 33 {"Type":"ReadyForQuery","TxStatus":"I"} 34 35 # Make sure that values casted to "char" get their type oid and type size 36 # reported correctly via pgwire. 37 38 send 39 Query {"String": "SELECT 'a'::\"char\" FROM a"} 40 ---- 41 42 until 43 ReadyForQuery 44 ---- 45 {"Type":"RowDescription","Fields":[{"Name":"char","TableOID":0,"TableAttributeNumber":0,"DataTypeOID":18,"DataTypeSize":1,"TypeModifier":-1,"Format":0}]} 46 {"Type":"DataRow","Values":[{"text":"a"}]} 47 {"Type":"CommandComplete","CommandTag":"SELECT 1"} 48 {"Type":"ReadyForQuery","TxStatus":"I"}