~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

Fixed bashism.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1017
1017
        opt_limit_clause delete_limit_clause fields opt_values values
1018
1018
        opt_precision opt_ignore opt_column
1019
1019
        set unlock string_list
 
1020
        opt_binary
1020
1021
        ref_list opt_match_clause opt_on_update_delete use
1021
1022
        opt_delete_options opt_delete_option varchar
1022
1023
        opt_outer table_list table_name
1567
1568
          Lex->length=(char*) 0; /* use default length */
1568
1569
        }
1569
1570
        | real_type opt_precision { $$=$1; }
1570
 
        | char '(' NUM ')'
 
1571
        | char '(' NUM ')' opt_binary
1571
1572
          {
1572
1573
            Lex->length=$3.str;
1573
1574
            $$=DRIZZLE_TYPE_VARCHAR;
1574
1575
          }
1575
 
        | char
 
1576
        | char opt_binary
1576
1577
          {
1577
1578
            Lex->length=(char*) "1";
1578
1579
            $$=DRIZZLE_TYPE_VARCHAR;
1579
1580
          }
1580
 
        | varchar '(' NUM ')'
 
1581
        | varchar '(' NUM ')' opt_binary
1581
1582
          {
1582
1583
            Lex->length=$3.str;
1583
1584
            $$= DRIZZLE_TYPE_VARCHAR;
1600
1601
            $$=DRIZZLE_TYPE_BLOB;
1601
1602
            Lex->length=(char*) 0; /* use default length */
1602
1603
          }
1603
 
        | TEXT_SYM
 
1604
        | TEXT_SYM opt_binary
1604
1605
          { 
1605
1606
            $$=DRIZZLE_TYPE_BLOB; 
1606
1607
            Lex->length=(char*) 0; /* use default length */
1607
1608
          }
1608
1609
        | DECIMAL_SYM float_options
1609
 
          { $$=DRIZZLE_TYPE_DECIMAL;}
 
1610
          { $$=DRIZZLE_TYPE_NEWDECIMAL;}
1610
1611
        | NUMERIC_SYM float_options
1611
 
          { $$=DRIZZLE_TYPE_DECIMAL;}
 
1612
          { $$=DRIZZLE_TYPE_NEWDECIMAL;}
1612
1613
        | FIXED_SYM float_options
1613
 
          { $$=DRIZZLE_TYPE_DECIMAL;}
 
1614
          { $$=DRIZZLE_TYPE_NEWDECIMAL;}
1614
1615
        | ENUM_SYM
1615
1616
          {Lex->interval_list.empty();}
1616
 
          '(' string_list ')'
 
1617
          '(' string_list ')' opt_binary
1617
1618
          { $$=DRIZZLE_TYPE_ENUM; }
1618
1619
        | SERIAL_SYM
1619
1620
          {
1781
1782
        | DEFAULT {}
1782
1783
        ;
1783
1784
 
 
1785
opt_binary:
 
1786
          /* empty */ { Lex->charset=NULL; }
 
1787
        | BYTE_SYM { Lex->charset=&my_charset_bin; }
 
1788
        | BINARY { Lex->type|= BINCMP_FLAG; }
 
1789
        ;
 
1790
 
1784
1791
ws_nweights:
1785
1792
        '(' real_ulong_num
1786
1793
        {
3394
3401
cast_type:
3395
3402
          BINARY opt_len
3396
3403
          { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
3397
 
        | CHAR_SYM opt_len
 
3404
        | CHAR_SYM opt_len opt_binary
3398
3405
          { $$=ITEM_CAST_CHAR; Lex->dec= 0; }
3399
3406
        | DATE_SYM
3400
3407
          { $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }