Improve error message for ER_CANT_FIND_DL_ENTRY
Added name of the dll/udf that caused the error.
This commit is contained in:
parent
9293d40fa7
commit
9c7e57a41b
@ -2,7 +2,7 @@ drop table if exists t1;
|
|||||||
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
||||||
CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
|
||||||
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||||
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
|
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library 'UDF_EXAMPLE_LIB'
|
||||||
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||||
CREATE FUNCTION udf_sequence RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION udf_sequence RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||||
CREATE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
||||||
|
@ -8,7 +8,7 @@ affected rows: 0
|
|||||||
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||||
affected rows: 0
|
affected rows: 0
|
||||||
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||||
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library
|
ERROR HY000: Can't find symbol 'myfunc_nonexist' in library 'UDF_EXAMPLE_LIB'
|
||||||
SELECT * FROM mysql.func ORDER BY name;
|
SELECT * FROM mysql.func ORDER BY name;
|
||||||
name ret dl type
|
name ret dl type
|
||||||
myfunc_double 1 UDF_LIB function
|
myfunc_double 1 UDF_LIB function
|
||||||
|
@ -3315,30 +3315,30 @@ ER_CANT_OPEN_LIBRARY
|
|||||||
swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d, %-.128s)"
|
swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d, %-.128s)"
|
||||||
ukr "Не можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d, %-.128s)"
|
ukr "Не можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d, %-.128s)"
|
||||||
ER_CANT_FIND_DL_ENTRY
|
ER_CANT_FIND_DL_ENTRY
|
||||||
chi "在库中找不到符号 '%-.128s'"
|
chi "在库中找不到符号 '%-.128s' '%-.128s'"
|
||||||
cze "Nemohu najít funkci '%-.128s' v knihovně"
|
cze "Nemohu najít funkci '%-.128s' v knihovně '%-.128s'"
|
||||||
dan "Kan ikke finde funktionen '%-.128s' i bibliotek"
|
dan "Kan ikke finde funktionen '%-.128s' i bibliotek '%-.128s'"
|
||||||
eng "Can't find symbol '%-.128s' in library"
|
eng "Can't find symbol '%-.128s' in library '%-.128s'"
|
||||||
est "Ei leia funktsiooni '%-.128s' antud teegis"
|
est "Ei leia funktsiooni '%-.128s' antud teegis '%-.128s'"
|
||||||
fre "Impossible de trouver la fonction '%-.128s' dans la bibliothèque"
|
fre "Impossible de trouver la fonction '%-.128s' dans la bibliothèque '%-.128s'"
|
||||||
ger "Kann Funktion '%-.128s' in der Library nicht finden"
|
ger "Kann Funktion '%-.128s' in der Library '%-.128s' nicht finden"
|
||||||
geo "ბიბლიოთეკაში სიმბოლო '%-.128s' ვერ ვიპოვე"
|
geo "ბიბლიოთეკაში სიმბოლო '%-.128s' '%-.128s' ვერ ვიპოვე"
|
||||||
greek "Δεν είναι δυνατή η ανεύρεση της συνάρτησης '%-.128s' στην βιβλιοθήκη"
|
greek "Δεν είναι δυνατή η ανεύρεση της συνάρτησης '%-.128s' στην βιβλιοθήκη '%-.128s'"
|
||||||
hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban"
|
hun "A(z) '%-.128s' fuggveny nem talalhato a konyvtarban '%-.128s'"
|
||||||
ita "Impossibile trovare la funzione '%-.128s' nella libreria"
|
ita "Impossibile trovare la funzione '%-.128s' nella libreria '%-.128s'"
|
||||||
jpn "関数 '%-.128s' は共有ライブラリー中にありません。"
|
jpn "関数 '%-.128s' '%-.128s' は共有ライブラリー中にありません。"
|
||||||
kor "라이버러리에서 '%-.128s' 함수를 찾을 수 없습니다."
|
kor "라이버러리에서 '%-.128s' '%-.128s' 함수를 찾을 수 없습니다."
|
||||||
nla "Kan functie '%-.128s' niet in library vinden"
|
nla "Kan functie '%-.128s' niet in library '%-.128s' vinden"
|
||||||
por "Não pode encontrar a função '%-.128s' na biblioteca"
|
por "Não pode encontrar a função '%-.128s' na biblioteca '%-.128s'"
|
||||||
rum "Nu pot gasi functia '%-.128s' in libraria"
|
rum "Nu pot gasi functia '%-.128s' in libraria '%-.128s'"
|
||||||
rus "Невозможно отыскать символ '%-.128s' в библиотеке"
|
rus "Невозможно отыскать символ '%-.128s' в библиотеке '%-.128s'"
|
||||||
serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci"
|
serbian "Ne mogu da pronadjem funkciju '%-.128s' u biblioteci '%-.128s'"
|
||||||
slo "Nemôžem nájsť funkciu '%-.128s' v knižnici"
|
slo "Nemôžem nájsť funkciu '%-.128s' v knižnici '%-.128s'"
|
||||||
spa "No puedo encontrar el símbolo '%-.128s' en biblioteca"
|
spa "No puedo encontrar el símbolo '%-.128s' en biblioteca '%-.128s'"
|
||||||
sw "Haiwezi kupata alama ya '% -.128s' kwenye maktaba"
|
sw "Haiwezi kupata alama ya '% -.128s' kwenye maktaba '%-.128s'"
|
||||||
swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket"
|
swe "Hittar inte funktionen '%-.128s' in det dynamiska biblioteket '%-.128s'"
|
||||||
ukr "Не можу знайти функцію '%-.128s' у бібліотеці"
|
ukr "Не можу знайти функцію '%-.128s' у бібліотеці '%-.128s'"
|
||||||
ER_FUNCTION_NOT_DEFINED
|
ER_FUNCTION_NOT_DEFINED
|
||||||
chi "未定义函数 '%-.192s'"
|
chi "未定义函数 '%-.192s'"
|
||||||
cze "Funkce '%-.192s' není definována"
|
cze "Funkce '%-.192s' není definována"
|
||||||
dan "Funktionen '%-.192s' er ikke defineret"
|
dan "Funktionen '%-.192s' er ikke defineret"
|
||||||
|
@ -543,7 +543,7 @@ static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
|
|||||||
/* Determine interface version */
|
/* Determine interface version */
|
||||||
if (!sym)
|
if (!sym)
|
||||||
{
|
{
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, plugin_interface_version_sym);
|
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, plugin_interface_version_sym, dlpath);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
plugin_dl->mariaversion= 0;
|
plugin_dl->mariaversion= 0;
|
||||||
@ -559,7 +559,7 @@ static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
|
|||||||
/* Find plugin declarations */
|
/* Find plugin declarations */
|
||||||
if (!(sym= dlsym(plugin_dl->handle, plugin_declarations_sym)))
|
if (!(sym= dlsym(plugin_dl->handle, plugin_declarations_sym)))
|
||||||
{
|
{
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, plugin_declarations_sym);
|
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, plugin_declarations_sym, dlpath);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,7 +663,7 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
|
|||||||
version we try mysql version.
|
version we try mysql version.
|
||||||
*/
|
*/
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags,
|
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags,
|
||||||
maria_plugin_interface_version_sym);
|
maria_plugin_interface_version_sym, dlpath);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
plugin_dl->mariaversion= *(int *)sym;
|
plugin_dl->mariaversion= *(int *)sym;
|
||||||
@ -679,7 +679,7 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
|
|||||||
/* Find plugin declarations */
|
/* Find plugin declarations */
|
||||||
if (!(sym= dlsym(plugin_dl->handle, maria_plugin_declarations_sym)))
|
if (!(sym= dlsym(plugin_dl->handle, maria_plugin_declarations_sym)))
|
||||||
{
|
{
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, maria_plugin_declarations_sym);
|
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, maria_plugin_declarations_sym, dlpath);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
if (plugin_dl->mariaversion != MARIA_PLUGIN_INTERFACE_VERSION)
|
if (plugin_dl->mariaversion != MARIA_PLUGIN_INTERFACE_VERSION)
|
||||||
@ -692,7 +692,8 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
|
|||||||
sizeof_st_plugin= *(int *)sym;
|
sizeof_st_plugin= *(int *)sym;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, maria_sizeof_st_plugin_sym);
|
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, maria_sizeof_st_plugin_sym,
|
||||||
|
dlpath);
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1221,7 +1222,7 @@ err:
|
|||||||
DBUG_ASSERT(!name->str || !dupes); // dupes is ONLY for name->str == 0
|
DBUG_ASSERT(!name->str || !dupes); // dupes is ONLY for name->str == 0
|
||||||
|
|
||||||
if (errs == 0 && oks == 0 && !dupes) // no plugin was found
|
if (errs == 0 && oks == 0 && !dupes) // no plugin was found
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MyFlags, name->str);
|
my_error(ER_PLUGIN_IS_NOT_LOADED, MyFlags, name->str);
|
||||||
|
|
||||||
plugin_dl_del(tmp.plugin_dl);
|
plugin_dl_del(tmp.plugin_dl);
|
||||||
if (errs > 0 || oks + dupes == 0)
|
if (errs > 0 || oks + dupes == 0)
|
||||||
|
@ -98,7 +98,7 @@ static const char *init_syms(udf_func *tmp, char *nm)
|
|||||||
if (!opt_allow_suspicious_udfs)
|
if (!opt_allow_suspicious_udfs)
|
||||||
return nm;
|
return nm;
|
||||||
if (thd->variables.log_warnings)
|
if (thd->variables.log_warnings)
|
||||||
sql_print_warning(ER_THD(thd, ER_CANT_FIND_DL_ENTRY), nm);
|
sql_print_warning(ER_THD(thd, ER_CANT_FIND_DL_ENTRY), nm, tmp->name.str);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -265,7 +265,8 @@ void udf_init()
|
|||||||
const char *missing;
|
const char *missing;
|
||||||
if ((missing= init_syms(tmp, buf)))
|
if ((missing= init_syms(tmp, buf)))
|
||||||
{
|
{
|
||||||
sql_print_error(ER_THD(new_thd, ER_CANT_FIND_DL_ENTRY), missing);
|
sql_print_error(ER_THD(new_thd, ER_CANT_FIND_DL_ENTRY), missing,
|
||||||
|
tmp->name.str);
|
||||||
del_udf(tmp);
|
del_udf(tmp);
|
||||||
if (new_dl)
|
if (new_dl)
|
||||||
dlclose(dl);
|
dlclose(dl);
|
||||||
@ -605,7 +606,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
|
|||||||
const char *missing;
|
const char *missing;
|
||||||
if ((missing= init_syms(udf, buf)))
|
if ((missing= init_syms(udf, buf)))
|
||||||
{
|
{
|
||||||
my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), missing);
|
my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), missing, udf->dl);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user