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 */
| 282 | 1 error |
| 283 | */ |
| 284 | static int |
| 285 | create_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 | /** |
no test coverage detected