[IOTDB-3168][To rel/0.13] Fix the path with * could be executed successfully when inserting#6051
[IOTDB-3168][To rel/0.13] Fix the path with * could be executed successfully when inserting#6051HTHou merged 4 commits intoapache:rel/0.13from 23931017wu:IOTDB-3168
Conversation
| for (String name : timeseries.getNodes()) { | ||
| try { | ||
| checkReservedNames(name); | ||
| checkNameFormatIfHasstar(name); |
There was a problem hiding this comment.
| checkNameFormatIfHasstar(name); | |
| checkNameFormatIfHasStar(name); |
| // set recover config, avoid creating deleted time series when recovering wal | ||
| boolean prevIsAutoCreateSchemaEnabled = config.isAutoCreateSchemaEnabled(); | ||
| config.setAutoCreateSchemaEnabled(false); | ||
| config.setAutoCreateSchemaEnabled(true); |
There was a problem hiding this comment.
why change the mode? We need to disable auto create when recover.
There was a problem hiding this comment.
Okay, got it.The state was changed to find the error.
|
|
||
| /** check whether the node name uses "*" correctly */ | ||
| private static void checkNameFormatIfHasstar(String name) throws MetadataException { | ||
| if (!((name.startsWith("'") && name.endsWith("'")) |
There was a problem hiding this comment.
use backquote, not the quotation
|
IoTDB> create timeseries root.test..a.b |
|
LGTM |

By adding a function of "checkNameFormatIfHasstar" to "MetaFormatUnit.java". Introduce the "checkNameFormatIfHasstar" in "checkTimeseries".
Create a new function in bb
/** check whether the node name uses "*" correctly /
private static void checkNameFormatIfHasstar(String name) throws MetadataException {
if (!((name.startsWith("'") && name.endsWith("'"))
|| (name.startsWith(""") && name.endsWith(""")))
&& name.contains("")
}
Content2 ...
/** check whether the given path is well formatted */
public static void checkTimeseries(PartialPath timeseries) throws IllegalPathException {
try {
checkCharacters(timeseries.getFullPath());
} catch (MetadataException e) {
throw new IllegalPathException(timeseries.getFullPath(), e.getMessage());
}
for (String name : timeseries.getNodes()) {
try {
checkReservedNames(name);
checkNameFormatIfHasstar(name);
checkNameFormat(name);
} catch (MetadataException e) {
throw new IllegalPathException(timeseries.getFullPath(), e.getMessage());
}
}
}