Grep Definition Pattern Include not matching even with .*
cdelaet opened this issue · 8 comments
Description
This line in schemacrawler.config.properties:
schemacrawler.grep.definition.pattern.include=.*
should match all routine definitions (I thought), however it matches nothing. If I put the line in # comments, it matches everything.
If I add a pattern which should match (part of a Stored Procedure definition), it also doesn't match while it should match:
schemacrawler.grep.definition.pattern.include=.*Versie.*
What am I doing wrong?
How to Reproduce
Using SQL Server (or an offline copy), running this command, produces the correct output:
schemacrawler.sh --server=offline --database=testinfordat.ser --info-level=maximum --command=list --schemas=TESTINFORDAT.dbo --routines=".*\"SA_NewStudent\;?[0-9]?\"" --tables=
System Information
========================================================================
generated by SchemaCrawler 16.20.4
generated on 2023-10-18 15:09:55
Routines
========================================================================
TESTINFORDAT.dbo."SA_NewStudent;1" [function, returns table]
However, if I use the same command and I uncomment the line
schemacrawler.grep.definition.pattern.include=.*
in the configuration file, I get this output:
System Information
========================================================================
generated by SchemaCrawler 16.20.4
generated on 2023-10-18 15:09:55
Relevant log output
FINE: Including <TESTINFORDAT.dbo> since it matches /TESTINFORDAT.dbo/
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Including <TESTINFORDAT.dbo."SA_NewStudent;1"> since it matches /.*"SA_NewStudent\;?[0-9]?"/
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding, since text is blank
Oct 19, 2023 12:57:53 PM schemacrawler.inclusionrule.RegularExpressionRule test
FINE: Excluding </* Versie: xxx xx xxx xxxx - xxxxx */
/* Laatst gewijzigd door xxxxxx */
CREATE PROCEDURE [dbo].[SA_NewStudent]
@parGebruiker int,
/* snip */
@outPersoonID int OUTPUT
AS
BEGIN
BEGIN TRY
DECLARE @IsTopTransaction int
/* snip*/
END CATCH
END> since it does not match /.*/
Oct 19, 2023 12:57:53 PM schemacrawler.filter.RoutineGrepFilter test
FINE: Excluding routine <TESTINFORDAT.dbo."SA_NewStudent;1">
SchemaCrawler Version
16.20.4
Java Version
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 19.0.2+7-44
Operating System and Version
Mac OS X 14.0
Relational Database System and Version
SQL Server 2019
JDBC Driver and Version
com.microsoft.sqlserver.jdbc.SQLServerDriver 12.2
In addition, but unrelated to this issue I think, it's strange that schemacrawler lists all Stored Procedures as "function" (see output in How to Reproduce above).
@cdelaet Would you be able to give me "testinfordat.ser", or scripts to create the database? If you are not comfortable posting here, email them to sualeh@hotmail.com.
In addition, but unrelated to this issue I think, it's strange that schemacrawler lists all Stored Procedures as "function" (see output in How to Reproduce above).
Let me take a look at that. It may be how the driver is reporting something. Please file another bug for that, to keep the issues separate. Thanks.
I did as you requested, Sualeh. Thank you for looking into this.
Let me know if there is anything else I can do to help with this issue. I would like to use Schemacrawler to help document our (huge) database, but this limits the usability for me.
@cdelaet My laptop is down. 😢 Waiting for it to get repaired. Please could you resend the .ser file - the link expired. Thanks.
@cdelaet Please try SchemaCrawler v16.20.5, and let me know if it works for you. Thanks.
regex searches in Stored Procedures work perfectly now. Thank you, Sualeh!