CMS Snapshot analysis - Run Metrics Calculation - Warnings - SQL with extension - The complexity of matching the regular expression exceeded predefined bounds
Purpose (problem description)
This page will guide you to troubleshoot the below warning that may be encountered in the Run Metric Calculation log file
[MAv2] Computing metrics on C:\CASTMS\Deploy832AIP\SQLSCRIPT-267\SQL\wccpprddl.sql
The following error "The complexity of matching the regular expression exceeded predefined bounds. Try refactoring the regular expression to make each choice made by the state machine unambiguous. This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate." occurred while searching a substring matching regular expression "SELECT.+FROM".
For more information, refer to
Official 8.3 documentation - Run and validate the analysis
Official 8.2 Documentation - Execute the Analysis
Online-help - CAST MS help Online : CAST Management Studio - Help > Metrics Calculation
Error Free Logs - CMS Snapshot Analysis - Run Metrics Calculation - Error Free Logs - CAST AIP 8
Online-help : CAST Management Studio - Help > How To > Regular audience > Run analysis only
Observed in CAST Version, CAST Extension Version, CAST Component Version
| SQL Analyzer Release | Yes/No |
|---|---|
| 2.x | ✅ |
| 1.x | ✅ |
| CAST AIP Release | Yes/No |
|---|---|
| 8.3.x (x >= 4) | ❌ |
| 8.3.x (x < 4) | ✅ |
| 8.2.x (x >= 11) | ❌ |
| 8.2.x (x < 11) | ✅ |
Observed in RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ✅ |
| CSS3 | ✅ |
| CSS2 | ✅ |
Step by Step Scenario
- Discover the source and deliver the application.
- Accept the delivery.
- Run analysis.
- Select the Run Metrics Calculation step and open the log file.
Action Plan
The problem is that until Cast AIP 8.2.10 and Cast AIP 8.3.3, the Univeral Analyzer parses SQL and DDL files. But there is no Language Pattern provided with extension SQL Analyzer.
This means that Metric Assistant has no definition of the basic structure of the objects.
A workaround is to provide a basic Language Pattern XML file. This is only a workaround, as it can slow down the analysis and degrade performance of SQL Analyzer. Starting from Cast AIP 8.2.10 and Cast AIP 8.3.3, the Universal analyzer does not parse the files any more, and the issue is solved.
Perform the below actions
- Copy file SQLScriptLanguagePattern.xml into **%PROGRAMDATA%\CAST\CAST\Extensions**com.castsoftware.sqlanalyzer.x.y.z\configuration\Languages\SQL then relaunch analysis
- If the above steps do not solve your issue contact CAST Technical Support. with the following Relevant input for CAST Technical Support to try to reproduce the issue
Relevant input
- CAST Support Tool (CST) - alias Sherlock export with the following options Export Logs and Export source code
Notes/Comments
Related Pages