~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

Merge in Monty's rename patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
/* Prototypes */
68
68
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
69
69
static bool parse_sql(Session *session, Lex_input_stream *lip);
70
 
void mysql_parse(Session *session, const char *inBuf, uint32_t length);
 
70
void parse(Session *session, const char *inBuf, uint32_t length);
71
71
 
72
72
/**
73
73
  @defgroup Runtime_Environment Runtime Environment
210
210
 
211
211
    SchemaIdentifier identifier(tmp);
212
212
 
213
 
    if (not mysql_change_db(session, identifier))
 
213
    if (not change_db(session, identifier))
214
214
    {
215
215
      session->my_ok();
216
216
    }
224
224
                        session->thread_id,
225
225
                        const_cast<const char *>(session->schema()->c_str()));
226
226
 
227
 
    mysql_parse(session, session->getQueryString()->c_str(), session->getQueryString()->length());
 
227
    parse(session, session->getQueryString()->c_str(), session->getQueryString()->length());
228
228
 
229
229
    break;
230
230
  }
429
429
    true        Error
430
430
*/
431
431
 
432
 
static int mysql_execute_command(Session *session)
 
432
static int execute_command(Session *session)
433
433
{
434
434
  bool res= false;
435
435
  LEX  *lex= session->lex;
587
587
 
588
588
 
589
589
void
590
 
mysql_init_select(LEX *lex)
 
590
init_select(LEX *lex)
591
591
{
592
592
  Select_Lex *select_lex= lex->current_select;
593
593
  select_lex->init_select();
601
601
 
602
602
 
603
603
bool
604
 
mysql_new_select(LEX *lex, bool move_down)
 
604
new_select(LEX *lex, bool move_down)
605
605
{
606
606
  Select_Lex *select_lex;
607
607
  Session *session= lex->session;
687
687
 
688
688
  session= current_session;
689
689
  lex= session->lex;
690
 
  mysql_init_select(lex);
 
690
  init_select(lex);
691
691
  lex->sql_command= SQLCOM_SELECT;
692
692
  tmp.str= (char*) var_name;
693
693
  tmp.length=strlen(var_name);
714
714
  @param       length  Length of the query text
715
715
*/
716
716
 
717
 
void mysql_parse(Session *session, const char *inBuf, uint32_t length)
 
717
void parse(Session *session, const char *inBuf, uint32_t length)
718
718
{
719
719
  boost::posix_time::ptime start_time=boost::posix_time::microsec_clock::local_time();
720
720
  session->lex->start(session);
748
748
        /* Actually execute the query */
749
749
        try 
750
750
        {
751
 
          mysql_execute_command(session);
 
751
          execute_command(session);
752
752
        }
753
753
        catch (...)
754
754
        {
1674
1674
 
1675
1675
  /* Parse the query. */
1676
1676
 
1677
 
  bool mysql_parse_status= DRIZZLEparse(session) != 0;
 
1677
  bool parse_status= DRIZZLEparse(session) != 0;
1678
1678
 
1679
1679
  /* Check that if DRIZZLEparse() failed, session->is_error() is set. */
1680
1680
 
1681
 
  assert(!mysql_parse_status || session->is_error());
 
1681
  assert(!parse_status || session->is_error());
1682
1682
 
1683
1683
  /* Reset Lex_input_stream. */
1684
1684
 
1685
1685
  session->m_lip= NULL;
1686
1686
 
1687
 
  DRIZZLE_QUERY_PARSE_DONE(mysql_parse_status || session->is_fatal_error);
 
1687
  DRIZZLE_QUERY_PARSE_DONE(parse_status || session->is_fatal_error);
1688
1688
 
1689
1689
  /* That's it. */
1690
1690
 
1691
 
  return mysql_parse_status || session->is_fatal_error;
 
1691
  return parse_status || session->is_fatal_error;
1692
1692
}
1693
1693
 
1694
1694
/**