Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.4.3 select statement error on table which partitioned by column with floor func #42323

Closed
HydraLee opened this issue Mar 16, 2023 · 0 comments · Fixed by #42363
Closed

v5.4.3 select statement error on table which partitioned by column with floor func #42323

HydraLee opened this issue Mar 16, 2023 · 0 comments · Fixed by #42363
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-6.6 affects-7.1 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@HydraLee
Copy link

HydraLee commented Mar 16, 2023

  1. table create sql
CREATE TABLE `test1` (
  `col1` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=2 */ 
PARTITION BY RANGE (FLOOR(`col1`))
(PARTITION `p2021` VALUES LESS THAN (202200),
 PARTITION `p2022` VALUES LESS THAN (202300),
 PARTITION `p2023` VALUES LESS THAN (202400),
 PARTITION `p2024` VALUES LESS THAN (202500),
 PARTITION `p2025` VALUES LESS THAN (202600),
 PARTITION `p2026` VALUES LESS THAN (202700));
  1. case sql
    v4.0.11
select * from test1 where col1 = 202303;

-> get normal result

v5.4.3

select * from test1 where col1 = 202303;

-> get error
--> ERROR 1105 (HY000): interface conversion: expression.Expression is *expression.Column, not *expression.ScalarFunction

select * from test1 where floor(col1) = 202303;

-> get normal result

@HydraLee HydraLee added the type/bug The issue is confirmed as a bug. label Mar 16, 2023
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Mar 21, 2023
@mjonss mjonss added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-6.6 and removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-6.1 may-affects-6.5 labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-6.6 affects-7.1 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants