This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 46a4fedb545 branch-3.1: [fix](auth)fix not allow set query_timeout
property <0 #55168 (#55331)
46a4fedb545 is described below
commit 46a4fedb54565af2974fc137e17361a4e6526520
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Aug 27 15:28:56 2025 +0800
branch-3.1: [fix](auth)fix not allow set query_timeout property <0 #55168
(#55331)
Cherry-picked from #55168
Co-authored-by: zhangdong <[email protected]>
---
.../apache/doris/mysql/privilege/CommonUserProperties.java | 3 ---
.../test/java/org/apache/doris/catalog/UserPropertyTest.java | 12 ++++++++++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/CommonUserProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/CommonUserProperties.java
index 12ed8cea083..67f3c7859e2 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/CommonUserProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/CommonUserProperties.java
@@ -146,9 +146,6 @@ public class CommonUserProperties implements Writable,
GsonPostProcessable {
}
public void setQueryTimeout(int timeout) {
- if (timeout <= 0) {
- LOG.warn("Setting 0 query timeout", new RuntimeException(""));
- }
this.queryTimeout = timeout;
}
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
b/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
index 6afe9b816b1..6762f6bbad0 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
@@ -168,6 +168,18 @@ public class UserPropertyTest {
Assert.assertTrue(e.getMessage().contains("is not valid"));
}
Assert.assertEquals(-1, userProperty.getCpuResourceLimit());
+ // we should allow query_timeout < 0, otherwise, not have command
reset query_timeout of user
+ properties = Lists.newArrayList();
+ properties.add(Pair.of("query_timeout", "-2"));
+ userProperty = new UserProperty();
+ userProperty.update(properties);
+ Assert.assertEquals(-2, userProperty.getQueryTimeout());
+ // we should allow insert_timeout < 0, otherwise, not have command
reset insert_timeout of user
+ properties = Lists.newArrayList();
+ properties.add(Pair.of("insert_timeout", "-2"));
+ userProperty = new UserProperty();
+ userProperty.update(properties);
+ Assert.assertEquals(-2, userProperty.getInsertTimeout());
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]