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

[cherry-pick](branch-21)fix date_floor function return wrong result (#41948) #42065

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

zhangstar333
Copy link
Contributor

Proposed changes

cherry-pick from master #41948

)

```
    void resize_fill(size_t n, const T& value) {
        size_t old_size = this->size();
        if (n > old_size) {
            this->reserve(n);
            std::fill(t_end(), t_end() + n - old_size, value);
        }
        this->c_end = this->c_start + this->byte_size(n);
    }
```
if n is not greater than old_size,
it's will not fill the data with value.

so it's not set the null_map flag to 1, it's can't return NULL
```
mysql [test_query_qa]>select k11,hour_floor(k11,0) from baseall where k1 = 6;
+---------------------+--------------------+
| k11                 | hour_floor(k11, 0) |
+---------------------+--------------------+
| 2015-03-13 12:36:38 |                    |
+---------------------+--------------------+
1 row in set (0.03 se
```

after fix:

```
mysql [test_query_qa]>select k11,hour_floor(k11,0) from baseall where k1 = 6;
+---------------------+--------------------+
| k11                 | hour_floor(k11, 0) |
+---------------------+--------------------+
| 2015-03-13 12:36:38 | NULL               |
+---------------------+--------------------+
1 row in set (0.03 sec)

```
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@zhangstar333
Copy link
Contributor Author

run buildall

Copy link
Contributor

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

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.02% (9347/25953)
Line Coverage: 27.59% (76786/278339)
Region Coverage: 26.40% (39457/149442)
Branch Coverage: 23.18% (20081/86614)
Coverage Report: http://coverage.selectdb-in.cc/coverage/749bd3078e241eefa4c78500f26ee8c3d92b9a08_749bd3078e241eefa4c78500f26ee8c3d92b9a08/report/index.html

@yiguolei yiguolei merged commit 460ff02 into apache:branch-2.1 Oct 18, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants