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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
95f97099
Commit
95f97099
authored
Feb 11, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge.
parents
b8863717
9e7dcf4d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
212 additions
and
146 deletions
+212
-146
client/mysql.cc
client/mysql.cc
+3
-1
client/mysqlcheck.c
client/mysqlcheck.c
+2
-1
client/mysqldump.c
client/mysqldump.c
+2
-1
client/mysqlimport.c
client/mysqlimport.c
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+17
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+9
-1
tests/client_test.c
tests/client_test.c
+177
-140
No files found.
client/mysql.cc
View file @
95f97099
...
...
@@ -839,7 +839,9 @@ static int get_options(int argc, char **argv)
opt_reconnect
=
0
;
connect_flag
=
0
;
/* Not in interactive mode */
}
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
if
(
strcmp
(
default_charset
,
charset_info
->
csname
)
&&
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
exit
(
1
);
if
(
argc
>
1
)
...
...
client/mysqlcheck.c
View file @
95f97099
...
...
@@ -311,7 +311,8 @@ static int get_options(int *argc, char ***argv)
}
/* TODO: This variable is not yet used */
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
if
(
strcmp
(
default_charset
,
charset_info
->
csname
)
&&
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
exit
(
1
);
if
(
*
argc
>
0
&&
opt_alldbs
)
...
...
client/mysqldump.c
View file @
95f97099
...
...
@@ -536,7 +536,8 @@ static int get_options(int *argc, char ***argv)
my_progname
);
return
(
1
);
}
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
if
(
strcmp
(
default_charset
,
charset_info
->
csname
)
&&
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
exit
(
1
);
if
((
*
argc
<
1
&&
!
opt_alldbs
)
||
(
*
argc
>
0
&&
opt_alldbs
))
...
...
client/mysqlimport.c
View file @
95f97099
...
...
@@ -238,7 +238,8 @@ static int get_options(int *argc, char ***argv)
fprintf
(
stderr
,
"You can't use --ignore (-i) and --replace (-r) at the same time.
\n
"
);
return
(
1
);
}
if
(
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
if
(
strcmp
(
default_charset
,
charset_info
->
csname
)
&&
!
(
charset_info
=
get_charset_by_csname
(
default_charset
,
MY_CS_PRIMARY
,
MYF
(
MY_WME
))))
exit
(
1
);
if
(
*
argc
<
2
)
...
...
sql/sql_parse.cc
View file @
95f97099
...
...
@@ -3845,7 +3845,23 @@ mysql_parse(THD *thd, char *inBuf, uint length)
if
(
query_cache_send_result_to_client
(
thd
,
inBuf
,
length
)
<=
0
)
{
LEX
*
lex
=
lex_start
(
thd
,
(
uchar
*
)
inBuf
,
length
);
if
(
!
yyparse
((
void
*
)
thd
)
&&
!
thd
->
is_fatal_error
)
if
(
!
yyparse
((
void
*
)
thd
)
&&
!
thd
->
is_fatal_error
&&
/*
If this is not a multiple query, ensure that it has been
successfully parsed until the last character. This is to prevent
against a wrong (too big) length passed to mysql_real_query(),
mysql_prepare()... which can generate garbage characters at the
end. If the query was initially multiple, found_colon will be false
only when we are in the last query; this last query had already
been end-spaces-stripped by alloc_query() in dispatch_command(); as
end spaces are the only thing we accept at the end of a query, and
they have been stripped already, here we can require that nothing
remains after parsing.
*/
(
thd
->
lex
->
found_colon
||
(
char
*
)(
thd
->
lex
->
ptr
)
==
(
thd
->
query
+
thd
->
query_length
+
1
)
||
/* yyerror() will show the garbage chars to the user */
(
yyerror
(
"syntax error"
),
0
)))
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if
(
mqh_used
&&
thd
->
user_connect
&&
...
...
sql/sql_prepare.cc
View file @
95f97099
...
...
@@ -909,7 +909,15 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
lex
->
safe_to_cache_query
=
0
;
lex
->
param_count
=
0
;
if
(
yyparse
((
void
*
)
thd
)
||
thd
->
is_fatal_error
||
send_prepare_results
(
stmt
))
if
(
yyparse
((
void
*
)
thd
)
||
thd
->
is_fatal_error
||
/*
Check for wrong (too big) length passed to mysql_prepare() resulting in
garbage at the end of the query. There is a similar check in mysql_parse().
*/
(
!
thd
->
lex
->
found_colon
&&
(
char
*
)(
thd
->
lex
->
ptr
)
!=
(
thd
->
query
+
thd
->
query_length
+
1
)
&&
/* yyerror() will show the garbage chars to the user */
(
yyerror
(
"syntax error"
),
1
))
||
send_prepare_results
(
stmt
))
goto
yyparse_err
;
lex_end
(
lex
);
...
...
tests/client_test.c
View file @
95f97099
This diff is collapsed.
Click to expand it.
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