[
"//information_schema/CHARACTER_SETS",
"//information_schema/COLLATIONS",
"//information_schema/COLLATION_CHARACTER_SET_APPLICABILITY",
"//information_schema/COLUMNS",
"//ghy",
"//performance_schema/accounts",
"//performance_schema/cond_instances",
"//performance_schema/events_stages_current",
"//performance_schema/events_stages_history",
"//test1/test1"
]
判断数组中这些元素有没有相同的部分(除了//),每一个都含有相同的字符串则返回true,没有则返回false。
比如:
[
"//information_schema/CHARACTER_SETS",
"//information_schema/COLLATIONS",
"//information_schema/COLLATION_CHARACTER_SET_APPLICABILITY",
"//information_schema/COLUMNS"
]
数组中四个元素均含有information_schema,如果数组只有这四个元素,则返回true。
如果是对于整个数组而言,无法人为的切割呢
场景:
如果,这样勾选,不需要对返回的数组元素处理:
[
"ghy",
"performance_schema",
"test"
]
如果勾选了两个数据库test1和test4其中一个表,则返回false,见下图
如果勾选了两个数据库test1和test4,其中数据库test1的表test1和test2都勾选了,同时数据库test4的表course勾选了,这样也要返回false,见下图
如果数据库的表全部勾选,只处理数据库即可
[
"test1",
"course"
]