~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:15:57 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051557-sm1v4xrmqe5ql2pi
logging is done by plugins, so imply in docs that new plugins can implement new logging.

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"
242
246
  lex->derived_tables= 0;
243
247
  lex->lock_option= TL_READ;
244
248
  lex->leaf_tables_insert= 0;
 
249
  lex->var_list.clear();
245
250
  lex->select_lex.select_number= 1;
246
251
  lex->length=0;
247
252
  lex->select_lex.in_sum_expr=0;
261
266
  lex->nest_level=0 ;
262
267
  lex->allow_sum_func= 0;
263
268
  lex->in_sum_func= NULL;
 
269
  lex->type= 0;
264
270
 
265
271
  lex->is_lex_started= true;
266
272
  lex->statement= NULL;
267
273
  
268
274
  lex->is_cross= false;
269
 
 
270
275
  lex->reset();
271
276
}
272
277
 
281
286
  }
282
287
 
283
288
  delete result;
 
289
  delete _create_table;
 
290
  _create_table= NULL;
 
291
  _create_field= NULL;
284
292
 
285
293
  result= 0;
286
294
  setCacheable(true);
1801
1809
  }
1802
1810
}
1803
1811
 
 
1812
LEX::~LEX()
 
1813
{
 
1814
  delete _create_table;
 
1815
}
 
1816
 
1804
1817
/**
1805
1818
  @brief Restore the LEX and Session in case of a parse error.
1806
1819
 
1863
1876
    statement parsing. On should use lex_start() function to prepare LEX
1864
1877
    for this.
1865
1878
*/
1866
 
LEX::LEX()
1867
 
  :
 
1879
LEX::LEX() :
1868
1880
    result(0), 
1869
1881
    yacc_yyss(0), 
1870
1882
    yacc_yyvs(0),
 
1883
    session(NULL),
1871
1884
    charset(NULL),
 
1885
    var_list(),
1872
1886
    sql_command(SQLCOM_END), 
 
1887
    statement(NULL),
1873
1888
    option_type(OPT_DEFAULT), 
1874
1889
    is_lex_started(0),
1875
1890
    cacheable(true),
1876
 
    sum_expr_used(false)
 
1891
    sum_expr_used(false),
 
1892
    _create_table(NULL),
 
1893
    _create_field(NULL),
 
1894
    _exists(false)
1877
1895
{
1878
1896
  reset_query_tables_list(true);
1879
 
  statement= NULL;
1880
1897
}
1881
1898
 
1882
1899
/**
2152
2169
                                            str, length));
2153
2170
}
2154
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
 
2155
2189
} /* namespace drizzled */