Constraints on Nullable types don't seem to work and return errors like the following:
```
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Constraint `c0` does not return a value of type UInt8.
```

**Does it reproduce on recent release?**

This issue has been encountered on Clickhouse `20.10.2.20`. I did not test latest `master`.
```
$ clickhouse-server --version
ClickHouse server version 20.10.2.20 (official build).
```

EDIT: this is also reproducible with the latest stable release:
```
$ clickhouse-server --version
ClickHouse server version 21.2.4.6 (official build).
```

**How to reproduce**

All settings are defaults.

To reproduce the error, create the following table:
```
CREATE TABLE foo.bar
(
    `id` UInt32,
    `buggy` Nullable(UInt32),
    CONSTRAINT `c0` CHECK `buggy` = 1
)
ENGINE = MergeTree()
PRIMARY KEY `id`
ORDER BY `id`
```

The table creation works fine. However, one gets an exception when trying to insert:
```
server :) INSERT INTO foo.bar VALUES (0, 1)

INSERT INTO foo.bar VALUES


Received exception from server (version 20.10.2):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Constraint `c0` does not return a value of type UInt8. 

1 rows in set. Elapsed: 0.001 sec.
```

The exception is unexpected as the constraint is a valid boolean expression. Not that I tried many variants of the constraints and the only one referring the field `buggy` that worked as expected is:
 ```
CONSTRAINT `c0` CHECK isNull(`buggy`)
```

**Expected behavior**

No exception raised as the constraint is a valid boolean expression.

**Error message and/or stacktrace**

```
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Constraint `c0` does not return a value of type UInt8. 
```

**Additional context**

The following issue may be related: #19334
{
                    throw Exception(ErrorCodes::VIOLATED_CONSTRAINT,
                                    "Constraint {} for table {} is violated, because it is a constant expression returning 0. "
                                    "It is most likely an error in table definition.",
                                    backQuote(constraint_ptr->name), table_id.getNameForLogs());
                }
            }
            else
            {
                const ColumnUInt8 & res_column_uint8 = assert_cast<const ColumnUInt8 &>(*res_column.column);
                const UInt8 * data = res_column_uint8.getData().data();
                size_t size = res_column_uint8.size();
                
                if (!memoryIsByte(data, size, 1))
                {
                    size_t row_idx = 0;
                    for (; row_idx < size; ++row_idx)
                        if (data[row_idx] != 1)
                            break;
                    Names related_columns = constraint_expr->getRequiredColumns();
                    bool first = true;
                    String column_values_msg;
                    constexpr size_t approx_bytes_for_col = 32;
                    column_values_msg.reserve(approx_bytes_for_col * related_columns.size());
                    for (const auto & name : related_columns)
                    {
                        const IColumn & column = *block.getByName(name).column;
                        assert(row_idx < column.size());
                        if (!first)
                            column_values_msg.append(", ");