Skip to content

Commit

Permalink
fix: fix base64 decode on + (#18837)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzxa21 authored Oct 10, 2024
1 parent 840c37b commit b12460d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions e2e_test/batch/functions/encdec.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ SELECT decode('MTIzAAE=', 'base64');
----
\x3132330001

query T
SELECT decode('MTIz/A+=', 'base64');
----
\x313233fc0f

# hex
query T
SELECT encode('joanna', 'hex');
Expand Down
2 changes: 1 addition & 1 deletion src/expr/impl/src/scalar/encdec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PARSE_BASE64_IGNORE_BYTES: [u8; 4] = [0x0D, 0x0A, 0x20, 0x09];
const PARSE_BASE64_ALPHABET_DECODE_TABLE: [u8; 123] = [
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3E, 0x7f, 0x7f, 0x7f, 0x7f, 0x3F,
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3E, 0x7f, 0x7f, 0x7f, 0x3F,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
0x7f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
Expand Down

0 comments on commit b12460d

Please sign in to comment.