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

Function debug_sync_token

sql/debug_sync.cc:1024–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022*/
1023
1024static char *debug_sync_token(Debug_token *to,
1025 char *ptr, char *ptrend)
1026{
1027 DBUG_ASSERT(to);
1028 DBUG_ASSERT(ptr);
1029
1030 /* Skip leading space */
1031 ptr+= system_charset_info->scan(ptr, ptrend, MY_SEQ_SPACES);
1032 if (!*ptr)
1033 {
1034 // Keep "to" intact.
1035 return NULL;
1036 }
1037
1038 /* Get token start. */
1039 to->str= ptr;
1040
1041 /* Find token end. */
1042 ptr+= system_charset_info->scan(ptr, ptrend, MY_SEQ_NONSPACES);
1043
1044 /* Get token length. */
1045 to->length= (uint)(ptr - to->str);
1046
1047 /* If necessary, terminate token. */
1048 if (*ptr)
1049 {
1050 DBUG_ASSERT(ptr < ptrend);
1051 /* Get terminator character length. */
1052 uint mbspacelen= system_charset_info->charlen_fix(ptr, ptrend);
1053
1054 /* Terminate token. */
1055 *ptr= '\0';
1056
1057 /* Skip the terminator. */
1058 ptr+= mbspacelen;
1059
1060 /* Skip trailing space */
1061 ptr+= system_charset_info->scan(ptr, ptrend, MY_SEQ_SPACES);
1062 }
1063
1064 return ptr;
1065}
1066
1067
1068/**

Callers 2

debug_sync_numberFunction · 0.85
debug_sync_eval_actionFunction · 0.85

Calls 2

charlen_fixMethod · 0.80
scanMethod · 0.45

Tested by

no test coverage detected