MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / is_replayable

Function is_replayable

tools/cdb2_sqlreplay/cdb2_sqlreplay.cpp:143–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool is_replayable(cson_value *val) {
144 int64_t nbound;
145
146 if(have_json_key(val, "error"))
147 return false;
148
149 // Have an array of bound parameters? Should be replayable.
150 bool have_bindings = have_json_key(val, "bound_parameters");
151 if (have_bindings)
152 return true;
153
154 // Don't have any bound parameters? Should be replayable.
155 have_bindings = get_intprop(val, "nbindings", &nbound);
156 if (!have_bindings || nbound == 0)
157 return true;
158
159 return false;
160}
161
162bool event_is_sql(cson_value *val) {
163 return get_strprop(val, "type") == std::string("sql");

Callers 1

handle_sqlFunction · 0.85

Calls 2

have_json_keyFunction · 0.85
get_intpropFunction · 0.85

Tested by

no test coverage detected