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

For SQL Language coloring mistaking a literal for an escaped character #9040

Closed
ghost opened this issue Oct 20, 2020 · 3 comments
Closed

For SQL Language coloring mistaking a literal for an escaped character #9040

ghost opened this issue Oct 20, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 20, 2020

notepadpp_escape
TOAD_escape
notepadpp_escape
TOAD_escape

Description of the Issue

The following line is having difficulty regarding syntax coloring when SQL is chosen as the language. (Database being used is Oracle, but this statement is generic:

select Table.Columname1 || '' || Table.Columname2 || '' || Table.Columname3 as "Label";

The difficulty appears to be that, instead of recognizing '' as a quoted literal string, the code is interpreting the sequence ' as an escaped apostrophe. As such, the text is gray from from the first apostrophe to the third apostrophe. The backslash after the third apostrophe is then shown as part of the statement (which it is not) by being colored black. The rest of the SQL statement is shown in gray as text even though this sections is actually part of the statement .

From other tickets on the Notepad++ site, this is likely a misinterpretation by Scintilla, but I (a) encountered the difficulty using NotePad++ so I could be mistaken and (b) I could not find a way to file a defect report on the Scintilla site.

Steps to Reproduce the Issue

  1. Place above string for the select statement in Notepad++
  2. Set the Language to SQL
  3. Observe the coloring of the syntax

Expected Behavior

Only the backslashes would be in gray to indicate that they are text. The rest of the statement would have regular coloring for the syntax, which can be compared using the statement

select Table.Columname1 || Table.Columname2 || Table.Columname3 as "Label";

Actual Behavior

See Description

Debug Information

Notepad++ v7.9 (64-bit)
Build time : Sep 22 2020 - 03:19:04
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1903
OS Build : 18362.1082
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

example of SQL syntax coloring

@ArkadiuszMichalski
Copy link
Contributor

#8919 (comment) << this not work?

@transcendtrade
Copy link

I am observing same behavior with trying to use the ESCAPE operator in SQL. The query in the screenshot works. But Notepad++ is not colorizing the query properly.

https://docs.oracle.com/cd/B19306_01/server.102/b14200/conditions007.htm

2020-10-23_11-24-14

@dail8859
Copy link
Contributor

@starryEXEL See above mentioned comment for treating \ as an escape character

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

No branches or pull requests

3 participants