Skip to content

[fix](fe) Fix show data all result row width#65215

Merged
yiguolei merged 1 commit into
apache:masterfrom
hoshinojyunn:fix/show_data
Jul 6, 2026
Merged

[fix](fe) Fix show data all result row width#65215
yiguolei merged 1 commit into
apache:masterfrom
hoshinojyunn:fix/show_data

Conversation

@hoshinojyunn

@hoshinojyunn hoshinojyunn commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #62058

Problem Summary: SHOW DATA ALL returns detailed database data with 9 metadata columns after LocalBinlogSize was added, but the Quota and Left summary rows still contained only 8 values. The FE MySQL protocol writer sends the 9-column metadata first and then serializes each row as-is, so MySQL clients see an inconsistent result packet and report ERROR 2027 (HY000): Malformed packet. This change pads the detailed Quota and Left rows with the missing LocalBinlogSize column and adds unit coverage to assert detailed SHOW DATA rows match metadata width.

For examples:

mysql> show data all;  <<< No Quota and Left
+---------------+--------------------+------+------------+------------+-------------+-------------------+
| DbId          | DbName             | Size | RemoteSize | BinlogSize | RecycleSize | RecycleRemoteSize |
+---------------+--------------------+------+------------+------------+-------------+-------------------+
| 0             | information_schema | 0    | 0          | 0          | 0           | 0                 |
| 1             | mysql              | 0    | 0          | 0          | 0           | 0                 |
| 1783146087105 | __internal_schema  | 0    | 0          | 0          | 0           | 0                 |
| Total         | NULL               | 0    | 0          | 0          | 0           | 0                 |
+---------------+--------------------+------+------------+------------+-------------+-------------------+
mysql> create database test;
mysql> use test;
mysql> show data all;  <<< Here will display Quota and Left
ERROR 2027 (HY000): Malformed packet

Fix:
Add an empty column for Quota and Left row to align with the other rows.

Release note

Fix SHOW DATA ALL malformed packet caused by inconsistent result row width.

Check List (For Author)

  • Test
    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason

Regression test:
./run-regression-test.sh --run -d show_p0 -s test_show_data_all_db

Unit Test:
./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.ShowDataCommandTest

  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29645 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit de20a683e43511d50edb2634cdd5623ba2bbcb23, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17636	4223	4128	4128
q2	2027	307	204	204
q3	10290	1454	822	822
q4	4688	466	338	338
q5	7654	851	573	573
q6	212	182	141	141
q7	817	851	631	631
q8	10077	1661	1679	1661
q9	6209	4382	4427	4382
q10	6845	1793	1519	1519
q11	519	344	316	316
q12	732	558	441	441
q13	18115	3417	2811	2811
q14	279	266	242	242
q15	q16	794	783	713	713
q17	1357	1041	955	955
q18	6980	5779	5483	5483
q19	1656	1400	1092	1092
q20	775	642	525	525
q21	5979	2790	2366	2366
q22	434	366	302	302
Total cold run time: 104075 ms
Total hot run time: 29645 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4555	4455	4526	4455
q2	305	320	211	211
q3	4638	4989	4429	4429
q4	2109	2168	1397	1397
q5	4552	4408	4726	4408
q6	266	198	150	150
q7	2075	1854	1620	1620
q8	2678	2244	2221	2221
q9	7985	8045	7997	7997
q10	4722	4898	4269	4269
q11	573	409	394	394
q12	778	808	601	601
q13	3260	3706	2922	2922
q14	299	299	279	279
q15	q16	741	763	650	650
q17	1433	1386	1335	1335
q18	8176	7304	6843	6843
q19	1164	1093	1153	1093
q20	2220	2230	1961	1961
q21	5336	5149	4660	4660
q22	541	450	400	400
Total cold run time: 58406 ms
Total hot run time: 52295 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 174259 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit de20a683e43511d50edb2634cdd5623ba2bbcb23, data reload: false

