10 Replies Latest reply: Nov 8, 2012 2:58 AM by 586529 RSS

    Bug with "Save Package Spec and Body" +11.2.0.3 DB

    thtsang
      I think this is bug is at least serious, or very likely critical. When I use the "Save Package Spec and Body" function (select package name -> Right Click -> Save Package Spec and Body), the saved source code have rows shifted randomly.

      One will be lucky if this only corrupt the source code and cause compilation error. Sometimes column list of select statement ordered incorrectly, statements in if-then-else clause went into the incorrect 'else' block...

      I faced this only with 11.2.0.3 DB, never had this problem with 10.2.0.4.


      SQLDeveloper: 2.1.1.64, 3.0.04
      SQLDeveloper OS: WinXP SP3
      SQLDeveloper JRE: 1.6.14

      Oracle: 11.2.0.3 Standard Edition RAC
      DB OS: RHEL5
        • 1. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
          Gary Graham-Oracle
          Hi,

          It's always advisable to provide a test case in order to get the quickest response. Otherwise anyone seeing this must commit to a little extra work to come up with a test case that reproduces the behavior. Very often such efforts are in vain, as a bug may occur for some edge-condition that you (or your environment) have hit upon.

          Anyway, I see no prior bug logged for this, but I lucked out and was able to reproduce the behavior. My test case is a package spec/body combination of 300+ lines with a large block of lines up to 205 characters long each, and happens using a remote 11.2.0.2 DB -- not sure if the remote part is relevant.

          I can log a bug, but will wait a day or so to see if you (or anyone else) can provide a smaller test case, or otherwise describe some special condition in which the behavior occurs.

          Thanks for your feedback,
          Gary
          SQL Developer Team
          • 2. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
            Gary Graham-Oracle
            Update: same package on a local 11.2.0.1 DB on WinXP did not suffer the same problem.
            • 3. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
              thtsang
              I don't know what test case can I provide. The description in the original messsage is specific enough for me. The only problem is whether it's reproducible in your site. And luckily it did :)

              I don't care whether you log a bug or not. I will not use that context menu option to save PL/SQL source anyway. But I think it is necessary to fix this bug, which can potentially cause serious data corruption (e.g., someone save the source from UAT and deploy to production...)
              • 4. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                Jan-Peter
                Hi,
                I have experienced the same issue both in 3.0 and 3.1EA2.
                Unfortunately it is sporadic and (after restarting SQL Developer) the export works fine ...
                Regards,
                Jan-Peter
                • 5. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                  Gary Graham-Oracle
                  Hi Jan-Peter,

                  Thanks for the feedback. I was not able to reproduce the problem today in any environment, even the original where I saw the problem:

                  1) SQL Developer 3.0.04.34 / 3.1.06.44 on Win XP against a remote 11.2.0.2 Oracle on Linux
                  2) or against a local 11.2.0.1
                  3) or against a remote 10g XE on Win XP

                  If I had not saved the diff files from Tuesday, I would doubt my own memory. Very frustrating.

                  Since the issue is intermittent and, for me, apparently difficult to reproduce, logging a bug would probably just waste more development time. If anyone comes up with a solid test case, please post it.

                  Thanks,
                  Gary
                  • 6. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                    739108
                    I've had this problem as well.

                    If this will help, in the comparison of files, the corruption occurs with varying frequency within a file, but will always move a line 4 lines above it's original position.

                    I'm running sql developer in Windows 7 - 64 with 64 bit java on various oracle versions from 11 to 11.2

                    for example watch the element in the mapretail function in the following:

                    --------------------------------------------------------------------------------------------------------

                    INSERT INTO org_retail_items
                    VALUES r_ori
                    RETURNING retail_id INTO n_new_retail_id;

                    n_retail_map_id := siphon.mapretail(
                    numloadid => n_retail_map_id
                    , numlegacyid => c_retail_items(iItem).legacy_id
                    *, nummaptoid => n_new_retail_id*
                    , nummaptoclass => NULL
                    , numorgid => p_org_id);


                    --------------------------------------------------------------------------------------------------------

                    INSERT INTO org_retail_items
                    VALUES r_ori
                    RETURNING retail_id INTO n_new_retail_id;

                    *, nummaptoid => n_new_retail_id*
                    n_retail_map_id := siphon.mapretail(
                    numloadid => n_retail_map_id
                    , numlegacyid => c_retail_items(iItem).legacy_id
                    , nummaptoclass => NULL
                    , numorgid => p_org_id);

                    It occurs this way every time it occurs. Hope it helps

                    Edited by: gr**** on Jan 31, 2012 7:34 AM
                    • 7. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                      900466
                      This bug is very annoying cause it messes up code pretty bad...
                      Version 3.1.07

                      I work in bank and official software for coding is sql developer, but cause of this bug people are turning to TOAD( don't get me wrong but this is very big BUG, I have no faith in SQL developers save specs and body anymore cause it hitted me more than 20 times)....

                      It's not very plesant when someone calls you in the middle of the night while you're sleepenig to urgently go back to work and says that you're code is not working as it supose to work, or that code didn't passed scheduled compile all because SAVE SPECS AND BODY messed up lines in code...

                      i have made some backup script that I use but it does not solve the issue....
                      • 8. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                        Vadim Tropashko-Oracle
                        The query doesn't contain order by clause... Expect fix in 3.1.1
                        • 9. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                          739108
                          When can we expect bug fix?
                          • 10. Re: Bug with "Save Package Spec and Body" +11.2.0.3 DB
                            586529
                            This problem seems to be solved in last 3.2.2 release.
                            Even if it doesn't appear in release notes...