Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
1b3b1a1
Pipe: Ignore logging when `returnSelf` is called in the event of an e…
luoluoyuyu Dec 2, 2025
2778868
Fixed the schema cache calculation 2 & The potential NPE caused by co…
Caideyipi Dec 2, 2025
e53f7e2
Fix the check of grant option for tree model (#16845)
shuwenwei Dec 2, 2025
999b359
Pipe: Fixed the bug that lower version tablet may cause NPE when sent…
Caideyipi Dec 2, 2025
5740154
Pipe: Fixed the auth implementation error (#16847)
Caideyipi Dec 2, 2025
d1e3e48
Fix NPE during compaction when disk space is insufficient (#16841)
shuwenwei Dec 3, 2025
9a3cbff
PipePlugin: Optimized the errorCode && Fixed the case-sensitive seman…
Caideyipi Dec 3, 2025
5523601
Pipe: Fix NullPointerException in concurrent event access (#16849)
luoluoyuyu Dec 4, 2025
bb55dd6
may-c (#16859)
Caideyipi Dec 4, 2025
ad448bc
Pipe: Prevent duplicate error logging in AsyncPipeDataTransferService…
luoluoyuyu Dec 4, 2025
d5c37ef
perf: Optimize TypeManager allocation in StatementAnalyzer (#16870)
luoluoyuyu Dec 5, 2025
78a01cf
Add system table named connections to resolve the idle session can be…
zerolbsony Dec 5, 2025
b02ae03
Switch to at.yawk.lz4:lz4-java:1.10.0 (#16871)
HTHou Dec 5, 2025
526ef27
Bump at.yawk.lz4:lz4-java from 1.10.0 to 1.10.1 (#16874)
dependabot[bot] Dec 6, 2025
186f602
Bump tsfile version to 2.2.0-251208-SNAPSHOT
JackieTien97 Dec 8, 2025
a600b44
Fix compile error caused by `perf: Use enum types for compression and…
JackieTien97 Dec 8, 2025
557f74c
Fix compile error
JackieTien97 Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE-binary
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ conditions of the following licenses.
The binary distribution of this product bundles these dependencies under the
following license. See licenses/ for text of these licenses.

Apache Software Foundation License 2.0
Apache License 2.0
--------------------------------------
commons-cli:commons-cli:1.5.0
com.nimbusds:content-type:2.2
Expand All @@ -223,7 +223,7 @@ com.fasterxml.jackson.core:jackson-annotations:2.16.2
com.fasterxml.jackson.core:jackson-core:2.16.2
com.fasterxml.jackson.core:jackson-databind:2.16.2
jakarta.inject:jakarta.inject:2.6.1
org.lz4:lz4-java:1.8.0
at.yawk.lz4:lz4-java:1.10.0
com.github.stephenc.jcip:jcip-annotations:1.0-1
com.github.ben-manes.caffeine:caffeine:2.9.3
org.eclipse.jetty:jetty-http:9.4.57.v20241219
Expand Down
2 changes: 1 addition & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": [
"at.yawk.lz4:lz4-java",
"cglib:cglib",
"ch.qos.logback:logback-classic",
"ch.qos.logback:logback-core",
Expand Down Expand Up @@ -155,7 +156,6 @@
"org.jline:jline",
"org.jvnet.mimepull:mimepull",
"org.latencyutils:LatencyUtils",
"org.lz4:lz4-java",
"org.ops4j.pax.jdbc:pax-jdbc-common",
"org.osgi:osgi.cmpn",
"org.osgi:osgi.core",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ public void testGrantAndGrantOpt() throws SQLException {
adminStmt.execute("CREATE USER user1 'password123456'");
adminStmt.execute("CREATE USER user2 'password123456'");
adminStmt.execute("CREATE USER user3 'password123456'");
adminStmt.execute("CREATE USER user4 'password123456'");
adminStmt.execute("CREATE USER user5 'password123456'");
adminStmt.execute("CREATE ROLE testRole");
adminStmt.execute("GRANT system ON root.** TO ROLE testRole WITH GRANT OPTION");
adminStmt.execute("GRANT READ_DATA ON root.t1.** TO ROLE testRole");
Expand Down Expand Up @@ -1095,6 +1097,18 @@ public void testGrantAndGrantOpt() throws SQLException {
}
}

try (Connection userCon = EnvFactory.getEnv().getConnection("user4", "password123456");
Statement userStmt = userCon.createStatement()) {
adminStmt.execute("GRANT SYSTEM ON root.** TO USER user4");
try {
Assert.assertThrows(
SQLException.class, () -> userStmt.execute("GRANT SYSTEM ON root.** TO USER user5"));
adminStmt.execute("GRANT SYSTEM ON root.** TO USER user5");
} finally {
userStmt.close();
}
}

adminStmt.close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
Expand Down Expand Up @@ -757,4 +758,64 @@ public void testValidPipeWithoutWithSink() {
fail(e.getMessage());
}
}

@Test
public void testPipePluginValidation() {
try (final Connection connection = senderEnv.getConnection();
final Statement statement = connection.createStatement()) {
try {
statement.execute(
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'");
fail();
} catch (final SQLException e) {
Assert.assertEquals(
"701: Untrusted uri xxx, current trusted_uri_pattern is file:.*", e.getMessage());
}
try {
statement.execute(
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'file:.*'");
fail();
} catch (final SQLException e) {
Assert.assertEquals("701: URI is not hierarchical", e.getMessage());
}
try {
statement.execute(
String.format(
"create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI '%s'",
new File(
System.getProperty("user.dir")
+ File.separator
+ "target"
+ File.separator
+ "test-classes"
+ File.separator)
.toURI()
+ "PipePlugin.jar"));
fail();
} catch (final SQLException e) {
Assert.assertEquals(
"1603: Failed to get executable for PipePlugin TestProcessor, please check the URI.",
e.getMessage());
}
try {
statement.execute("drop pipePlugin test_processor");
fail();
} catch (final SQLException e) {
Assert.assertEquals(
"1601: Failed to drop pipe plugin TEST_PROCESSOR. Failures: TEST_PROCESSOR does not exist.",
e.getMessage());
}
try {
statement.execute("drop pipePlugin `Do-Nothing-Sink`");
fail();
} catch (final SQLException e) {
Assert.assertEquals(
"1601: Failed to drop PipePlugin [DO-NOTHING-SINK], the PipePlugin is a built-in PipePlugin",
e.getMessage());
}
} catch (final SQLException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

package org.apache.iotdb.pipe.it.single;

import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
import org.apache.iotdb.db.it.utils.TestUtils;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.MultiClusterIT1;
Expand All @@ -33,6 +31,7 @@
import org.junit.runner.RunWith;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
Expand All @@ -44,7 +43,7 @@
public class IoTDBPipePermissionIT extends AbstractPipeSingleIT {
@Test
public void testSinkPermission() {
TestUtils.executeNonQuery(env, "create user `thulab` 'passwd'", null);
TestUtils.executeNonQuery(env, "create user `thulab` 'StrngPsWd@623451'", null);

// Shall fail if username is specified without password
try (final Connection connection = env.getConnection(BaseEnv.TABLE_SQL_DIALECT);
Expand Down Expand Up @@ -90,7 +89,8 @@ public void testSinkPermission() {
// Successfully alter
try (final Connection connection = env.getConnection(BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
statement.execute("alter pipe a2b modify sink ('username'='thulab', 'password'='passwd')");
statement.execute(
"alter pipe a2b modify sink ('username'='thulab', 'password'='StrngPsWd@623451')");
} catch (final SQLException e) {
e.printStackTrace();
fail("Alter pipe shall not fail if user and password are specified");
Expand Down Expand Up @@ -156,14 +156,12 @@ public void testSinkPermission() {
}

// A user shall only see its own pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) env.getLeaderConfigNodeConnection()) {
Assert.assertEquals(
1,
client
.showPipe(new TShowPipeReq().setIsTableModel(true).setUserName("thulab"))
.pipeInfoList
.size());
try (final Connection connection =
env.getConnection("thulab", "StrngPsWd@623451", BaseEnv.TABLE_SQL_DIALECT);
final Statement statement = connection.createStatement()) {
final ResultSet result = statement.executeQuery("show pipes");
Assert.assertTrue(result.next());
Assert.assertFalse(result.next());
} catch (Exception e) {
fail(e.getMessage());
}
Expand All @@ -181,7 +179,8 @@ public void testSinkPermissionWithHistoricalDataAndTablePattern() {
BaseEnv.TABLE_SQL_DIALECT,
env,
Arrays.asList(
"create user thulab 'passwD@123456'", "grant INSERT on test.test1 to user thulab"),
"create user thulab 'StrngPsWd@623451@123456'",
"grant INSERT on test.test1 to user thulab"),
null);

// Write some data
Expand All @@ -196,7 +195,7 @@ public void testSinkPermissionWithHistoricalDataAndTablePattern() {
"create pipe a2b "
+ "with source ('database'='test1', 'table'='test1') "
+ "with processor('processor'='rename-database-processor', 'processor.new-db-name'='test') "
+ "with sink ('sink'='write-back-sink', 'username'='thulab', 'password'='passwD@123456')");
+ "with sink ('sink'='write-back-sink', 'username'='thulab', 'password'='StrngPsWd@623451@123456')");
} catch (final SQLException e) {
e.printStackTrace();
fail("Create pipe without user shall succeed if use the current session");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ public void testInformationSchema() throws SQLException {
"columns,INF,",
"config_nodes,INF,",
"configurations,INF,",
"connections,INF,",
"data_nodes,INF,",
"databases,INF,",
"functions,INF,",
Expand Down Expand Up @@ -575,6 +576,8 @@ public void testInformationSchema() throws SQLException {
Assert.assertThrows(
SQLException.class, () -> statement.execute("select * from config_nodes"));
Assert.assertThrows(SQLException.class, () -> statement.execute("select * from data_nodes"));
Assert.assertThrows(
SQLException.class, () -> statement.executeQuery("select * from pipe_plugins"));

// Filter out not self-created pipes
TestUtils.assertResultSetEqual(
Expand All @@ -583,12 +586,6 @@ public void testInformationSchema() throws SQLException {
Collections.emptySet());

// No auth needed
TestUtils.assertResultSetEqual(
statement.executeQuery(
"select * from pipe_plugins where plugin_name = 'IOTDB-THRIFT-SINK'"),
"plugin_name,plugin_type,class_name,plugin_jar,",
Collections.singleton(
"IOTDB-THRIFT-SINK,Builtin,org.apache.iotdb.commons.pipe.agent.plugin.builtin.sink.iotdb.thrift.IoTDBThriftSink,null,"));

TestUtils.assertResultSetEqual(
statement.executeQuery(
Expand Down Expand Up @@ -648,12 +645,13 @@ public void testInformationSchema() throws SQLException {
"information_schema,nodes,INF,USING,null,SYSTEM VIEW,",
"information_schema,config_nodes,INF,USING,null,SYSTEM VIEW,",
"information_schema,data_nodes,INF,USING,null,SYSTEM VIEW,",
"information_schema,connections,INF,USING,null,SYSTEM VIEW,",
"test,test,INF,USING,test,BASE TABLE,",
"test,view_table,100,USING,null,VIEW FROM TREE,")));
TestUtils.assertResultSetEqual(
statement.executeQuery("count devices from tables where status = 'USING'"),
"count(devices),",
Collections.singleton("19,"));
Collections.singleton("20,"));
TestUtils.assertResultSetEqual(
statement.executeQuery(
"select * from columns where table_name = 'queries' or database = 'test'"),
Expand Down
Loading
Loading