query5	4318	632	482	482
query6	450	236	210	210
query7	4845	588	353	353
query8	346	192	177	177
query9	8800	4120	4072	4072
query10	448	344	303	303
query11	5784	2334	2177	2177
query12	161	103	98	98
query13	1330	574	434	434
query14	6210	5322	4981	4981
query14_1	4334	4290	4309	4290
query15	216	202	182	182
query16	1033	481	465	465
query17	1146	735	591	591
query18	2560	475	350	350
query19	217	191	151	151
query20	115	108	107	107
query21	242	158	137	137
query22	13621	13589	13497	13497
query23	17359	16555	16107	16107
query23_1	16312	16248	16211	16211
query24	7652	1802	1279	1279
query24_1	1324	1320	1304	1304
query25	574	459	397	397
query26	1346	366	208	208
query27	2567	610	368	368
query28	4470	2017	1987	1987
query29	1083	640	501	501
query30	334	263	227	227
query31	1121	1092	1003	1003
query32	112	70	65	65
query33	541	325	267	267
query34	1171	1154	670	670
query35	766	789	689	689
query36	1400	1385	1223	1223
query37	170	110	94	94
query38	1903	1715	1657	1657
query39	923	937	944	937
query39_1	939	923	938	923
query40	252	170	144	144
query41	75	72	91	72
query42	95	92	95	92
query43	327	330	294	294
query44	1489	798	782	782
query45	207	194	181	181
query46	1129	1287	761	761
query47	2427	2345	2247	2247
query48	409	448	281	281
query49	578	424	307	307
query50	1068	466	340	340
query51	4463	4375	4341	4341
query52	85	86	71	71
query53	263	298	213	213
query54	278	225	222	222
query55	77	70	66	66
query56	293	292	281	281
query57	1443	1389	1323	1323
query58	272	252	245	245
query59	1543	1668	1448	1448
query60	308	268	248	248
query61	156	149	157	149
query62	684	651	596	596
query63	248	211	213	211
query64	2550	761	601	601
query65	4910	4811	4789	4789
query66	1806	512	385	385
query67	28935	29499	29389	29389
query68	3059	1601	914	914
query69	407	307	267	267
query70	1070	1001	944	944
query71	376	326	302	302
query72	2907	2640	2536	2536
query73	880	759	444	444
query74	5073	4969	4817	4817
query75	2604	2587	2215	2215
query76	2309	1179	795	795
query77	364	378	285	285
query78	12323	12561	11840	11840
query79	1480	1133	778	778
query80	1312	542	481	481
query81	553	339	278	278
query82	656	156	119	119
query83	366	316	295	295
query84	282	166	134	134
query85	958	634	516	516
query86	435	290	267	267
query87	1814	1819	1761	1761
query88	3749	2829	2794	2794
query89	459	404	354	354
query90	1903	208	201	201
query91	204	190	160	160
query92	62	58	54	54
query93	1726	1491	1039	1039
query94	723	336	307	307
query95	771	595	483	483
query96	1045	794	382	382
query97	2696	2709	2563	2563
query98	210	212	207	207
query99	1167	1152	1028	1028
Total cold run time: 258901 ms
Total hot run time: 174259 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.41 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit de20a683e43511d50edb2634cdd5623ba2bbcb23, data reload: false

query1	0.00	0.00	0.00
query2	0.10	0.06	0.05
query3	0.26	0.14	0.14
query4	1.64	0.15	0.14
query5	0.24	0.22	0.22
query6	1.24	1.08	1.09
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.37	0.32	0.31
query10	0.55	0.56	0.57
query11	0.19	0.15	0.15
query12	0.18	0.14	0.14
query13	0.49	0.48	0.48
query14	1.02	1.02	1.00
query15	0.62	0.61	0.61
query16	0.30	0.33	0.32
query17	1.12	1.07	1.12
query18	0.23	0.22	0.21
query19	2.05	2.01	1.94
query20	0.01	0.01	0.01
query21	15.43	0.19	0.14
query22	4.99	0.06	0.05
query23	16.14	0.32	0.12
query24	2.96	0.41	0.33
query25	0.11	0.05	0.04
query26	0.73	0.21	0.16
query27	0.04	0.04	0.04
query28	3.48	0.92	0.56
query29	12.47	4.28	3.47
query30	0.27	0.16	0.15
query31	2.77	0.60	0.32
query32	3.22	0.60	0.50
query33	3.35	3.22	3.29
query34	15.52	4.25	3.54
query35	3.59	3.51	3.56
query36	0.56	0.43	0.44
query37	0.10	0.07	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.02
query40	0.18	0.16	0.16
query41	0.09	0.04	0.03
query42	0.04	0.02	0.03
query43	0.05	0.04	0.04
Total cold run time: 96.88 s
Total hot run time: 25.41 s

Issue Number: close #xxx

Related PR: apache#62058

Problem Summary: SHOW DATA ALL returns detailed database data with 9 metadata columns after LocalBinlogSize was added, but the Quota and Left summary rows still contained only 8 values. The FE MySQL protocol writer sends the 9-column metadata first and then serializes each row as-is, so MySQL clients see an inconsistent result packet and report ERROR 2027 (HY000): Malformed packet. This change pads the detailed Quota and Left rows with the missing LocalBinlogSize column and adds unit coverage to assert detailed SHOW DATA rows match metadata width.

