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 {
268
268
seen := make (map [string ]bool ) // used to check for duplicate column names
269
269
for _ , inheritTable := range stmt .Inherits {
270
270
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
274
280
}
275
281
276
- t , _ , err := inheritSchema .getTable (inheritTable )
282
+ t , _ , err := inheritTableSchema .getTable (inheritTable )
277
283
if err != nil {
278
284
return err
279
285
}
286
+
280
287
// check and ignore duplicate columns
281
288
for _ , col := range t .Columns {
282
289
if notNull , ok := seen [col .Name ]; ok {
You can’t perform that action at this time.
0 commit comments