提交 eb6934d0 authored 作者: noelgrandin's avatar noelgrandin

we have a utility method, so lets use it

上级 c9818113
...@@ -5365,7 +5365,7 @@ public class Parser { ...@@ -5365,7 +5365,7 @@ public class Parser {
if ("InnoDb".equalsIgnoreCase(tableEngine)) { if ("InnoDb".equalsIgnoreCase(tableEngine)) {
// ok // ok
} else if (!"MyISAM".equalsIgnoreCase(tableEngine)) { } else if (!"MyISAM".equalsIgnoreCase(tableEngine)) {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, tableEngine); throw DbException.getUnsupportedException(tableEngine);
} }
} else { } else {
command.setTableEngine(readUniqueIdentifier()); command.setTableEngine(readUniqueIdentifier());
......
...@@ -182,7 +182,7 @@ public class AlterTableAddConstraint extends SchemaCommand { ...@@ -182,7 +182,7 @@ public class AlterTableAddConstraint extends SchemaCommand {
Table refTable = refSchema.getTableOrView(session, refTableName); Table refTable = refSchema.getTableOrView(session, refTableName);
session.getUser().checkRight(refTable, Right.ALL); session.getUser().checkRight(refTable, Right.ALL);
if (!refTable.canReference()) { if (!refTable.canReference()) {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, "Reference " + refTable.getSQL()); throw DbException.getUnsupportedException("Reference " + refTable.getSQL());
} }
boolean isOwner = false; boolean isOwner = false;
IndexColumn.mapColumns(indexColumns, table); IndexColumn.mapColumns(indexColumns, table);
......
...@@ -93,7 +93,7 @@ public class CreateView extends SchemaCommand { ...@@ -93,7 +93,7 @@ public class CreateView extends SchemaCommand {
} else { } else {
ArrayList<Parameter> params = select.getParameters(); ArrayList<Parameter> params = select.getParameters();
if (params != null && params.size() > 0) { if (params != null && params.size() > 0) {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, "parameters in views"); throw DbException.getUnsupportedException("parameters in views");
} }
querySQL = select.getPlanSQL(); querySQL = select.getPlanSQL();
} }
......
...@@ -76,7 +76,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index { ...@@ -76,7 +76,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
for (IndexColumn c : columns) { for (IndexColumn c : columns) {
int type = c.column.getType(); int type = c.column.getType();
if (type == Value.CLOB || type == Value.BLOB) { if (type == Value.CLOB || type == Value.BLOB) {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, "Index on BLOB or CLOB column: " + c.column.getCreateSQL()); throw DbException.getUnsupportedException("Index on BLOB or CLOB column: " + c.column.getCreateSQL());
} }
} }
} }
......
...@@ -899,7 +899,7 @@ public class Csv implements SimpleRowSource { ...@@ -899,7 +899,7 @@ public class Csv implements SimpleRowSource {
} else if (isParam(key, "caseSensitiveColumnNames")) { } else if (isParam(key, "caseSensitiveColumnNames")) {
setCaseSensitiveColumnNames(Boolean.parseBoolean(value)); setCaseSensitiveColumnNames(Boolean.parseBoolean(value));
} else { } else {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, key); throw DbException.getUnsupportedException(key);
} }
} }
return charset; return charset;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论