669
669
table_list.select_lex= &(session->lex->select_lex);
671
671
lex_start(session);
672
mysql_reset_session_for_next_command(session);
672
session->reset_for_next_command();
675
675
select_lex.table_list.link_in_list((unsigned char*) &table_list,
2321
Reset Session part responsible for command processing state.
2323
This needs to be called before execution of every statement
2324
(prepared or conventional).
2325
It is not called by substatements of routines.
2328
Make it a method of Session and align its name with the rest of
2329
reset/end/start/init methods.
2331
Call it after we use Session for queries, not before.
2334
void mysql_reset_session_for_next_command(Session *session)
2336
session->free_list= 0;
2337
session->select_number= 1;
2339
Those two lines below are theoretically unneeded as
2340
Session::cleanup_after_query() should take care of this already.
2342
session->auto_inc_intervals_in_cur_stmt_for_binlog.empty();
2344
session->query_start_used= 0;
2345
session->is_fatal_error= 0;
2346
session->server_status&= ~ (SERVER_MORE_RESULTS_EXISTS |
2347
SERVER_QUERY_NO_INDEX_USED |
2348
SERVER_QUERY_NO_GOOD_INDEX_USED);
2350
If in autocommit mode and not in a transaction, reset
2351
OPTION_STATUS_NO_TRANS_UPDATE | OPTION_KEEP_LOG to not get warnings
2352
in ha_rollback_trans() about some tables couldn't be rolled back.
2354
if (!(session->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
2356
session->options&= ~OPTION_KEEP_LOG;
2357
session->transaction.all.modified_non_trans_table= false;
2359
session->thread_specific_used= false;
2363
reset_dynamic(&session->user_var_events);
2364
session->user_var_events_alloc= session->mem_root;
2366
session->clear_error();
2367
session->main_da.reset_diagnostics_area();
2368
session->total_warn_count=0; // Warnings for this query
2369
session->sent_row_count= session->examined_row_count= 0;
2376
2321
mysql_init_select(LEX *lex)
2607
2552
Lex_input_stream lip(session, inBuf, length);
2608
2553
lex_start(session);
2609
mysql_reset_session_for_next_command(session);
2554
session->reset_for_next_command();
2611
2556
if (!parse_sql(session, &lip) &&
2612
2557
all_tables_not_ok(session,(TableList*) lex->select_lex.table_list.first))