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

Method make_clex_string

sql/sql_class.h:1458–1472  ·  view source on GitHub ↗

Methods to copy a string value on memory root, but also allocate on memory root LEX_CSTRING itself and return a pointer to it. */

Source from the content-addressed store, hash-verified

1456 and return a pointer to it.
1457 */
1458 LEX_CSTRING *make_clex_string(const char* str, size_t length) const
1459 {
1460 LEX_CSTRING *lex_str;
1461 char *tmp;
1462 if (unlikely(!(lex_str= (LEX_CSTRING *)alloc_root(mem_root,
1463 sizeof(LEX_CSTRING) +
1464 length+1))))
1465 return 0;
1466 tmp= (char*) (lex_str+1);
1467 lex_str->str= tmp;
1468 memcpy(tmp, str, length);
1469 tmp[length]= 0;
1470 lex_str->length= length;
1471 return lex_str;
1472 }
1473 LEX_CSTRING *make_clex_string(const LEX_CSTRING from) const
1474 {
1475 return make_clex_string(from.str, from.length);

Callers 10

record_gtidMethod · 0.80
gtid_delete_pendingMethod · 0.80
add_tableMethod · 0.80
add_schema_tableFunction · 0.80
schema_tables_addFunction · 0.80
make_table_name_listFunction · 0.80
vers_push_fieldMethod · 0.80
get_dboptFunction · 0.80
load_db_optFunction · 0.80
thd_make_lex_stringFunction · 0.80

Calls 1

alloc_rootFunction · 0.85

Tested by

no test coverage detected