mirror of
https://github.com/actiontech/dble.git
synced 2026-01-07 13:20:21 -06:00
Merge pull request #354 from actiontech/issue-346
#346 Suggested:when view set `ALGORITHM` ,dble can return unsupported…
This commit is contained in:
@@ -71,6 +71,10 @@ public class ViewMeta {
|
||||
viewParser.parseCreateView(this);
|
||||
|
||||
try {
|
||||
if ("".equals(viewName)) {
|
||||
throw new Exception("sql not supported ");
|
||||
}
|
||||
|
||||
DbleServer.getInstance().getTmManager().addMetaLock(schema, viewName);
|
||||
|
||||
//check if the select part has
|
||||
|
||||
@@ -91,6 +91,8 @@ public class ViewMetaParser {
|
||||
return originalSql.substring(viewNameStat, offset);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,17 @@ public class ViewMetaParserTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void getViewNodeSupportTest() {
|
||||
ViewMetaParser x = new ViewMetaParser("create or replace ALGORITHM = MERGE view x_xx__xx(id,name)as select * from suntest");
|
||||
Assert.assertEquals("", x.getViewName());
|
||||
x = new ViewMetaParser("create or replace DEFINER = CURRENT_USER view x_xx__xx(id,name)as select * from suntest");
|
||||
Assert.assertEquals("", x.getViewName());
|
||||
x = new ViewMetaParser("create or replace SQL SECURITY DEFINER view x_xx__xx(id,name)as select * from suntest");
|
||||
Assert.assertEquals("", x.getViewName());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseTotalTest() {
|
||||
ViewMetaParser x = new ViewMetaParser(" create or replace view x_xx__xx(id,name)as select * from suntest");
|
||||
|
||||
Reference in New Issue
Block a user