** Allocate and return a new IdxConstraint object. Set the IdxConstraint.zColl ** variable to point to a copy of nul-terminated string zColl. */
| 8652 | ** variable to point to a copy of nul-terminated string zColl. |
| 8653 | */ |
| 8654 | static IdxConstraint *idxNewConstraint(int *pRc, const char *zColl){ |
| 8655 | IdxConstraint *pNew; |
| 8656 | int nColl = STRLEN(zColl); |
| 8657 | |
| 8658 | assert( *pRc==SQLITE_OK ); |
| 8659 | pNew = (IdxConstraint*)idxMalloc(pRc, sizeof(IdxConstraint) * nColl + 1); |
| 8660 | if( pNew ){ |
| 8661 | pNew->zColl = (char*)&pNew[1]; |
| 8662 | memcpy(pNew->zColl, zColl, nColl+1); |
| 8663 | } |
| 8664 | return pNew; |
| 8665 | } |
| 8666 | |
| 8667 | /* |
| 8668 | ** An error associated with database handle db has just occurred. Pass |
no test coverage detected