From: Neil M. <nm...@us...> - 2001-05-21 00:20:35
|
Update of /cvsroot/firebird/interbase/isql In directory usw-pr-cvs1:/tmp/cvs-serv3062/isql Modified Files: isql.e Log Message: Add new option PLANONLY - if on and plan on isql will display query plan but not execute query. Requires changes to messages file if it is to be displayed in help output. Index: isql.e =================================================================== RCS file: /cvsroot/firebird/interbase/isql/isql.e,v retrieving revision 1.8 retrieving revision 1.9 diff -U3 -r1.8 -r1.9 --- isql.e 2001/01/28 10:38:09 1.8 +++ isql.e 2001/05/21 00:20:31 1.9 @@ -28,6 +28,7 @@ Apparently this has to be done in show.e also, but that is for another day :-) + 2001/05/20 Neil McCalden add planonly option */ #include "../jrd/ib_stdio.h" @@ -197,6 +198,7 @@ static SSHORT List = FALSE; static SSHORT Docount = FALSE; static SSHORT Plan = FALSE; +static SSHORT Planonly = FALSE; static int Termlen = 0; static SCHAR ISQL_charset[MAXCHARSET_LENGTH] = {0}; static IB_FILE *Diag; @@ -1855,6 +1857,7 @@ List = FALSE; Docount = FALSE; Plan = FALSE; +Planonly = FALSE; Doblob = 1; Time_display = FALSE; Sqlda_display = FALSE; @@ -1932,6 +1935,7 @@ Autofetch = TRUE; Docount = FALSE; Plan = FALSE; +Planonly = FALSE; Doblob = 1; Time_display = FALSE; Sqlda_display = FALSE; @@ -4173,6 +4177,13 @@ ret = do_set_command (parms[2], &List); else if (!strcmp (parms [1], "PLAN")) ret = do_set_command (parms[2], &Plan); + else if (!strcmp (parms [1], "PLANONLY")) + { + ret = do_set_command (parms[2], &Planonly); + if ( Planonly && (! Plan) ) + /* turn on plan */ + ret = do_set_command ("ON", &Plan); + } else if ((!strcmp (parms [1], "BLOBDISPLAY")) || (!strcmp (parms [1], "BLOB"))) { @@ -5469,6 +5480,9 @@ ISQL_printf (Out, "Access Plan: "); ISQL_printf (Out, (Plan ? "ON" : "OFF")); ISQL_printf (Out, NEWLINE); +ISQL_printf (Out, "Access Plan only: "); +ISQL_printf (Out, (Planonly ? "ON" : "OFF")); +ISQL_printf (Out, NEWLINE); ISQL_printf (Out, "Display BLOB type: "); if (Doblob == ALL_BLOBS) ISQL_printf (Out, "ALL"); @@ -7456,6 +7470,9 @@ ISQL_printf (Diag, Print_buffer); } ISQL_FREE (plan_buffer); + + if (Planonly) return ret; /* do not execute */ + } /* If the statement isn't a select, execute it and be done */ |