Gmail Agenda Documenten Reader Het internet meer »
Onlangs bekeken groepen | Help | Aanmelden
Google Discussiegroepen Startpagina
10.2 Bug?
Er zijn momenteel te veel onderwerpen in deze discussiegroep die als eerste worden weergegeven. Als je dit onderwerp als eerste wilt weergeven, moet je deze optie verwijderen van een ander onderwerp.
Er is een fout opgetreden bij het verwerken van je verzoek. Probeer het opnieuw.
Markeren
  6 berichten - Alles uitvouwen  -  Alles naar het vertalen Vertaald (alle originelen weergeven)
De groep waarnaar je een bericht verzendt, is een Usenet-groep. Berichten die je in deze groep verzendt, zijn zichtbaar voor iedereen op het Internet
Je antwoord is niet verzonden.
Uw bericht is geplaatst
 
Van:
Aan:
Cc:
Reactie op:
Cc toevoegen | Reactie toevoegen | Onderwerp bewerken
Onderwerp:
Validatie:
Typ ter verificatie de tekens uit de onderstaande afbeelding of de getallen die je hoort wanneer je klikt op het pictogram voor toegankelijkheid. Luister en typ de nummers die je hoort
 
DA Morgan  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 8 feb 2006, 18:07
Nieuwsgroepen: comp.databases.oracle.server
Van: DA Morgan <damor...@psoug.org>
Datum: Wed, 08 Feb 2006 09:07:40 -0800
Lokaal: wo 8 feb 2006 18:07
Onderwerp: 10.2 Bug?
I know ... I know ... but this seems to be worth reporting but I would
like someone else to confirm it.

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 8 09:05:54 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL>  ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';

Session altered.

SQL>  CREATE OR REPLACE PROCEDURE dead_code AS
   2   x NUMBER := 10;
   3  BEGIN
   4    IF x = 10 THEN
   5      x := 20;
   6    ELSE
   7      x := 100; -- dead code (never reached)
   8    END IF;
   9  END dead_code;
  10  /

SP2-0804: Procedure created with compilation warnings

SQL> show err
Errors for PROCEDURE DEAD_CODE:

LINE/COL ERROR
-------- -------------------------------------------------------------
4/8      PLW-06002: Unreachable code
7/5      PLW-06002: Unreachable code
SQL>

This change in behaviour, reporting line 4 as unreachable, did not occur
in 10.1.0.4.

Thanks.
--
Daniel A. Morgan
http://www.psoug.org
damor...@x.washington.edu
(replace x with u to respond)


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Jim Smith  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 8 feb 2006, 18:26
Nieuwsgroepen: comp.databases.oracle.server
Van: Jim Smith <j...@jimsmith.demon.co.uk>
Datum: Wed, 8 Feb 2006 17:26:54 +0000
Lokaal: wo 8 feb 2006 18:26
Onderwerp: Re: 10.2 Bug?
In message <1139418452.832...@jetspin.drizzle.com>, DA Morgan
<damor...@psoug.org> writes

I can reproduce it on 10.2.0.1.0 on Linux. (Although strangely, not
using 9.2 sql*plus)

--
Jim Smith
I'm afraid you've mistaken me for someone who gives a damn.


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Andy Hassall  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
(1 gebruiker)  Meer opties 8 feb 2006, 19:47
Nieuwsgroepen: comp.databases.oracle.server
Van: Andy Hassall <a...@andyh.co.uk>
Datum: Wed, 08 Feb 2006 18:47:47 +0000
Lokaal: wo 8 feb 2006 19:47
Onderwerp: Re: 10.2 Bug?

 Interesting - it looks like a result of the new PL/SQL optimiser - so perhaps
an unexpected result, but not necessarily a bug.

 An optimiser capable of realising that line 7 cannot be reached because both
the value of "x" and the value it's compared to on line 4 are constant can go
further and completely remove the conditional since it'll never be false.

 It seems this is exactly what the optimizer now does. It's transforming the
source code, but Oracle seems to have a decent go at matching the warnings back
to the original source - but the optimisation process marks the optimised-away
conditional as dead code.

 Consider: (procedure previously loaded as per your original message):

SQL> ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=0;

Session altered.

SQL> alter procedure dead_code compile;

Procedure altered.

SQL> show errors
No errors.

SQL> ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=1;

Session altered.

SQL> alter procedure dead_code compile;

SP2-0805: Procedure altered with compilation warnings

SQL> show errors
Errors for PROCEDURE DEAD_CODE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
7/5      PLW-06002: Unreachable code

SQL> ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=2;

Session altered.

SQL> alter procedure dead_code compile;

SP2-0805: Procedure altered with compilation warnings

SQL> show errors
Errors for PROCEDURE DEAD_CODE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/8      PLW-06002: Unreachable code
7/5      PLW-06002: Unreachable code

 I bet you've got PLSQL_OPTIMIZE_LEVEL=2 (as that's the default). As with
debugging any compiled language, trying to trace back to line numbers in the
original source for optimised output presents problems.

 Interesting that PLSQL_OPTIMIZE_LEVEL=0 ends up disabling the warnings - now
