mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-07 15:13:51 +08:00
🐛 fix(data-grid): 兼容 bit 十六进制值大小写
- 让 bit 十六进制字面量匹配不区分大小写 - 避免大写十六进制值回退为带引号字符串 - 增加 0X0F 复制 INSERT 回归验证
This commit is contained in:
@@ -86,7 +86,7 @@ describe('buildCopyInsertSQL', () => {
|
||||
record: {
|
||||
disabled: 0,
|
||||
enabled: 1,
|
||||
mask: '0x05',
|
||||
mask: '0X0F',
|
||||
note: '1',
|
||||
},
|
||||
columnTypesByLowerName: {
|
||||
@@ -97,7 +97,7 @@ describe('buildCopyInsertSQL', () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(sql).toBe("INSERT INTO `flags` (`disabled`, `enabled`, `mask`, `note`) VALUES (0, 1, 5, '1');");
|
||||
expect(sql).toBe("INSERT INTO `flags` (`disabled`, `enabled`, `mask`, `note`) VALUES (0, 1, 15, '1');");
|
||||
});
|
||||
|
||||
it('normalizes MySQL bit binary and decimal text values', () => {
|
||||
|
||||
@@ -250,7 +250,7 @@ const formatMySQLBitLiteral = (value: any): string | null => {
|
||||
if (/^0[bB][01]+$/.test(raw)) {
|
||||
numericText = raw.slice(2);
|
||||
radix = 2;
|
||||
} else if (/^0[xX][0-9a-f]+$/.test(raw)) {
|
||||
} else if (/^0x[0-9a-f]+$/i.test(raw)) {
|
||||
numericText = raw.slice(2);
|
||||
radix = 16;
|
||||
} else if (!/^\d+$/.test(raw)) {
|
||||
|
||||
Reference in New Issue
Block a user