This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bf9bb2bfd [improvement](createtable)fix create table error msg in 
information_schema database (#18412)
6bf9bb2bfd is described below

commit 6bf9bb2bfd6dfb33092067a9fa4765cc5e17f90c
Author: wudi <[email protected]>
AuthorDate: Sun Apr 9 18:11:46 2023 +0800

    [improvement](createtable)fix create table error msg in information_schema 
database (#18412)
    
    
    ---------
    
    Co-authored-by: wudi <>
---
 fe/fe-core/src/main/java/org/apache/doris/common/ErrorCode.java      | 1 +
 .../src/main/java/org/apache/doris/datasource/InternalCatalog.java   | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/ErrorCode.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/ErrorCode.java
index 86ef7b9f26..72c9c2cd0b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/ErrorCode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/ErrorCode.java
@@ -23,6 +23,7 @@ import java.util.MissingFormatArgumentException;
 public enum ErrorCode {
     // Try our best to compatible with MySQL's
     ERR_HASHCHK(1000, new byte[]{'H', 'Y', '0', '0', '0'}, "hashchk"),
+    ERR_CANT_CREATE_TABLE(1005, new byte[]{'H', 'Y', '0', '0', '0'}, "Can't 
create table '%s' (errno: %d - %s)"),
     ERR_DB_CREATE_EXISTS(1007, new byte[]{'H', 'Y', '0', '0', '0'}, "Can't 
create database '%s'; database exists"),
     ERR_DB_DROP_EXISTS(1008, new byte[]{'H', 'Y', '0', '0', '0'}, "Can't drop 
database '%s'; database doesn't exist"),
     ERR_DBACCESS_DENIED_ERROR(1044, new byte[]{'4', '2', '0', '0', '0'}, 
"Access denied for user '%s' to "
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
index 9473b3b9d2..5b745bca6b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
@@ -1107,6 +1107,11 @@ public class InternalCatalog implements 
CatalogIf<Database> {
 
         // check if db exists
         Database db = (Database) getDbOrDdlException(dbName);
+        // InfoSchemaDb can not create table
+        if (db instanceof InfoSchemaDb) {
+            ErrorReport.reportDdlException(ErrorCode.ERR_CANT_CREATE_TABLE, 
tableName,
+                    ErrorCode.ERR_CANT_CREATE_TABLE.getCode(), "not supported 
create table in this database");
+        }
 
         // only internal table should check quota and cluster capacity
         if (!stmt.isExternal()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to