zclllyybb opened a new issue, #55057:
URL: https://github.com/apache/doris/issues/55057

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Description
   
   now in Doris we have some nonsense use of `const_cast` to remove the 
const-cv qualifier. like 
https://github.com/apache/doris/blob/117b2e3dee8a3811ef1d6e9251914a86dd4cec61/be/src/vec/data_types/serde/data_type_string_serde.h#L43
   since we plan to write to the memory of `src`, it makes no sense to make it 
`const char*` and remove it in the function. it lead to some wrong use like 
https://github.com/apache/doris/blob/117b2e3dee8a3811ef1d6e9251914a86dd4cec61/be/test/vec/data_types/data_type_string_test.cpp#L345,
 where we tried to write to a static memory region. it's a critical bug.
   
   ### Solution
   
   you should go through our whole `be/` and find all `const_cast`. check if 
they make sense. (which I think most of them don't. for wrong usage, remove it. 
and leave a comment to others to explain why it's necessary.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to