~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Merged up with build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1956
1956
                              const char *operator_name,
1957
1957
                              thr_lock_type lock_type,
1958
1958
                              bool open_for_modify,
1959
 
                              bool no_warnings_for_error,
1960
 
                              uint32_t extra_open_options,
1961
 
                              int (*prepare_func)(Session *, TableList *,
1962
 
                                                  HA_CHECK_OPT *),
1963
1959
                              int (Cursor::*operator_func)(Session *,
1964
1960
                                                            HA_CHECK_OPT *))
1965
1961
{
1993
1989
    bool fatal_error=0;
1994
1990
 
1995
1991
    sprintf(table_name,"%s.%s",db,table->table_name);
1996
 
    session->open_options|= extra_open_options;
1997
1992
    table->lock_type= lock_type;
1998
1993
    /* open only one table from local list of command */
1999
1994
    {
2012
2007
      lex->query_tables= table;
2013
2008
      lex->query_tables_last= &table->next_global;
2014
2009
      lex->query_tables_own_last= 0;
2015
 
      session->no_warnings_for_error= no_warnings_for_error;
 
2010
      session->no_warnings_for_error= 0;
2016
2011
 
2017
2012
      session->openTablesLock(table);
2018
2013
      session->no_warnings_for_error= 0;
2019
2014
      table->next_global= save_next_global;
2020
2015
      table->next_local= save_next_local;
2021
 
      session->open_options&= ~extra_open_options;
2022
 
    }
2023
 
 
2024
 
    if (prepare_func)
2025
 
    {
2026
 
      switch ((*prepare_func)(session, table, check_opt)) {
2027
 
      case  1:           // error, message written to net
2028
 
        ha_autocommit_or_rollback(session, 1);
2029
 
        session->endTransaction(ROLLBACK);
2030
 
        session->close_thread_tables();
2031
 
        continue;
2032
 
      case -1:           // error, message could be written to net
2033
 
        goto err;
2034
 
      default:           // should be 0 otherwise
2035
 
        ;
2036
 
      }
2037
2016
    }
2038
2017
 
2039
2018
    /*
2481
2460
  thr_lock_type lock_type = TL_READ_NO_INSERT;
2482
2461
 
2483
2462
  return(mysql_admin_table(session, tables, check_opt,
2484
 
                                "analyze", lock_type, 1, 0, 0, 0,
 
2463
                                "analyze", lock_type, true,
2485
2464
                                &Cursor::ha_analyze));
2486
2465
}
2487
2466
 
2492
2471
 
2493
2472
  return(mysql_admin_table(session, tables, check_opt,
2494
2473
                                "check", lock_type,
2495
 
                                0, 0, HA_OPEN_FOR_REPAIR, 0,
 
2474
                                false,
2496
2475
                                &Cursor::ha_check));
2497
2476
}
2498
2477