List:Bugs« Previous MessageNext Message »
From:Michael Widenius Date:November 16 2000 12:13am
Subject:user-defined integer function doesn't work via myodbc
View as plain text  
Hi!

>>>>> "Peter" == Peter Duffy <peter@stripped> writes:

Peter> From: root
Peter> To: --help
Peter> Subject: user-defined function in mysql doesn't work with myodbc

>> Description:
Peter>   Having added a user-defined function returning type integer to mysql,
Peter> it
Peter> works as expected within the mysql console, but not via MyODBC, when it
Peter> returns
Peter> a column with a blank value and a type of -5. (Functions returning reals
Peter> and
Peter> strings appear to work as expected.) The behaviour is exhibited by the
Peter> example functions included with mysql, so is fairly easy to reproduce.
>> How-To-Repeat:

Peter>   1) Build and install the example user-defined functions as in
Peter>
> http://www.mysql.com/documentation/mysql/commented/manual.php?section=UDF_compiling
Peter>   (NB: I was unable to get the "CREATE FUNCTION" step to work until I
Peter> renamed
Peter> the shared library to "libudf_example.so")
Peter>   2) Define a mysql database as a datasource to MyODBC
Peter>   3) Using odbctest (in .../libiodbc-2.50.3/samples) connect to the
Peter> datasource
Peter>   4) Run the following or similar commands to the user-defined
Peter> functions:
Peter> select * from myfunc_int("this is a test") (should return a blank column
Peter> with
Peter> a type of -5)
Peter> select * from myfunc_real("this is a test") (should return a single
Peter> column
Peter> of type 8, value 92.93)
Peter> (I hope this is sufficient detail: I'm happy to provide more info for
Peter> steps
Peter> 1 and 2 if required.)

-5 stands for 'bigint' or 64 byte integer in ODBC.  The problem in
this case is that the ODBC manager (not MyODBC) doesn't yet support
the BIGINT type.

Regards,
Monty
Thread
user-defined integer function doesn't work via myodbcPeter Duffy14 Nov
  • Re: user-defined integer function doesn't work via myodbcPeter Duffy15 Nov
  • user-defined integer function doesn't work via myodbcMichael Widenius16 Nov
  • Re: user-defined integer function doesn't work via myodbcPeter Duffy16 Nov
    • Re: user-defined integer function doesn't work via myodbcMichael Widenius16 Nov