microsoft / microsoft/sql-server-samples

EPM-framework - Invalid length parameter passed to the RIGHT function in policy.v_EvaluationErrorHistory

Open
#556 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Executing SELECT * FROM policy.v_EvaluationErrorHistory in EPM-framework can result in following error when EvaluatedObject doesn't contain a backslash:

Invalid length parameter passed to the RIGHT function

Checking if a backslash is present solves the issue:

case when CHARINDEX('\', REVERSE(EvaluatedObject)) >0 then RIGHT(EvaluatedObject,CHARINDEX('\', REVERSE(EvaluatedObject)) - 1) else EvaluatedObject end

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the definition of policy.v_EvaluationErrorHistory and run SELECT * FROM policy.v_EvaluationErrorHistory with an EvaluatedObject that contains no backslash. Check the RIGHT expression responsible for the invalid length error, then verify the view handles both backslash and no-backslash values without changing the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.