Setup
$ mycli --execute 'source 1.sql' test_database
where 1.sql contains a special command (source, \T, etc.):
SELECT 1;
\T ascii; -- In addition to `\T`, I also confirmed with a nested `source`
SELECT 2;
Expected Behavior
Actual Behavior
-
Processing the file is aborted right after encountering a special command (this is preferable).
- In other words,
SELECT 1 is executed while SELECT 2 is not executed.
-
No error message is printed.
-
The command returns 0 as the exit status.
System
- mycli version: v2.13.2
- OS/version: Alpine Linux
Cause (AI-generated, unverified)
The problem is that the rejection is returned as an SQLResult.status.
The --execute path does not render that status and treats the completed
run_query() call as success, causing silent partial execution with exit
status 0.
Setup
$ mycli --execute 'source 1.sql' test_databasewhere
1.sqlcontains a special command (source,\T, etc.):Expected Behavior
An error message is printed.
The command returns a non-zero exit status.
Actual Behavior
Processing the file is aborted right after encountering a special command (this is preferable).
SELECT 1is executed whileSELECT 2is not executed.No error message is printed.
The command returns
0as the exit status.System
Cause (AI-generated, unverified)
The problem is that the rejection is returned as an
SQLResult.status.The
--executepath does not render that status and treats the completedrun_query()call as success, causing silent partial execution with exitstatus
0.