Skip to content

Commit 73dfb40

Browse files
rahulanand16novrobertbindar
authored andcommitted
MDEV-20500: Bad error msg on disabling local infile
1 parent 8f8cc5f commit 73dfb40

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

mysql-test/suite/sys_vars/r/local_infile_func.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DROP TABLE IF EXISTS t1;
2929
create table t1(a int);
3030
LOAD DATA LOCAL INFILE
3131
'MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
32-
ERROR 42000: The used command is not allowed with this MariaDB version
32+
ERROR HY000: The used command is not allowed because the MariaDB server or client has disabled the local infile capability
3333
SELECT count(*) from t1;
3434
count(*)
3535
0

mysql-test/suite/sys_vars/t/local_infile_func.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ DROP TABLE IF EXISTS t1;
7474
create table t1(a int);
7575

7676
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
77-
--Error ER_NOT_ALLOWED_COMMAND
77+
--Error ER_LOAD_INFILE_CAPABILITY_DISABLED
7878
eval LOAD DATA LOCAL INFILE
7979
'$MYSQLTEST_VARDIR/std_data/numbers.txt' INTO TABLE test.t1;
8080

sql/share/errmsg-utf8.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7944,4 +7944,7 @@ ER_WARN_HISTORY_ROW_START_TIME
79447944
ER_PART_STARTS_BEYOND_INTERVAL
79457945
eng "%`s: STARTS is later than query time, first history partition may exceed INTERVAL value"
79467946
ER_GALERA_REPLICATION_NOT_SUPPORTED
7947-
eng "DDL-statement is forbidden as table storage engine does not support Galera replication"
7947+
eng "DDL-statement is forbidden as table storage engine does not support Galera replication"
7948+
ER_LOAD_INFILE_CAPABILITY_DISABLED
7949+
eng "The used command is not allowed because the MariaDB server or client has disabled the local infile capability"
7950+
rum "Comanda folosită nu este permisă deoarece clientul sau serverul MariaDB a dezactivat această capabilitate"

sql/sql_parse.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4940,8 +4940,9 @@ mysql_execute_command(THD *thd)
49404940
if (!(thd->client_capabilities & CLIENT_LOCAL_FILES) ||
49414941
!opt_local_infile)
49424942
{
4943-
my_message(ER_NOT_ALLOWED_COMMAND, ER_THD(thd, ER_NOT_ALLOWED_COMMAND), MYF(0));
4944-
goto error;
4943+
my_message(ER_LOAD_INFILE_CAPABILITY_DISABLED,
4944+
ER_THD(thd, ER_LOAD_INFILE_CAPABILITY_DISABLED), MYF(0));
4945+
goto error;
49454946
}
49464947
}
49474948

0 commit comments

Comments
 (0)