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
c49e378a
Commit
c49e378a
authored
Apr 25, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review fix
parent
6f5cacfa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
sql/sql_lex.cc
sql/sql_lex.cc
+3
-3
sql/sql_lex.h
sql/sql_lex.h
+4
-1
sql/sql_parse.cc
sql/sql_parse.cc
+5
-4
No files found.
sql/sql_lex.cc
View file @
c49e378a
...
...
@@ -122,7 +122,8 @@ Lex_input_stream::Lex_input_stream(THD *thd,
tok_start_prev
(
NULL
),
buf
(
buffer
),
next_state
(
MY_LEX_START
),
found_semicolon
(
NULL
)
found_semicolon
(
NULL
),
ignore_space
(
test
(
thd
->
variables
.
sql_mode
&
MODE_IGNORE_SPACE
))
{
}
...
...
@@ -192,7 +193,6 @@ void lex_start(THD *thd)
lex
->
select_lex
.
udf_list
.
empty
();
lex
->
current_select
=
&
lex
->
select_lex
;
lex
->
yacc_yyss
=
lex
->
yacc_yyvs
=
0
;
lex
->
ignore_space
=
test
(
thd
->
variables
.
sql_mode
&
MODE_IGNORE_SPACE
);
lex
->
sql_command
=
lex
->
orig_sql_command
=
SQLCOM_END
;
lex
->
duplicates
=
DUP_ERROR
;
lex
->
ignore
=
0
;
...
...
@@ -656,7 +656,7 @@ int MYSQLlex(void *arg, void *yythd)
}
length
=
(
uint
)
(
lip
->
ptr
-
lip
->
tok_start
)
-
1
;
start
=
lip
->
ptr
;
if
(
l
ex
->
ignore_space
)
if
(
l
ip
->
ignore_space
)
{
/*
If we find a space then this can't be an identifier. We notice this
...
...
sql/sql_lex.h
View file @
c49e378a
...
...
@@ -951,6 +951,9 @@ class Lex_input_stream
/** Position of ';' in the stream, to delimit multiple queries. */
const
char
*
found_semicolon
;
/** SQL_MODE = IGNORE_SPACE. */
bool
ignore_space
;
};
...
...
@@ -1069,7 +1072,7 @@ typedef struct st_lex : public Query_tables_list
uint8
create_view_algorithm
;
uint8
create_view_check
;
bool
drop_if_exists
,
drop_temporary
,
local_file
,
one_shot_set
;
bool
in_comment
,
ignore_space
,
verbose
,
no_write_to_binlog
;
bool
in_comment
,
verbose
,
no_write_to_binlog
;
bool
tx_chain
,
tx_release
;
/*
Special JOIN::prepare mode: changing of query is prohibited.
...
...
sql/sql_parse.cc
View file @
c49e378a
...
...
@@ -5990,16 +5990,14 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
- first, call query_cache_send_result_to_client,
- second, if caching failed, initialise the lexical and syntactic parser.
The problem is that the query cache depends on a clean initialization
of
the thd and thd->lex structures, which happen to be implemented
by:
of
(among others) lex->safe_to_cache_query and thd->server_status,
which are reset respectively in
- lex_start()
- mysql_reset_thd_for_next_command()
So, initializing the lexical analyser *before* using the query cache
is required for the cache to work properly.
FIXME: cleanup the dependencies in the code to simplify this.
*/
Lex_input_stream
lip
(
thd
,
inBuf
,
length
);
thd
->
m_lip
=
&
lip
;
lex_start
(
thd
);
mysql_reset_thd_for_next_command
(
thd
);
...
...
@@ -6010,6 +6008,9 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
sp_cache_flush_obsolete
(
&
thd
->
sp_proc_cache
);
sp_cache_flush_obsolete
(
&
thd
->
sp_func_cache
);
Lex_input_stream
lip
(
thd
,
inBuf
,
length
);
thd
->
m_lip
=
&
lip
;
int
err
=
MYSQLparse
(
thd
);
*
found_semicolon
=
lip
.
found_semicolon
;
...
...
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