Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](auth)Fix the need for low-level table permissions when querying views in certain situations #44621

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

zddr
Copy link
Contributor

@zddr zddr commented Nov 26, 2024

What problem does this PR solve?

fix when create view v1 as select * from table1 union select * from table2 and user has select_priv of v1,but he can not select * from v1

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
Fix the need for low-level table permissions when querying views in certain situations

Release note

Fix the need for low-level table permissions when querying views in certain situations

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
  • 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

@doris-robot
Copy link

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?

@zddr
Copy link
Contributor Author

zddr commented Nov 26, 2024

run buildall

924060929
924060929 previously approved these changes Nov 26, 2024
@zddr
Copy link
Contributor Author

zddr commented Nov 26, 2024

run buildall

Copy link
Contributor

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

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 26, 2024
Copy link
Contributor

PR approved by anyone and no changes requested.

@zddr
Copy link
Contributor Author

zddr commented Nov 26, 2024

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Nov 26, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 26, 2024
Copy link
Contributor

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

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17919	7512	7279	7279
q2	2047	178	174	174
q3	10626	1120	1119	1119
q4	10348	709	733	709
q5	7602	2963	2707	2707
q6	241	143	148	143
q7	951	629	612	612
q8	9230	1844	1947	1844
q9	6614	6444	6361	6361
q10	6963	2246	2311	2246
q11	456	263	251	251
q12	406	210	209	209
q13	17773	3003	2987	2987
q14	237	209	218	209
q15	575	530	519	519
q16	640	593	591	591
q17	976	559	568	559
q18	7362	6717	6742	6717
q19	1338	1068	895	895
q20	470	172	174	172
q21	3928	3215	3045	3045
q22	374	308	316	308
Total cold run time: 107076 ms
Total hot run time: 39656 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7306	7251	7208	7208
q2	319	231	224	224
q3	2892	2744	3072	2744
q4	2080	1816	1780	1780
q5	5556	5724	5674	5674
q6	218	135	131	131
q7	2184	1771	1815	1771
q8	3388	3480	3497	3480
q9	8858	8841	8907	8841
q10	3561	3556	3536	3536
q11	601	517	500	500
q12	829	616	608	608
q13	8850	3273	3119	3119
q14	315	266	273	266
q15	572	518	520	518
q16	692	637	623	623
q17	1802	1588	1589	1588
q18	7791	7494	7503	7494
q19	1647	1536	1527	1527
q20	2017	1808	1852	1808
q21	5285	5259	4939	4939
q22	629	590	553	553
Total cold run time: 67392 ms
Total hot run time: 58932 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 192029 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 21ad0358f460dda22c37ee9ac248e2fdf618634b, data reload: false

