Skip to content

wrong behavior when enabling prepare-cache in stmt order by ? #8153

Closed
@winoros

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
create table t1 (a int, b int);
insert into t1 (a,b) values (2,8),(1,9),(3,7);

# Will order by index
prepare stmt from "select * from t1 order by ?";
set @a=1;
execute stmt using @a;
set @a=2;
execute stmt using @a;
deallocate prepare stmt;
  1. What did you expect to see?

The results are ordered by column.

  1. What did you see instead?

Results are unordered.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

master dd65caa

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    sig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions