Repository navigation
fix cast binary - #25549
fix cast binary#25549
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Merge Queue Status
This pull request spent 39 minutes 31 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #25549 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25264 matrixorigin#25246 ## What this PR does / why we need it: 核心修改 - parser 区分 plain hex 和 _binary hex: - X'3132' 仍是 P_hexnum - _binary X'3132' 新增为 P_ScoreBinaryHexnum - _binary '1' 保持为 P_ScoreBinary - binder 语义调整: - X'...' 继续绑定为 varchar + IsBin=true - _binary X'...' 绑定为 varbinary + IsBin=false - _binary '...' 也绑定为 varbinary + IsBin=false - 这样保留了两类 MySQL 行为: - cast(X'3132' as unsigned) = 12594 - cast(_binary X'3132' as unsigned) = 12 - _binary '1' + 0 = 1 - _binary X'31' | X'31' 走二进制字符串操作,结果为 1 新增/更新测试 - parser UT: - 覆盖 X'3132' - 覆盖 _binary X'3132' - 覆盖 _binary '1' - binder UT: - 覆盖 _binary X'3132' 绑定为 T_varbinary + IsBin=false - 覆盖 _binary '1' 绑定为 T_varbinary + IsBin=false - 覆盖显式 numeric cast、bitwise、bit_count 绑定路径 - function UT: - 覆盖 strToUnsigned 对 IsBin=false 和 IsBin=true 的差异: - IsBin=false: "12" -> 12 - IsBin=true: raw bytes 0x3132 -> 12594 - BVT case: - 增加 MySQL varbinary.test 里的关键场景: - _binary '1' + 0 - _binary X'31' | X'31' - (_binary X'31' | X'31') + 0 - 1.0 * (_binary X'312E35' | X'312E35') - 1.0 * (X'312E35' | X'312E35') - (_binary X'31' | NULL) + 0 - _binary X'FF' &/|/^ _binary X'0F' 结果文件状态 - _binary 新增结果和 MySQL 行为对齐。 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25264 matrixorigin#25246 ## What this PR does / why we need it: 核心修改 - parser 区分 plain hex 和 _binary hex: - X'3132' 仍是 P_hexnum - _binary X'3132' 新增为 P_ScoreBinaryHexnum - _binary '1' 保持为 P_ScoreBinary - binder 语义调整: - X'...' 继续绑定为 varchar + IsBin=true - _binary X'...' 绑定为 varbinary + IsBin=false - _binary '...' 也绑定为 varbinary + IsBin=false - 这样保留了两类 MySQL 行为: - cast(X'3132' as unsigned) = 12594 - cast(_binary X'3132' as unsigned) = 12 - _binary '1' + 0 = 1 - _binary X'31' | X'31' 走二进制字符串操作,结果为 1 新增/更新测试 - parser UT: - 覆盖 X'3132' - 覆盖 _binary X'3132' - 覆盖 _binary '1' - binder UT: - 覆盖 _binary X'3132' 绑定为 T_varbinary + IsBin=false - 覆盖 _binary '1' 绑定为 T_varbinary + IsBin=false - 覆盖显式 numeric cast、bitwise、bit_count 绑定路径 - function UT: - 覆盖 strToUnsigned 对 IsBin=false 和 IsBin=true 的差异: - IsBin=false: "12" -> 12 - IsBin=true: raw bytes 0x3132 -> 12594 - BVT case: - 增加 MySQL varbinary.test 里的关键场景: - _binary '1' + 0 - _binary X'31' | X'31' - (_binary X'31' | X'31') + 0 - 1.0 * (_binary X'312E35' | X'312E35') - 1.0 * (X'312E35' | X'312E35') - (_binary X'31' | NULL) + 0 - _binary X'FF' &/|/^ _binary X'0F' 结果文件状态 - _binary 新增结果和 MySQL 行为对齐。 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25264 matrixorigin#25246 ## What this PR does / why we need it: 核心修改 - parser 区分 plain hex 和 _binary hex: - X'3132' 仍是 P_hexnum - _binary X'3132' 新增为 P_ScoreBinaryHexnum - _binary '1' 保持为 P_ScoreBinary - binder 语义调整: - X'...' 继续绑定为 varchar + IsBin=true - _binary X'...' 绑定为 varbinary + IsBin=false - _binary '...' 也绑定为 varbinary + IsBin=false - 这样保留了两类 MySQL 行为: - cast(X'3132' as unsigned) = 12594 - cast(_binary X'3132' as unsigned) = 12 - _binary '1' + 0 = 1 - _binary X'31' | X'31' 走二进制字符串操作,结果为 1 新增/更新测试 - parser UT: - 覆盖 X'3132' - 覆盖 _binary X'3132' - 覆盖 _binary '1' - binder UT: - 覆盖 _binary X'3132' 绑定为 T_varbinary + IsBin=false - 覆盖 _binary '1' 绑定为 T_varbinary + IsBin=false - 覆盖显式 numeric cast、bitwise、bit_count 绑定路径 - function UT: - 覆盖 strToUnsigned 对 IsBin=false 和 IsBin=true 的差异: - IsBin=false: "12" -> 12 - IsBin=true: raw bytes 0x3132 -> 12594 - BVT case: - 增加 MySQL varbinary.test 里的关键场景: - _binary '1' + 0 - _binary X'31' | X'31' - (_binary X'31' | X'31') + 0 - 1.0 * (_binary X'312E35' | X'312E35') - 1.0 * (X'312E35' | X'312E35') - (_binary X'31' | NULL) + 0 - _binary X'FF' &/|/^ _binary X'0F' 结果文件状态 - _binary 新增结果和 MySQL 行为对齐。 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #25264
#25246
What this PR does / why we need it:
核心修改
parser 区分 plain hex 和 _binary hex:
binder 语义调整:
这样保留了两类 MySQL 行为:
新增/更新测试
parser UT:
binder UT:
function UT:
BVT case:
结果文件状态