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

Method PrepareWriting

storage/connect/tabjson.cpp:1248–1270  ·  view source on GitHub ↗

/ PrepareWriting: Prepare the line for WriteDB. */ /

Source from the content-addressed store, hash-verified

1246/* PrepareWriting: Prepare the line for WriteDB. */
1247/***********************************************************************/
1248bool TDBJSN::PrepareWriting(PGLOBAL g)
1249{
1250 PSZ s;
1251
1252 if (MakeTopTree(g, Row))
1253 return true;
1254
1255 if ((s = Serialize(G, Top, NULL, Pretty))) {
1256 if (Comma)
1257 strcat(s, ",");
1258
1259 if ((signed)strlen(s) > Lrecl) {
1260 safe_strcpy(To_Line, Lrecl, s);
1261 snprintf(g->Message, sizeof(g->Message), "Line truncated (lrecl=%d)", Lrecl);
1262 return PushWarning(g, this);
1263 } else
1264 strcpy(To_Line, s);
1265
1266 return false;
1267 } else
1268 return true;
1269
1270} // end of PrepareWriting
1271
1272/***********************************************************************/
1273/* WriteDB: Data Base write routine for JSON access method. */

Callers

nothing calls this directly

Calls 3

SerializeFunction · 0.85
safe_strcpyFunction · 0.85
PushWarningFunction · 0.85

Tested by

no test coverage detected