~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2011-02-27 02:20:23 UTC
  • mfrom: (2198.6.15 drizzle-build)
  • Revision ID: brian@tangent.org-20110227022023-ycawb23rnf22ic1l
Add ANSI || operator, fixes CREATE TABLE for boolean types such that
TRUE/FALSE are not the options for default values. Removes BOOL mysql
compatible (since Monty fixed all bool to work for MySQL clients).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1062
1062
      lip->yyUnget();                   // Safety against eof
1063
1063
      state = MY_LEX_START;             // Try again
1064
1064
      break;
 
1065
 
1065
1066
    case MY_LEX_LONG_COMMENT:           /* Long C comment? */
1066
1067
      if (lip->yyPeek() != '*')
1067
1068
      {
1159
1160
      lip->in_comment= NO_COMMENT;
1160
1161
      lip->set_echo(true);
1161
1162
      break;
 
1163
 
1162
1164
    case MY_LEX_END_LONG_COMMENT:
1163
1165
      if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/')
1164
1166
      {
1175
1177
      else
1176
1178
        state=MY_LEX_CHAR;              // Return '*'
1177
1179
      break;
 
1180
 
1178
1181
    case MY_LEX_SET_VAR:                // Check if ':='
1179
1182
      if (lip->yyPeek() != '=')
1180
1183
      {
1183
1186
      }
1184
1187
      lip->yySkip();
1185
1188
      return (SET_VAR);
 
1189
 
1186
1190
    case MY_LEX_SEMICOLON:                      // optional line terminator
1187
1191
      if (lip->yyPeek())
1188
1192
      {
1191
1195
      }
1192
1196
      lip->next_state=MY_LEX_END;       // Mark for next loop
1193
1197
      return(END_OF_INPUT);
 
1198
 
1194
1199
    case MY_LEX_EOL:
1195
1200
      if (lip->eof())
1196
1201
      {
1206
1211
      }
1207
1212
      state=MY_LEX_CHAR;
1208
1213
      break;
 
1214
 
1209
1215
    case MY_LEX_END:
1210
1216
      lip->next_state=MY_LEX_END;
1211
1217
      return false;                     // We found end of input last time
1212
1218
 
1213
1219
      /* Actually real shouldn't start with . but allow them anyhow */
 
1220
 
1214
1221
    case MY_LEX_REAL_OR_POINT:
1215
1222
      if (my_isdigit(cs,lip->yyPeek()))
1216
1223
        state= MY_LEX_REAL;             // Real
1220
1227
        lip->yyUnget();                 // Put back '.'
1221
1228
      }
1222
1229
      break;
 
1230
 
1223
1231
    case MY_LEX_USER_END:               // end '@' of user@hostname
1224
1232
      switch (state_map[(uint8_t)lip->yyPeek()]) {
1225
1233
      case MY_LEX_STRING:
1236
1244
      yylval->lex_str.str=(char*) lip->get_ptr();
1237
1245
      yylval->lex_str.length=1;
1238
1246
      return((int) '@');
 
1247
 
1239
1248
    case MY_LEX_HOSTNAME:               // end '@' of user@hostname
1240
1249
      for (c=lip->yyGet() ;
1241
1250
           my_isalnum(cs,c) || c == '.' || c == '_' ||  c == '$';
1242
1251
           c= lip->yyGet()) ;
1243
1252
      yylval->lex_str=get_token(lip, 0, lip->yyLength());
1244
1253
      return(LEX_HOSTNAME);
 
1254
 
1245
1255
    case MY_LEX_SYSTEM_VAR:
1246
1256
      yylval->lex_str.str=(char*) lip->get_ptr();
1247
1257
      yylval->lex_str.length=1;
1251
1261
                        MY_LEX_OPERATOR_OR_IDENT :
1252
1262
                        MY_LEX_IDENT_OR_KEYWORD);
1253
1263
      return((int) '@');
 
1264
 
1254
1265
    case MY_LEX_IDENT_OR_KEYWORD:
1255
1266
      /*
1256
1267
        We come here when we have found two '@' in a row.
1264
1275
 
1265
1276
      if (c == '.')
1266
1277
        lip->next_state=MY_LEX_IDENT_SEP;
 
1278
 
1267
1279
      length= lip->yyLength();
1268
1280
      if (length == 0)
1269
1281
        return(ABORT_SYM);              // Names must be nonempty.
 
1282
 
1270
1283
      if ((tokval= find_keyword(lip, length,0)))
1271
1284
      {
1272
1285
        lip->yyUnget();                         // Put back 'c'