should be it
This commit is contained in:
41
external/duckdb/test/sql/function/blob/encode.test
vendored
Normal file
41
external/duckdb/test/sql/function/blob/encode.test
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# name: test/sql/function/blob/encode.test
|
||||
# description: Test blob encode/decode functions
|
||||
# group: [blob]
|
||||
|
||||
statement ok
|
||||
PRAGMA enable_verification
|
||||
|
||||
# test basic encode/decode usage
|
||||
query I
|
||||
SELECT encode('ü')
|
||||
----
|
||||
\xC3\xBC
|
||||
|
||||
query I
|
||||
SELECT decode(encode('ü'))
|
||||
----
|
||||
ü
|
||||
|
||||
query I
|
||||
SELECT decode('\xF0\x9F\xA6\x86'::BLOB)
|
||||
----
|
||||
🦆
|
||||
|
||||
# null byte
|
||||
query I
|
||||
SELECT decode('\x00'::BLOB)
|
||||
----
|
||||
\0
|
||||
|
||||
# test invalid decodes
|
||||
statement error
|
||||
SELECT decode('\xFF'::BLOB)
|
||||
----
|
||||
|
||||
query I
|
||||
SELECT decode(encode(a)) || a from (values ('hello'), ('world')) tbl(a);
|
||||
----
|
||||
hellohello
|
||||
worldworld
|
||||
|
||||
|
||||
Reference in New Issue
Block a user