~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

Merge in SQL reserved word patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
/* A lexical scanner on a temporary buffer with a yacc interface */
18
18
 
19
19
#include "config.h"
 
20
 
20
21
#define DRIZZLE_LEX 1
 
22
 
 
23
#include "drizzled/sql_reserved_words.h"
 
24
 
21
25
#include "drizzled/configmake.h"
22
26
#include "drizzled/item/num.h"
23
27
#include "drizzled/error.h"
262
266
  lex->nest_level=0 ;
263
267
  lex->allow_sum_func= 0;
264
268
  lex->in_sum_func= NULL;
 
269
  lex->type= 0;
265
270
 
266
271
  lex->is_lex_started= true;
267
272
  lex->statement= NULL;
268
273
  
269
274
  lex->is_cross= false;
270
 
 
271
275
  lex->reset();
272
276
}
273
277
 
282
286
  }
283
287
 
284
288
  delete result;
 
289
  delete _create_table;
 
290
  _create_table= NULL;
 
291
  _create_field= NULL;
285
292
 
286
293
  result= 0;
287
294
  setCacheable(true);
1802
1809
  }
1803
1810
}
1804
1811
 
 
1812
LEX::~LEX()
 
1813
{
 
1814
  delete _create_table;
 
1815
}
 
1816
 
1805
1817
/**
1806
1818
  @brief Restore the LEX and Session in case of a parse error.
1807
1819
 
1864
1876
    statement parsing. On should use lex_start() function to prepare LEX
1865
1877
    for this.
1866
1878
*/
1867
 
LEX::LEX()
1868
 
  :
 
1879
LEX::LEX() :
1869
1880
    result(0), 
1870
1881
    yacc_yyss(0), 
1871
1882
    yacc_yyvs(0),
 
1883
    session(NULL),
1872
1884
    charset(NULL),
1873
1885
    var_list(),
1874
1886
    sql_command(SQLCOM_END), 
 
1887
    statement(NULL),
1875
1888
    option_type(OPT_DEFAULT), 
1876
1889
    is_lex_started(0),
1877
1890
    cacheable(true),
1878
 
    sum_expr_used(false)
 
1891
    sum_expr_used(false),
 
1892
    _create_table(NULL),
 
1893
    _create_field(NULL),
 
1894
    _exists(false)
1879
1895
{
1880
1896
  reset_query_tables_list(true);
1881
 
  statement= NULL;
1882
1897
}
1883
1898
 
1884
1899
/**
2154
2169
                                            str, length));
2155
2170
}
2156
2171
 
 
2172
bool check_for_sql_keyword(drizzled::drizzle_lex_string const& string)
 
2173
{
 
2174
  if (sql_reserved_words::in_word_set(string.str, string.length))
 
2175
      return true;
 
2176
 
 
2177
  return false;
 
2178
}
 
2179
 
 
2180
bool check_for_sql_keyword(drizzled::st_lex_symbol const& string)
 
2181
{
 
2182
  if (sql_reserved_words::in_word_set(string.str, string.length))
 
2183
      return true;
 
2184
 
 
2185
  return false;
 
2186
}
 
2187
 
 
2188
 
2157
2189
} /* namespace drizzled */