KassaSana commented on code in PR #25807:
URL: https://github.com/apache/datafusion/pull/25807#discussion_r4213938162


##########
datafusion-cli/src/exec.rs:
##########
@@ -183,10 +186,12 @@ pub async fn exec_from_repl(
                             continue
                         },
                     }
-                    // dialect might have changed
-                    rl.helper_mut().unwrap().set_dialect(
-                        
&ctx.task_ctx().session_config().options().sql_parser.dialect,
-                    );
+                    // dialect or recursion limit might have changed
+                    let task_ctx = ctx.task_ctx();
+                    let sql_parser = 
&task_ctx.session_config().options().sql_parser;
+                    let helper = rl.helper_mut().unwrap();
+                    helper.set_dialect(&sql_parser.dialect);
+                    
helper.set_recursion_limit(sql_parser.recursion_limit.get());

Review Comment:
   Good catch, thanks. You're right: the helper only got refreshed after SQL 
input, so a `\i` that raised the limit never reached it.
   
   Fixed in 91f61d594. The sync now runs at the top of the REPL loop, right 
before each `readline`, so SQL, `\i` and the other backslash commands are all 
covered. I removed the old post-SQL refresh, since nothing reads the helper 
between there and the next read. The `continue` in the Ctrl-C arm went too, 
since clippy flagged it as redundant.
   
   I reproduced it through a pty on the previous commit (`\i` setting the limit 
to 100, then a 60-deep query: held as incomplete, never ran). On the fix it 
runs. A directly typed `SET` and the default-limit rejection behave as before.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to