SQL highlight stops after encountering a token delimited with the identifier delimiter `
For example
/*sql*/`
SELECT
*
FROM \`table\`
WHERE
1=1
`;
Here's a test SQL for your future tests.
SELECT
*
FROM
(
SELECT
-- One line comment with /* stream comment inside of it */ and another right after -- I want my independence
DISTINCT unique_random_numbers_anyway,
(
SELECT
COUNT(*),
*
FROM whatever
FORCE INDEX (bigger_than_the_table_itself)
),
@var_Name := CONCAT('''', "'abc'", "/*' -- Hello'*/", '\r\n\t -- line comment inside string? It can''t be. /* block comment */ '''' '),
'"/*''\r\n\t*/"', -- Confusing start of block comment: /*
-3 + (-9) - - 3 + ( - 99 + 2 % -5 | 333 ~999&111111111 * -0.00 * + 33 >> +123 << ++321.22) ^ 0xAFe0 AS `Computer error 123`
FROM users /* Why do we have stream comments? */
LEFT JOIN something ON something.user_id = users.user_id
WHERE
-- We joined you to kill you. TROJAN JOIN
something.user_id IS NULL
AND -1=-+-+-++-1
AND -1=-+-+-++1
AND `quoted_name`='2019-12-12'
OR`quoted_name` >= '2019-12-12T12:34:56Z'
-- NOT IN and IN may vary in number of elements dynamically for the same query, usually when they don't contain any subqueries.
OR xxx NOT IN ( - 999, 'AAA', -59)
AND zzz not in ('a', -12.99e-30, 0xAFED13, (select name from cache limit 1), 0, column_name)
AND -user_id = -123 -- That minus sign must be gone. Only questions must remain. Except for the name which must keep the minus sign.
AND wage > 0.1
AND name LIKE '%I will become a question mark% start of block comment: /*'
ORDER BY
user_date_created DESC /*
Multi-line comment means importance!
ortance...
tance...
sss...
*/
LIMIT 1460 /* LIMIT HERE? */ -- Noooo!
UNION -- ALL
SELECT
`database name with spaces`./*What am I?*/`012345799`
FROM xxxx
)
ORDER BY FIELD(user_phone_call_uniqueid, 'abc', 'def', 'xxx', 1, -1)
SQL highlight stops after encountering a token delimited with the identifier delimiter `
For example
Here's a test SQL for your future tests.