Skip to content

[Bug]: Substr result bug #3166

Closed
Closed

Description

@dengn

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):e1319c52cf87b17a98008ae0dda79b72237d9ed1
- Hardware parameters:Mac M1 ARM 16GB Memory
- OS type:OSX
- Others:

Actual Behavior

select substring(c,2,-1),substr(vc,3,-1) from t1 where id = 4 ;
+---------------------+-------------------+
| substring(c, 2, -1) | substr(vc, 3, -1) |
+---------------------+-------------------+
| nonymou | nnabuythisbook |
+---------------------+-------------------+

Expected Behavior

select substring(c,2,-1),substr(vc,3,-1) from t1 where id = 4 ;
+-------------------+-----------------+
| substring(c,2,-1) | substr(vc,3,-1) |
+-------------------+-----------------+
| | |
+-------------------+-----------------+

Steps to Reproduce

drop table if exists t1;
create table t1 ( id int, c char(10),vc varchar(20));
insert into t1 values (1,'Daffy','Aducklife');
insert into t1 values (1,'Daffy','Aducklife');
insert into t1 values (2,'Bugs','Arabbitlife');
insert into t1 values (3,'Cowboy','Lifeontherange');
insert into t1 values (4,'Anonymous','Wannabuythisbook?');
insert into t1 values (5,'BestSeller','OneHeckuvabook');
insert into t1 values (5,'BestSeller','OneHeckuvabook');
insert into t1 values (6,'EveryoneBu','Thisverybook');
insert into t1 values (7,'SanFran','Itisasanfranlifetyle');
insert into t1 values (8,'BerkAuthor','Cool.Berkly.the.book');
insert into t1 values (9,null,null);
insert into t1 values (10,'','');

Additional information

No response

Activity

  1. added
    kind/bug
    on Jun 21, 2022
  2. added this to the v0.5.0 milestone on Jun 21, 2022
  3. added
    bvt
    on Jun 24, 2022
  4. dengn commented on Jun 30, 2022

    @dengn
    ContributorAuthor

    @jianwan0214 #3166 tag has not been completely removed.
    This issue is not finished.
    Check on


  5. assigned and unassigned on Jun 30, 2022
  6. dengn commented on Jul 2, 2022

    @dengn
    ContributorAuthor

    @jianwan0214 #3166 tag still remains....

  7. assigned and unassigned on Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bvtkind/bugtriage/accepted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions