~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Monty Taylor
  • Date: 2008-11-12 17:42:40 UTC
  • mto: This revision was merged to the branch mainline in revision 584.
  • Revision ID: monty@inaugust.com-20081112174240-l2vg9lnzbmjc3uyk
More header cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2047
2047
  to implement the clean up.
2048
2048
*/
2049
2049
 
2050
 
void st_lex::cleanup_lex_after_parse_error(Session *session __attribute__((unused)))
 
2050
void LEX::cleanup_lex_after_parse_error(Session *session __attribute__((unused)))
2051
2051
{
2052
2052
}
2053
2053
 
2121
2121
  Initialize LEX object.
2122
2122
 
2123
2123
  SYNOPSIS
2124
 
    st_lex::st_lex()
 
2124
    LEX::LEX()
2125
2125
 
2126
2126
  NOTE
2127
2127
    LEX object initialized with this constructor can be used as part of
2131
2131
    for this.
2132
2132
*/
2133
2133
 
2134
 
st_lex::st_lex()
 
2134
LEX::LEX()
2135
2135
  :result(0), yacc_yyss(0), yacc_yyvs(0),
2136
2136
   sql_command(SQLCOM_END), option_type(OPT_DEFAULT), is_lex_started(0)
2137
2137
{
2148
2148
  Check whether the merging algorithm can be used on this VIEW
2149
2149
 
2150
2150
  SYNOPSIS
2151
 
    st_lex::can_be_merged()
 
2151
    LEX::can_be_merged()
2152
2152
 
2153
2153
  DESCRIPTION
2154
2154
    We can apply merge algorithm if it is single SELECT view  with
2162
2162
    true  - merge algorithm can be used
2163
2163
*/
2164
2164
 
2165
 
bool st_lex::can_be_merged()
 
2165
bool LEX::can_be_merged()
2166
2166
{
2167
2167
  // TODO: do not forget implement case when select_lex.table_list.elements==0
2168
2168
 
2199
2199
  check if command can use VIEW with MERGE algorithm (for top VIEWs)
2200
2200
 
2201
2201
  SYNOPSIS
2202
 
    st_lex::can_use_merged()
 
2202
    LEX::can_use_merged()
2203
2203
 
2204
2204
  DESCRIPTION
2205
2205
    Only listed here commands can use merge algorithm in top level
2206
2206
    SELECT_LEX (for subqueries will be used merge algorithm if
2207
 
    st_lex::can_not_use_merged() is not true).
 
2207
    LEX::can_not_use_merged() is not true).
2208
2208
 
2209
2209
  RETURN
2210
2210
    false - command can't use merged VIEWs
2211
2211
    true  - VIEWs with MERGE algorithms can be used
2212
2212
*/
2213
2213
 
2214
 
bool st_lex::can_use_merged()
 
2214
bool LEX::can_use_merged()
2215
2215
{
2216
2216
  switch (sql_command)
2217
2217
  {
2236
2236
  Check if command can't use merged views in any part of command
2237
2237
 
2238
2238
  SYNOPSIS
2239
 
    st_lex::can_not_use_merged()
 
2239
    LEX::can_not_use_merged()
2240
2240
 
2241
2241
  DESCRIPTION
2242
2242
    Temporary table algorithm will be used on all SELECT levels for queries
2243
 
    listed here (see also st_lex::can_use_merged()).
 
2243
    listed here (see also LEX::can_use_merged()).
2244
2244
 
2245
2245
  RETURN
2246
2246
    false - command can't use merged VIEWs
2247
2247
    true  - VIEWs with MERGE algorithms can be used
2248
2248
*/
2249
2249
 
2250
 
bool st_lex::can_not_use_merged()
 
2250
bool LEX::can_not_use_merged()
2251
2251
{
2252
2252
  switch (sql_command)
2253
2253
  {
2274
2274
    false no, we need data
2275
2275
*/
2276
2276
 
2277
 
bool st_lex::only_view_structure()
 
2277
bool LEX::only_view_structure()
2278
2278
{
2279
2279
  switch (sql_command) {
2280
2280
  case SQLCOM_SHOW_CREATE:
2299
2299
*/
2300
2300
 
2301
2301
 
2302
 
bool st_lex::need_correct_ident()
 
2302
bool LEX::need_correct_ident()
2303
2303
{
2304
2304
  switch(sql_command)
2305
2305
  {
2332
2332
*/
2333
2333
 
2334
2334
bool
2335
 
st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
 
2335
LEX::copy_db_to(char **p_db, size_t *p_db_length) const
2336
2336
{
2337
2337
  return session->copy_db_to(p_db, p_db_length);
2338
2338
}
2384
2384
      In this case link_to_local is set.
2385
2385
 
2386
2386
*/
2387
 
TableList *st_lex::unlink_first_table(bool *link_to_local)
 
2387
TableList *LEX::unlink_first_table(bool *link_to_local)
2388
2388
{
2389
2389
  TableList *first;
2390
2390
  if ((first= query_tables))
2424
2424
  table list
2425
2425
 
2426
2426
  SYNOPSYS
2427
 
     st_lex::first_lists_tables_same()
 
2427
     LEX::first_lists_tables_same()
2428
2428
 
2429
2429
  NOTES
2430
2430
    In many cases (for example, usual INSERT/DELETE/...) the first table of
2435
2435
    the global list first.
2436
2436
*/
2437
2437
 
2438
 
void st_lex::first_lists_tables_same()
 
2438
void LEX::first_lists_tables_same()
2439
2439
{
2440
2440
  TableList *first_table= (TableList*) select_lex.table_list.first;
2441
2441
  if (query_tables != first_table && first_table != 0)
2471
2471
    global list
2472
2472
*/
2473
2473
 
2474
 
void st_lex::link_first_table_back(TableList *first,
 
2474
void LEX::link_first_table_back(TableList *first,
2475
2475
                                   bool link_to_local)
2476
2476
{
2477
2477
  if (first)
2498
2498
  cleanup lex for case when we open table by table for processing
2499
2499
 
2500
2500
  SYNOPSIS
2501
 
    st_lex::cleanup_after_one_table_open()
 
2501
    LEX::cleanup_after_one_table_open()
2502
2502
 
2503
2503
  NOTE
2504
2504
    This method is mostly responsible for cleaning up of selects lists and
2506
2506
    to call Query_tables_list::reset_query_tables_list(false).
2507
2507
*/
2508
2508
 
2509
 
void st_lex::cleanup_after_one_table_open()
 
2509
void LEX::cleanup_after_one_table_open()
2510
2510
{
2511
2511
  /*
2512
2512
    session->lex->derived_tables & additional units may be set if we open
2541
2541
      backup  Pointer to Query_tables_list instance to be used for backup
2542
2542
*/
2543
2543
 
2544
 
void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
 
2544
void LEX::reset_n_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
2545
2545
{
2546
2546
}
2547
2547
 
2554
2554
      backup  Pointer to Query_tables_list instance used for backup
2555
2555
*/
2556
2556
 
2557
 
void st_lex::restore_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
 
2557
void LEX::restore_backup_query_tables_list(Query_tables_list *backup __attribute__((unused)))
2558
2558
{
2559
2559
}
2560
2560
 
2570
2570
    true   Either or both routines and tables are used.
2571
2571
*/
2572
2572
 
2573
 
bool st_lex::table_or_sp_used()
 
2573
bool LEX::table_or_sp_used()
2574
2574
{
2575
2575
  if (sroutines.records || query_tables)
2576
2576
    return(true);