From e10d42d93b373080ec9acb28f9ed29857000c0ae Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 11 Nov 2013 09:31:09 +0100 Subject: [PATCH] MDEV-5022 Strange message or wrong errno on mismatching versions of plugin and server 1. use an appropriate errno code 2. put a comma between the errno and the error message text --- mysql-test/r/plugin_maturity.result | 8 ++--- sql/share/errmsg-utf8.txt | 48 ++++++++++++++--------------- sql/sql_plugin.cc | 8 ++--- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/plugin_maturity.result b/mysql-test/r/plugin_maturity.result index 3249ea9b3c1..cd47830cbd3 100644 --- a/mysql-test/r/plugin_maturity.result +++ b/mysql-test/r/plugin_maturity.result @@ -1,8 +1,8 @@ INSTALL PLUGIN example SONAME 'ha_example.so'; -ERROR HY000: Can't open shared library 'ha_example.so' (errno: 0 Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) +ERROR HY000: Can't open shared library 'ha_example.so' (errno: 1, Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) INSTALL SONAME 'ha_example.so'; -ERROR HY000: Can't open shared library 'ha_example.so' (errno: 0 Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) +ERROR HY000: Can't open shared library 'ha_example.so' (errno: 1, Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) show warnings; Level Code Message -Error 1126 Can't open shared library 'ha_example.so' (errno: 0 Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) -Error 1126 Can't open shared library 'ha_example.so' (errno: 0 Loading of experimental plugin UNUSABLE is prohibited by --plugin-maturity=stable) +Error 1126 Can't open shared library 'ha_example.so' (errno: 1, Loading of experimental plugin EXAMPLE is prohibited by --plugin-maturity=stable) +Error 1126 Can't open shared library 'ha_example.so' (errno: 1, Loading of experimental plugin UNUSABLE is prohibited by --plugin-maturity=stable) diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 612c415359f..4f22ffb04de 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -2958,30 +2958,30 @@ ER_UDF_EXISTS swe "Funktionen '%-.192s' finns redan" ukr "Функція '%-.192s' вже існує" ER_CANT_OPEN_LIBRARY - cze "Nemohu otev-Břít sdílenou knihovnu '%-.192s' (errno: %d %-.128s)" - dan "Kan ikke åbne delt bibliotek '%-.192s' (errno: %d %-.128s)" - nla "Kan shared library '%-.192s' niet openen (Errcode: %d %-.128s)" - eng "Can't open shared library '%-.192s' (errno: %d %-.128s)" - jps "shared library '%-.192s' を開く事ができません (errno: %d %-.128s)", - est "Ei suuda avada jagatud teeki '%-.192s' (veakood: %d %-.128s)" - fre "Impossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d %-.128s)" - ger "Kann Shared Library '%-.192s' nicht öffnen (Fehler: %d %-.128s)" - greek "Δεν είναι δυνατή η ανάγνωση της shared library '%-.192s' (κωδικός λάθους: %d %-.128s)" - hun "A(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d %-.128s)" - ita "Impossibile aprire la libreria condivisa '%-.192s' (errno: %d %-.128s)" - jpn "shared library '%-.192s' を開く事ができません (errno: %d %-.128s)" - kor "'%-.192s' 공유 라이버러리를 열수 없습니다.(에러번호: %d %-.128s)" - nor "Can't open shared library '%-.192s' (errno: %d %-.128s)" - norwegian-ny "Can't open shared library '%-.192s' (errno: %d %-.128s)" - pol "Can't open shared library '%-.192s' (errno: %d %-.128s)" - por "Não pode abrir biblioteca compartilhada '%-.192s' (erro no. %d '%-.128s')" - rum "Nu pot deschide libraria shared '%-.192s' (Eroare: %d %-.128s)" - rus "Невозможно открыть динамическую библиотеку '%-.192s' (ошибка: %d %-.128s)" - serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d %-.128s)" - slo "Nemôžem otvoriť zdieľanú knižnicu '%-.192s' (chybový kód: %d %-.128s)" - spa "No puedo abrir libraria conjugada '%-.192s' (errno: %d %-.128s)" - swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d %-.128s)" - ukr "Не можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d %-.128s)" + cze "Nemohu otev-Břít sdílenou knihovnu '%-.192s' (errno: %d, %-.128s)" + dan "Kan ikke åbne delt bibliotek '%-.192s' (errno: %d, %-.128s)" + nla "Kan shared library '%-.192s' niet openen (Errcode: %d, %-.128s)" + eng "Can't open shared library '%-.192s' (errno: %d, %-.128s)" + jps "shared library '%-.192s' を開く事ができません (errno: %d, %-.128s)", + est "Ei suuda avada jagatud teeki '%-.192s' (veakood: %d, %-.128s)" + fre "Impossible d'ouvrir la bibliothèque partagée '%-.192s' (errno: %d, %-.128s)" + ger "Kann Shared Library '%-.192s' nicht öffnen (Fehler: %d, %-.128s)" + greek "Δεν είναι δυνατή η ανάγνωση της shared library '%-.192s' (κωδικός λάθους: %d, %-.128s)" + hun "A(z) '%-.192s' megosztott konyvtar nem hasznalhato (hibakod: %d, %-.128s)" + ita "Impossibile aprire la libreria condivisa '%-.192s' (errno: %d, %-.128s)" + jpn "shared library '%-.192s' を開く事ができません (errno: %d, %-.128s)" + kor "'%-.192s' 공유 라이버러리를 열수 없습니다.(에러번호: %d, %-.128s)" + nor "Can't open shared library '%-.192s' (errno: %d, %-.128s)" + norwegian-ny "Can't open shared library '%-.192s' (errno: %d, %-.128s)" + pol "Can't open shared library '%-.192s' (errno: %d, %-.128s)" + por "Não pode abrir biblioteca compartilhada '%-.192s' (erro no. %d, %-.128s)" + rum "Nu pot deschide libraria shared '%-.192s' (Eroare: %d, %-.128s)" + rus "Невозможно открыть динамическую библиотеку '%-.192s' (ошибка: %d, %-.128s)" + serbian "Ne mogu da otvorim share-ovanu biblioteku '%-.192s' (errno: %d, %-.128s)" + slo "Nemôžem otvoriť zdieľanú knižnicu '%-.192s' (chybový kód: %d, %-.128s)" + spa "No puedo abrir libraria conjugada '%-.192s' (errno: %d, %-.128s)" + swe "Kan inte öppna det dynamiska biblioteket '%-.192s' (Felkod: %d, %-.128s)" + ukr "Не можу відкрити розділювану бібліотеку '%-.192s' (помилка: %d, %-.128s)" ER_CANT_FIND_DL_ENTRY cze "Nemohu naj-Bít funkci '%-.128s' v knihovně" dan "Kan ikke finde funktionen '%-.128s' i bibliotek" diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index eb8b05a9c99..c0b59dcadcb 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -644,7 +644,7 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl, (plugin_dl->mariaversion >> 8) > (MARIA_PLUGIN_INTERFACE_VERSION >> 8)) { free_plugin_mem(plugin_dl); - report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, + report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, ENOEXEC, "plugin interface version mismatch"); DBUG_RETURN(TRUE); } @@ -789,7 +789,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report) my_snprintf(buf, sizeof(buf), "service '%s' interface version mismatch", list_of_services[i].name); - report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf); + report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, ENOEXEC, buf); DBUG_RETURN(0); } *(void**)sym= list_of_services[i].service; @@ -1083,7 +1083,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, plugin_type_names[plugin->type].str, " plugin ", tmp.name.str, " not supported by this version of the server", NullS); - report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf); + report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, ENOEXEC, buf); goto err; } if (plugin_maturity_map[plugin->maturity] < plugin_maturity) @@ -1095,7 +1095,7 @@ static bool plugin_add(MEM_ROOT *tmp_root, " is prohibited by --plugin-maturity=", plugin_maturity_names[plugin_maturity], NullS); - report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf); + report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, EPERM, buf); goto err; } tmp.plugin= plugin;