Description:
Hello,
I'm seeing some strange behavior in MySQL Workbench. I wrote a UDF that takes one string parameter and returns a longlong, or INT in SQL. Let's say it's called it StrLen and I have it in a shared library called strlen.so in the MySQL plugins directory.
CREATE FUNCTION StrLen RETURNS INT SONAME 'strlen.so';
If, using MySQL Workbench, I directly do a SELECT on this function the result is displayed as blob.
(1) SELECT StrLen('hello');
However, the result of the following is shown as the correct number:
(2) SELECT StrLen('hello') * 1;
The result of the following is also display correctly:
(3) SELECT StrLen('hello');``SET @l = Strlen('hello');
SELECT @l;
I think this is a problem with MySQL Workbench. I tried it with the mysql Linux command line client and this showed the result of (1) correctly.
I'm seeing it with both the Windows and Linux versions of MySQL Workbench.
Server version:
mysql> SHOW VARIABLES LIKE "%version%";
+--------------------------+------------------------------+
| Variable_name | Value |
+--------------------------+------------------------------+
| immediate_server_version | 999999 |
| innodb_version | 8.0.17 |
| original_server_version | 999999 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1,TLSv1.2 |
| version | 8.0.17 |
| version_comment | MySQL Community Server - GPL |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
| version_compile_zlib | 1.2.11 |
+--------------------------+------------------------------+
How to repeat:
- set up a UDF that returns a number, such as
CREATE FUNCTION StrLen RETURNS INT SONAME 'strlen.so';
- In MySQL Workbench call it with SELECT StrLen('hello');