-
Notifications
You must be signed in to change notification settings - Fork 67
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
Allow custom functions to return nonzero BLOB #121
base: master
Are you sure you want to change the base?
Conversation
Fixes #124 |
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.
Looks good. minor nit in the tests.
if stmt.ColumnBytes(0, got) != len(want) || !bytes.Equal(got, want) { | ||
t.Errorf("blobcat(x'ff00',x'00ba')='%x', want '%x'", got, want) | ||
} | ||
stmt.Finalize() |
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.
defer this after line 155 please
if got, want := stmt.ColumnText(0), "strcat"; got != want { | ||
t.Errorf("strcat('str','','cat')='%s', want '%s'", got, want) | ||
} | ||
stmt.Finalize() |
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.
ditto
t.Fatal("Error does not match expected description") | ||
} | ||
|
||
stmt.Finalize() |
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.
ditto
Context
lacks the expected methodResultBlob
for nonzero blobs, even though it implementsResultZeroBlob
for zeroed blobs of arbitrary size. As a result, custom functions cannot currently return[]byte
results, such as cryptographic hashes.