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
13da57d0
Commit
13da57d0
authored
Oct 07, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Init "saved_expected_errors" at program start, avoids crash where --error is first command
strcmp -> strncmp
parent
4f709703
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
client/mysqltest.c
client/mysqltest.c
+10
-6
No files found.
client/mysqltest.c
View file @
13da57d0
...
@@ -2544,11 +2544,11 @@ void do_get_errcodes(struct st_command *command)
...
@@ -2544,11 +2544,11 @@ void do_get_errcodes(struct st_command *command)
- May contain only digits[0-9] and _uppercase_ letters
- May contain only digits[0-9] and _uppercase_ letters
*/
*/
p
++
;
/* Step past the S */
p
++
;
/* Step past the S */
if
(
end
-
p
!=
SQLSTATE_LENGTH
)
if
(
(
end
-
p
)
!=
SQLSTATE_LENGTH
)
die
(
"The sqlstate must be exactly %d chars long"
,
SQLSTATE_LENGTH
);
die
(
"The sqlstate must be exactly %d chars long"
,
SQLSTATE_LENGTH
);
/* Check sqlstate string validity */
/* Check sqlstate string validity */
while
(
*
p
&&
p
!=
end
)
while
(
*
p
&&
p
<
end
)
{
{
if
(
my_isdigit
(
charset_info
,
*
p
)
||
my_isupper
(
charset_info
,
*
p
))
if
(
my_isdigit
(
charset_info
,
*
p
)
||
my_isupper
(
charset_info
,
*
p
))
*
to_ptr
++=
*
p
++
;
*
to_ptr
++=
*
p
++
;
...
@@ -4652,7 +4652,8 @@ void handle_error(struct st_command *command,
...
@@ -4652,7 +4652,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
,
err_errno
,
err_error
);
die
(
"require query '%s' failed: %d: %s"
,
command
->
query
,
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 */
abort_not_supported_test
(
"Query '%s' failed, required functionality"
\
abort_not_supported_test
(
"Query '%s' failed, required functionality"
\
...
@@ -4669,8 +4670,8 @@ void handle_error(struct st_command *command,
...
@@ -4669,8 +4670,8 @@ void handle_error(struct st_command *command,
if
(((
command
->
expected_errors
.
err
[
i
].
type
==
ERR_ERRNO
)
&&
if
(((
command
->
expected_errors
.
err
[
i
].
type
==
ERR_ERRNO
)
&&
(
command
->
expected_errors
.
err
[
i
].
code
.
errnum
==
err_errno
))
||
(
command
->
expected_errors
.
err
[
i
].
code
.
errnum
==
err_errno
))
||
((
command
->
expected_errors
.
err
[
i
].
type
==
ERR_SQLSTATE
)
&&
((
command
->
expected_errors
.
err
[
i
].
type
==
ERR_SQLSTATE
)
&&
(
strcmp
(
command
->
expected_errors
.
err
[
i
].
code
.
sqlstate
,
(
str
n
cmp
(
command
->
expected_errors
.
err
[
i
].
code
.
sqlstate
,
err_sqlstate
)
==
0
)))
err_sqlstate
,
SQLSTATE_LENGTH
)
==
0
)))
{
{
if
(
!
disable_result_log
)
if
(
!
disable_result_log
)
{
{
...
@@ -4695,7 +4696,7 @@ void handle_error(struct st_command *command,
...
@@ -4695,7 +4696,7 @@ void handle_error(struct st_command *command,
}
}
DBUG_PRINT
(
"info"
,(
"i: %d expected_errors: %d"
,
i
,
DBUG_PRINT
(
"info"
,(
"i: %d expected_errors: %d"
,
i
,
command
->
expected_errors
));
command
->
expected_errors
.
count
));
if
(
!
disable_result_log
)
if
(
!
disable_result_log
)
{
{
...
@@ -5423,6 +5424,9 @@ int main(int argc, char **argv)
...
@@ -5423,6 +5424,9 @@ int main(int argc, char **argv)
save_file
[
0
]
=
0
;
save_file
[
0
]
=
0
;
TMPDIR
[
0
]
=
0
;
TMPDIR
[
0
]
=
0
;
/* Init expected errors */
memset
(
&
saved_expected_errors
,
0
,
sizeof
(
saved_expected_errors
));
/* Init connections */
/* Init connections */
memset
(
connections
,
0
,
sizeof
(
connections
));
memset
(
connections
,
0
,
sizeof
(
connections
));
connections_end
=
connections
+
connections_end
=
connections
+
...
...
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