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

Function mysql_test_insert_select

sql/sql_prepare.cc:2142–2169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2140*/
2141
2142static bool mysql_test_insert_select(Prepared_statement *stmt,
2143 TABLE_LIST *tables)
2144{
2145 int res;
2146 LEX *lex= stmt->lex;
2147 TABLE_LIST *first_local_table;
2148
2149 if (tables->table)
2150 {
2151 // don't allocate insert_values
2152 tables->table->insert_values=(uchar *)1;
2153 }
2154
2155 if (insert_precheck(stmt->thd, tables))
2156 return 1;
2157
2158 /* store it, because mysql_insert_select_prepare_tester change it */
2159 first_local_table= lex->first_select_lex()->table_list.first;
2160 DBUG_ASSERT(first_local_table != 0);
2161
2162 res=
2163 select_like_stmt_test_with_open(stmt, tables,
2164 &mysql_insert_select_prepare_tester,
2165 OPTION_SETUP_TABLES_DONE);
2166 /* revert changes made by mysql_insert_select_prepare_tester */
2167 lex->first_select_lex()->table_list.first= first_local_table;
2168 return res;
2169}
2170
2171/**
2172 Validate SELECT statement.

Callers 1

check_prepared_statementFunction · 0.85

Calls 3

insert_precheckFunction · 0.85
first_select_lexMethod · 0.80

Tested by

no test coverage detected