Skip to content

Reject database paths with empty nodes on ConfigNode#18308

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/cn-database-empty-path-node
Open

Reject database paths with empty nodes on ConfigNode#18308
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/cn-database-empty-path-node

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

ConfigNode now validates every node in a database path before checking database conflicts. If any node is an empty string, the request is rejected with ILLEGAL_PATH instead of allowing an invalid path such as root. or an empty table-model database name into ConfigNode metadata.

The validation stays in ClusterSchemaInfo.isDatabaseNameValid, so all database creation paths that go through ClusterSchemaManager, including pipe-generated plans, share the same guard.

Unit coverage includes valid tree/table database names and empty nodes at the database, middle, and trailing levels.

Tests

  • mvn spotless:apply -pl iotdb-core/confignode
  • mvn test -pl iotdb-core/confignode -Dtest=ClusterSchemaInfoTest
  • mvn test-compile -pl iotdb-core/confignode -P with-zh-locale -DskipTests

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths.

Key changed/added classes
  • ClusterSchemaInfo
  • ClusterSchemaInfoTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant