[CONC-101] dlerror() redifined Created: 2014-07-13  Updated: 2014-07-14  Resolved: 2014-07-14

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.0.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: René Cannaò Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

From my_global.h :

#if HAVE_DLERROR
#define dlerror() ""
#endif

Why is that?

For comparison, in MySQL my_global.h :

#ifndef HAVE_DLERROR
#ifdef _WIN32
...
#define dlerror() ""
#define dlopen_errno GetLastError()
#else /* _WIN32 */
#define dlerror() "No support for dynamic loading (static build?)"
#define DLERROR_GENERATE(errmsg, error_number) errmsg= dlerror()
#define dlopen_errno errno
#endif /* _WIN32 */
#else /* HAVE_DLERROR */
#define DLERROR_GENERATE(errmsg, error_number) errmsg= dlerror()
#define dlopen_errno errno
#endif /* HAVE_DLERROR */

MySQL my_global.h (rightfully) redefines dlerror() if HAVE_DLERROR is not defined, while MariaDB client library redefines dlerror() if HAVE_DLERROR is defined.



 Comments   
Comment by René Cannaò [ 2014-07-13 ]

The consequence of this is that if I include my_global.h , dlerror() doesn't work anymore and I can't verify if dynamic linking loader is working correctly.

The workaround I am using is to add the follow after I include my_global.h :

// MariaDB client library redefines dlerror(), see https://mariadb.atlassian.net/browse/CONC-101
#ifdef dlerror
#undef dlerror
#endif

Comment by Georg Richter [ 2014-07-14 ]

Fixed in rev. 148.

Generated at Thu Feb 08 03:02:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.