Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d692f0c0
Commit
d692f0c0
authored
Aug 31, 2005
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove syntax !$<err_no> to set an expected error code
Use !<err_no> instead
parent
2fc6ef3a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
42 deletions
+9
-42
client/mysqltest.c
client/mysqltest.c
+5
-35
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+0
-5
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+4
-2
No files found.
client/mysqltest.c
View file @
d692f0c0
...
...
@@ -104,12 +104,11 @@ enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD,
/* ************************************************************************ */
/*
A line that starts with !$ or $S, and the list of error codes to
--error are stored in an internal array of structs. This struct can
hold numeric SQL error codes or SQLSTATE codes as strings. The
element next to the last active element in the list is set to type
ERR_EMPTY. When an SQL statement return an error we use this list to
check if this is an expected error.
The list of error codes to --error are stored in an internal array of
structs. This struct can hold numeric SQL error codes or SQLSTATE codes
as strings. The element next to the last active element in the list is
set to type ERR_EMPTY. When an SQL statement return an error we use
this list to check if this is an expected error.
*/
enum
match_err_type
...
...
@@ -2338,8 +2337,6 @@ int read_line(char *buf, int size)
Converts lines returned by read_line into a query, this involves
parsing the first word in the read line to find the query type.
If the line starts with !$<num> or !S<alphanum> the query is setup
to expect that result when query is executed.
A -- comment may contain a valid query as the first word after the
comment start. Thus it's always checked to see if that is the case.
...
...
@@ -2397,33 +2394,6 @@ int read_query(struct st_query** q_ptr)
}
else
{
if
(
*
p
==
'!'
)
{
q
->
abort_on_error
=
0
;
p
++
;
if
(
*
p
==
'$'
)
{
int
expected_errno
=
0
;
p
++
;
for
(;
my_isdigit
(
charset_info
,
*
p
);
p
++
)
expected_errno
=
expected_errno
*
10
+
*
p
-
'0'
;
q
->
expected_errno
[
0
].
code
.
errnum
=
expected_errno
;
q
->
expected_errno
[
0
].
type
=
ERR_ERRNO
;
q
->
expected_errno
[
1
].
type
=
ERR_EMPTY
;
q
->
expected_errors
=
1
;
}
else
if
(
*
p
==
'S'
)
/* SQLSTATE */
{
int
i
;
p
++
;
for
(
i
=
0
;
my_isalnum
(
charset_info
,
*
p
)
&&
i
<
SQLSTATE_LENGTH
;
p
++
,
i
++
)
q
->
expected_errno
[
0
].
code
.
sqlstate
[
i
]
=
*
p
;
q
->
expected_errno
[
0
].
code
.
sqlstate
[
i
]
=
'\0'
;
q
->
expected_errno
[
0
].
type
=
ERR_SQLSTATE
;
q
->
expected_errno
[
1
].
type
=
ERR_EMPTY
;
q
->
expected_errors
=
1
;
}
}
while
(
*
p
&&
my_isspace
(
charset_info
,
*
p
))
p
++
;
if
(
*
p
==
'@'
)
...
...
mysql-test/r/mysqltest.result
View file @
d692f0c0
...
...
@@ -13,14 +13,9 @@ ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1;
otto
1
select otto from (select 1 as otto) as t1;
otto
1
mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22...
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000...
select otto from (select 1 as otto) as t1;
otto
...
...
mysql-test/t/mysqltest.test
View file @
d692f0c0
...
...
@@ -75,8 +75,9 @@ select friedrich from (select 1 as otto) as t1;
# Positive case(statement)
# ----------------------------------------------------------------------------
# This syntax not allowed anymore, use --error S00000, see below
# expectation = response
!
S00000
select
otto
from
(
select
1
as
otto
)
as
t1
;
#
!S00000 select otto from (select 1 as otto) as t1;
--
error
S00000
select
otto
from
(
select
1
as
otto
)
as
t1
;
...
...
@@ -94,8 +95,9 @@ select otto from (select 1 as otto) as t1;
# Negative case(statement)
# ----------------------------------------------------------------------------
# This syntax not allowed anymore, use --error S42S22, see below
# expectation = response
!
S42S22
select
friedrich
from
(
select
1
as
otto
)
as
t1
;
#
!S42S22 select friedrich from (select 1 as otto) as t1;
--
error
S42S22
select
friedrich
from
(
select
1
as
otto
)
as
t1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment