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
971268dc
Commit
971268dc
authored
May 08, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing tabs to spaces in sql_lex.cc and sql_lex.h (and coding style slightly)
parent
1b8749f7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
184 additions
and
184 deletions
+184
-184
sql/sql_lex.cc
sql/sql_lex.cc
+160
-160
sql/sql_lex.h
sql/sql_lex.h
+24
-24
No files found.
sql/sql_lex.cc
View file @
971268dc
...
@@ -1167,9 +1167,9 @@ static inline uint int_token(const char *str,uint length)
...
@@ -1167,9 +1167,9 @@ static inline uint int_token(const char *str,uint length)
{
{
if
(
length
==
long_len
)
if
(
length
==
long_len
)
{
{
cmp
=
signed_long_str
+
1
;
cmp
=
signed_long_str
+
1
;
smaller
=
NUM
;
// If <= signed_long_str
smaller
=
NUM
;
// If <= signed_long_str
bigger
=
LONG_NUM
;
// If >= signed_long_str
bigger
=
LONG_NUM
;
// If >= signed_long_str
}
}
else
if
(
length
<
signed_longlong_len
)
else
if
(
length
<
signed_longlong_len
)
return
LONG_NUM
;
return
LONG_NUM
;
...
@@ -1177,8 +1177,8 @@ static inline uint int_token(const char *str,uint length)
...
@@ -1177,8 +1177,8 @@ static inline uint int_token(const char *str,uint length)
return
DECIMAL_NUM
;
return
DECIMAL_NUM
;
else
else
{
{
cmp
=
signed_longlong_str
+
1
;
cmp
=
signed_longlong_str
+
1
;
smaller
=
LONG_NUM
;
// If <= signed_longlong_str
smaller
=
LONG_NUM
;
// If <= signed_longlong_str
bigger
=
DECIMAL_NUM
;
bigger
=
DECIMAL_NUM
;
}
}
}
}
...
@@ -1381,7 +1381,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1381,7 +1381,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
const
uchar
*
const
state_map
=
cs
->
state_map
;
const
uchar
*
const
state_map
=
cs
->
state_map
;
const
uchar
*
const
ident_map
=
cs
->
ident_map
;
const
uchar
*
const
ident_map
=
cs
->
ident_map
;
lip
->
yylval
=
yylval
;
// The global state
lip
->
yylval
=
yylval
;
// The global state
lip
->
start_token
();
lip
->
start_token
();
state
=
lip
->
next_state
;
state
=
lip
->
next_state
;
...
@@ -1408,8 +1408,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1408,8 +1408,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
case
MY_LEX_ESCAPE
:
case
MY_LEX_ESCAPE
:
if
(
!
lip
->
eof
()
&&
lip
->
yyGet
()
==
'N'
)
if
(
!
lip
->
eof
()
&&
lip
->
yyGet
()
==
'N'
)
{
// Allow \N as shortcut for NULL
{
// Allow \N as shortcut for NULL
yylval
->
lex_str
.
str
=
(
char
*
)
"
\\
N"
;
yylval
->
lex_str
.
str
=
(
char
*
)
"
\\
N"
;
yylval
->
lex_str
.
length
=
2
;
yylval
->
lex_str
.
length
=
2
;
return
NULL_SYM
;
return
NULL_SYM
;
}
}
/* Fall through */
/* Fall through */
...
@@ -1562,8 +1562,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1562,8 +1562,8 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
if
(
my_isdigit
(
cs
,
lip
->
yyPeek
()))
// Number must have digit after sign
if
(
my_isdigit
(
cs
,
lip
->
yyPeek
()))
// Number must have digit after sign
{
{
lip
->
yySkip
();
lip
->
yySkip
();
while
(
my_isdigit
(
cs
,
lip
->
yyGet
()))
;
while
(
my_isdigit
(
cs
,
lip
->
yyGet
()))
;
yylval
->
lex_str
=
get_token
(
lip
,
0
,
lip
->
yyLength
());
yylval
->
lex_str
=
get_token
(
lip
,
0
,
lip
->
yyLength
());
return
(
FLOAT_NUM
);
return
(
FLOAT_NUM
);
}
}
}
}
...
@@ -1596,7 +1596,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1596,7 +1596,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
c
=
lip
->
yyGet
();
c
=
lip
->
yyGet
();
if
(
c
==
'-'
||
c
==
'+'
)
if
(
c
==
'-'
||
c
==
'+'
)
c
=
lip
->
yyGet
();
// Skip sign
c
=
lip
->
yyGet
();
// Skip sign
if
(
!
my_isdigit
(
cs
,
c
))
if
(
!
my_isdigit
(
cs
,
c
))
{
// No digit after sign
{
// No digit after sign
state
=
MY_LEX_CHAR
;
state
=
MY_LEX_CHAR
;
break
;
break
;
...
@@ -1669,11 +1669,11 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1669,11 +1669,11 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
case
MY_LEX_BOOL
:
case
MY_LEX_BOOL
:
if
(
c
!=
lip
->
yyPeek
())
if
(
c
!=
lip
->
yyPeek
())
{
{
state
=
MY_LEX_CHAR
;
state
=
MY_LEX_CHAR
;
break
;
break
;
}
}
lip
->
yySkip
();
lip
->
yySkip
();
tokval
=
find_keyword
(
lip
,
2
,
0
);
// Is a bool operator
tokval
=
find_keyword
(
lip
,
2
,
0
);
// Is a bool operator
lip
->
next_state
=
MY_LEX_START
;
// Allow signed numbers
lip
->
next_state
=
MY_LEX_START
;
// Allow signed numbers
return
(
tokval
);
return
(
tokval
);
...
@@ -1704,14 +1704,14 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1704,14 +1704,14 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
}
}
case
MY_LEX_COMMENT
:
// Comment
case
MY_LEX_COMMENT
:
// Comment
lex
->
select_lex
.
options
|=
OPTION_FOUND_COMMENT
;
lex
->
select_lex
.
options
|=
OPTION_FOUND_COMMENT
;
while
((
c
=
lip
->
yyGet
())
!=
'\n'
&&
c
)
;
while
((
c
=
lip
->
yyGet
())
!=
'\n'
&&
c
)
;
lip
->
yyUnget
();
// Safety against eof
lip
->
yyUnget
();
// Safety against eof
state
=
MY_LEX_START
;
// Try again
state
=
MY_LEX_START
;
// Try again
break
;
break
;
case
MY_LEX_LONG_COMMENT
:
/* Long C comment? */
case
MY_LEX_LONG_COMMENT
:
// Long C comment?
if
(
lip
->
yyPeek
()
!=
'*'
)
if
(
lip
->
yyPeek
()
!=
'*'
)
{
{
state
=
MY_LEX_CHAR
;
// Probable division
state
=
MY_LEX_CHAR
;
// Probable division
break
;
break
;
}
}
lex
->
select_lex
.
options
|=
OPTION_FOUND_COMMENT
;
lex
->
select_lex
.
options
|=
OPTION_FOUND_COMMENT
;
...
@@ -1782,7 +1782,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1782,7 +1782,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
thd
->
wsrep_consistency_check
=
CONSISTENCY_CHECK_DECLARED
;
thd
->
wsrep_consistency_check
=
CONSISTENCY_CHECK_DECLARED
;
lip
->
yySkipn
(
5
);
lip
->
yySkipn
(
5
);
lip
->
set_echo
(
TRUE
);
lip
->
set_echo
(
TRUE
);
state
=
MY_LEX_START
;
state
=
MY_LEX_START
;
break
;
/* Do not treat contents as a comment. */
break
;
/* Do not treat contents as a comment. */
}
}
#endif
/* WITH_WSREP */
#endif
/* WITH_WSREP */
...
@@ -1851,12 +1851,12 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1851,12 +1851,12 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
state
=
MY_LEX_START
;
state
=
MY_LEX_START
;
}
}
else
else
state
=
MY_LEX_CHAR
;
// Return '*'
state
=
MY_LEX_CHAR
;
// Return '*'
break
;
break
;
case
MY_LEX_SET_VAR
:
// Check if ':='
case
MY_LEX_SET_VAR
:
// Check if ':='
if
(
lip
->
yyPeek
()
!=
'='
)
if
(
lip
->
yyPeek
()
!=
'='
)
{
{
state
=
MY_LEX_CHAR
;
// Return ':'
state
=
MY_LEX_CHAR
;
// Return ':'
break
;
break
;
}
}
lip
->
yySkip
();
lip
->
yySkip
();
...
@@ -1905,10 +1905,10 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1905,10 +1905,10 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
case
MY_LEX_STRING_OR_DELIMITER
:
case
MY_LEX_STRING_OR_DELIMITER
:
break
;
break
;
case
MY_LEX_USER_END
:
case
MY_LEX_USER_END
:
lip
->
next_state
=
MY_LEX_SYSTEM_VAR
;
lip
->
next_state
=
MY_LEX_SYSTEM_VAR
;
break
;
break
;
default:
default:
lip
->
next_state
=
MY_LEX_HOSTNAME
;
lip
->
next_state
=
MY_LEX_HOSTNAME
;
break
;
break
;
}
}
yylval
->
lex_str
.
str
=
(
char
*
)
lip
->
get_ptr
();
yylval
->
lex_str
.
str
=
(
char
*
)
lip
->
get_ptr
();
...
@@ -1916,7 +1916,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
...
@@ -1916,7 +1916,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
return
((
int
)
'@'
);
return
((
int
)
'@'
);
case
MY_LEX_HOSTNAME
:
// end '@' of user@hostname
case
MY_LEX_HOSTNAME
:
// end '@' of user@hostname
for
(
c
=
lip
->
yyGet
()
;
for
(
c
=
lip
->
yyGet
()
;
my_isalnum
(
cs
,
c
)
||
c
==
'.'
||
c
==
'_'
||
c
==
'$'
;
my_isalnum
(
cs
,
c
)
||
c
==
'.'
||
c
==
'_'
||
c
==
'$'
;
c
=
lip
->
yyGet
())
;
c
=
lip
->
yyGet
())
;
yylval
->
lex_str
=
get_token
(
lip
,
0
,
lip
->
yyLength
());
yylval
->
lex_str
=
get_token
(
lip
,
0
,
lip
->
yyLength
());
return
(
LEX_HOSTNAME
);
return
(
LEX_HOSTNAME
);
...
...
sql/sql_lex.h
View file @
971268dc
...
@@ -2914,7 +2914,7 @@ struct LEX: public Query_tables_list
...
@@ -2914,7 +2914,7 @@ struct LEX: public Query_tables_list
*/
*/
bool
parse_vcol_expr
;
bool
parse_vcol_expr
;
enum
SSL_type
ssl_type
;
/* defined in violite.h */
enum
SSL_type
ssl_type
;
// defined in violite.h
enum
enum_duplicates
duplicates
;
enum
enum_duplicates
duplicates
;
enum
enum_tx_isolation
tx_isolation
;
enum
enum_tx_isolation
tx_isolation
;
enum
enum_ha_read_modes
ha_read_mode
;
enum
enum_ha_read_modes
ha_read_mode
;
...
@@ -2975,7 +2975,7 @@ struct LEX: public Query_tables_list
...
@@ -2975,7 +2975,7 @@ struct LEX: public Query_tables_list
List
<
Item
>
prepared_stmt_params
;
List
<
Item
>
prepared_stmt_params
;
sp_head
*
sphead
;
sp_head
*
sphead
;
sp_name
*
spname
;
sp_name
*
spname
;
bool
sp_lex_in_use
;
/* Keep track on lex usage in SPs for error handling */
bool
sp_lex_in_use
;
// Keep track on lex usage in SPs for error handling
bool
all_privileges
;
bool
all_privileges
;
bool
proxy_priv
;
bool
proxy_priv
;
...
...
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