You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2022/01/20 05:23:57 UTC
[iotdb] 01/01: [IOTDB-2441] Msg has no status code when MULTIPLE_ERROR occurs
This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch IOTDB-2441
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 717179b7014a6f6a9ed3a10d87a6758ec1b65515
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Thu Jan 20 13:23:14 2022 +0800
[IOTDB-2441] Msg has no status code when MULTIPLE_ERROR occurs
---
.../iotdb/db/integration/IoTDBSelectIntoIT.java | 21 +++++++++++++++++++++
.../main/java/org/apache/iotdb/rpc/RpcUtils.java | 5 +++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
index 820c6d9..da61024 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSelectIntoIT.java
@@ -122,6 +122,13 @@ public class IoTDBSelectIntoIT {
TSEncoding.PLAIN,
CompressionType.UNCOMPRESSED,
null);
+
+ IoTDB.metaManager.createTimeseries(
+ new PartialPath("root.sg.d1.datatype"),
+ TSDataType.DOUBLE,
+ TSEncoding.PLAIN,
+ CompressionType.UNCOMPRESSED,
+ null);
}
private static void generateData() {
@@ -398,6 +405,20 @@ public class IoTDBSelectIntoIT {
}
@Test
+ public void testSourceAndTargetPathDataTypeUnmatched() {
+ try (Connection connection =
+ DriverManager.getConnection(
+ Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+ Statement statement = connection.createStatement()) {
+ statement.execute("select s1 " + "into root.sg.d1.`datatype` " + "from root.sg.d1");
+ fail();
+ } catch (SQLException throwable) {
+ assertTrue(throwable.getMessage().contains("506"));
+ assertTrue(throwable.getMessage().contains("mismatch"));
+ }
+ }
+
+ @Test
public void testSelectIntoAlignedTimeSeriesWithUnmatchedTypes() {
try (Connection connection =
DriverManager.getConnection(
diff --git a/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcUtils.java b/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcUtils.java
index 0cfa04b..b294325 100644
--- a/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcUtils.java
+++ b/service-rpc/src/main/java/org/apache/iotdb/rpc/RpcUtils.java
@@ -136,11 +136,12 @@ public class RpcUtils {
}
public static void verifySuccess(List<TSStatus> statuses) throws BatchExecutionException {
- StringBuilder errMsgs = new StringBuilder();
+ StringBuilder errMsgs =
+ new StringBuilder().append(TSStatusCode.MULTIPLE_ERROR.getStatusCode()).append(": ");
for (TSStatus status : statuses) {
if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()
&& status.getCode() != TSStatusCode.NEED_REDIRECTION.getStatusCode()) {
- errMsgs.append(status.getMessage()).append(";");
+ errMsgs.append(status.getMessage()).append("; ");
}
}
if (errMsgs.length() > 0) {