** Allocate and return a new IdxConstraint object. Set the IdxConstraint.zColl ** variable to point to a copy of nul-terminated string zColl. */
| 10495 | ** variable to point to a copy of nul-terminated string zColl. |
| 10496 | */ |
| 10497 | static 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 |
no test coverage detected