Skip to content

Commit

Permalink
feat(cubesql): Allow ::information_schema.cardinal_number casting
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou authored and ovr committed May 27, 2022
1 parent 759d2fa commit b198fb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rust/cubesql/cubesql/src/sql/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl<'ast> Visitor<'ast> for CastReplacer {
{
match data_type {
ast::DataType::Custom(name) => match name.to_string().as_str() {
"oid" => {
"oid" | "information_schema.cardinal_number" => {
self.visit_expr(&mut *cast_expr);

*expr = *cast_expr.clone();
Expand Down Expand Up @@ -679,6 +679,8 @@ mod tests {

run_cast_replacer("SELECT 'pg_class'::regclass::oid", "SELECT 1259")?;

run_cast_replacer("SELECT 64::information_schema.cardinal_number", "SELECT 64")?;

Ok(())
}

Expand Down

0 comments on commit b198fb3

Please sign in to comment.