Issue Details (XML | Word | Printable)

Key: CORE-1412
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Claudio Valderrama C.
Reporter: Kuznetsov Eugene
Votes: 0
Watchers: 0

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

Some bugs in GSTAT's parameters processing

Created: 12/Aug/07 02:20 PM   Updated: 19/Jan/16 05:07 AM
Component/s: GSTAT
Affects Version/s: 1.5.4, 2.0.1, 2.1 Alpha 1, 2.1 Beta 1
Fix Version/s: 2.5 Beta 2

QA Status: No test

 Description  « Hide
As long as all these bugs are closely related and
easy to resolve, I decided merge them into single post, not
to soil the tracker.

1. GSTAT allows inputting several database's names, but all actions
will be executed for the last one.

gstat -h localhost:employee -user SYSDBA -password masterkey localhost:help

returns header page for localhost:help instead of error message.

2. GSTAT doesn't return error message if switch -t is used without relation name

gstat -a localhost:employee -user SYSDBA -password masterkey -t

returns header info and 'Analyzing database pages ...' instead of error message

3. GSTAT doesn't return error message if switch -t is used, but only header info
is queried

gstat -h localhost:employee -user SYSDBA -password masterkey -t COUNTRY

4. GSTAT does not parse -t switch correctly, if's met before database name

Example: gstat -a -t COUNTRY localhost:employee -user SYSDBA -password masterkey
returns 'please retry, giving a database name'

If we look at dba.epp, we'll see next code

                 sw_relation = true;
                 while (argv < end && **argv != '-') {
                     if (strlen(*argv) > MAX_SQL_IDENTIFIER_LEN) {
So, -t will be correctly processing, only if another switch is found later or one is the
last switch in parameter string.

To resolve this, I suppose, we need to change syntax and prohibit using
several relation names after -t switch. In other words,

gstat -a localhost:employee -user SYSDBA -password masterkey -t COUNTRY CUSTOMER

should return error.

With best regards, Eugene

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Claudio Valderrama C. added a comment - 24/Jun/09 05:42 AM
1.- Now it shows error with two database names
2.- This was an internal option that was made public. Now it checks that at least one table was given
3.- Not only -t, but most switches had unchecked conflict with -h; fixed now
4.- If gstat -t didn't receive yet the db name, it accepts only one table. If it got the db name already, it does the old logic.