You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/08/06 12:04:30 UTC
[GitHub] [iotdb] zyk990424 commented on a change in pull request #3699: [To rel/0.12] MeasurementId check while insert
zyk990424 commented on a change in pull request #3699:
URL: https://github.com/apache/iotdb/pull/3699#discussion_r684181737
##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -1901,6 +1901,12 @@ public MNode getSeriesSchemasAndReadLockDevice(InsertPlan plan)
if (!config.isAutoCreateSchemaEnabled()) {
throw new PathNotExistException(deviceId + PATH_SEPARATOR + measurementList[i]);
} else {
+ // check measurementId syntax
+ if (measurementList[i].contains(".")
+ && !(measurementList[i].startsWith("\"") && measurementList[i].endsWith("\""))) {
+ throw new MetadataException(
+ String.format("%s is an illegal measurementId", measurementList[i]));
+ }
Review comment:
That's may be better encapsulation. I've updated my code.
Here's some explanation. In this problem, once the path is transformed from PartialPath to String, like root.sg.d.a.b with measurementId a.b, the regex is unable to check the problem. Only when the path is in format of name list, String[] nodeNames, can the problem be detected.
The string concat operation on path may exist widely in iotdb's code. That's why I suggested above, filter the illegal syntax before create query plan.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org