checkCompatibleTypes checks if multiple types for which a parameter are used are compatible.
(ctx *sql.Context, existingOid, newOid uint32, newName string)
| 226 | |
| 227 | // checkCompatibleTypes checks if multiple types for which a parameter are used are compatible. |
| 228 | func checkCompatibleTypes(ctx *sql.Context, existingOid, newOid uint32, newName string) error { |
| 229 | var err error |
| 230 | existing := pgtypes.GetTypeByID(id.Type(id.Cache().ToInternal(existingOid))) |
| 231 | newType := pgtypes.GetTypeByID(id.Type(id.Cache().ToInternal(newOid))) |
| 232 | if _, _, err = framework.FindCommonType(ctx, []*pgtypes.DoltgresType{existing, newType}); err != nil { |
| 233 | err = errors.Errorf("parameter %s is used for incompatible types: %s and %s", newName, existing.String(), newType.String()) |
| 234 | } |
| 235 | return err |
| 236 | } |
no test coverage detected