~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-05-15 19:17:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1023.
  • Revision ID: brian@gaz-20090515191703-bhfoodfaenh6gp9z
Force UTF8 (remove the bits for looking for ascii).

This is a reverse of commit 31951 from MySQL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5160
5160
/* Common definitions */
5161
5161
 
5162
5162
text_literal:
5163
 
          TEXT_STRING
5164
 
          {
5165
 
            LEX_STRING tmp;
5166
 
            Session *session= YYSession;
5167
 
            const CHARSET_INFO * const cs_con= session->variables.getCollation();
5168
 
            const CHARSET_INFO * const cs_cli= default_charset_info;
5169
 
            uint32_t repertoire= session->lex->text_string_is_7bit &&
5170
 
                             my_charset_is_ascii_based(cs_cli) ?
5171
 
                             MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30;
5172
 
            tmp= $1;
5173
 
            $$= new Item_string(tmp.str, tmp.length, cs_con, DERIVATION_COERCIBLE, repertoire);
5174
 
          }
 
5163
        TEXT_STRING_literal
 
5164
        {
 
5165
          Session *session= YYSession;
 
5166
          $$ = new Item_string($1.str, $1.length, session->variables.getCollation());
 
5167
        }
5175
5168
        | text_literal TEXT_STRING_literal
5176
 
          {
5177
 
            Item_string* item= (Item_string*) $1;
5178
 
            item->append($2.str, $2.length);
5179
 
            if (!(item->collation.repertoire & MY_REPERTOIRE_EXTENDED))
5180
 
            {
5181
 
              /*
5182
 
                 If the string has been pure ASCII so far,
5183
 
                 check the new part.
5184
 
              */
5185
 
              const CHARSET_INFO * const cs= YYSession->variables.getCollation();
5186
 
              item->collation.repertoire|= my_string_repertoire(cs,
5187
 
                                                                $2.str,
5188
 
                                                                $2.length);
5189
 
            }
 
5169
          { 
 
5170
            ((Item_string*) $1)->append($2.str, $2.length); 
5190
5171
          }
5191
5172
        ;
5192
5173