Issue Details (XML | Word | Printable)

Key: CORE-5256
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Pavel Zotov
Votes: 0
Watchers: 2

If you were logged in you would be able to see more operations.
Firebird Core

SHOW <X> should produce WARNING rather than ERROR when <X> does not exist in database

Created: 02/Jun/16 08:57 PM   Updated: 03/Jun/16 11:04 AM
Component/s: ISQL
Affects Version/s: 2.5.5, 4.0 Initial, 3.0.0
Fix Version/s: None

QA Status: No test

 Description  « Hide
Consider this script:

set echo on;
set bail on;
show domain;
show database;

Run it via batch:

@echo off
C:\MIX\firebird\fb30\isql /:e30 -i show-grant-when-bail-on.sql
if errorlevel 1 echo Error occured inside SQL script.

Output will be:

set bail on;
show domain;
There are no domains in this database
Error occured inside SQL script.

Command 'show database;' (and all subsequent ones) was not executed because of set bail = ON. But this case (when there is no domain or other object type) not neccessary should be considered as ERROR!

Can ISQL be improved in such way that message "There are no <...> in this database" will be WARNING rather than ERROR ? (of course it should be redirected in STDERR as before).

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 03/Jun/16 08:41 AM
Why not use slightly modified scrypt:

set echo on;
set bail off;
show domain;
show database;
set bail on;

Next time you would like to ignore errors from some specific COMMIT :)

Pavel Zotov added a comment - 03/Jun/16 11:04 AM
1) Your sample requires two additive commands every time I need to show objects.
2) I do not offer to ignore absence of <X>, just to consider it as warning.