Господа! Помогите разобраться.
Есть функция:
[user@myhost udf]$ cat str_simple.c
#include <string.h>
#include "/opt/firebird/include/ib_util.h"
char *str_simple(char *str) {
char *result = ib_util_malloc(strlen(str) + 1);
memcpy(result, str, strlen(str) + 1);
return result;
}
[user@myhost udf]$
[user@myhost udf]$ cat makeudf
#!/bin/bash
gcc -c -O -fpic $1.c &&
ld -G $1.o -lm -lc -o $1.so &&
rm $1.o &&
mv $1.so /opt/firebird/UDF
[user@myhost udf]$ ./makeudf str_simple
[user@myhost udf]$
DECLARE EXTERNAL FUNCTION str_simple
CSTRING(256)
RETURNS CSTRING(256) FREE_IT
ENTRY_POINT 'str_simple' MODULE_NAME 'str_simple';
[user@myhost database]$ /opt/firebird/bin/isql base.gdb -USER sysdba -PASS masterkey
Database: base.gdb, User: sysdba
SQL> SELECT STR_SIMPLE('Текст') FROM RDB$FIELDS;
STR_SIMPLE
===============================================================================
Statement failed, SQLSTATE = 08006
Error reading data from the connection.
Всё это в Linux 3.1.9-2-ARCH ... x86_64 и Firebird-SuperServer 2.5.1.26351_0-4