You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Dongming Zhao (Jira)" <ji...@apache.org> on 2022/03/01 04:16:00 UTC
[jira] [Created] (IOTDB-2634) Cli exit current cmd.exe instead of the start-cli.bat script file
Dongming Zhao created IOTDB-2634:
------------------------------------
Summary: Cli exit current cmd.exe instead of the start-cli.bat script file
Key: IOTDB-2634
URL: https://issues.apache.org/jira/browse/IOTDB-2634
Project: Apache IoTDB
Issue Type: Bug
Components: Client/CLI
Environment: Windows OS
Reporter: Dongming Zhao
Attachments: 1.png
The EXIT command was added to start-cli.bat in IOTDB-2523 to make sure the script exit/return with the correct Exit Code. However, the EXIT *terminates current cmd.exe* instead of just exiting the .bat script file. They are the same while using CLI by double-click on the .bat file, as the activated cmd.exe is temporal and will always be terminated by OS when the script exits. But when we pre-activate a cmd.exe window and call the start-cli.bat by file name/path, the EXIT will close the window and {*}prevent subsequent user commands{*}. (By the way, Windows PowerShell is not affected.) Things are similar when we call the start-cli.bat with CALL clause from another .bat script and no commands after CALL will be executed.
One of the most affected thing is the register-UDF.bat for UDF-Library, which is using multiple CALL start-cli.bat commands to register all UDF functions. Now the script will exit once after the first CALL is executed, and the following functions will not be registered at all.
The way to fix this is adding the parameter /B for EXIT command(EXIT /B %ret_code%), which makes the EXIT only affect the current .bat script and return to the caller script or cmd.exe window.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)