diff options
author | unknown <jcole@abel.spaceapes.com> | 2001-03-14 07:15:45 -0600 |
---|---|---|
committer | unknown <jcole@abel.spaceapes.com> | 2001-03-14 07:15:45 -0600 |
commit | 79924f27efb1640ef2430cc6be59d5de35df39b6 (patch) | |
tree | e7dfccda5cff6fea865f644da997138ac44495c1 /sql | |
parent | 8187e5e8f8fd8dd5e9c3aa5dea68db4af0e98a7e (diff) | |
download | mariadb-git-79924f27efb1640ef2430cc6be59d5de35df39b6.tar.gz |
Reversed SQL_ANSI_MODE per Monty's request.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r-- | sql/gen_lex_hash.cc | 6 | ||||
-rw-r--r-- | sql/lex.h | 1 | ||||
-rw-r--r-- | sql/mysql_priv.h | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.h | 3 | ||||
-rw-r--r-- | sql/sql_lex.cc | 56 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 13 |
7 files changed, 26 insertions, 59 deletions
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc index ca105257f19..08180e62a44 100644 --- a/sql/gen_lex_hash.cc +++ b/sql/gen_lex_hash.cc @@ -472,10 +472,8 @@ int main(int argc,char **argv) int error; MY_INIT(argv[0]); - start_value=4934807L; best_t1=5181754L; best_t2=1469522L; best_type=0; - /* mode=4999 add=7 type: 0 */ - - if (get_options(argc,(char **) argv)) + start_value=5315771L; best_t1=6916833L; best_t2=3813748L; best_type=3; /* mode=5839 add=5 type: 0 */ + if (get_options(argc,(char **) argv)) exit(1); make_max_length_table(); diff --git a/sql/lex.h b/sql/lex.h index 6d676a39755..6f030aa524d 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -270,7 +270,6 @@ static SYMBOL symbols[] = { { "SLAVE", SYM(SLAVE),0,0}, { "SMALLINT", SYM(SMALLINT),0,0}, { "SONAME", SYM(UDF_SONAME_SYM),0,0}, - { "SQL_ANSI_MODE", SYM(SQL_ANSI_MODE),0,0}, { "SQL_AUTO_IS_NULL", SYM(SQL_AUTO_IS_NULL),0,0}, { "SQL_BIG_RESULT", SYM(SQL_BIG_RESULT),0,0}, { "SQL_BIG_SELECTS", SYM(SQL_BIG_SELECTS),0,0}, diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1f41e0a0d2e..a975cab3c7c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -539,8 +539,6 @@ extern struct show_var_st init_vars[]; extern struct show_var_st status_vars[]; extern enum db_type default_table_type; -extern uchar global_state_map[256]; - #ifndef __WIN__ extern pthread_t signal_thread; #endif diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 107073951b0..925061594a9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -135,10 +135,6 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0), } #endif - // copy global state map into thread - for(int x=0; x < 256; x++) - state_map[x] = global_state_map[x]; - #ifdef __WIN__ real_id = 0 ; #endif diff --git a/sql/sql_class.h b/sql/sql_class.h index b3ab4bb947d..37ef237757d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -285,9 +285,6 @@ public: ulong slave_proxy_id; // in slave thread we need to know in behalf of which // thread the query is being run to replicate temp tables properly - // thread-specific state map for lex parser - uchar state_map[256]; - THD(); ~THD(); bool store_globals(); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f0357b99d70..b8d2ee13b0e 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -75,7 +75,7 @@ inline int lex_casecmp(const char *s, const char *t, uint len) #include "lex_hash.h" -uchar global_state_map[256]; +static uchar state_map[256]; void lex_init(void) @@ -89,49 +89,42 @@ void lex_init(void) VOID(pthread_key_create(&THR_LEX,NULL)); - /* Fill global_state_map with states to get a faster parser */ + /* Fill state_map with states to get a faster parser */ for (i=0; i < 256 ; i++) { if (isalpha(i)) - global_state_map[i]=(uchar) STATE_IDENT; + state_map[i]=(uchar) STATE_IDENT; else if (isdigit(i)) - global_state_map[i]=(uchar) STATE_NUMBER_IDENT; + state_map[i]=(uchar) STATE_NUMBER_IDENT; #if defined(USE_MB) && defined(USE_MB_IDENT) else if (use_mb(default_charset_info) && my_ismbhead(default_charset_info, i)) - global_state_map[i]=(uchar) STATE_IDENT; + state_map[i]=(uchar) STATE_IDENT; #endif else if (!isgraph(i)) - global_state_map[i]=(uchar) STATE_SKIP; + state_map[i]=(uchar) STATE_SKIP; else - global_state_map[i]=(uchar) STATE_CHAR; + state_map[i]=(uchar) STATE_CHAR; } - global_state_map[(uchar)'_']= - global_state_map[(uchar)'$']=(uchar) STATE_IDENT; - global_state_map[(uchar)'\'']= - global_state_map[(uchar)'"']=(uchar) STATE_STRING; - global_state_map[(uchar)'-']= - global_state_map[(uchar)'+']=(uchar) STATE_SIGNED_NUMBER; - global_state_map[(uchar)'.']=(uchar) STATE_REAL_OR_POINT; - global_state_map[(uchar)'>']= - global_state_map[(uchar)'=']= - global_state_map[(uchar)'!']= (uchar) STATE_CMP_OP; - global_state_map[(uchar)'<']= (uchar) STATE_LONG_CMP_OP; - global_state_map[(uchar)'&']=global_state_map[(uchar)'|']=(uchar) STATE_BOOL; - global_state_map[(uchar)'#']=(uchar) STATE_COMMENT; - global_state_map[(uchar)';']=(uchar) STATE_COLON; - global_state_map[(uchar)':']=(uchar) STATE_SET_VAR; - global_state_map[0]=(uchar) STATE_EOL; - global_state_map[(uchar)'\\']= (uchar) STATE_ESCAPE; - global_state_map[(uchar)'/']= (uchar) STATE_LONG_COMMENT; - global_state_map[(uchar)'*']= (uchar) STATE_END_LONG_COMMENT; - global_state_map[(uchar)'@']= (uchar) STATE_USER_END; - global_state_map[(uchar) '`']= (uchar) STATE_USER_VARIABLE_DELIMITER; - + state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) STATE_IDENT; + state_map[(uchar)'\'']=state_map[(uchar)'"']=(uchar) STATE_STRING; + state_map[(uchar)'-']=state_map[(uchar)'+']=(uchar) STATE_SIGNED_NUMBER; + state_map[(uchar)'.']=(uchar) STATE_REAL_OR_POINT; + state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) STATE_CMP_OP; + state_map[(uchar)'<']= (uchar) STATE_LONG_CMP_OP; + state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) STATE_BOOL; + state_map[(uchar)'#']=(uchar) STATE_COMMENT; + state_map[(uchar)';']=(uchar) STATE_COLON; + state_map[(uchar)':']=(uchar) STATE_SET_VAR; + state_map[0]=(uchar) STATE_EOL; + state_map[(uchar)'\\']= (uchar) STATE_ESCAPE; + state_map[(uchar)'/']= (uchar) STATE_LONG_COMMENT; + state_map[(uchar)'*']= (uchar) STATE_END_LONG_COMMENT; + state_map[(uchar)'@']= (uchar) STATE_USER_END; + state_map[(uchar) '`']= (uchar) STATE_USER_VARIABLE_DELIMITER; if (thd_startup_options & OPTION_ANSI_MODE) { - global_state_map[(uchar) '"'] = STATE_USER_VARIABLE_DELIMITER; + state_map[(uchar) '"'] = STATE_USER_VARIABLE_DELIMITER; } - DBUG_VOID_RETURN; } @@ -425,7 +418,6 @@ int yylex(void *arg) uint length; enum lex_states state,prev_state; LEX *lex=current_lex; - uchar *state_map = lex->thd->state_map; YYSTYPE *yylval=(YYSTYPE*) arg; lex->yylval=yylval; // The global state diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a533b9ff44a..34cdb3dbf13 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -394,7 +394,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token END %token THEN_SYM -%token SQL_ANSI_MODE %token SQL_BIG_TABLES %token SQL_BIG_SELECTS %token SQL_SELECT_LIMIT @@ -2609,18 +2608,6 @@ option_value: else Lex->options|= OPTION_NOT_AUTO_COMMIT; } - | SQL_ANSI_MODE equal NUM - { - if(atoi($3.str) == 0) - { - Lex->options &= ~(OPTION_ANSI_MODE); - Lex->thd->state_map[(uchar) '"'] = STATE_STRING; - } else { - Lex->options |= OPTION_ANSI_MODE; - Lex->thd->state_map[(uchar) '"'] = STATE_USER_VARIABLE_DELIMITER; - } - } - | SQL_SELECT_LIMIT equal ULONG_NUM { Lex->select_limit= $3; |