sqlinsight-pro/tests/SQLInsight.Core.Tests
Søren Eggert Lundsteen Olsen 8d092b6a35 Review 1.5: the read-only check of typed queries can no longer be bypassed
The synthetic SQL check (and custom rules) used a regex that ended an [identifier]
at the first ] and a block comment at the first */, so "[x]]'] DELETE ..." hid a
DELETE inside what it took for a string. T-SQL also needs no semicolon between
statements, so "SELECT 1 COMMIT" or "SELECT 1 WRITETEXT ..." passed.

- ReadOnlyQuery lexes T-SQL as SQL Server does (nested comments, '' ]] ""),
  refuses unterminated comments/strings/identifiers, every statement keyword
  (COMMIT, ROLLBACK, SET, DECLARE, WRITETEXT, UPDATETEXT, RAISERROR, CHECKPOINT,
  ENABLE/DISABLE, RECEIVE/SEND ...), NEXT VALUE FOR (sequences are not rolled
  back) and update/exclusive lock hints, and a second SELECT unless joined by
  UNION/EXCEPT/INTERSECT.
- CustomRuleDefinition.QueryProblems uses it, so the synthetic check validates the
  same way when saved and before it runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:08:34 +02:00
..
BaselineTests.cs Fase 2: baselines and anomaly detection 2026-09-29 08:01:11 +00:00
ConfigurationFingerprintTests.cs Configuration page with change log 2026-10-02 08:12:26 +02:00
DeltaTests.cs Fase 1: collectors and rule pack (41 rules) 2026-09-29 06:17:08 +00:00
DiskTests.cs Disk speed per drive: IOPS, MB/s and latency 2026-10-02 08:03:11 +02:00
DynamicsAxTests.cs Review 1.4: AX texts in API v1 and the hub without logins or host names; API has what the pages show 2026-10-02 14:29:34 +02:00
ErrorLogTests.cs SQL Server error log without elevated rights (8a) 2026-10-02 10:30:41 +02:00
IndexUsageTests.cs Review 1.2: index usage after a counter reset without a restart 2026-10-02 11:34:17 +02:00
InstanceCapabilitiesTests.cs Fase 2: Azure SQL Managed Instance, docs and rule catalog test 2026-09-29 08:23:40 +00:00
InstanceConfigurationTests.cs Instance configuration core: database selection, sealed credentials, agent request contracts 2026-10-02 13:21:59 +02:00
PrivilegeAnalysisTests.cs Privilege audit: sysadmin and server roles with AD unfolding 2026-10-02 08:39:56 +02:00
QueryStatsDeltaTests.cs Top SQL: collect what the heaviest statements use every 5 minutes 2026-10-01 15:46:45 +02:00
ReadOnlyQueryTests.cs Review 1.5: the read-only check of typed queries can no longer be bypassed 2026-10-02 15:08:34 +02:00
SQLInsight.Core.Tests.csproj Dynamics AX core: central detector, per-version schema adapters, read-access GRANT 2026-10-02 13:52:58 +02:00
SqlServerVersionTests.cs Fase 0: solution structure, capability model, rule engine, least-privilege script 2026-09-29 05:40:49 +00:00
SyntheticCheckTests.cs Windows servers and synthetic checks core: data, disk forecast, event dedup, grant script 2026-10-02 14:58:17 +02:00
WaitSamplingTests.cs Wait type drill-down with active session sampling 2026-10-02 08:50:31 +02:00
WindowsServerTests.cs Windows servers and synthetic checks core: data, disk forecast, event dedup, grant script 2026-10-02 14:58:17 +02:00