Skip to content

Don't allow KQL in presence of bugs - #59305

Merged
alexey-milovidov merged 3 commits into
masterfrom
remove-kql
Jan 28, 2024
Merged

alexey-milovidov merged 3 commits into
masterfrom
remove-kql

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Backward Incompatible Change

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Kusto dialect is disabled until these two bugs will be fixed: #59037 and #59036

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backward-incompatible Pull request with backwards incompatible changes label Jan 28, 2024
@robot-clickhouse-ci-1

robot-clickhouse-ci-1 commented Jan 28, 2024 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit c7663c6 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Docs checkThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Fast testsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
SQLancerFuzzing tests that detect logical bugs with SQLancer tool✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success
Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc❌ error
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure

@alexey-milovidov alexey-milovidov self-assigned this Jan 28, 2024
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Looks alright.

@alexey-milovidov
alexey-milovidov merged commit c1b5703 into master Jan 28, 2024
@alexey-milovidov
alexey-milovidov deleted the remove-kql branch January 28, 2024 19:35
pull Bot pushed a commit to Mu-L/ClickHouse that referenced this pull request Aug 29, 2026
The dialect was contributed in 2022 and abandoned by its authors; the
rewrite they promised in ClickHouse#62668 was closed unmerged.  Since then it has
been emergency-disabled once (ClickHouse#59305) and gated behind
`allow_experimental_kusto_dialect` (ClickHouse#74224), and issue ClickHouse#61742 ("Remove
KQL support if this code will not be fixed") has stayed open.

The implementation translated a KQL token stream directly into
ClickHouse SQL *text* and re-parsed it.  Everything below follows from
that:

  - KQL string literals were spliced into generated SQL unescaped, so
    `T | where s contains "x') OR 1 = 1 OR ilike(s, 'y"` injected
    arbitrary expressions -- and `contains '50%'` matched `'50x'`
    because LIKE metacharacters passed through.
  - No types were available while translating, so 14 sites emitted
    runtime `toTypeName()` dispatch and datetimes were modelled as
    strings truncated to 27 characters.
  - Arguments were SQL text, so a dozen sites called `std::stoi` on it;
    `format_timespan(col, 'hh:mm')` failed with "stoi: no conversion".
  - 28 of the 237 registered functions were stubs that returned the raw
    KQL name into the generated SQL, including every `series_*`.
  - `let` bindings lived in a `static thread_local` map that, by its own
    comment, leaked between unrelated queries.

This commit removes the implementation and every trace of it: the
parser, the `kusto` dialect and its experimental setting, the `kusto`
value of `interval_output_format` and the interval serialization it
drove, the client/server call sites, the fuzzer and style-check
carve-outs, and the tests.  A correct implementation is added next.

Two notes on what was deliberately kept.  `ASTSelectQuery::normalize
ChildrenOrder` stays -- several other parsers use it -- with its comment
generalized.  `04305_parser_error_message_oob_101143.sh` stays as a
regression test for the error-formatter buffer overflow; its rationale
is rewritten, since the parser it originally exercised is now gone.

Release history in CHANGELOG.md, docs/changelogs/ and
SettingsChangesHistory.cpp is left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backward-incompatible Pull request with backwards incompatible changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Experimental KQL: Clickhouse server v24.1.1.1 SEGV inside DB::(anonymous namespace)::writeQueryAroundTheError

2 participants