Commit 5fb07d22 authored by Rucha Deodhar's avatar Rucha Deodhar

MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated,

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.
parent 745fa255
......@@ -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
#
......@@ -2267,6 +2267,31 @@ SELECT * FROM t1;
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 #
......@@ -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'"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment