~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2009-03-10 15:30:16 UTC
  • mfrom: (923.1.9 merge)
  • Revision ID: brian@tangent.org-20090310153016-imdmo2jj1cecz9py
Merge from Brian (Cleanup around LCOV)

Show diffs side-by-side

added added

removed removed

Lines of Context:
931
931
      goto end_with_restore_list;
932
932
#endif
933
933
    /*
934
 
      If we are using SET CHARSET without DEFAULT, add an implicit
935
 
      DEFAULT to not confuse old users. (This may change).
936
 
    */
937
 
    if ((create_info.used_fields &
938
 
         (HA_CREATE_USED_DEFAULT_CHARSET | HA_CREATE_USED_CHARSET)) ==
939
 
        HA_CREATE_USED_CHARSET)
940
 
    {
941
 
      create_info.used_fields&= ~HA_CREATE_USED_CHARSET;
942
 
      create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
943
 
      create_info.default_table_charset= create_info.table_charset;
944
 
      create_info.table_charset= 0;
945
 
    }
946
 
    /*
947
934
      The create-select command will open and read-lock the select table
948
935
      and then create, open and write-lock the new table. If a global
949
936
      read lock steps in, we get a deadlock. The write lock waits for
2046
2033
}
2047
2034
 
2048
2035
 
2049
 
/*
2050
 
  When you modify mysql_parse(), you may need to mofify
2051
 
  mysql_test_parse_for_slave() in this same file.
2052
 
*/
2053
 
 
2054
2036
/**
2055
2037
  Parse a query.
2056
2038
 
2129
2111
}
2130
2112
 
2131
2113
 
2132
 
/*
2133
 
  Usable by the replication SQL thread only: just parse a query to know if it
2134
 
  can be ignored because of replicate-*-table rules.
2135
 
 
2136
 
  @retval
2137
 
    0   cannot be ignored
2138
 
  @retval
2139
 
    1   can be ignored
2140
 
*/
2141
 
 
2142
 
bool mysql_test_parse_for_slave(Session *session, char *inBuf, uint32_t length)
2143
 
{
2144
 
  LEX *lex= session->lex;
2145
 
  bool error= 0;
2146
 
 
2147
 
  Lex_input_stream lip(session, inBuf, length);
2148
 
  lex_start(session);
2149
 
  session->reset_for_next_command();
2150
 
 
2151
 
  if (!parse_sql(session, &lip) &&
2152
 
      all_tables_not_ok(session,(TableList*) lex->select_lex.table_list.first))
2153
 
    error= 1;                  /* Ignore question */
2154
 
  session->end_statement();
2155
 
  session->cleanup_after_query();
2156
 
  return(error);
2157
 
}
2158
 
 
2159
 
 
2160
2114
 
2161
2115
/**
2162
2116
  Store field definition for create.
2261
2215
  current_session->lex->last_field->after=const_cast<char*> (name);
2262
2216
}
2263
2217
 
2264
 
bool
2265
 
add_proc_to_list(Session* session, Item *item)
2266
 
{
2267
 
  order_st *order;
2268
 
  Item  **item_ptr;
2269
 
 
2270
 
  if (!(order = (order_st *) session->alloc(sizeof(order_st)+sizeof(Item*))))
2271
 
    return 1;
2272
 
  item_ptr = (Item**) (order+1);
2273
 
  *item_ptr= item;
2274
 
  order->item=item_ptr;
2275
 
  order->free_me=0;
2276
 
  session->lex->proc_list.link_in_list((unsigned char*) order,(unsigned char**) &order->next);
2277
 
  return 0;
2278
 
}
2279
 
 
2280
 
 
2281
2218
/**
2282
2219
  save order by and tables in own lists.
2283
2220
*/