Hi Team,
I’ve run into another SQLcl Project bug that is increasingly making it difficult to detect production drift on a large project I’m working on. The issue results in code being recorded in src and later propagated to dist even though this code does not exist in the source database.
In this particular case, project export adds an extra semicolon to a view definition when the final line ends with a line comment. The behavior is very easy to reproduce:
- Create a view that ends with a line comment:
SQL> create or replace view foo.view_with_comment as
2 select 1 x from dual -- there is no semicolon here
3* /
View FOO.VIEW_WITH_COMMENT created.
2. Export the view:
SQL> proj export -o view_with_comment
The current connection //localhost:1521/freepdb1 INSTALLER will be used for all operations
*** VIEWS ***
-------------------------------
VIEW 1
-------------------------------
Exported 1 objects
Elapsed 5 sec
SQL>
3. Open the export file src/database/foo/views/view_with_comment.sql, and you will see a semicolon at the end of the comment:
create or replace force editionable view foo.view_with_comment (
x
) as
select
1 x
from
dual -- there is no semicolon here;
;
-- sqlcl_snapshot {"hash":"bdf854ad8cfba1cadf066bfb7e84b44389b19f22","type":"VIEW","name":"VIEW_WITH_COMMENT","schemaName":"FOO","sxml":""}
4. Reproducable 100% at version
Oracle SQLDeveloper Command-Line (SQLcl) version: 25.3.2.0 build: 25.3.2.317.1117
Best,
Alex