MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / idxNewConstraint

Function idxNewConstraint

modules/dasSQLITE/sqlite/shell.c:10497–10508  ·  view source on GitHub ↗

** Allocate and return a new IdxConstraint object. Set the IdxConstraint.zColl ** variable to point to a copy of nul-terminated string zColl. */

Source from the content-addressed store, hash-verified

10495** variable to point to a copy of nul-terminated string zColl.
10496*/
10497static IdxConstraint *idxNewConstraint(int *pRc, const char *zColl){
10498 IdxConstraint *pNew;
10499 int nColl = STRLEN(zColl);
10500
10501 assert( *pRc==SQLITE_OK );
10502 pNew = (IdxConstraint*)idxMalloc(pRc, sizeof(IdxConstraint) * nColl + 1);
10503 if( pNew ){
10504 pNew->zColl = (char*)&pNew[1];
10505 memcpy(pNew->zColl, zColl, nColl+1);
10506 }
10507 return pNew;
10508}
10509
10510/*
10511** An error associated with database handle db has just occurred. Pass

Callers 1

expertBestIndexFunction · 0.85

Calls 2

assertFunction · 0.85
idxMallocFunction · 0.85

Tested by

no test coverage detected