This commit is contained in:
Amos Bird 2024-02-22 15:13:49 +08:00
parent 6a2eb7297d
commit 5551a9073b
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
3 changed files with 25 additions and 14 deletions

View File

@ -604,6 +604,9 @@ void logExceptionBeforeStart(
if (auto txn = context->getCurrentTransaction())
elem.tid = txn->tid;
if (settings.log_query_settings)
elem.query_settings = std::make_shared<Settings>(context->getSettingsRef());
if (settings.calculate_text_stack_trace)
setExceptionStackTrace(elem);
logException(context, elem);

View File

@ -275,6 +275,14 @@ JSONBuilder::ItemPtr QueryPlan::explainPlan(const ExplainPlanOptions & options)
}
else
{
auto child_plans = frame.node->step->getChildPlans();
if (!frame.children_array && !child_plans.empty())
frame.children_array = std::make_unique<JSONBuilder::JSONArray>();
for (const auto & child_plan : child_plans)
frame.children_array->add(child_plan->explainPlan(options));
if (frame.children_array)
frame.node_map->add("Plans", std::move(frame.children_array));

View File

@ -179,7 +179,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
2000-01-01 1 test string 1 1
@ -203,7 +203,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
)
@ -229,7 +229,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
) AS b
WHERE id = 1
)
@ -248,7 +248,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
2000-01-01 1 test string 1 1
@ -272,7 +272,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
)
@ -291,7 +291,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
) AS b
WHERE id = 1
2000-01-01 1 test string 1 1
@ -315,7 +315,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
) AS a
WHERE id = 1
) AS b
@ -332,7 +332,7 @@ FROM
date,
min(value) AS value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
GROUP BY
id,
date
@ -352,7 +352,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
UNION ALL
SELECT
date,
@ -360,7 +360,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
2000-01-01 1 test string 1 1
@ -381,7 +381,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
ANY LEFT JOIN
(
@ -443,7 +443,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
ANY LEFT JOIN
(
@ -540,7 +540,7 @@ FROM
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
) AS a
ANY LEFT JOIN
(
@ -587,7 +587,7 @@ SEMI LEFT JOIN
name,
value
FROM test_00597
PREWHERE id = 1
WHERE id = 1
)
WHERE id = 1
) AS r USING (id)