Fix SHOW DATA ALL malformed packet caused by inconsistent result row width.

- Test: Unit Test
    - ./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.ShowDataCommandTest
    - ./run-regression-test.sh --run show_p0/test_show_data_all_db.groovy
- Behavior changed: Yes (SHOW DATA ALL now returns valid result packets instead of malformed packets)
- Does this need documentation: No
@hoshinojyunn

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29543 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7e142e18f6b47788379a85399790c127c5e607bd, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17627	3989	4092	3989
q2	2016	319	198	198
q3	10314	1395	828	828
q4	4682	469	337	337
q5	7492	864	571	571
q6	186	173	136	136
q7	746	851	623	623
q8	9478	1520	1616	1520
q9	6245	4466	4414	4414
q10	6779	1782	1558	1558
q11	508	346	314	314
q12	712	553	422	422
q13	18102	3404	2699	2699
q14	272	258	249	249
q15	q16	792	769	715	715
q17	1033	959	1035	959
q18	6911	5709	5596	5596
q19	1311	1280	1138	1138
q20	769	679	512	512
q21	6010	2688	2467	2467
q22	446	360	298	298
Total cold run time: 102431 ms
Total hot run time: 29543 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4432	4288	4266	4266
q2	274	314	206	206
q3	4579	5021	4516	4516
q4	2153	2203	1434	1434
q5	4626	4411	4360	4360
q6	237	180	127	127
q7	2130	2026	1704	1704
q8	2541	2161	2155	2155
q9	7916	7772	7800	7772
q10	4707	4749	4298	4298
q11	556	627	383	383
q12	759	754	528	528
q13	3275	3515	2974	2974
q14	306	318	280	280
q15	q16	725	741	675	675
q17	1358	1330	1332	1330
q18	8103	7288	7063	7063
q19	1096	1101	1106	1101
q20	2219	2200	1949	1949
q21	5285	4677	4542	4542
q22	538	455	439	439
Total cold run time: 57815 ms
Total hot run time: 52102 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 174074 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7e142e18f6b47788379a85399790c127c5e607bd, data reload: false

query5	4320	639	496	496
query6	464	215	205	205
query7	4868	582	345	345
query8	348	191	170	170
query9	8789	4061	4038	4038
query10	468	360	292	292
query11	5952	2329	2162	2162
query12	156	100	99	99
query13	1263	650	436	436
query14	6227	5303	4948	4948
query14_1	4293	4280	4271	4271
query15	222	219	177	177
query16	1020	452	428	428
query17	1112	712	563	563
query18	2439	459	339	339
query19	199	183	142	142
query20	109	104	108	104
query21	230	160	129	129
query22	13589	13667	13378	13378
query23	17283	16496	16174	16174
query23_1	16336	16189	16317	16189
query24	7432	1792	1344	1344
query24_1	1332	1331	1347	1331
query25	574	464	415	415
query26	1328	338	210	210
query27	2620	562	381	381
query28	4445	2006	2089	2006
query29	1122	647	523	523
query30	344	264	226	226
query31	1119	1096	1015	1015
query32	111	64	61	61
query33	529	332	266	266
query34	1180	1124	605	605
query35	777	786	677	677
query36	1427	1401	1221	1221
query37	154	107	100	100
query38	1887	1697	1658	1658
query39	926	907	944	907
query39_1	887	890	891	890
query40	251	170	153	153
query41	71	69	69	69
query42	98	97	96	96
query43	324	329	290	290
query44	1518	789	778	778
query45	221	191	183	183
query46	1085	1256	763	763
query47	2393	2320	2284	2284
query48	406	442	307	307
query49	587	422	319	319
query50	1079	443	351	351
query51	4476	4400	4346	4346
query52	94	91	78	78
query53	277	284	211	211
query54	286	264	230	230
query55	78	74	69	69
query56	304	334	287	287
query57	1440	1404	1345	1345
query58	310	266	255	255
query59	1614	1703	1468	1468
query60	315	283	265	265
query61	181	181	215	181
query62	699	649	571	571
query63	245	206	211	206
query64	2519	752	644	644
query65	4879	4831	4758	4758
query66	1807	518	375	375
query67	29487	29464	29231	29231
query68	3028	1613	972	972
query69	417	300	261	261
query70	1108	1019	962	962
query71	354	318	304	304
query72	2900	2643	2328	2328
query73	842	800	442	442
query74	5191	5006	4803	4803
query75	2602	2609	2218	2218
query76	2339	1208	823	823
query77	366	393	282	282
query78	12534	12452	11980	11980
query79	1474	1210	755	755
query80	1306	541	461	461
query81	557	321	274	274
query82	614	162	120	120
query83	370	324	296	296
query84	275	159	129	129
query85	954	591	531	531
query86	433	322	274	274
query87	1824	1831	1782	1782
query88	3808	2835	2799	2799
query89	459	413	355	355
query90	1870	199	192	192
query91	197	194	161	161
query92	65	61	55	55
query93	1797	1528	999	999
query94	735	390	324	324
query95	767	484	453	453
query96	1101	882	364	364
query97	2692	2689	2572	2572
query98	216	207	203	203
query99	1199	1150	1025	1025
Total cold run time: 259821 ms
Total hot run time: 174074 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.24 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7e142e18f6b47788379a85399790c127c5e607bd, data reload: false