query1	963	387	389	387
query2	6523	2122	2016	2016
query3	6700	217	208	208
query4	34121	23582	23430	23430
query5	4301	471	495	471
query6	286	193	191	191
query7	4632	292	306	292
query8	283	222	213	213
query9	9441	2611	2608	2608
query10	474	248	249	248
query11	18161	15113	15087	15087
query12	156	98	104	98
query13	1644	408	417	408
query14	10066	7597	7562	7562
query15	301	175	177	175
query16	8151	459	432	432
query17	1816	587	563	563
query18	2132	286	289	286
query19	370	149	142	142
query20	115	111	111	111
query21	214	102	104	102
query22	4753	4260	4350	4260
query23	35069	34065	34216	34065
query24	10417	2560	2613	2560
query25	661	400	415	400
query26	1205	154	156	154
query27	2570	294	298	294
query28	7799	2420	2413	2413
query29	873	441	437	437
query30	302	153	152	152
query31	1038	796	831	796
query32	98	58	59	58
query33	795	301	293	293
query34	984	508	528	508
query35	856	744	734	734
query36	1182	958	1006	958
query37	138	79	76	76
query38	4393	4184	4209	4184
query39	1485	1440	1429	1429
query40	206	101	102	101
query41	48	45	45	45
query42	112	99	100	99
query43	529	471	486	471
query44	1233	787	789	787
query45	186	169	166	166
query46	1203	735	721	721
query47	1952	1828	1961	1828
query48	425	312	320	312
query49	1152	378	405	378
query50	857	404	398	398
query51	7465	7102	7122	7102
query52	98	90	88	88
query53	265	191	187	187
query54	1434	398	409	398
query55	80	80	81	80
query56	274	246	240	240
query57	1295	1235	1171	1171
query58	227	223	225	223
query59	3205	3162	3018	3018
query60	282	261	247	247
query61	107	114	108	108
query62	922	682	697	682
query63	220	191	186	186
query64	5367	649	626	626
query65	3318	3233	3233	3233
query66	1473	334	334	334
query67	16150	15911	15648	15648
query68	5016	549	554	549
query69	442	253	256	253
query70	1206	1154	1167	1154
query71	340	254	248	248
query72	6445	4063	4130	4063
query73	796	352	366	352
query74	10261	9069	9030	9030
query75	3518	2745	2739	2739
query76	2920	1127	1116	1116
query77	400	271	283	271
query78	10512	9464	9489	9464
query79	2543	626	611	611
query80	1140	459	443	443
query81	545	234	238	234
query82	731	123	120	120
query83	251	183	142	142
query84	235	68	68	68
query85	1507	297	304	297
query86	461	297	302	297
query87	4801	4582	4524	4524
query88	3959	2160	2146	2146
query89	435	320	297	297
query90	2196	197	246	197
query91	142	112	105	105
query92	70	55	52	52
query93	1515	543	544	543
query94	987	299	294	294
query95	347	252	249	249
query96	659	282	269	269
query97	2904	2700	2729	2700
query98	221	196	201	196
query99	1539	1328	1329	1328
Total cold run time: 304597 ms
Total hot run time: 192029 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.98 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 21ad0358f460dda22c37ee9ac248e2fdf618634b, data reload: false

query1	0.04	0.03	0.02
query2	0.07	0.03	0.03
query3	0.24	0.08	0.07
query4	1.60	0.10	0.11
query5	0.42	0.42	0.40
query6	1.14	0.69	0.65
query7	0.02	0.02	0.02
query8	0.04	0.04	0.03
query9	0.59	0.51	0.50
query10	0.54	0.55	0.56
query11	0.14	0.11	0.11
query12	0.13	0.11	0.10
query13	0.61	0.59	0.60
query14	2.68	2.72	2.83
query15	0.89	0.82	0.82
query16	0.41	0.37	0.38
query17	0.96	1.08	1.06
query18	0.22	0.21	0.20
query19	1.97	1.83	1.97
query20	0.02	0.02	0.01
query21	15.36	0.62	0.60
query22	2.97	1.89	1.50
query23	17.14	0.97	0.85
query24	3.06	2.01	1.68
query25	0.27	0.14	0.11
query26	0.67	0.13	0.14
query27	0.05	0.05	0.04
query28	9.53	1.09	1.07
query29	12.55	3.24	3.25
query30	0.25	0.07	0.07
query31	2.87	0.39	0.37
query32	3.27	0.45	0.47
query33	2.96	3.01	3.06
query34	17.00	4.40	4.49
query35	4.51	4.52	4.48
query36	0.66	0.49	0.51
query37	0.08	0.06	0.06
query38	0.05	0.04	0.04
query39	0.03	0.02	0.02
query40	0.16	0.13	0.12
query41	0.09	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.04
Total cold run time: 106.33 s
Total hot run time: 32.98 s

@zddr
Copy link
Contributor Author

zddr commented Nov 27, 2024

run p0

@morrySnow morrySnow merged commit da79ceb into apache:master Nov 27, 2024
26 of 28 checks passed
zddr added a commit to zddr/incubator-doris that referenced this pull request Dec 2, 2024
… views in certain situations (apache#44621)

fix when `create view v1 as select * from table1 union select * from
table2` and user has select_priv of v1,but he can not `select * from v1`

Fix the need for low-level table permissions when querying views in
certain situations
zddr added a commit to zddr/incubator-doris that referenced this pull request Dec 2, 2024
… views in certain situations (apache#44621)

fix when `create view v1 as select * from table1 union select * from
table2` and user has select_priv of v1,but he can not `select * from v1`

Fix the need for low-level table permissions when querying views in
certain situations
yiguolei pushed a commit that referenced this pull request Dec 4, 2024
morningman pushed a commit that referenced this pull request Dec 8, 2024
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. dev/2.1.8-merged dev/3.0.4-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants