Skip to content

Invalid binding table configuration for alphabetical sharding keys in ShardingSphere-JDBC 5.5.2 #35293

@EvaDongCS

Description

@EvaDongCS

Bug Report

Which version of ShardingSphere did you use?

5.5.2

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

When my sharding key is alphabetical, I expect to successfully configure the binding tables t_order and t_order_item.

Actual behavior

An exception occurs when configuring the binding tables:
Caused by: org.apache.shardingsphere.sharding.exception.metadata.InvalidBindingTablesException: Invalid binding table configuration.

Reason analyze (If you can)

The DATA_NODE_SUFFIX_PATTERN uses \\d+$, which causes the system to expect the suffix of the binding tables to be numeric. However, the actual table names t_order_a and t_order_item_a have alphabetical suffixes, leading to the configuration being rejected.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

  1. Create tables t_order and t_order_item, with their sharding tables named t_order_a and t_order_item_a.
  2. Configure the binding tables as follows:

bindingTables:

  • t_order,t_order_item
  1. Start the application and observe the exception.

Example codes for reproduce this issue (such as a github link).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions