Forum Stats

  • 3,770,598 Users
  • 2,253,140 Discussions
  • 7,875,505 Comments

Discussions

StackOverflowError formatting files using sqlcl

ifernand
ifernand Member Posts: 29 Blue Ribbon
edited Apr 3, 2018 1:29PM in SQLcl

Hi.

I am formatting several sql files using sqlcl, but I have noticed that when I try to format files bigger than 200k bytes sqlcl is aborted

SQL> format file D:\inserts.sql D:\inserts.format.sql

Exception in thread "main" java.lang.StackOverflowError

    at oracle.dbtools.util.Array.indexOf(Array.java:81)

    at oracle.dbtools.util.Array.indexOf(Array.java:81)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:81)

    at oracle.dbtools.util.Array.indexOf(Array.java:81)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:83)

    at oracle.dbtools.util.Array.indexOf(Array.java:56)

    at oracle.dbtools.parser.Earley.followComplete(Earley.java:791)

    at oracle.dbtools.parser.Earley.tree(Earley.java:739)

    at oracle.dbtools.parser.Earley.followComplete(Earley.java:810)

    at oracle.dbtools.parser.Earley.tree(Earley.java:739)

    at oracle.dbtools.parser.Earley.followComplete(Earley.java:815)

    at oracle.dbtools.parser.Earley.tree(Earley.java:739)

    at oracle.dbtools.parser.Earley.followComplete(Earley.java:810)

    at oracle.dbtools.parser.Earley.tree(Earley.java:739)

    at oracle.dbtools.parser.Earley.followComplete(Earley.java:815)

    at oracle.dbtools.parser.Earley.tree(Earley.java:739)

.......

It's working fine with files under 200k bytes.

Regards.

ifernand

Answers

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,094 Employee
    edited Mar 28, 2018 12:36PM

    Sounds like a bug.

  • ifernand
    ifernand Member Posts: 29 Blue Ribbon
    edited Apr 3, 2018 12:15PM

    I had found previous behavior using SQLcl 17.2.0, but I have found exactly same bug using SQLcl 17.4.0.

    Then I have tried with SQLcl 18.1.0, but in that version I have a different situation. I have loaded format rules extracted from SQLDeveloper 17.4 and when I try to format files under 200k bytes that were formatted in previous versions without problems I have found:

    SQL> format file D:\inserts.small.sql D:\inserts.small.format.sql

    Syntax error in line 347, column 32

    | [node) from_clause & [node^+8 < node^)

                                    ^^^    

    Expected: ')','^','-','+',

    (* Output messages has been translated into english)

    Using this version error output for big files is slightly different:

    SQL> format file D:\inserts.sql D:\inserts.format.sql

    Exception in thread "main" java.lang.StackOverflowError

        at java.util.HashMap.getNode(Unknown Source)

        at java.util.HashMap.get(Unknown Source)

        at oracle.dbtools.parser.Matrix.get(Matrix.java:28)

        at oracle.dbtools.parser.Earley.followComplete(Earley.java:781)

        at oracle.dbtools.parser.Earley.tree(Earley.java:734)

        at oracle.dbtools.parser.Earley.followComplete(Earley.java:805)

        at oracle.dbtools.parser.Earley.tree(Earley.java:734)

        at oracle.dbtools.parser.Earley.followComplete(Earley.java:810)

        at oracle.dbtools.parser.Earley.tree(Earley.java:734)

        at oracle.dbtools.parser.Earley.followComplete(Earley.java:805)

        at oracle.dbtools.parser.Earley.tree(Earley.java:734)

    Perhaps error with small files in version 18.1.0 is because format rules file generated in SQLDeveloper 17.4 is not compatible with SQLcl 18.1. How can I obtain a format rules file for SQLcl 18.1.0? When is going to be published SQLDeveloper 18.1?

    Regards.

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,094 Employee
    edited Apr 3, 2018 1:29PM

    >> When is going to be published SQLDeveloper 18.1?

    Soon

    ifernand