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

Method Rephrase

storage/connect/xobject.cpp:142–172  ·  view source on GitHub ↗

/ Rephrase: temporary implementation used by PlugRephraseSQL. */ /

Source from the content-addressed store, hash-verified

140/* Rephrase: temporary implementation used by PlugRephraseSQL. */
141/***********************************************************************/
142bool CONSTANT::Rephrase(PGLOBAL g, PSZ work)
143 {
144 size_t cur_len = strlen(work);
145
146 switch (Value->GetType()) {
147 case TYPE_STRING:
148 snprintf(work + cur_len, MAX_STR - cur_len, "'%s'", Value->GetCharValue());
149 break;
150 case TYPE_SHORT:
151 snprintf(work + cur_len, MAX_STR - cur_len, "%hd", Value->GetShortValue());
152 break;
153 case TYPE_INT:
154 case TYPE_DATE:
155 snprintf(work + cur_len, MAX_STR - cur_len, "%d", Value->GetIntValue());
156 break;
157 case TYPE_DOUBLE:
158 snprintf(work + cur_len, MAX_STR - cur_len, "%lf", Value->GetFloatValue());
159 break;
160 case TYPE_BIGINT:
161 snprintf(work + cur_len, MAX_STR - cur_len, "%lld", Value->GetBigintValue());
162 break;
163 case TYPE_TINY:
164 snprintf(work + cur_len, MAX_STR - cur_len, "%d", Value->GetTinyValue());
165 break;
166 default:
167 snprintf(g->Message, sizeof(g->Message), MSG(BAD_CONST_TYPE), Value->GetType());
168 return false;
169 } // endswitch
170
171 return false;
172 } // end of Rephrase
173#endif // 0
174
175/***********************************************************************/

Callers

nothing calls this directly

Calls 7

GetTypeMethod · 0.45
GetCharValueMethod · 0.45
GetShortValueMethod · 0.45
GetIntValueMethod · 0.45
GetFloatValueMethod · 0.45
GetBigintValueMethod · 0.45
GetTinyValueMethod · 0.45

Tested by

no test coverage detected