~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2009-02-17 00:40:38 UTC
  • mfrom: (873.2.30 devel)
  • Revision ID: brian@tangent.org-20090217004038-ivu0noxx1958wwls
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/error.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/sql_base.h>
25
 
#include <drizzled/hash_symbol.h>
 
25
#include <drizzled/lookup_symbol.h>
26
26
 
27
27
 
28
28
 
317
317
    tok_upper[tok_pos]=my_toupper(system_charset_info, tok[tok_pos]);
318
318
  tok_upper[tok_pos]=0;
319
319
 
320
 
  const SYMBOL *symbol= get_hash_symbol(tok_upper, len, function);
 
320
  const SYMBOL *symbol= lookup_symbol(tok_upper, len, function);
321
321
  if (symbol)
322
322
  {
323
323
    lip->yylval->symbol.symbol=symbol;
330
330
  return 0;
331
331
}
332
332
 
333
 
/*
334
 
  Check if name is a keyword
335
 
 
336
 
  SYNOPSIS
337
 
    is_keyword()
338
 
    name      checked name (must not be empty)
339
 
    len       length of checked name
340
 
 
341
 
  RETURN VALUES
342
 
    0         name is a keyword
343
 
    1         name isn't a keyword
344
 
*/
345
 
 
346
 
bool is_keyword(const char *name, uint32_t len)
347
 
{
348
 
  assert(len != 0);
349
 
  return get_hash_symbol(name,len,0)!=0;
350
 
}
351
333
 
352
334
bool is_lex_native_function(const LEX_STRING *name)
353
335
{
354
336
  assert(name != NULL);
355
 
  return (get_hash_symbol(name->str, name->length, 1) != 0);
 
337
  return (lookup_symbol(name->str, name->length, 1) != 0);
356
338
}
357
339
 
358
340
/* make a copy of token before ptr and set yytoklen */