~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Padraig O'Sullivan
  • Date: 2010-02-11 16:22:34 UTC
  • mto: (1300.3.1 query-as-string)
  • mto: This revision was merged to the branch mainline in revision 1307.
  • Revision ID: osullivan.padraig@gmail.com-20100211162234-tkk64v4vdqkb9syv
Removed the found_semicolon member from the parsing stage

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
/* Prototypes */
67
67
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
68
68
static bool parse_sql(Session *session, Lex_input_stream *lip);
69
 
static void mysql_parse(Session *session, const char *inBuf, uint32_t length,
70
 
                 const char ** found_semicolon);
 
69
static void mysql_parse(Session *session, const char *inBuf, uint32_t length);
71
70
 
72
71
/**
73
72
  @defgroup Runtime_Environment Runtime Environment
224
223
    DRIZZLE_QUERY_START(session->query,
225
224
                        session->thread_id,
226
225
                        const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
227
 
    const char* end_of_stmt= NULL;
228
226
 
229
227
    plugin::QueryRewriter::rewriteQuery(session->query);
230
228
 
231
 
    mysql_parse(session, session->query.c_str(), session->query.length(), &end_of_stmt);
 
229
    mysql_parse(session, session->query.c_str(), session->query.length());
232
230
 
233
231
    break;
234
232
  }
738
736
  @param       session     Current thread
739
737
  @param       inBuf   Begining of the query text
740
738
  @param       length  Length of the query text
741
 
  @param[out]  found_semicolon For multi queries, position of the character of
742
 
                               the next query in the query text.
743
739
*/
744
740
 
745
 
static void mysql_parse(Session *session, const char *inBuf, uint32_t length,
746
 
                 const char ** found_semicolon)
 
741
static void mysql_parse(Session *session, const char *inBuf, uint32_t length)
747
742
{
748
743
  lex_start(session);
749
744
  session->reset_for_next_command();
753
748
  Lex_input_stream lip(session, inBuf, length);
754
749
 
755
750
  bool err= parse_sql(session, &lip);
756
 
  *found_semicolon= lip.found_semicolon;
757
751
 
758
752
  if (!err)
759
753
  {
760
754
    {
761
755
      if (! session->is_error())
762
756
      {
763
 
        /*
764
 
          Binlog logs a string starting from session->query and having length
765
 
          session->query_length; so we set session->query_length correctly (to not
766
 
          log several statements in one event, when we executed only first).
767
 
          We set it to not see the ';' (otherwise it would get into binlog
768
 
          and Query_log_event::print() would give ';;' output).
769
 
          This also helps display only the current query in SHOW
770
 
          PROCESSLIST.
771
 
          Note that we don't need LOCK_thread_count to modify query_length.
772
 
        */
773
 
        /*if (*found_semicolon &&
774
 
            (session->query_length= (ulong)(*found_semicolon - session->query)))
775
 
          session->query_length--;*/
776
757
        DRIZZLE_QUERY_EXEC_START(session->query,
777
758
                                 session->thread_id,
778
759
                                 const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));