summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-07-15 04:28:42 +0300
committerunknown <monty@mysql.com>2004-07-15 04:28:42 +0300
commita96bb92f4a6542409e801c1410d58fa36eb55cad (patch)
treefc4aab8e00b642d92acb665697ea33f18288f4be /sql/sql_lex.cc
parentc78da28a4f9489ff8a6268f836512ce1dc4bc44d (diff)
parent46ea874fb78743e1a315fbfa09b012dc382fcbbf (diff)
downloadmariadb-git-a96bb92f4a6542409e801c1410d58fa36eb55cad.tar.gz
Merge
sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_select.cc: Auto merged sql/table.h: Auto merged
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc42
1 files changed, 14 insertions, 28 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2a4f29083e8..723399e275b 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -44,13 +44,6 @@ pthread_key(LEX*,THR_LEX);
#define TOCK_NAME_LENGTH 24
/*
- Map to default keyword characters. This is used to test if an identifer
- is 'simple', in which case we don't have to do any character set conversions
- on it
-*/
-uchar *bin_ident_map= my_charset_bin.ident_map;
-
-/*
The following data is based on the latin1 character set, and is only
used when comparing keywords
*/
@@ -557,13 +550,9 @@ int yylex(void *arg, void *yythd)
else
#endif
{
- result_state= bin_ident_map[c] ? IDENT : IDENT_QUOTED;
- while (ident_map[c=yyGet()])
- {
- /* If not simple character, mark that we must convert it */
- if (!bin_ident_map[c])
- result_state= IDENT_QUOTED;
- }
+ for (result_state= c; ident_map[c= yyGet()]; result_state|= c);
+ /* If there were non-ASCII characters, mark that we must convert */
+ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
}
length= (uint) (lex->ptr - lex->tok_start)-1;
if (lex->ignore_space)
@@ -665,12 +654,11 @@ int yylex(void *arg, void *yythd)
}
else
#endif
- while (ident_map[c = yyGet()])
- {
- /* If not simple character, mark that we must convert it */
- if (!bin_ident_map[c])
- result_state= IDENT_QUOTED;
- }
+ {
+ for (result_state=0; ident_map[c= yyGet()]; result_state|= c);
+ /* If there were non-ASCII characters, mark that we must convert */
+ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
+ }
if (c == '.' && ident_map[yyPeek()])
lex->next_state=MY_LEX_IDENT_SEP;// Next is '.'
@@ -944,13 +932,11 @@ int yylex(void *arg, void *yythd)
We should now be able to handle:
[(global | local | session) .]variable_name
*/
- result_state= IDENT;
- while (ident_map[c=yyGet()])
- {
- /* If not simple character, mark that we must convert it */
- if (!bin_ident_map[c])
- result_state= IDENT_QUOTED;
- }
+
+ for (result_state= 0; ident_map[c= yyGet()]; result_state|= c);
+ /* If there were non-ASCII characters, mark that we must convert */
+ result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT;
+
if (c == '.')
lex->next_state=MY_LEX_IDENT_SEP;
length= (uint) (lex->ptr - lex->tok_start)-1;
@@ -1018,7 +1004,7 @@ void st_select_lex::init_query()
ref_pointer_array= 0;
select_n_having_items= 0;
prep_where= 0;
- explicit_limit= 0;
+ subquery_in_having= explicit_limit= 0;
first_execution= 1;
first_cond_optimization= 1;
}