MCPcopy Create free account
hub / github.com/MariaDB/server / run_sql_command_thd

Function run_sql_command_thd

sql/wsrep_sst.cc:1558–1597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1556}
1557
1558static int run_sql_command_thd(THD *thd, const char *query)
1559{
1560 int ret= 0;
1561
1562 thd->reset_for_next_command();
1563 thd->set_query((char*)query, strlen(query));
1564
1565 Parser_state ps;
1566 if (ps.init(thd, thd->query(), thd->query_length()))
1567 {
1568 WSREP_ERROR("SST query: %s failed", query);
1569 ret= -1;
1570 }
1571 else
1572 {
1573 PSI_statement_locker *parent_locker= thd->m_statement_psi;
1574 thd->set_query_id(next_query_id());
1575
1576 mysql_parse(thd, thd->query(), thd->query_length(), &ps);
1577 if (thd->is_error())
1578 {
1579 int const err= thd->get_stmt_da()->sql_errno();
1580 if (err)
1581 {
1582 WSREP_WARN ("Error executing '%s': %d (%s)",
1583 query, err, thd->get_stmt_da()->message());
1584 ret= err;
1585 }
1586 thd->clear_error();
1587 }
1588 thd->m_statement_psi= parent_locker;
1589 thd->end_statement();
1590 close_thread_tables(thd);
1591 delete_explain_query(thd->lex);
1592 }
1593
1594 thd->reset_query();
1595 thd->cleanup_after_query();
1596 return ret;
1597}
1598
1599
1600#define SST_USER_PREFIX "wsrep.sst."

Callers 1

sst_flush_tablesFunction · 0.85

Calls 15

next_query_idFunction · 0.85
mysql_parseFunction · 0.85
close_thread_tablesFunction · 0.85
delete_explain_queryFunction · 0.85
query_lengthMethod · 0.80
set_query_idMethod · 0.80
sql_errnoMethod · 0.80
get_stmt_daMethod · 0.80
reset_queryMethod · 0.80
set_queryMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected