**Describe what's wrong**

Selecting from a Buffer table with ORDER BY <col> DESC clause returns wrong rows, and the returned rows are not ordered.

**Does it reproduce on recent release?**

Tested version: 22.7.2.15

**How to reproduce**

* Which ClickHouse server version to use
22.7.2.15
* `CREATE TABLE` statements for all tables involved

        CREATE TABLE mydb.mytable_stored
        (
            `a` UInt8
        )
        ENGINE = MergeTree
        ORDER BY a;

        CREATE TABLE mydb.mytable
        (
            `a` UInt8
        )
        ENGINE = Buffer('mydb', 'mytable_stored', 4, 600, 3600, 10, 100, 10000, 10000000);

* Sample data for all these tables
Note: rows must be inserted one-by-one:

        INSERT INTO mydb.mytable VALUES (0);
        INSERT INTO mydb.mytable VALUES (1);
        INSERT INTO mydb.mytable VALUES (2);
        INSERT INTO mydb.mytable VALUES (3);
        INSERT INTO mydb.mytable VALUES (4);
        INSERT INTO mydb.mytable VALUES (5);
        INSERT INTO mydb.mytable VALUES (6);
        INSERT INTO mydb.mytable VALUES (7);
        INSERT INTO mydb.mytable VALUES (8);
        INSERT INTO mydb.mytable VALUES (9);

* Queries to run that lead to unexpected result

        SELECT a FROM mydb.mytable ORDER BY a DESC LIMIT 5;
        ┌─a─┐
        │ 3 │
        │ 7 │
        └───┘
        ┌─a─┐
        │ 2 │
        │ 6 │
        └───┘
        ┌─a─┐
        │ 1 │
        └───┘
        5 rows in set. Elapsed: 0.007 sec.

(Interestingly, ascending order *seems* to work, did not test it thoroughly though.)

**Expected behavior**

Get the results in descending order, ie. `9, 8, 7, 6, 5`.

**Additional context**

Selecting the maximal value works:

        SELECT max(a) FROM mydb.mytable;
        ┌─max(a)─┐
        │      9 │
        └────────┘
        1 row in set. Elapsed: 0.007 sec.

After the rows are flushed to the backing MergeTree table, the results are good.

        OPTIMIZE TABLE mydb.mytable;
        SELECT a FROM mydb.mytable ORDER BY a DESC LIMIT 5;
        ┌─a─┐
        │ 9 │
        │ 8 │
        │ 7 │
        │ 6 │
        │ 5 │
        └───┘
        5 rows in set. Elapsed: 0.008 sec. 


QueryPlan & query_plan,
    const Names & column_names,
    const StorageSnapshotPtr & storage_snapshot,
    SelectQueryInfo & query_info,
    ContextPtr local_context,
    QueryProcessingStage::Enum processed_stage,
    size_t max_block_size,
    unsigned num_streams)
{
    const auto & metadata_snapshot = storage_snapshot->metadata;
    if (auto destination = getDestinationTable())
    {
        auto destination_lock = destination->lockForShare(local_context->getCurrentQueryId(), local_context->getSettingsRef().lock_acquire_timeout);
        auto destination_metadata_snapshot = destination->getInMemoryMetadataPtr();
        auto destination_snapshot = destination->getStorageSnapshot(destination_metadata_snapshot, local_context);
        const bool dst_has_same_structure = std::all_of(column_names.begin(), column_names.end(), [metadata_snapshot, destination_metadata_snapshot](const String& column_name)
        {
            const auto & dest_columns = destination_metadata_snapshot->getColumns();
            const auto & our_columns = metadata_snapshot->getColumns();
            auto dest_columm = dest_columns.tryGetColumnOrSubcolumn(GetColumnsOptions::AllPhysical, column_name);
            return dest_columm && dest_columm->type->equals(*our_columns.getColumnOrSubcolumn(GetColumnsOptions::AllPhysical, column_name).type);
        });
        if (dst_has_same_structure)
        {
            if (query_info.order_optimizer)
                query_info.input_order_info = query_info.order_optimizer->getInputOrder(destination_metadata_snapshot, local_context);
            
            destination->read(
                query_plan, column_names, destination_snapshot, query_info,