forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBMSCommon.java
More file actions
30 lines (21 loc) · 717 Bytes
/
DBMSCommon.java
File metadata and controls
30 lines (21 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package sqlancer.common;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class DBMSCommon {
private static final Pattern SQLANCER_INDEX_PATTERN = Pattern.compile("^i\\d+");
private DBMSCommon() {
}
public static String createTableName(int nr) {
return String.format("t%d", nr);
}
public static String createColumnName(int nr) {
return String.format("c%d", nr);
}
public static String createIndexName(int nr) {
return String.format("i%d", nr);
}
public static boolean matchesIndexName(String indexName) {
Matcher matcher = SQLANCER_INDEX_PATTERN.matcher(indexName);
return matcher.matches();
}
}