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

Function read_token

sql/sql_digest.cc:51–67  ·  view source on GitHub ↗

Read a single token from token array. */

Source from the content-addressed store, hash-verified

49 Read a single token from token array.
50*/
51inline uint read_token(const sql_digest_storage *digest_storage,
52 uint index, uint *tok)
53{
54 uint safe_byte_count= digest_storage->m_byte_count;
55
56 if (index + SIZE_OF_A_TOKEN <= safe_byte_count &&
57 safe_byte_count <= digest_storage->m_token_array_length)
58 {
59 const unsigned char *src= & digest_storage->m_token_array[index];
60 *tok= src[0] | (src[1] << 8);
61 return index + SIZE_OF_A_TOKEN;
62 }
63
64 /* The input byte stream is exhausted. */
65 *tok= 0;
66 return MAX_DIGEST_STORAGE_SIZE + 1;
67}
68
69/**
70 Store a single token in token array.

Callers 1

compute_digest_textFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected