UDF In 4.1
Jani Tolonen <[email protected]>
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi Michael,
Schulman, Michael writes:
> I'm trying to create a Aggregate UDF. Everything works fine except for the
> error handling. I return 1 from the init function and mysqld crashes with a
> signal 11. Here is the code :
>
> my_bool xopen_init( UDF_INIT* initid, UDF_ARGS* args, char* message ) {
> fprintf(stderr ,"INIT \n");
> if (args->arg_count != 1) {
> fprintf(stderr ,"INIT BAD ARG COUNT\n");
> strcpy( message, "wrong number of arguments: XOPEN() requires one
> arguments");
> fprintf(stderr, "wrong number of arguments: XOPEN() requires one
> arguments\n");
> return 1;
> }
> fprintf(stderr ,"INIT 2\n");
> if ((args->arg_type[0] != INT_RESULT) && (args->arg_type[0] !=
> REAL_RESULT) ) {
> fprintf(stderr ,"INIT BAD ARGS\n");
> strcpy(message, "wrong argument type: XOPEN() requires an INT or a REAL"
> );
> fprintf(stderr, "wrong argument type: XOPEN() requires an INT or a
> REAL\n" );
> return 1;
> }
> initid->maybe_null = 1; // The result may be null
> initid->max_length = 20; // 6 digits + . + 10 decimals
> initid->ptr = (char*)NULL;
> fprintf(stderr ,"INIT 4\n");
> return 0;
> }
>
> It runs fine when I pass in one int or real data type but as soon as I pass
> in a string or two variables it crashes...
>
> Here is the output from the error file :
Can you please try to resolve the backtrace.
Section:
E.1.4 Using a Stack Trace
in the manual describes how to do this.
Also, if you have compiled mysqld with debugging enabled, you
can start mysqld under gdb, and when it crashes, please run:
backtrace
info local
up
info local
up
info local
This should give us more information about the place and reason of the
crash.
Regards,
- Jani
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Jani Tolonen <[email protected]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com
--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/[email protected]