Skip to content

Conversation

@zhangstar333
Copy link
Contributor

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.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@zhangstar333
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

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

@zhangstar333 zhangstar333 merged commit 9cc51da into apache:branch-3.0 Nov 11, 2024
@gavinchou gavinchou mentioned this pull request Nov 26, 2024
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.

2 participants