summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2020-07-27 19:07:08 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2020-07-27 19:15:45 +0530
commit5065cb980d361b3541dee2cc1142bec6dc73786f (patch)
tree5bae5110bc7e7f99ca7b238fe97c9d1ad4415d64
parentcf72e969094ef8bde3cb88bc0575abd9a7f4a910 (diff)
downloadmariadb-git-bb-10.2-MDEV-23082.tar.gz
MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated,bb-10.2-MDEV-23082
and inaccurately Analysis: The list of all privileges is 118 characters wide. However, the format of error message was: "%-.32s command denied to user...". get_length() sets the maximum width to 32 characters. As a result, only first 32 characters of list of privilege are stored. Fix: Changing the format to "%-.100T..." so that get_length() sets width to 100. Hence, first 100 characters of the list of privilege are stored and the type specifier 'T' appends '...' so that truncation can be seen.
-rw-r--r--mysql-test/r/grant.result18
-rw-r--r--mysql-test/t/grant.test25
-rw-r--r--sql/share/errmsg-utf8.txt38
3 files changed, 62 insertions, 19 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index e7edaacdc9b..bd24c5bf380 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -2767,5 +2767,23 @@ root@localhost
DROP TABLE t1;
DROP USER dummy@localhost;
#
+# MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
+# inaccurately
+#
+CREATE USER foo;
+CREATE DATABASE db;
+CREATE TABLE db.t (a INT);
+connect con1,localhost,foo,,;
+GRANT ALL ON db.t TO foo;
+ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
+INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;
+ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
+connection default;
+disconnect con1;
+DROP USER foo;
+DROP TABLE db.t;
+DROP DATABASE db;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 11281811f02..fa3a690a2ee 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -2268,5 +2268,30 @@ DROP TABLE t1;
DROP USER dummy@localhost;
--echo #
+--echo # MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
+--echo # inaccurately
+--echo #
+
+CREATE USER foo;
+CREATE DATABASE db;
+CREATE TABLE db.t (a INT);
+
+--connect (con1,localhost,foo,,)
+
+--error ER_TABLEACCESS_DENIED_ERROR
+GRANT ALL ON db.t TO foo;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
+INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;
+
+--connection default
+--disconnect con1
+
+DROP USER foo;
+DROP TABLE db.t;
+DROP DATABASE db;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 8db992c7501..a4465ae0083 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -3244,25 +3244,25 @@ ER_NONEXISTING_GRANT 42000
swe "Det finns inget privilegium definierat för användare '%-.48s' på '%-.64s'"
ukr "Повноважень не визначено для користувача '%-.48s' з хосту '%-.64s'"
ER_TABLEACCESS_DENIED_ERROR 42000
- cze "%-.32s příkaz nepřístupný pro uživatele: '%s'@'%s' pro tabulku '%-.192s'"
- dan "%-.32s-kommandoen er ikke tilladt for brugeren '%s'@'%s' for tabellen '%-.192s'"
- nla "%-.32s commando geweigerd voor gebruiker: '%s'@'%s' voor tabel '%-.192s'"
- eng "%-.32s command denied to user '%s'@'%s' for table '%-.192s'"
- jps "コマンド %-.32s は ユーザー '%s'@'%s' ,テーブル '%-.192s' に対して許可されていません",
- est "%-.32s käsk ei ole lubatud kasutajale '%s'@'%s' tabelis '%-.192s'"
- fre "La commande '%-.32s' est interdite à l'utilisateur: '%s'@'%s' sur la table '%-.192s'"
- ger "%-.32s Befehl nicht erlaubt für Benutzer '%s'@'%s' auf Tabelle '%-.192s'"
- hun "%-.32s parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a '%-.192s' tablaban"
- ita "Comando %-.32s negato per l'utente: '%s'@'%s' sulla tabella '%-.192s'"
- jpn "コマンド %-.32s は ユーザー '%s'@'%s' ,テーブル '%-.192s' に対して許可されていません"
- kor "'%-.32s' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 테이블 '%-.192s'"
- por "Comando '%-.32s' negado para o usuário '%s'@'%s' na tabela '%-.192s'"
- rum "Comanda %-.32s interzisa utilizatorului: '%s'@'%s' pentru tabela '%-.192s'"
- rus "Команда %-.32s запрещена пользователю '%s'@'%s' для таблицы '%-.192s'"
- serbian "%-.32s komanda zabranjena za korisnika '%s'@'%s' za tabelu '%-.192s'"
- spa "%-.32s comando negado para usuario: '%s'@'%s' para tabla '%-.192s'"
- swe "%-.32s ej tillåtet för '%s'@'%s' för tabell '%-.192s'"
- ukr "%-.32s команда заборонена користувачу: '%s'@'%s' у таблиці '%-.192s'"
+ cze "%-.100T příkaz nepřístupný pro uživatele: '%s'@'%s' pro tabulku '%-.192s'"
+ dan "%-.100T-kommandoen er ikke tilladt for brugeren '%s'@'%s' for tabellen '%-.192s'"
+ nla "%-.100T commando geweigerd voor gebruiker: '%s'@'%s' voor tabel '%-.192s'"
+ eng "%-.100T command denied to user '%s'@'%s' for table '%-.192s'"
+ jps "コマンド %-.100T は ユーザー '%s'@'%s' ,テーブル '%-.192s' に対して許可されていません",
+ est "%-.100T käsk ei ole lubatud kasutajale '%s'@'%s' tabelis '%-.192s'"
+ fre "La commande '%-.100T' est interdite à l'utilisateur: '%s'@'%s' sur la table '%-.192s'"
+ ger "%-.100T Befehl nicht erlaubt für Benutzer '%s'@'%s' auf Tabelle '%-.192s'"
+ hun "%-.100T parancs a '%s'@'%s' felhasznalo szamara nem engedelyezett a '%-.192s' tablaban"
+ ita "Comando %-.100T negato per l'utente: '%s'@'%s' sulla tabella '%-.192s'"
+ jpn "コマンド %-.100T は ユーザー '%s'@'%s' ,テーブル '%-.192s' に対して許可されていません"
+ kor "'%-.100T' 명령은 다음 사용자에게 거부되었습니다. : '%s'@'%s' for 테이블 '%-.192s'"
+ por "Comando '%-.100T' negado para o usuário '%s'@'%s' na tabela '%-.192s'"
+ rum "Comanda %-.100T interzisa utilizatorului: '%s'@'%s' pentru tabela '%-.192s'"
+ rus "Команда %-.100T запрещена пользователю '%s'@'%s' для таблицы '%-.192s'"
+ serbian "%-.100T komanda zabranjena za korisnika '%s'@'%s' za tabelu '%-.192s'"
+ spa "%-.100T comando negado para usuario: '%s'@'%s' para tabla '%-.192s'"
+ swe "%-.100T ej tillåtet för '%s'@'%s' för tabell '%-.192s'"
+ ukr "%-.100T команда заборонена користувачу: '%s'@'%s' у таблиці '%-.192s'"
ER_COLUMNACCESS_DENIED_ERROR 42000
cze "%-.32s příkaz nepřístupný pro uživatele: '%s'@'%s' pro sloupec '%-.192s' v tabulce '%-.192s'"
dan "%-.32s-kommandoen er ikke tilladt for brugeren '%s'@'%s' for kolonne '%-.192s' in tabellen '%-.192s'"