1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

make sql_udf.cc to shorten dlerror() messages

just as sql_plugin.cc does
This commit is contained in:
Sergei Golubchik
2017-03-05 15:50:32 +01:00
parent 2b1bbac5fa
commit 6cddd12ad6
5 changed files with 40 additions and 16 deletions

View File

@ -723,7 +723,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
#ifdef HAVE_DLOPEN
char dlpath[FN_REFLEN];
uint plugin_dir_len, dummy_errors, dlpathlen, i;
uint plugin_dir_len, dummy_errors, i;
struct st_plugin_dl *tmp= 0, plugin_dl;
void *sym;
st_ptr_backup tmp_backup[array_elements(list_of_services)];
@ -759,15 +759,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
/* Open new dll handle */
if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
{
const char *errmsg=dlerror();
dlpathlen= strlen(dlpath);
if (!strncmp(dlpath, errmsg, dlpathlen))
{ // if errmsg starts from dlpath, trim this prefix.
errmsg+=dlpathlen;
if (*errmsg == ':') errmsg++;
if (*errmsg == ' ') errmsg++;
}
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, my_dlerror(dlpath));
goto ret;
}
dlopen_count++;