From f12663c1864f31e1f907747001167f217831ed11 Mon Sep 17 00:00:00 2001 From: Ye Sijun Date: Wed, 30 Mar 2022 11:40:48 +0800 Subject: [PATCH] Invaild column definitions lead to incorrect mariadb-client behavior Signed-off-by: Ye Sijun --- mysql/src/lib.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/mysql/src/lib.rs b/mysql/src/lib.rs index 0e10c72..d03fbdf 100644 --- a/mysql/src/lib.rs +++ b/mysql/src/lib.rs @@ -561,18 +561,11 @@ impl>> + Send + Sync, S: AsyncRead + AsyncWrite // NOTE: spec dictates no response from server } Command::ListFields(_) => { - let cols = &[Column { - table: String::new(), - column: "not implemented".to_owned(), - coltype: myc::constants::ColumnType::MYSQL_TYPE_SHORT, - colflags: myc::constants::ColumnFlags::UNSIGNED_FLAG, - }]; - writers::write_column_definitions_41( - cols, - &mut self.writer, - self.client_capabilities, - true, - )?; + // mysql_list_fields (CommandByte::COM_FIELD_LIST / 0x04) has been deprecated in mysql 5.7 + // and will be removed in a future version. + // The mysql command line tool issues one of these commands after switching databases with USE . + // Return a invalid column definitions lead to incorrect mariadb-client behaviour, + // see https://github.com/datafuselabs/databend/issues/4439 let ok_packet = OkResponse { header: 0xfe, ..Default::default()