Bug 262464

Summary: databases/mariadb-connector-odbc: Undefined symbol "libiconv_open" with isql on INSERT, UPDATE or SELECT
Product: Ports & Packages Reporter: James Elstone <james>
Component: Individual Port(s)Assignee: Bernard Spil <brnrd>
Status: Closed FIXED    
Severity: Affects Only Me CC: james
Priority: --- Flags: bugzilla: maintainer-feedback? (brnrd)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch file for cmake.txt to find iconv libraries and headers none

Description James Elstone 2022-03-10 11:58:28 UTC
When using databases/mariadb-connector-odbc and attempting to action any SQL commands that return a non-zero result set causes the following error:

# /usr/local/bin/isql -v Database_ODBC_Name
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> insert into persons (id,name,surname,password) values (1,'Jack','Jones','***');
ld-elf.so.1: /usr/local/lib/mariadb/libmaodbc.so: Undefined symbol "libiconv_open"


CREATE and DROP do not cause the issue, or results that have 0 rows returned.

Fudged a fix locally to include the USES line from databases/mariadb106-server seemed to work, but did have "WITH_LIBICONV_COMPAT=1" set in /etc/make.conf, e.g.:

< USES=cmake:insource ssl
> USES=bison:build cmake:insource compiler:c++11-lib cpe iconv:translit libedit ncurses shebangfix ssl
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2022-03-19 11:18:12 UTC
Hi James,

How was your package built? Poudriere? `make` in databases/mariadb-connector-odbc?
Comment 2 James Elstone 2022-03-24 16:55:36 UTC
Hi Bernard,

From ports (/usr/ports/databases/mariadb-connector-odbc). Updated the tree today, and tried again.

Interestingly enough though, I got it to work in the end:

There is a confitional statement in work/mariadb-connector-odbc-3.1.15-src/CMakeLists.txt which only reacts is the build system is Apple or AIX. Adding FreeBSD to that seemed to fix it.

Just working on making a patch file for it now...
Comment 3 James Elstone 2022-03-24 17:09:55 UTC
Created attachment 232678 [details]
patch file for cmake.txt to find iconv libraries and headers

Patch to allow MariaDB ODBC find iconv correctly, and now displays errors when called through "isql". No changes to /etc/make.conf or Makefile needed.
Comment 4 James Elstone 2022-03-24 17:10:38 UTC
Tested on a clean FreeBSD install and now works without issue using the simple patch. :-)