()
| 711 | #[test] |
| 712 | #[cfg_attr(not(feature = "recursive_protection"), ignore)] |
| 713 | fn test_deeply_nested_binary_expr() -> Result<()> { |
| 714 | // Create a deeply nested binary expression tree: ((((a + a) + a) + a) + ... ) |
| 715 | // With 1000 levels of nesting, this would overflow the stack without recursion protection. |
| 716 | let depth = 1000; |
| 717 | |
| 718 | let mut expr = col("a"); |
| 719 | for _ in 0..depth { |
| 720 | expr = Expr::BinaryExpr(BinaryExpr { |
| 721 | left: Box::new(expr), |
| 722 | op: Operator::Plus, |
| 723 | right: Box::new(col("a")), |
| 724 | }); |
| 725 | } |
| 726 | |
| 727 | let schema = Schema::new(vec![Field::new("a", DataType::Int32, false)]); |
| 728 | let df_schema = DFSchema::try_from(schema)?; |
| 729 | |
| 730 | // This should not stack overflow |
| 731 | let _physical_expr = |
| 732 | create_physical_expr(&expr, &df_schema, &ExecutionProps::new())?; |
| 733 | |
| 734 | Ok(()) |
| 735 | } |
| 736 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…