提交 48bce83f authored 作者: Thomas Mueller's avatar Thomas Mueller

MySQL compatibility: SHOW COLUMN FOR schemaName.columnName.

上级 751299ba
...@@ -843,11 +843,11 @@ public class Parser { ...@@ -843,11 +843,11 @@ public class Parser {
} else if (readIf("COLUMNS")) { } else if (readIf("COLUMNS")) {
// for MySQL compatibility // for MySQL compatibility
read("FROM"); read("FROM");
String tableName = readUniqueIdentifier(); String tableName = readIdentifierWithSchema();
String schemaName = getSchema().getName();
paramValues.add(ValueString.get(tableName)); paramValues.add(ValueString.get(tableName));
String schema = Constants.SCHEMA_MAIN;
if (readIf("FROM")) { if (readIf("FROM")) {
schema = readUniqueIdentifier(); schemaName = readUniqueIdentifier();
} }
buff.append("C.COLUMN_NAME FIELD, " + buff.append("C.COLUMN_NAME FIELD, " +
"C.TYPE_NAME || '(' || C.NUMERIC_PRECISION || ')' TYPE, " + "C.TYPE_NAME || '(' || C.NUMERIC_PRECISION || ')' TYPE, " +
...@@ -863,7 +863,7 @@ public class Parser { ...@@ -863,7 +863,7 @@ public class Parser {
"FROM INFORMATION_SCHEMA.COLUMNS C " + "FROM INFORMATION_SCHEMA.COLUMNS C " +
"WHERE C.TABLE_NAME=? AND C.TABLE_SCHEMA=? " + "WHERE C.TABLE_NAME=? AND C.TABLE_SCHEMA=? " +
"ORDER BY C.ORDINAL_POSITION"); "ORDER BY C.ORDINAL_POSITION");
paramValues.add(ValueString.get(schema)); paramValues.add(ValueString.get(schemaName));
} else if (readIf("DATABASES") || readIf("SCHEMAS")) { } else if (readIf("DATABASES") || readIf("SCHEMAS")) {
// for MySQL compatibility // for MySQL compatibility
buff.append("SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA"); buff.append("SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论