fix set variables
@@ -46,12 +46,16 @@ impl<'a> Binder {
let variable = variable.name.clone();
let box (value, _) = type_checker.resolve_literal(value, None)?;
- let value = String::from_utf8(
- value
- .as_string()
- .ok_or_else(|| ErrorCode::Internal("Invalid variable value"))?
- .clone(),
- )?;
+ let value = match value {
+ common_expression::Literal::UInt64(v) => format!("{v}"),
+ common_expression::Literal::Float64(v) => format!("{v}"),
+ common_expression::Literal::String(v) => {
+ String::from_utf8(v).map_err(|_| ErrorCode::Internal("Invalid variable value"))?
+ }
+ common_expression::Literal::Boolean(v) => format!("{v}"),
+ common_expression::Literal::Null => "NULL".to_string(),
+ _ => return Err(ErrorCode::Internal("Invalid variable value")),
+ };
let vars = vec![VarValue {
is_global,
