MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / get_quote_char_for_identifier

Function get_quote_char_for_identifier

sql/sql_show.cc:576–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574*/
575
576int get_quote_char_for_identifier(THD *thd, const char *name, uint length)
577{
578 if (length &&
579 !is_keyword(name,length) &&
580 !require_quotes(name, length) &&
581 !(thd->variables.option_bits & OPTION_QUOTE_SHOW_CREATE))
582 return EOF;
583 if (thd->variables.sql_mode & MODE_ANSI_QUOTES)
584 return '"';
585 return '`';
586}
587
588
589/****************************************************************************

Callers 2

append_identifierFunction · 0.85
add_identifierFunction · 0.85

Calls 2

is_keywordFunction · 0.85
require_quotesFunction · 0.85

Tested by

no test coverage detected