forked from MyCATApache/Mycat-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
处理就是rrs 的 GroupByCols对象里面的通配符去掉
- Loading branch information
noah
committed
Feb 19, 2019
1 parent
51dc4dc
commit 2d80929
Showing
3 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/io/mycat/route/parser/util/WildcardUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.mycat.route.parser.util; | ||
|
||
public class WildcardUtil { | ||
|
||
public static String wildcard(String name) { | ||
if (name.startsWith("`")) { | ||
name = name.replaceAll("`", ""); | ||
} else if (name.startsWith("\"")) { | ||
name = name.replaceAll("\"", ""); | ||
} else if (name.startsWith("'")) { | ||
name = name.replaceAll("'", ""); | ||
} | ||
return name; | ||
} | ||
|
||
public static void wildcards(String[] names) { | ||
for (int i = 0; i < names.length; i++) { | ||
names[i] = wildcard(names[i]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters