Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONC-749 plugins.multiauth fails on mac #263

Open
wants to merge 1 commit into
base: 3.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions libmariadb/ma_client_plugin.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,22 @@ mysql_client_register_plugin(MYSQL *mysql,
}


#ifdef __APPLE__
/*
If the dylib isn't found on linux, then dlerror() returns 'no such file'
but on Mac it returns a lot more information. Our tests expect the
'no such file', so detect that error on Mac and replace the text.
*/
static const char *normalize_no_such_file_err(const char *errmsg)
{
static const char *fnf= "no such file";
if (!strstr(errmsg, fnf))
return errmsg;
return fnf;
}
#endif


/* see <mysql/client_plugin.h> for a full description */
struct st_mysql_client_plugin * STDCALL
mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
Expand Down Expand Up @@ -421,6 +437,9 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
errmsg= errbuf;
#else
errmsg= dlerror();
#ifdef __APPLE__
errmsg= normalize_no_such_file_err(errmsg);
#endif
#endif
goto err;
}
Expand Down