blackbeam / rust-mysql-simple

Mysql client library implemented in rust.
Apache License 2.0
658 stars 144 forks source link

Error "SELECT 1,2,3,null,4,5,null,7" in version 21.0.0 #284

Closed zirill closed 3 years ago

zirill commented 3 years ago

Hello,

version 20.1.0 Rez: Bytes("1") Rez: Bytes("2") Rez: Bytes("3") Rez: Null Rez: Bytes("4") Rez: Bytes("5") Rez: Null Rez: Bytes("7")

version 21.0.0 Rez: Bytes("1") Rez: Bytes("2") Rez: Bytes("3") Rez: Null Rez: Null Rez: Null Rez: Null Rez: Null

let mut result = match conn.query_iter("SELECT 1,2,3,null,4,5,null,7") {
        Ok(r) => r,
        Err(e) => return Err(e),
};

while let Some(result_set) = result.next_set() {
        let list_row = result_set.unwrap();

        for row in list_row {
            for str in row {

                let mut idx_col = 0;
                for column in str.columns_ref() {
                    let column_value = &str[idx_col];
                    idx_col += 1;

                    println!("Rez: {:?}", column_value);
                }
            }
        }
}
blackbeam commented 3 years ago

Hi. Thanks! This seems to be the reason of blackbeam/mysql_async#162. Looking into it.

blackbeam commented 3 years ago

Should be fixed in mysql_common v0.27.4, please invoke cargo update.

zirill commented 3 years ago

Thanks!