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

[BugFix] append_trailing_char_if_absent return empty string for const empty strings #13762

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

fzhedu
Copy link
Contributor

@fzhedu fzhedu commented Nov 21, 2022

Signed-off-by: fzhedu [email protected]

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Which issues of this PR fixes :

Fixes ##12769

Problem Summary(Required) :

append_trailing_char_if_absent's behavior is different when the first arg is an empty string from columns or not.

mysql> Create table t ( a int, name char(20), pv double) ENGINE=OLAP DUPLICATE KEY(a)  DISTRIBUTED BY HASH(a) BUCKETS 10 PROPERTIES("replication_num" = "1");
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t values (1,'',3);
Query OK, 1 row affected (0.03 sec)
{'label':'insert_a4e0c3d6-670e-11ed-b25b-00163e1f2aee', 'status':'VISIBLE', 'txnId':'5640284'}

mysql> select append_trailing_char_if_absent(name,'a') from t;
+-------------------------------------------+
| append_trailing_char_if_absent(name, 'a') |
+-------------------------------------------+
|                                           |
+-------------------------------------------+
1 row in set (0.01 sec)


mysql> select append_trailing_char_if_absent('','a') from t;
+-----------------------------------------+
| append_trailing_char_if_absent('', 'a') |
+-----------------------------------------+
| a                                       |
+-----------------------------------------+
1 row in set (0.00 sec)

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

@github-actions
Copy link

Please check the version labels which this pr will be auto backported to target branch and click the checkbox:

  • check done.

@wanpengfei-git wanpengfei-git added the Approved Ready to merge label Nov 21, 2022
@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@sonarcloud
Copy link

sonarcloud bot commented Nov 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.1% 1.1% Duplication

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

run starrocks_be_unittest

@kangkaisen kangkaisen merged commit 27dd3c3 into StarRocks:main Nov 21, 2022
@github-actions github-actions bot removed Approved Ready to merge be-build labels Nov 21, 2022
@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport-2.2

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport-2.3

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport-2.4

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport-2.5

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport -2.2

❌ No backport have been created

  • Backport to branch -2.2 failed: Branch not found

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport -2.3

❌ No backport have been created

  • Backport to branch -2.3 failed: Branch not found

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport -2.4

❌ No backport have been created

  • Backport to branch -2.4 failed: Branch not found

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport -2.5

❌ No backport have been created

  • Backport to branch -2.5 failed: Branch not found

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport branch-2.5

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport branch-2.4

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport branch-2.3

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 21, 2022

@mergify backport branch-2.2

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport branch-2.5

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport branch-2.4

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport branch-2.3

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Nov 21, 2022

backport branch-2.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 21, 2022
wanpengfei-git pushed a commit that referenced this pull request Nov 21, 2022
wanpengfei-git pushed a commit that referenced this pull request Nov 22, 2022
wanpengfei-git pushed a commit that referenced this pull request Nov 22, 2022
wanpengfei-git pushed a commit that referenced this pull request Nov 22, 2022
@fzhedu fzhedu deleted the append_trailing_char_if_absent branch January 4, 2023 07:33
trueeyu pushed a commit to trueeyu/starrocks that referenced this pull request Mar 13, 2023
wanpengfei-git pushed a commit that referenced this pull request Mar 13, 2023
… empty strings (#13762) (#19414)

append_trailing_char_if_absent return empty string for const empty strings
(cherry picked from commit 27dd3c3)
Co-authored-by: Zhuhe Fang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants