@@ -64,13 +64,14 @@ where
6464 w. write_u16 :: < LittleEndian > ( 0 ) ?; // number of warnings
6565 w. end_packet ( ) ?;
6666
67- write_column_definitions ( pi, w, true ) ?;
68- write_column_definitions ( ci, w, true )
67+ write_column_definitions ( pi, w, false , true ) ?;
68+ write_column_definitions ( ci, w, false , true )
6969}
7070
7171pub ( crate ) fn write_column_definitions < ' a , I , W > (
7272 i : I ,
7373 w : & mut PacketWriter < W > ,
74+ is_comm_field_list_response : bool ,
7475 only_eof_on_nonempty : bool ,
7576) -> io:: Result < ( ) >
7677where
9495 w. write_u16 :: < LittleEndian > ( c. colflags . bits ( ) ) ?;
9596 w. write_all ( & [ 0x00 ] ) ?; // decimals
9697 w. write_all ( & [ 0x00 , 0x00 ] ) ?; // unused
98+
99+ if is_comm_field_list_response {
100+ // We should write length encoded int with string size
101+ // followed by string with some "default values" (possibly it's column defaults).
102+ // But we just send NULL for simplicity
103+ w. write_u8 ( 0xfb ) ?;
104+ }
105+
97106 w. end_packet ( ) ?;
98107 empty = false ;
99108 }
@@ -114,5 +123,5 @@ where
114123 let i = i. into_iter ( ) ;
115124 w. write_lenenc_int ( i. len ( ) as u64 ) ?;
116125 w. end_packet ( ) ?;
117- write_column_definitions ( i, w, false )
126+ write_column_definitions ( i, w, false , false )
118127}
0 commit comments