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

Function create_query_string

sql/events.cc:284–305  ·  view source on GitHub ↗

Create a new query string for removing executable comments for avoiding leak and keeping consistency of the execution on master and slave. @param[in] thd Thread handler @param[in] buf Query string @return 0 ok 1 error */

Source from the content-addressed store, hash-verified

282 1 error
283*/
284static int
285create_query_string(THD *thd, String *buf)
286{
287 buf->length(0);
288 /* Append the "CREATE" part of the query */
289 if (thd->lex->create_info.or_replace())
290 {
291 if (buf->append(STRING_WITH_LEN("CREATE OR REPLACE ")))
292 return 1;
293 }
294 else if (buf->append(STRING_WITH_LEN("CREATE ")))
295 return 1;
296 /* Append definer */
297 append_definer(thd, buf, &(thd->lex->definer->user), &(thd->lex->definer->host));
298 /* Append the left part of thd->query after "DEFINER" part */
299 if (buf->append(thd->lex->stmt_definition_begin,
300 thd->lex->stmt_definition_end -
301 thd->lex->stmt_definition_begin))
302 return 1;
303
304 return 0;
305}
306
307
308/**

Callers 2

create_eventMethod · 0.85
wsrep_create_event_queryFunction · 0.85

Calls 4

append_definerFunction · 0.85
or_replaceMethod · 0.80
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected