(tableName string)
| 65 | } |
| 66 | |
| 67 | func (m *memStoreImpl) fetchTable(tableName string) error { |
| 68 | table, err := m.metaStore.GetTable(tableName) |
| 69 | if err != nil { |
| 70 | if err != metaCom.ErrTableDoesNotExist { |
| 71 | return utils.StackError(err, "Failed to get table schema for table %s from meta", tableName) |
| 72 | } |
| 73 | } else { |
| 74 | tableSchema := memCom.NewTableSchema(table) |
| 75 | for columnID, column := range table.Columns { |
| 76 | if !column.Deleted { |
| 77 | if column.IsEnumColumn() { |
| 78 | enumCases, err := m.metaStore.GetEnumDict(tableName, column.Name) |
| 79 | if err != nil { |
| 80 | if err != metaCom.ErrTableDoesNotExist && err != metaCom.ErrColumnDoesNotExist { |
| 81 | return utils.StackError(err, "Failed to fetch enum cases for table: %s, column: %s", tableName, column.Name) |
| 82 | } |
| 83 | } else { |
| 84 | tableSchema.CreateEnumDict(column.Name, enumCases) |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | tableSchema.SetDefaultValue(columnID) |
| 89 | } |
| 90 | m.Lock() |
| 91 | m.TableSchemas[tableName] = tableSchema |
| 92 | m.Unlock() |
| 93 | } |
| 94 | return nil |
| 95 | } |
| 96 | |
| 97 | // watch enumCases will setup watch channels for each enum column. |
| 98 | func (m *memStoreImpl) watchEnumCases(tableName, columnName string, startCase int) error { |
no test coverage detected