So in order to see this actually work I wrote a small test:vsql returns the following informational messages:
0 to the shell if it finished normally
1 if a fatal error of its own (out of memory, file not found) occurs
2 if the connection to the server went bad and the session was not interactive
3 if an error occurred in a script and the variable ON_ERROR_STOP was set
Code: Select all
#!/bin/bash
set -e # If a command returns a non-zero exitcode, terminate the shell with an error.
source /opt/vertica/load/scripts/vertica_load.cfg
$VSQL -d $VSQL_DBNAME -U $VSQL_USERNAME -w $VSQL_PASSWORD -f error_testing.sql
echo $?
exit 0
As expected I get the no such file or directory error, but it has an exit-status 0. Shouldn’t that be an exit-status 1? What am I missing here?executing script: /opt/vertica/load/scripts/vertica_db/error_testing
error_testing.sql: No such file or directory
0
[SSH] exit-status: 0
Finished: SUCCESS