_that_ might be a bug as I can't immediately find a reference that says it's
got to be at least 1 for PLSQL_WARNINGS to work.

 Looks like PLSQL_OPTIMIZE_LEVEL=1 is the level to keep it at whilst developing
and debugging.

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/ini...
"
PLSQL_OPTIMIZE_LEVEL specifies the optimization level that will be used to
compile PL/SQL library units. The higher the setting of this parameter, the
more effort the compiler makes to optimize PL/SQL library units.

Values:

    * 0

      Maintains the evaluation order and hence the pattern of side effects,
exceptions, and package initializations of Oracle9i and earlier releases. Also
removes the new semantic identity of BINARY_INTEGER and PLS_INTEGER and
restores the earlier rules for the evaluation of integer expressions. Although
code will run somewhat faster than it did in Oracle9i, use of level 0 will
forfeit most of the performance gains of PL/SQL in Oracle Database 10g.

    * 1

      Applies a wide range of optimizations to PL/SQL programs including the
elimination of unnecessary computations and exceptions, but generally does not
move source code out of its original source order.

    * 2

      Applies a wide range of modern optimization techniques beyond those of
level 1 including changes which may move source code relatively far from its
original location.

Generally, setting this parameter to 2 pays off in better execution
performance. If, however, the compiler runs slowly on a particular source
module or if optimization does not make sense for some reason (for example,
during rapid turnaround development), then setting this parameter to 1 will
result in almost as good a compilation with less use of compile-time resources.
"

--
Andy Hassall :: a...@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
DA Morgan  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 9 feb 2006, 00:02
Nieuwsgroepen: comp.databases.oracle.server
Van: DA Morgan <damor...@psoug.org>
Datum: Wed, 08 Feb 2006 15:02:52 -0800
Lokaal: do 9 feb 2006 00:02
Onderwerp: Re: 10.2 Bug?

Thanks. I've duplicated your test changing the optimizer level and you
seem to be correct. From where I stand, looking at how it performs I'd
say it is (if not a bug) not as helpful as it used to be as I can see
it marking and IF ELSIF ELSIF ELSIF ELSIF ELSE ENDIF as unreachable
just because one element is: Something for me to test this weekend when
what I really want is a pointer to the element(s) that are specifically
unreachable.

Thanks again.
--
Daniel A. Morgan
http://www.psoug.org
damor...@x.washington.edu
(replace x with u to respond)


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Andy Hassall  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 9 feb 2006, 00:49
Nieuwsgroepen: comp.databases.oracle.server
Van: Andy Hassall <a...@andyh.co.uk>
Datum: Wed, 08 Feb 2006 23:49:43 +0000
Lokaal: do 9 feb 2006 00:49
Onderwerp: Re: 10.2 Bug?

On Wed, 08 Feb 2006 15:02:52 -0800, DA Morgan <damor...@psoug.org> wrote:
>From where I stand, looking at how it performs I'd
>say it is (if not a bug) not as helpful as it used to be as I can see
>it marking and IF ELSIF ELSIF ELSIF ELSIF ELSE ENDIF as unreachable
>just because one element is: Something for me to test this weekend when
>what I really want is a pointer to the element(s) that are specifically
>unreachable.

 As it stands, I see the results in this case as being _more_ useful. It's
pointing out more code that can be removed without changing the operation of
the program - so why's it there in the first place?

 Maybe it'd be clearer if there was a separate PLW "optimiser removed redundant
code" - but then again once the optimiser's removed it, it _is_ unreachable
code.

 It should only mark lines that really are redundant - presumably with an
IF/ELSIF/ELSIF/ENDIF it'll only mark the specific branches where it can prove
that the conditions are impossible. If it starts marking other branches as
unreachable then that'd be a bug - but here the "IF x = 10" conditional is
clearly pointless as x is a constant value 10 through all code paths, so it's
trivially true and there's no point it doing the comparison at runtime.

--
Andy Hassall :: a...@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
DA Morgan  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 9 feb 2006, 20:48
Nieuwsgroepen: comp.databases.oracle.server
Van: DA Morgan <damor...@psoug.org>
Datum: Thu, 09 Feb 2006 11:48:18 -0800
Lokaal: do 9 feb 2006 20:48
Onderwerp: Re: 10.2 Bug?

Andy Hassall wrote:
>  It should only mark lines that really are redundant - presumably with an
> IF/ELSIF/ELSIF/ENDIF it'll only mark the specific branches where it can prove
> that the conditions are impossible. If it starts marking other branches as
> unreachable then that'd be a bug - but here the "IF x = 10" conditional is
> clearly pointless as x is a constant value 10 through all code paths, so it's
> trivially true and there's no point it doing the comparison at runtime.

You've got my vote. I liked it better the way it worked in 10.1.
--
Daniel A. Morgan
http://www.psoug.org
damor...@x.washington.edu
(replace x with u to respond)

    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
Einde van berichten
« Terug naar Discussies « Nieuwer onderwerp     Ouder onderwerp »

Discussiegroep maken - Google Discussiegroepen - Google Startpagina - Servicevoorwaarden - Privacybeleid
©2010 Google