File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -268,15 +268,22 @@ func (c *Catalog) createTable(stmt *ast.CreateTableStmt) error {
268268 seen := make (map [string ]bool ) // used to check for duplicate column names
269269 for _ , inheritTable := range stmt .Inherits {
270270
271- inheritSchema , err := c .getSchema (inheritTable .Schema )
272- if err != nil {
273- return err
271+ var inheritTableSchema * Schema
272+ if inheritTable .Schema == "" {
273+ inheritTableSchema = schema
274+ } else {
275+ inheritSchema , err := c .getSchema (inheritTable .Schema )
276+ if err != nil {
277+ return err
278+ }
279+ inheritTableSchema = inheritSchema
274280 }
275281
276- t , _ , err := inheritSchema .getTable (inheritTable )
282+ t , _ , err := inheritTableSchema .getTable (inheritTable )
277283 if err != nil {
278284 return err
279285 }
286+
280287 // check and ignore duplicate columns
281288 for _ , col := range t .Columns {
282289 if notNull , ok := seen [col .Name ]; ok {
You can’t perform that action at this time.
0 commit comments