-
Notifications
You must be signed in to change notification settings - Fork 36
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
Wrong memory allocation with init? #9
Comments
Is this really a problem? |
I went to the docs page linked in the original post and found this: https://dev.mysql.com/doc/refman/5.6/en/udf-arguments.html
So, calling |
Thank you. Unable to look at this issue right now. Will come back at it
later. Thank you for posting!
On Tue 19. Feb 2019 at 14:32, Ignacio colautti ***@***.***> wrote:
I went to the docs page linked in the original post and found this:
unsigned long *lengths
For the initialization function, the lengths array indicates the maximum
string length for each argument. You should not change these. For each
invocation of the main function, lengths contains the actual lengths of any
string arguments that are passed for the row currently being processed. For
arguments of types INT_RESULT or REAL_RESULT, lengths still contains the
maximum length of the argument (as for the initialization function).
So, calling malloc(sizeof(int) * (args->lengths[0] + 1) *
(args->lengths[1] + 1)) on the init function is the right thing to do,
which would allocate memory for the maximum length allowed
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGQH4OM7EThhpEybsxignYkBC_Tln_qks5vO_z2gaJpZM4E0R4n>
.
--
Juanmi, CEO and co-founder @ 🍃tagtog.net
Follow tagtog updates on 🐦 Twitter: @tagtog_net
<https://twitter.com/tagtog_net>
|
Just pinging a little bit. Although I have no idea about this issue(?) |
From Pablo Ruano (in Spanish):
The text was updated successfully, but these errors were encountered: