[sql-hint] identifier quote is not escaped if identifiers contain it - or spaces#4626
[sql-hint] identifier quote is not escaped if identifiers contain it - or spaces#4626crazy4chrissi wants to merge 3 commits intocodemirror:masterfrom
Conversation
…s not correctly escape column identifiers in table names, column names etc. For example a table name back`tick needs to be escaped like this: `back``tick`. Same for double quotes as column identifiers.
…amed my"table are now doublicated correctly (e.g. quoting produces: "my""table"). This fixes 2 failing tests, but 2 others still fail.
|
(continuous-integration fails because this pull request introduces two new tests regarding bugs that it does not fix yet) |
|
Yeah, sql-hint is a mess and I regret ever having merged it. Oh well. Do you intend to work on fixing the other failures? I'd prefer not to have our CI red because of this. |
|
Haha, okay. I can't believe the phpMyAdmin developers use codemirror with sql-hint and don't bother about such issues. Anyway, I will try to fix the other two issues. But it will take more time I guess because I need to better understand the way the hinter works to find where the problem is. |
|
Please, consider this issue: I already have a working code, I just do not know how to submit my changes. Thanks |
There are several bugs in sql-hint. The following table / column names don't work correctly. Assume the identifier quote is ", then the identifier
some"nameneeds to be escaped as"some""name".Also, spaces cause problems: Assume a table is called
table nameand we start auto completion after"table na, we don't get"table name"but allna*hints.I wrote several failing tests that show this problem contained in this pull request. Currently, this pull request fixes all except two of the failing tests. Maybe fixing the remaining two is more easy for you than me. It seems it would require me to dig deep into CodeMirror to understand what's going on.