{"record":{"id":"a3688948280d5751","repo":"MyCATApache/Mycat-Server","slug":"invalid-table-subtables","errorCode":null,"errorMessage":"invalid table subTables","messagePattern":"invalid table subTables","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/config/model/TableConfig.java","lineNumber":98,"sourceCode":"        this.dbTypes = dbType;\n        if (ruleRequired && rule == null) {\n            throw new IllegalArgumentException(\"ruleRequired but rule is null\");\n        }\n\n        this.name = tableName.toUpperCase();\n        String theDataNodes[] = SplitUtil.split(dataNode, ',', '$', '-');\n        if (theDataNodes == null || theDataNodes.length <= 0) {\n            throw new IllegalArgumentException(\"invalid table dataNodes: \" + dataNode);\n        }\n        dataNodes = new ArrayList<String>(theDataNodes.length);\n        for (String dn : theDataNodes) {\n            dataNodes.add(dn);\n        }\n\n        if (subTables != null && !subTables.equals(\"\")) {\n            String sTables[] = SplitUtil.split(subTables, ',', '$', '-');\n            if (sTables == null || sTables.length <= 0) {\n                throw new IllegalArgumentException(\"invalid table subTables\");\n            }\n            this.distTables = new ArrayList<String>(sTables.length);\n            for (String table : sTables) {\n                distTables.add(table);\n            }\n        } else {\n            this.distTables = new ArrayList<String>();\n        }\n\n        this.rule = rule;\n        this.partitionColumn = (rule == null) ? null : rule.getColumn();\n        partionKeyIsPrimaryKey = (partitionColumn == null) ? primaryKey == null : partitionColumn.equals(primaryKey);\n        this.ruleRequired = ruleRequired;\n        this.childTable = isChildTable;\n        this.parentTC = parentTC;\n        this.joinKey = joinKey;\n        this.parentKey = parentKey;\n        if (parentTC != null) {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/config/model/TableConfig.java#L80-L116","documentation":"When a TableConfig has a non-empty subTables value, TableConfig splits it with SplitUtil.split and requires at least one resulting table name. If the split yields null or an empty array, IllegalArgumentException(\"invalid table subTables\") is thrown — the subTables attribute exists but resolves to no actual sub-table names.","triggerScenarios":"subTables is non-null and non-empty but SplitUtil.split(subTables, ',', '$', '-') returns null or length 0 — e.g. only delimiters/whitespace such as subTables=\",,\".","commonSituations":"schema.xml table element with subTables=\"\" patterns of commas; copy-paste leaving just separators; malformed range expression in the subTables list.","solutions":["Provide a concrete comma-separated sub-table list, e.g. subTables=\"orders_0,orders_1\" or a valid range like orders$0-127.","Remove stray commas or whitespace-only entries from the subTables value.","If no sub-tables are intended, omit the subTables attribute entirely so the branch is skipped."],"exampleFix":"// before (schema.xml)\n<table name=\"orders\" dataNode=\"dn1\" subTables=\", ,\" />\n// after\n<table name=\"orders\" dataNode=\"dn1\" subTables=\"orders$0-orders$2\" />","handlingStrategy":"validation","validationCode":"if (subTables != null && !subTables.isEmpty()) {\n    String[] st = SplitUtil.split(subTables, ',', '$', '-');\n    if (st == null || st.length == 0) throw new IllegalArgumentException(\"invalid subTables for table \" + tableName);\n}","typeGuard":null,"tryCatchPattern":"try { new TableConfig(...); } catch (IllegalArgumentException e) { if (\"invalid table subTables\".equals(e.getMessage())) { LOG.error(\"subTables set but resolves to no names\"); } throw e; }","preventionTips":["List sub-tables explicitly (orders_0,orders_1) or use a valid range expression.","Omit subTables entirely when the table has no sub-tables.","Lint schema.xml for separator-only attribute values."],"tags":["config","mycat","subtables","invalid-argument"],"backgroundTag":"invalid-config-value","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}