Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Jul 31, 2024
1 parent fd1c804 commit f2e41c9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions sql/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,18 @@ impl TryFrom<(&DataType, &str)> for Value {
let decoder = ValueDecoder {};
decoder.read_field(t, &mut reader)
}
DataType::Nullable(inner) => {
if v == NULL_VALUE {
Ok(Self::Null)
} else {
Self::try_from((inner.as_ref(), v))
DataType::Nullable(inner) => match inner.as_ref() {
DataType::String => Ok(Self::String(v.to_string())),
_ => {
// not string type, try to check if it is NULL
// for compatible with old version server
if v == NULL_VALUE {
Ok(Self::Null)
} else {
Self::try_from((inner.as_ref(), v))
}
}
}
},
}
}
}
Expand Down

0 comments on commit f2e41c9

Please sign in to comment.