-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](prepared statement) fix protocol with TIME datatype #47389
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
7f8eb6e
to
4934b00
Compare
run buildall |
TPC-H: Total hot run time: 32311 ms
|
TPC-DS: Total hot run time: 184725 ms
|
ClickBench: Total hot run time: 31.09 s
|
TeamCity be ut coverage result: |
MysqlRowBuffer<true> buffer; | ||
|
||
// case1 : all 0, should only send 1 byte | ||
buffer.push_timev2(0.0, 6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the contents of a buffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
4934b00
to
25c138d
Compare
25c138d
to
cdd68be
Compare
run buildall |
TPC-H: Total hot run time: 32141 ms
|
TPC-DS: Total hot run time: 190973 ms
|
TeamCity be ut coverage result: |
ClickBench: Total hot run time: 31.12 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request adds functionality to encode time values into MySQL binary protocol format with microsecond precision and includes corresponding test cases. The changes primarily involve adding a new function for encoding time and updating the `push_time` and `push_timev2` methods in the `MysqlRowBuffer` class to use this new function. ### Encoding time into MySQL binary protocol format: * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbR364-R433): Added the `encode_binary_timev2` function to encode time into MySQL binary protocol format with support for microsecond precision. The function handles time values within the range of '-838:59:59' to '838:59:59' and adjusts the precision based on the provided scale. ### Updates to `MysqlRowBuffer` class: * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbR364-R433): Updated the `push_time` method to throw an exception for unsupported time types in binary protocol. * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbL382-R451): Modified the `push_timev2` method to use the new `encode_binary_timev2` function, adjusting the buffer size and appending the encoded time. ### Test cases: * [`be/test/util/mysql_row_buffer_test.cpp`](diffhunk://#diff-1feab58caea3546e0e6fda52bff2fbd5f60f7cafcef8f891be83b0a2f74a93ebR118-R133): Added a new test case `TestBinaryTimeCompressedEncoding` to verify the correct encoding of time values in various scenarios, including zero time, time without microseconds, time with microseconds, and negative time values.
This pull request adds functionality to encode time values into MySQL binary protocol format with microsecond precision and includes corresponding test cases. The changes primarily involve adding a new function for encoding time and updating the `push_time` and `push_timev2` methods in the `MysqlRowBuffer` class to use this new function. ### Encoding time into MySQL binary protocol format: * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbR364-R433): Added the `encode_binary_timev2` function to encode time into MySQL binary protocol format with support for microsecond precision. The function handles time values within the range of '-838:59:59' to '838:59:59' and adjusts the precision based on the provided scale. ### Updates to `MysqlRowBuffer` class: * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbR364-R433): Updated the `push_time` method to throw an exception for unsupported time types in binary protocol. * [`be/src/util/mysql_row_buffer.cpp`](diffhunk://#diff-181b7a490933fd9d3f8a00c97852d8fa17ab34694b1683ffd762e0f595a7c4fbL382-R451): Modified the `push_timev2` method to use the new `encode_binary_timev2` function, adjusting the buffer size and appending the encoded time. ### Test cases: * [`be/test/util/mysql_row_buffer_test.cpp`](diffhunk://#diff-1feab58caea3546e0e6fda52bff2fbd5f60f7cafcef8f891be83b0a2f74a93ebR118-R133): Added a new test case `TestBinaryTimeCompressedEncoding` to verify the correct encoding of time values in various scenarios, including zero time, time without microseconds, time with microseconds, and negative time values.
…47389 (#47543) Cherry-picked from #47389 Co-authored-by: lihangyu <[email protected]>
What problem does this PR solve?
This pull request adds functionality to encode time values into MySQL binary protocol format with microsecond precision and includes corresponding test cases. The changes primarily involve adding a new function for encoding time and updating the
push_time
andpush_timev2
methods in theMysqlRowBuffer
class to use this new function.Encoding time into MySQL binary protocol format:
be/src/util/mysql_row_buffer.cpp
: Added theencode_binary_timev2
function to encode time into MySQL binary protocol format with support for microsecond precision. The function handles time values within the range of '-838:59:59' to '838:59:59' and adjusts the precision based on the provided scale.Updates to
MysqlRowBuffer
class:be/src/util/mysql_row_buffer.cpp
: Updated thepush_time
method to throw an exception for unsupported time types in binary protocol.be/src/util/mysql_row_buffer.cpp
: Modified thepush_timev2
method to use the newencode_binary_timev2
function, adjusting the buffer size and appending the encoded time.Test cases:
be/test/util/mysql_row_buffer_test.cpp
: Added a new test caseTestBinaryTimeCompressedEncoding
to verify the correct encoding of time values in various scenarios, including zero time, time without microseconds, time with microseconds, and negative time values.Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)