MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / SQL_IsFieldNull

Function SQL_IsFieldNull

core/logic/smn_database.cpp:1243–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1241}
1242
1243static cell_t SQL_IsFieldNull(IPluginContext *pContext, const cell_t *params)
1244{
1245 IQuery *query;
1246 HandleError err;
1247
1248 if ((err = ReadQueryHndl(params[1], pContext, &query)) != HandleError_None)
1249 {
1250 return pContext->ThrowNativeError("Invalid query Handle %x (error: %d)", params[1], err);
1251 }
1252
1253 IResultSet *rs = query->GetResultSet();
1254 if (!rs)
1255 {
1256 return pContext->ThrowNativeError("No current result set");
1257 }
1258
1259 IResultRow *row = rs->CurrentRow();
1260 if (!row)
1261 {
1262 return pContext->ThrowNativeError("Current result set has no fetched rows");
1263 }
1264
1265 if ((unsigned)params[2] >= rs->GetFieldCount())
1266 {
1267 return pContext->ThrowNativeError("Invalid field index %d", params[2]);
1268 }
1269
1270 return row->IsNull(params[2]) ? 1 : 0;
1271}
1272
1273static cell_t SQL_FetchSize(IPluginContext *pContext, const cell_t *params)
1274{

Callers

nothing calls this directly

Calls 5

ReadQueryHndlFunction · 0.85
GetResultSetMethod · 0.45
CurrentRowMethod · 0.45
GetFieldCountMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected