提交 7b482dff authored 作者: Owner's avatar Owner

Undo help.csv change, minor edits in other file

上级 5cad03b9
......@@ -1137,7 +1137,7 @@ public class Parser {
String[] querySQLOutput = new String[]{null};
List<Column> columnTemplateList = createQueryColumnTemplateList(null, command.getQuery(), querySQLOutput);
Table temporarySourceTableView = createTemporarySessionView(
TableView temporarySourceTableView = createTemporarySessionView(
command.getQueryAlias(), querySQLOutput[0],
columnTemplateList, false/* no recursion */,
false/* do not add to session */,
......@@ -5129,18 +5129,18 @@ public class Parser {
List<TableView> viewsCreated = new ArrayList<>();
readIf("RECURSIVE");
// this WITH statement might not be temporary - allow keyword to tell us that
// this WITH statement might not be temporary - allow optional keyword to tell us that
// this keyword is a work in progress feature and will not be documented
boolean isPersistent = readIf("PERSISTENT");
// this WITH statement might not be temporary - it my part of a persistent view
// as in CREATE VIEW abc AS WITH
// this WITH statement might not be temporary - it may part of a persistent view
// as in CREATE VIEW abc AS WITH - this auto detects that condition
if(session.isParsingView()){
isPersistent = true;
}
do {
TableView newView = parseSingleCommonTableExpression(isPersistent);
viewsCreated.add(newView);
viewsCreated.add(parseSingleCommonTableExpression(isPersistent));
} while (readIf(","));
Prepared p = null;
......@@ -5227,6 +5227,7 @@ public class Parser {
// table expressions need to reference something that look like
// themselves
// to work (its removed after creation in this method)
// only create table data and table if we don't have a working CTE already
if(oldViewFound == null){
CreateTableData recursiveTableData = new CreateTableData();
recursiveTableData.id = database.allocateObjectId();
......@@ -5246,7 +5247,6 @@ public class Parser {
read("AS");
read("(");
Query withQuery = parseSelect();
//withQuery.setSession(targetSession);
read(")");
columnTemplateList = createQueryColumnTemplateList(cols, withQuery, querySQLOutput);
......@@ -5255,13 +5255,14 @@ public class Parser {
targetSession.removeLocalTempTable(recursiveTable);
}
}
// If it's persistent, a CTE and a TableView - return existing one
// If it's persistent, a CTE and a TableView - return existing one, otherwise create new...
if(oldViewFound!=null && isPersistent && oldViewFound instanceof TableView && oldViewFound.isTableExpression()){
return (TableView) oldViewFound;
}
TableView view = createTemporarySessionView(tempViewName,
querySQLOutput[0], columnTemplateList,
true/* allowRecursiveQueryDetection */, true, isPersistent);
true/* allowRecursiveQueryDetection */, true/* add to session */, isPersistent);
return view;
}
......
......@@ -101,9 +101,9 @@ public class CreateView extends SchemaCommand {
}
// The view creates a Prepared command object, which belongs to a
// session, so we pass the system session (not the current session) down.
//Session viewSession = select.isTableExpression()!=null ? select.getSession() : db.getSystemSession();
Session viewSession = db.getSystemSession();
synchronized (viewSession) {
// Why is the SYS session used here ? I think it might cause a problem...
Session sysSession = db.getSystemSession();
synchronized (sysSession) {
try {
Column[] columnTemplates = null;
if (columnNames != null) {
......@@ -115,15 +115,15 @@ public class CreateView extends SchemaCommand {
if (view == null) {
Schema schema = session.getDatabase().getSchema(
session.getCurrentSchemaName());
viewSession.setCurrentSchema(schema);
sysSession.setCurrentSchema(schema);
view = new TableView(getSchema(), id, viewName, querySQL, null,
columnTemplates, viewSession, false, false);
columnTemplates, sysSession, false, false);
} else {
view.replace(querySQL, columnTemplates, viewSession, false, force, false);
view.replace(querySQL, columnTemplates, sysSession, false, force, false);
view.setModified();
}
} finally {
viewSession.setCurrentSchema(db.getSchema(Constants.SCHEMA_MAIN));
sysSession.setCurrentSchema(db.getSchema(Constants.SCHEMA_MAIN));
}
}
if (comment != null) {
......
......@@ -47,14 +47,6 @@ MERGE INTO tableName [ ( columnName [,...] ) ]
{ VALUES { ( { DEFAULT | expression } [,...] ) } [,...] | select }
","
Updates existing rows, and insert rows that don't exist."
"Commands (DML)","MERGE USING","
MERGE INTO targetTableName [ [AS] targetAlias]
USING { ( select ) | sourceTableName }[ [AS] sourceAlias ]
ON ( expression )
[ WHEN MATCHED THEN [ update ] [ delete] ]
[ WHEN NOT MATCHED THEN insert ]
","
Updates or deletes existing rows, and insert rows that don't exist."
"Commands (DML)","RUNSCRIPT","
RUNSCRIPT FROM fileNameString scriptCompressionEncryption
[ CHARSET charsetString ]
......@@ -378,11 +370,6 @@ Switches auto commit on or off."
SET CACHE_SIZE int
","
Sets the size of the cache in KB (each KB being 1024 bytes) for the current database."
"Commands (Other)","SET COLUMN_NAMING_RULES","
SET COLUMN_NAMING_RULES = { DEFAULT | EMULATE=... | MAX_IDENTIFIER_LENGTH=... | REGULAR_EXPRESSION_MATCH_ALLOWED=... | REGULAR_EXPRESSION_MATCH_DISALLOWED=... | DEFAULT_COLUMN_NAME_PATTERN=... | GENERATE_UNIQUE_COLUMN_NAMES=...}
","
This setting controls the rules dealing with how column names are generated
in select statements."
"Commands (Other)","SET CLUSTER","
SET CLUSTER serverListString
","
......@@ -440,10 +427,6 @@ SET JAVA_OBJECT_SERIALIZER
{ null | className }
","
Sets the object used to serialize and deserialize java objects being stored in column of type OTHER."
"Commands (Other)","SET LAZY_QUERY_EXECUTION","
SET LAZY_QUERY_EXECUTION int
","
Sets the lazy query execution mode."
"Commands (Other)","SET LOG","
SET LOG int
","
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论