query1	0.01	0.01	0.01
query2	0.10	0.06	0.05
query3	0.26	0.14	0.14
query4	1.61	0.15	0.13
query5	0.25	0.26	0.22
query6	1.25	1.06	1.07
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.32	0.31
query10	0.56	0.60	0.57
query11	0.19	0.15	0.15
query12	0.19	0.15	0.14
query13	0.47	0.48	0.49
query14	1.02	1.01	1.02
query15	0.64	0.59	0.61
query16	0.30	0.31	0.33
query17	1.17	1.09	1.15
query18	0.24	0.22	0.21
query19	2.04	1.94	1.93
query20	0.02	0.01	0.01
query21	15.44	0.23	0.13
query22	4.85	0.05	0.06
query23	16.13	0.32	0.12
query24	2.90	0.41	0.32
query25	0.10	0.05	0.04
query26	0.72	0.22	0.15
query27	0.04	0.05	0.03
query28	3.55	0.91	0.53
query29	12.49	4.30	3.47
query30	0.27	0.16	0.16
query31	2.77	0.58	0.32
query32	3.22	0.60	0.49
query33	3.17	3.17	3.18
query34	15.55	4.14	3.51
query35	3.55	3.51	3.57
query36	0.54	0.43	0.41
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.15
query41	0.08	0.03	0.02
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.62 s
Total hot run time: 25.24 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

2 similar comments
@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@morrySnow

Copy link
Copy Markdown
Contributor

/review

1 similar comment
@yiguolei

yiguolei commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review result: requested changes.

Critical checkpoint conclusions:

  • Goal/test: the production change fixes the detailed single-database SHOW DATA ALL row-width mismatch by padding the Quota and Left rows to the 9-column metadata shape. The new unit coverage checks metadata width against all detailed rows.
  • Scope: the code change is small and focused on result formatting; no unrelated production behavior changes were found.
  • Concurrency/lifecycle/config/compatibility/persistence/data writes: no new concurrency, lifecycle, config, persistent format, FE-BE protocol, or data-write path changes were introduced.
  • Parallel paths: checked detailed database output, table/index output, all-database output, and warehouse-property output. The table/index and all-database paths already produce rows matching their metadata; the changed detailed database summary rows were the missing path.
  • Tests/results: the regression exercises SHOW DATA ALL and checks row width, but one test-style issue remains in the added Groovy test. I did not run FE or regression tests because thirdparty/installed/bin/protoc is missing in this checkout; scoped git diff --check passed.
  • Observability/performance: no material observability or performance concern for this formatting fix.

Subagent conclusions:

  • optimizer-rewrite reported no candidates and returned NO_NEW_VALUABLE_FINDINGS in convergence round 1.
  • tests-session-config proposed TSC-1, accepted as MAIN-1 and submitted inline below; it returned NO_NEW_VALUABLE_FINDINGS in convergence round 1.
  • Duplicate suppression: no existing inline review comments or replies were present, and the live PR comments API also returned none.

User focus: no additional user-provided review focus was supplied.


suite("test_show_data_all_db") {
def dbName = "test_show_data_all_db";
def tableName = "test_show_data_all_tb";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new regression is an ordinary single-table case, but it defines def tableName and interpolates it through the DROP/CREATE/INSERT statements. The repo testing standard in AGENTS.md asks these simple table names to be hardcoded in the SQL instead, so please replace the variable with the literal test_show_data_all_tb.

@yiguolei yiguolei merged commit 0c8ee95 into apache:master Jul 6, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants