Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating query for referenced objects results in syntax error if name contains apostrophe #1155

Closed
mrisump opened this issue Aug 3, 2023 · 1 comment
Assignees

Comments

@mrisump
Copy link

mrisump commented Aug 3, 2023

Describe the bug
When showing objects that reference a measure with a name that contains an apostrophe ' (Char 39), the generated SQL does not escape the apostrophe, causing a syntax error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a measure in your model with a name like 'Measure
  2. Right-click on the measure in the Metadata pane, and select "Show Objects That Reference Measure"
  3. The query will run and result in a syntax error on the WHERE [REFERENCED_OBJECT] = ''Measure' line

Expected behavior
No syntax error should result, and referenced objects should be be found: i.e. the generated query should escape the ', so it would read ... = '''Measure'.

Screenshots
image

Additional context
DAX Studio: 3.0.8 (2023-07-03)

@github-actions github-actions bot added the triage issues that need to be classified label Aug 3, 2023
@dgosbell dgosbell added bug fix-checked-in and removed triage issues that need to be classified labels Aug 4, 2023
@dgosbell dgosbell self-assigned this Aug 4, 2023
@dgosbell
Copy link
Contributor

dgosbell commented Aug 4, 2023

Thanks for logging this. I have a fix checked in that will be part of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants