~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

Yacc! (or yuck!) cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
822
822
%token  UNDERSCORE_CHARSET
823
823
%token  UNDOFILE_SYM
824
824
%token  UNDO_SYM                      /* FUTURE-USE */
825
 
%token  UNICODE_SYM
826
825
%token  UNINSTALL_SYM
827
826
%token  UNION_SYM                     /* SQL-2003-R */
828
827
%token  UNIQUE_SYM
2017
2016
 
2018
2017
opt_binary:
2019
2018
          /* empty */ { Lex->charset=NULL; }
2020
 
        | ASCII_SYM opt_bin_mod { Lex->charset=&my_charset_utf8_general_ci; }
2021
2019
        | BYTE_SYM { Lex->charset=&my_charset_bin; }
2022
 
        | UNICODE_SYM opt_bin_mod
2023
 
          {
2024
 
            if (!(Lex->charset=get_charset_by_csname("ucs2",
2025
 
                                                     MY_CS_PRIMARY,MYF(0))))
2026
 
            {
2027
 
              my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2028
 
              DRIZZLE_YYABORT;
2029
 
            }
2030
 
          }
2031
2020
        | charset charset_name opt_bin_mod { Lex->charset=$2; }
2032
2021
        | BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; }
2033
2022
        ;
2039
2028
 
2040
2029
opt_bin_charset:
2041
2030
          /* empty */ { Lex->charset= NULL; }
2042
 
        | ASCII_SYM { Lex->charset=&my_charset_utf8_general_ci; }
2043
 
        | UNICODE_SYM
2044
 
          {
2045
 
            if (!(Lex->charset=get_charset_by_csname("ucs2",
2046
 
                                                     MY_CS_PRIMARY,MYF(0))))
2047
 
            {
2048
 
              my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "ucs2");
2049
 
              DRIZZLE_YYABORT;
2050
 
            }
2051
 
          }
2052
2031
        | charset charset_name { Lex->charset=$2; }
2053
2032
        ;
2054
2033
 
6234
6213
        | START_SYM             {}
6235
6214
        | STOP_SYM              {}
6236
6215
        | TRUNCATE_SYM          {}
6237
 
        | UNICODE_SYM           {}
6238
6216
        | UNINSTALL_SYM         {}
6239
6217
        | WRAPPER_SYM           {}
6240
6218
        | UPGRADE_SYM           {}