mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Added ER_... labels to mtr fatal error messages
This commit is contained in:
@ -8110,7 +8110,8 @@ void handle_error(struct st_command *command,
|
|||||||
*/
|
*/
|
||||||
if (err_errno == CR_SERVER_LOST ||
|
if (err_errno == CR_SERVER_LOST ||
|
||||||
err_errno == CR_SERVER_GONE_ERROR)
|
err_errno == CR_SERVER_GONE_ERROR)
|
||||||
die("require query '%s' failed: %d: %s", command->query,
|
die("require query '%s' failed: %s (%d): %s", command->query,
|
||||||
|
get_errname_from_code(err_errno),
|
||||||
err_errno, err_error);
|
err_errno, err_error);
|
||||||
|
|
||||||
/* Abort the run of this test, pass the failed query as reason */
|
/* Abort the run of this test, pass the failed query as reason */
|
||||||
@ -8120,7 +8121,9 @@ void handle_error(struct st_command *command,
|
|||||||
|
|
||||||
if (command->abort_on_error)
|
if (command->abort_on_error)
|
||||||
{
|
{
|
||||||
report_or_die("query '%s' failed: %d: %s", command->query, err_errno,
|
report_or_die("query '%s' failed: %s (%d): %s", command->query,
|
||||||
|
get_errname_from_code(err_errno),
|
||||||
|
err_errno,
|
||||||
err_error);
|
err_error);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
@ -8169,9 +8172,12 @@ void handle_error(struct st_command *command,
|
|||||||
if (command->expected_errors.count > 0)
|
if (command->expected_errors.count > 0)
|
||||||
{
|
{
|
||||||
if (command->expected_errors.err[0].type == ERR_ERRNO)
|
if (command->expected_errors.err[0].type == ERR_ERRNO)
|
||||||
report_or_die("query '%s' failed with wrong errno %d: '%s', instead of "
|
report_or_die("query '%s' failed with wrong errno %s (%d): '%s', "
|
||||||
"%d...",
|
"instead of %s (%d)...",
|
||||||
command->query, err_errno, err_error,
|
command->query,
|
||||||
|
get_errname_from_code(err_errno),
|
||||||
|
err_errno, err_error,
|
||||||
|
get_errname_from_code(command->expected_errors.err[0].code.errnum),
|
||||||
command->expected_errors.err[0].code.errnum);
|
command->expected_errors.err[0].code.errnum);
|
||||||
else
|
else
|
||||||
report_or_die("query '%s' failed with wrong sqlstate %s: '%s', "
|
report_or_die("query '%s' failed with wrong sqlstate %s: '%s', "
|
||||||
@ -8204,8 +8210,11 @@ void handle_no_error(struct st_command *command)
|
|||||||
command->expected_errors.err[0].code.errnum != 0)
|
command->expected_errors.err[0].code.errnum != 0)
|
||||||
{
|
{
|
||||||
/* Error code we wanted was != 0, i.e. not an expected success */
|
/* Error code we wanted was != 0, i.e. not an expected success */
|
||||||
report_or_die("query '%s' succeeded - should have failed with errno %d...",
|
report_or_die("query '%s' succeeded - should have failed with error "
|
||||||
command->query, command->expected_errors.err[0].code.errnum);
|
"%s (%d)...",
|
||||||
|
command->query,
|
||||||
|
get_errname_from_code(command->expected_errors.err[0].code.errnum),
|
||||||
|
command->expected_errors.err[0].code.errnum);
|
||||||
}
|
}
|
||||||
else if (command->expected_errors.err[0].type == ERR_SQLSTATE &&
|
else if (command->expected_errors.err[0].type == ERR_SQLSTATE &&
|
||||||
strcmp(command->expected_errors.err[0].code.sqlstate,"00000") != 0)
|
strcmp(command->expected_errors.err[0].code.sqlstate,"00000") != 0)
|
||||||
|
@ -8,7 +8,7 @@ select otto from (select 1 as otto) as t1;
|
|||||||
otto
|
otto
|
||||||
1
|
1
|
||||||
select friedrich from (select 1 as otto) as t1;
|
select friedrich from (select 1 as otto) as t1;
|
||||||
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: 1054: Unknown column 'friedrich' in 'field list'
|
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'friedrich' in 'field list'
|
||||||
select friedrich from (select 1 as otto) as t1;
|
select friedrich from (select 1 as otto) as t1;
|
||||||
ERROR 42S22: Unknown column 'friedrich' in 'field list'
|
ERROR 42S22: Unknown column 'friedrich' in 'field list'
|
||||||
select otto from (select 1 as otto) as t1;
|
select otto from (select 1 as otto) as t1;
|
||||||
@ -155,7 +155,7 @@ select 1146 as "after_!errno_masked_error" ;
|
|||||||
after_!errno_masked_error
|
after_!errno_masked_error
|
||||||
1146
|
1146
|
||||||
select 3 from t1;
|
select 3 from t1;
|
||||||
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1000...
|
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno ER_NO_SUCH_TABLE (1146): 'Table 'test.t1' doesn't exist', instead of ER_HASHCHK (1000)...
|
||||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
||||||
is empty
|
is empty
|
||||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nonsense' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nonsense' at line 1
|
||||||
@ -169,7 +169,7 @@ after_--enable_abort_on_error
|
|||||||
select 3 from t1 ;
|
select 3 from t1 ;
|
||||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||||
select 3 from t1;
|
select 3 from t1;
|
||||||
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1064...
|
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno ER_NO_SUCH_TABLE (1146): 'Table 'test.t1' doesn't exist', instead of ER_PARSE_ERROR (1064)...
|
||||||
garbage;
|
garbage;
|
||||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
||||||
select 2;
|
select 2;
|
||||||
@ -360,7 +360,7 @@ insert into t1 values ('$dollar');
|
|||||||
$dollar
|
$dollar
|
||||||
`select 42`
|
`select 42`
|
||||||
drop table t1;
|
drop table t1;
|
||||||
mysqltest: At line 1: query 'let $var2= `failing query`' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'failing query' at line 1
|
mysqltest: At line 1: query 'let $var2= `failing query`' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'failing query' at line 1
|
||||||
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
|
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
|
||||||
mysqltest: At line 1: Could not open 'non_existingFile' for reading, errno: 2
|
mysqltest: At line 1: Could not open 'non_existingFile' for reading, errno: 2
|
||||||
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
|
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
|
||||||
@ -383,7 +383,7 @@ At line 1: Source directives are nesting too deep
|
|||||||
garbage ;
|
garbage ;
|
||||||
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
|
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
|
||||||
included from <stdin> at line 1:
|
included from <stdin> at line 1:
|
||||||
At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
At line 1: query 'garbage ' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'garbage' at line 1
|
||||||
|
|
||||||
2 = outer loop variable after while
|
2 = outer loop variable after while
|
||||||
here is the sourced script
|
here is the sourced script
|
||||||
@ -520,7 +520,7 @@ mysqltest: At line 1: Missing '{' after while. Found "dec $i"
|
|||||||
mysqltest: At line 1: Stray '}' - end of block before beginning
|
mysqltest: At line 1: Stray '}' - end of block before beginning
|
||||||
mysqltest: At line 1: Stray 'end' command - end of block before beginning
|
mysqltest: At line 1: Stray 'end' command - end of block before beginning
|
||||||
{;
|
{;
|
||||||
mysqltest: At line 1: query '{' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{' at line 1
|
mysqltest: At line 1: query '{' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{' at line 1
|
||||||
mysqltest: At line 1: Missing '{' after while. Found "echo hej"
|
mysqltest: At line 1: Missing '{' after while. Found "echo hej"
|
||||||
mysqltest: At line 3: Missing end of block
|
mysqltest: At line 3: Missing end of block
|
||||||
mysqltest: At line 3: Missing end of block
|
mysqltest: At line 3: Missing end of block
|
||||||
@ -560,7 +560,7 @@ mysqltest: At line 1: Missing required argument 'connection name' to command 'co
|
|||||||
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
|
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
|
||||||
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
|
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
|
||||||
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
|
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
|
||||||
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
|
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: ER_BAD_DB_ERROR (1049): Unknown database 'illegal_db'
|
||||||
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
|
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
|
||||||
mysqltest: At line 1: Illegal option to connect: SMTP
|
mysqltest: At line 1: Illegal option to connect: SMTP
|
||||||
200 connects succeeded
|
200 connects succeeded
|
||||||
@ -631,12 +631,12 @@ insertz 'error query'||||
|
|||||||
mysqltest: At line 3: query 'create table t1 (a int primary key);
|
mysqltest: At line 3: query 'create table t1 (a int primary key);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
select 'select-me';
|
select 'select-me';
|
||||||
insertz 'error query'' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'insertz 'error query'' at line 1
|
insertz 'error query'' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'insertz 'error query'' at line 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
mysqltest: At line 3: query 'create table t1 (a int primary key);
|
mysqltest: At line 3: query 'create table t1 (a int primary key);
|
||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
select 'select-me';
|
select 'select-me';
|
||||||
insertz 'error query'' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'insertz 'error query'' at line 1
|
insertz 'error query'' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'insertz 'error query'' at line 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
Multi statement using expected error
|
Multi statement using expected error
|
||||||
create table t1 (a int primary key);
|
create table t1 (a int primary key);
|
||||||
@ -931,7 +931,7 @@ mysqltest: At line 1: Could not find column 'column_not_exists' in the result of
|
|||||||
mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
|
mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
|
||||||
mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
|
mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
|
||||||
value= No such row
|
value= No such row
|
||||||
mysqltest: At line 1: query 'let $value= query_get_value(SHOW COLNS FROM t1, Field, 1)' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLNS FROM t1' at line 1
|
mysqltest: At line 1: query 'let $value= query_get_value(SHOW COLNS FROM t1, Field, 1)' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLNS FROM t1' at line 1
|
||||||
|
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
a int(11) YES -><- NULL
|
a int(11) YES -><- NULL
|
||||||
@ -946,9 +946,9 @@ a int(11) YES NULL
|
|||||||
b varchar(255) YES NULL
|
b varchar(255) YES NULL
|
||||||
c datetime YES NULL
|
c datetime YES NULL
|
||||||
drop table t1;
|
drop table t1;
|
||||||
mysqltest: At line 1: query 'change_user root,,inexistent' failed: 1049: Unknown database 'inexistent'
|
mysqltest: At line 1: query 'change_user root,,inexistent' failed: ER_BAD_DB_ERROR (1049): Unknown database 'inexistent'
|
||||||
mysqltest: At line 1: query 'change_user inexistent,,test' failed: 1045: Access denied for user 'inexistent'@'localhost' (using password: NO)
|
mysqltest: At line 1: query 'change_user inexistent,,test' failed: ER_ACCESS_DENIED_ERROR (1045): Access denied for user 'inexistent'@'localhost' (using password: NO)
|
||||||
mysqltest: At line 1: query 'change_user root,inexistent,test' failed: 1045: Access denied for user 'root'@'localhost' (using password: YES)
|
mysqltest: At line 1: query 'change_user root,inexistent,test' failed: ER_ACCESS_DENIED_ERROR (1045): Access denied for user 'root'@'localhost' (using password: YES)
|
||||||
REPLACED_FILE1.txt
|
REPLACED_FILE1.txt
|
||||||
file1.txt
|
file1.txt
|
||||||
file2.txt
|
file2.txt
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
select error;
|
select error;
|
||||||
mysqltest: At line 1: query 'select error' failed: 1054: Unknown column 'error' in 'field list'
|
mysqltest: At line 1: query 'select error' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'error' in 'field list'
|
||||||
SELECT ERROR;
|
SELECT ERROR;
|
||||||
mysqltest: At line 1: query 'SELECT ERROR' failed: 1054: Unknown column 'ERROR' in 'field list'
|
mysqltest: At line 1: query 'SELECT ERROR' failed: ER_BAD_FIELD_ERROR (1054): Unknown column 'ERROR' in 'field list'
|
||||||
SELECT 2;
|
SELECT 2;
|
||||||
2
|
2
|
||||||
2
|
2
|
||||||
|
Reference in New Issue
Block a user