Uh oh!
There was an error while loading. Please reload this page.
fix: distribute derived tables and stop silent sort/SQL bugs - #58
Conversation
Rewrite DERIVED_SCAN inner plans so FROM (SELECT ...) hits remote shards. Store remote_sql_len as uint32_t so statements longer than 64KB are not truncated. Resolve ORDER BY position/alias in the plan builder, and only MERGE_SORT when every key is a table column — expressions gather and sort locally instead of comparing column 0.
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Refuse multi-table UPDATE/DELETE when any table is sharded or backends differ. Evaluate HAVING against aggregate output so COUNT(*) filters work locally and distributed. Push equi-joins of same-layout sharded tables to each shard. sqlengine and mysql_server use 2PC when backends are configured; SELECTs inside an open distributed txn hit pinned sessions. Optional --txn-log on sqlengine.
fix: close remaining sharding correctness holes
Uh oh!
There was an error while loading. Please reload this page.
Summary
Stacked on #57.
FROM (SELECT …):distribute_noderewritesDERIVED_SCAN.inner_plan. Inner scans becomeREMOTE_SCANs.remote_sql_len:uint16_t→uint32_t(matchesStringRef). Test uses a 70k literal.MERGE_SORTkeys:ORDER BYposition/alias rewritten to the select-list expr inPlanBuilder. Expression keys no longer merge on column 0 — they gather and sort locally.Validation
./run_tests --gtest_brief=1: 1315 passed, 38 skipped./run_tests --gtest_filter='DistributedPlannerTest.Derived*:DistributedPlannerTest.OrderBy*:DistributedPlannerTest.RemoteSql*:PlanExecutorTest.OrderBy*'