Lines Matching refs:z

5750 SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
8185 char *z; /* Pointer to data for string (char array) types */ member
8522 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
10107 char *z; /* Value if eType is SQLITE_TEXT or SQLITE_BLOB */ member
10123 const char *z; /* Text of the token. Not NULL-terminated! */ member
11487 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*, int, u8);
11537 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
11559 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z);
11653 #define sqlite3TableLock(v,w,x,y,z) argument
12627 char *z; /* String or BLOB value */ member
13664 char *z, zBuf[30]; in parseModifier() local
13665 z = zBuf; in parseModifier()
13667 z[n] = (char)sqlite3UpperToLower[(u8)zMod[n]]; in parseModifier()
13669 z[n] = 0; in parseModifier()
13670 switch( z[0] ){ in parseModifier()
13678 if( strcmp(z, "localtime")==0 ){ in parseModifier()
13693 if( strcmp(z, "unixepoch")==0 && p->validJD ){ in parseModifier()
13699 else if( strcmp(z, "utc")==0 ){ in parseModifier()
13720 if( strncmp(z, "weekday ", 8)==0 in parseModifier()
13721 && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8) in parseModifier()
13743 if( strncmp(z, "start of ", 9)!=0 ) break; in parseModifier()
13744 z += 9; in parseModifier()
13751 if( strcmp(z,"month")==0 ){ in parseModifier()
13754 }else if( strcmp(z,"year")==0 ){ in parseModifier()
13759 }else if( strcmp(z,"day")==0 ){ in parseModifier()
13777 for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){} in parseModifier()
13778 if( !sqlite3AtoF(z, &r, n, SQLITE_UTF8) ){ in parseModifier()
13782 if( z[n]==':' ){ in parseModifier()
13788 const char *z2 = z; in parseModifier()
13798 if( z[0]=='-' ) tx.iJD = -tx.iJD; in parseModifier()
13805 z += n; in parseModifier()
13806 while( sqlite3Isspace(*z) ) z++; in parseModifier()
13807 n = sqlite3Strlen30(z); in parseModifier()
13809 if( z[n-1]=='s' ){ z[n-1] = 0; n--; } in parseModifier()
13813 if( n==3 && strcmp(z,"day")==0 ){ in parseModifier()
13815 }else if( n==4 && strcmp(z,"hour")==0 ){ in parseModifier()
13817 }else if( n==6 && strcmp(z,"minute")==0 ){ in parseModifier()
13819 }else if( n==6 && strcmp(z,"second")==0 ){ in parseModifier()
13821 }else if( n==5 && strcmp(z,"month")==0 ){ in parseModifier()
13834 }else if( n==4 && strcmp(z,"year")==0 ){ in parseModifier()
13872 const unsigned char *z; in isDate() local
13882 z = sqlite3_value_text(argv[0]); in isDate()
13883 if( !z || parseDateOrTime(context, (char*)z, p) ){ in isDate()
13888 z = sqlite3_value_text(argv[i]); in isDate()
13889 if( z==0 || parseModifier(context, (char*)z, p) ) return 1; in isDate()
14002 char *z; in strftimeFunc() local
14046 z = zBuf; in strftimeFunc()
14051 z = sqlite3DbMallocRaw(db, (int)n); in strftimeFunc()
14052 if( z==0 ){ in strftimeFunc()
14061 z[j++] = zFmt[i]; in strftimeFunc()
14065 case 'd': sqlite3_snprintf(3, &z[j],"%02d",x.D); j+=2; break; in strftimeFunc()
14069 sqlite3_snprintf(7, &z[j],"%06.3f", s); in strftimeFunc()
14070 j += sqlite3Strlen30(&z[j]); in strftimeFunc()
14073 case 'H': sqlite3_snprintf(3, &z[j],"%02d",x.h); j+=2; break; in strftimeFunc()
14086 sqlite3_snprintf(3, &z[j],"%02d",(nDay+7-wd)/7); in strftimeFunc()
14089 sqlite3_snprintf(4, &z[j],"%03d",nDay+1); in strftimeFunc()
14095 sqlite3_snprintf(20, &z[j],"%.16g",x.iJD/86400000.0); in strftimeFunc()
14096 j+=sqlite3Strlen30(&z[j]); in strftimeFunc()
14099 case 'm': sqlite3_snprintf(3, &z[j],"%02d",x.M); j+=2; break; in strftimeFunc()
14100 case 'M': sqlite3_snprintf(3, &z[j],"%02d",x.m); j+=2; break; in strftimeFunc()
14102 sqlite3_snprintf(30,&z[j],"%lld", in strftimeFunc()
14104 j += sqlite3Strlen30(&z[j]); in strftimeFunc()
14107 case 'S': sqlite3_snprintf(3,&z[j],"%02d",(int)x.s); j+=2; break; in strftimeFunc()
14109 z[j++] = (char)(((x.iJD+129600000)/86400000) % 7) + '0'; in strftimeFunc()
14113 sqlite3_snprintf(5,&z[j],"%04d",x.Y); j+=sqlite3Strlen30(&z[j]); in strftimeFunc()
14116 default: z[j++] = '%'; break; in strftimeFunc()
14120 z[j] = 0; in strftimeFunc()
14121 sqlite3_result_text(context, z, -1, in strftimeFunc()
14122 z==zBuf ? SQLITE_TRANSIENT : SQLITE_DYNAMIC); in strftimeFunc()
15127 char *z; in sqlite3MemMalloc() local
15139 z = p; in sqlite3MemMalloc()
15140 pBt = (void**)&z[mem.nTitle]; in sqlite3MemMalloc()
15166 memcpy(z, mem.zTitle, mem.nTitle); in sqlite3MemMalloc()
15186 char *z; in sqlite3MemFree() local
15207 z = (char*)pBt; in sqlite3MemFree()
15208 z -= pHdr->nTitle; in sqlite3MemFree()
15210 randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + in sqlite3MemFree()
15212 free(z); in sqlite3MemFree()
15370 char *z = (char*)pHdr; in sqlite3MemdebugDump() local
15371 z -= pHdr->nBacktraceSlots*sizeof(void*) + pHdr->nTitle; in sqlite3MemdebugDump()
15373 pHdr->iSize, &pHdr[1], pHdr->nTitle ? z : "???"); in sqlite3MemdebugDump()
18716 SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3 *db, const char *z){ in sqlite3DbStrDup() argument
18719 if( z==0 ){ in sqlite3DbStrDup()
18722 n = sqlite3Strlen30(z) + 1; in sqlite3DbStrDup()
18726 memcpy(zNew, z, n); in sqlite3DbStrDup()
18730 SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3 *db, const char *z, int n){ in sqlite3DbStrNDup() argument
18732 if( z==0 ){ in sqlite3DbStrNDup()
18738 memcpy(zNew, z, n); in sqlite3DbStrNDup()
18751 char *z; in sqlite3SetString() local
18754 z = sqlite3VMPrintf(db, zFormat, ap); in sqlite3SetString()
18757 *pz = z; in sqlite3SetString()
19482 sqlite3StrAccumAppend(pAccum, (const char*)pToken->z, pToken->n); in sqlite3VXPrintf()
19536 SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){ in sqlite3StrAccumAppend() argument
19537 assert( z!=0 || N==0 ); in sqlite3StrAccumAppend()
19544 N = sqlite3Strlen30(z); in sqlite3StrAccumAppend()
19546 if( N==0 || NEVER(z==0) ){ in sqlite3StrAccumAppend()
19583 memcpy(&p->zText[p->nChar], z, N); in sqlite3StrAccumAppend()
19644 char *z; in sqlite3VMPrintf() local
19652 z = sqlite3StrAccumFinish(&acc); in sqlite3VMPrintf()
19656 return z; in sqlite3VMPrintf()
19665 char *z; in sqlite3MPrintf() local
19667 z = sqlite3VMPrintf(db, zFormat, ap); in sqlite3MPrintf()
19669 return z; in sqlite3MPrintf()
19682 char *z; in sqlite3MAppendf() local
19684 z = sqlite3VMPrintf(db, zFormat, ap); in sqlite3MAppendf()
19687 return z; in sqlite3MAppendf()
19695 char *z; in sqlite3_vmprintf() local
19704 z = sqlite3StrAccumFinish(&acc); in sqlite3_vmprintf()
19705 return z; in sqlite3_vmprintf()
19714 char *z; in sqlite3_mprintf() local
19719 z = sqlite3_vmprintf(zFormat, ap); in sqlite3_mprintf()
19721 return z; in sqlite3_mprintf()
19746 char *z; in sqlite3_snprintf() local
19749 z = sqlite3_vsnprintf(n, zBuf, zFormat, ap); in sqlite3_snprintf()
19751 return z; in sqlite3_snprintf()
20173 unsigned char *z; /* Output iterator */ in sqlite3VdbeMemTranslate() local
20202 zIn = (u8*)pMem->z; in sqlite3VdbeMemTranslate()
20238 zIn = (u8*)pMem->z; in sqlite3VdbeMemTranslate()
20244 z = zOut; in sqlite3VdbeMemTranslate()
20252 WRITE_UTF16LE(z, c); in sqlite3VdbeMemTranslate()
20260 WRITE_UTF16BE(z, c); in sqlite3VdbeMemTranslate()
20263 pMem->n = (int)(z - zOut); in sqlite3VdbeMemTranslate()
20264 *z++ = 0; in sqlite3VdbeMemTranslate()
20271 WRITE_UTF8(z, c); in sqlite3VdbeMemTranslate()
20277 WRITE_UTF8(z, c); in sqlite3VdbeMemTranslate()
20280 pMem->n = (int)(z - zOut); in sqlite3VdbeMemTranslate()
20282 *z = 0; in sqlite3VdbeMemTranslate()
20289 pMem->z = (char*)zOut; in sqlite3VdbeMemTranslate()
20290 pMem->zMalloc = pMem->z; in sqlite3VdbeMemTranslate()
20318 u8 b1 = *(u8 *)pMem->z; in sqlite3VdbeMemHandleBom()
20319 u8 b2 = *(((u8 *)pMem->z) + 1); in sqlite3VdbeMemHandleBom()
20332 memmove(pMem->z, &pMem->z[2], pMem->n); in sqlite3VdbeMemHandleBom()
20333 pMem->z[pMem->n] = '\0'; in sqlite3VdbeMemHandleBom()
20334 pMem->z[pMem->n+1] = '\0'; in sqlite3VdbeMemHandleBom()
20352 const u8 *z = (const u8*)zIn; in sqlite3Utf8CharLen() local
20355 zTerm = &z[nByte]; in sqlite3Utf8CharLen()
20359 assert( z<=zTerm ); in sqlite3Utf8CharLen()
20360 while( *z!=0 && z<zTerm ){ in sqlite3Utf8CharLen()
20361 SQLITE_SKIP_UTF8(z); in sqlite3Utf8CharLen()
20404 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){ in sqlite3Utf16to8() argument
20408 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC); in sqlite3Utf16to8()
20412 m.z = 0; in sqlite3Utf16to8()
20417 assert( m.z || db->mallocFailed ); in sqlite3Utf16to8()
20418 return m.z; in sqlite3Utf16to8()
20432 SQLITE_PRIVATE char *sqlite3Utf8to16(sqlite3 *db, u8 enc, char *z, int n, int *pnOut){ in sqlite3Utf8to16() argument
20436 sqlite3VdbeMemSetStr(&m, z, n, SQLITE_UTF8, SQLITE_STATIC); in sqlite3Utf8to16()
20441 assert( m.z==m.zMalloc ); in sqlite3Utf8to16()
20443 return m.z; in sqlite3Utf8to16()
20454 unsigned char const *z = zIn; in sqlite3Utf16ByteLen() local
20459 READ_UTF16BE(z, 1, c); in sqlite3Utf16ByteLen()
20464 READ_UTF16LE(z, 1, c); in sqlite3Utf16ByteLen()
20468 return (int)(z-(unsigned char const *)zIn); in sqlite3Utf16ByteLen()
20480 unsigned char *z; in sqlite3UtfSelfTest() local
20485 z = zBuf; in sqlite3UtfSelfTest()
20486 WRITE_UTF8(z, i); in sqlite3UtfSelfTest()
20487 n = (int)(z-zBuf); in sqlite3UtfSelfTest()
20489 z[0] = 0; in sqlite3UtfSelfTest()
20490 z = zBuf; in sqlite3UtfSelfTest()
20491 c = sqlite3Utf8Read(z, (const u8**)&z); in sqlite3UtfSelfTest()
20496 assert( (z-zBuf)==n ); in sqlite3UtfSelfTest()
20500 z = zBuf; in sqlite3UtfSelfTest()
20501 WRITE_UTF16LE(z, i); in sqlite3UtfSelfTest()
20502 n = (int)(z-zBuf); in sqlite3UtfSelfTest()
20504 z[0] = 0; in sqlite3UtfSelfTest()
20505 z = zBuf; in sqlite3UtfSelfTest()
20506 READ_UTF16LE(z, 1, c); in sqlite3UtfSelfTest()
20508 assert( (z-zBuf)==n ); in sqlite3UtfSelfTest()
20512 z = zBuf; in sqlite3UtfSelfTest()
20513 WRITE_UTF16BE(z, i); in sqlite3UtfSelfTest()
20514 n = (int)(z-zBuf); in sqlite3UtfSelfTest()
20516 z[0] = 0; in sqlite3UtfSelfTest()
20517 z = zBuf; in sqlite3UtfSelfTest()
20518 READ_UTF16BE(z, 1, c); in sqlite3UtfSelfTest()
20520 assert( (z-zBuf)==n ); in sqlite3UtfSelfTest()
20596 volatile double z = y; in sqlite3IsNaN() local
20597 rc = (y!=z); in sqlite3IsNaN()
20614 SQLITE_PRIVATE int sqlite3Strlen30(const char *z){ in sqlite3Strlen30() argument
20615 const char *z2 = z; in sqlite3Strlen30()
20616 if( z==0 ) return 0; in sqlite3Strlen30()
20618 return 0x3fffffff & (int)(z2 - z); in sqlite3Strlen30()
20646 char *z; in sqlite3Error() local
20649 z = sqlite3VMPrintf(db, zFormat, ap); in sqlite3Error()
20651 sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC); in sqlite3Error()
20709 SQLITE_PRIVATE int sqlite3Dequote(char *z){ in sqlite3Dequote() argument
20712 if( z==0 ) return -1; in sqlite3Dequote()
20713 quote = z[0]; in sqlite3Dequote()
20721 for(i=1, j=0; ALWAYS(z[i]); i++){ in sqlite3Dequote()
20722 if( z[i]==quote ){ in sqlite3Dequote()
20723 if( z[i+1]==quote ){ in sqlite3Dequote()
20724 z[j++] = quote; in sqlite3Dequote()
20730 z[j++] = z[i]; in sqlite3Dequote()
20733 z[j] = 0; in sqlite3Dequote()
20787 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){ in sqlite3AtoF() argument
20790 const char *zEnd = z + length; in sqlite3AtoF()
20803 if( enc==SQLITE_UTF16BE ) z++; in sqlite3AtoF()
20806 while( z<zEnd && sqlite3Isspace(*z) ) z+=incr; in sqlite3AtoF()
20807 if( z>=zEnd ) return 0; in sqlite3AtoF()
20810 if( *z=='-' ){ in sqlite3AtoF()
20812 z+=incr; in sqlite3AtoF()
20813 }else if( *z=='+' ){ in sqlite3AtoF()
20814 z+=incr; in sqlite3AtoF()
20818 while( z<zEnd && z[0]=='0' ) z+=incr, nDigits++; in sqlite3AtoF()
20821 while( z<zEnd && sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){ in sqlite3AtoF()
20822 s = s*10 + (*z - '0'); in sqlite3AtoF()
20823 z+=incr, nDigits++; in sqlite3AtoF()
20828 while( z<zEnd && sqlite3Isdigit(*z) ) z+=incr, nDigits++, d++; in sqlite3AtoF()
20829 if( z>=zEnd ) goto do_atof_calc; in sqlite3AtoF()
20832 if( *z=='.' ){ in sqlite3AtoF()
20833 z+=incr; in sqlite3AtoF()
20836 while( z<zEnd && sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){ in sqlite3AtoF()
20837 s = s*10 + (*z - '0'); in sqlite3AtoF()
20838 z+=incr, nDigits++, d--; in sqlite3AtoF()
20841 while( z<zEnd && sqlite3Isdigit(*z) ) z+=incr, nDigits++; in sqlite3AtoF()
20843 if( z>=zEnd ) goto do_atof_calc; in sqlite3AtoF()
20846 if( *z=='e' || *z=='E' ){ in sqlite3AtoF()
20847 z+=incr; in sqlite3AtoF()
20849 if( z>=zEnd ) goto do_atof_calc; in sqlite3AtoF()
20851 if( *z=='-' ){ in sqlite3AtoF()
20853 z+=incr; in sqlite3AtoF()
20854 }else if( *z=='+' ){ in sqlite3AtoF()
20855 z+=incr; in sqlite3AtoF()
20858 while( z<zEnd && sqlite3Isdigit(*z) ){ in sqlite3AtoF()
20859 e = e*10 + (*z - '0'); in sqlite3AtoF()
20860 z+=incr; in sqlite3AtoF()
20867 while( z<zEnd && sqlite3Isspace(*z) ) z+=incr; in sqlite3AtoF()
20930 return z>=zEnd && nDigits>0 && eValid; in sqlite3AtoF()
20932 return !sqlite3Atoi64(z, pResult, length, enc); in sqlite3AtoF()
21093 SQLITE_PRIVATE int sqlite3Atoi(const char *z){ in sqlite3Atoi() argument
21095 if( z ) sqlite3GetInt32(z, &x); in sqlite3Atoi()
21534 SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ in sqlite3HexToBlob() argument
21542 zBlob[i/2] = (sqlite3HexToInt(z[i])<<4) | sqlite3HexToInt(z[i+1]); in sqlite3HexToBlob()
21689 SQLITE_PRIVATE void sqlite3FileSuffix3(const char *zBaseFilename, char *z){ in sqlite3FileSuffix3() argument
21694 sz = sqlite3Strlen30(z); in sqlite3FileSuffix3()
21695 for(i=sz-1; i>0 && z[i]!='/' && z[i]!='.'; i--){} in sqlite3FileSuffix3()
21696 if( z[i]=='.' && ALWAYS(sz>i+4) ) memcpy(&z[i+1], &z[sz-3], 4); in sqlite3FileSuffix3()
21755 static unsigned int strHash(const char *z, int nKey){ in strHash() argument
21759 h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++]; in strHash()
24954 static int robust_open(const char *z, int f, int m){
24956 do{ rc = osOpen(z,f,m); }while( rc<0 && errno==EINTR );
25205 static int vxworksSimplifyName(char *z, int n){
25207 while( n>1 && z[n-1]=='/' ){ n--; }
25209 if( z[i]=='/' ){
25210 if( z[i+1]=='/' ) continue;
25211 if( z[i+1]=='.' && i+2<n && z[i+2]=='/' ){
25215 if( z[i+1]=='.' && i+3<n && z[i+2]=='.' && z[i+3]=='/' ){
25216 while( j>0 && z[j-1]!='/' ){ j--; }
25222 z[j++] = z[i];
25224 z[j] = 0;
28690 static const sqlite3_io_methods *FINDER##Impl(const char *z, unixFile *p){ \
28691 UNUSED_PARAMETER(z); UNUSED_PARAMETER(p); \
36716 # define sqlite3WalOpen(x,y,z) 0
36718 # define sqlite3WalClose(w,x,y,z) 0
36719 # define sqlite3WalBeginReadTransaction(y,z) 0
36720 # define sqlite3WalEndReadTransaction(z)
36721 # define sqlite3WalRead(v,w,x,y,z) 0
36725 # define sqlite3WalUndo(x,y,z) 0
36726 # define sqlite3WalSavepoint(y,z)
36727 # define sqlite3WalSavepointUndo(y,z) 0
36728 # define sqlite3WalFrames(u,v,w,x,y,z) 0
36729 # define sqlite3WalCheckpoint(r,s,t,u,v,w,x,y,z) 0
36730 # define sqlite3WalCallback(z) 0
36731 # define sqlite3WalExclusiveMode(y,z) 0
36732 # define sqlite3WalHeapMemory(z) 0
37584 # define pagerWalFrames(v,w,x,y,z) 0
37585 # define pagerOpenWalIfPresent(z) SQLITE_OK
37586 # define pagerBeginReadTransaction(z) SQLITE_OK
41129 const char *z;
41138 z = zUri = &zFilename[sqlite3Strlen30(zFilename)+1];
41139 while( *z ){
41140 z += sqlite3Strlen30(z)+1;
41141 z += sqlite3Strlen30(z)+1;
41143 nUri = &z[1] - zUri;
48002 #define invalidateIncrblobCursors(x,y,z)
48361 #define ptrmapPut(w,x,y,z,rc)
48362 #define ptrmapGet(w,x,y,z) SQLITE_OK
51668 # define assertParentIndex(x,y,z)
53233 u8 *z;
53235 z = findCell(pPage, j);
53236 btreeParseCellPtr(pPage, z, &info);
53238 Pgno ovfl = get4byte(&z[info.iOverflow]);
53243 Pgno child = get4byte(z);
55600 SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
55630 return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1);
56467 ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) +
56476 if( preserve && pMem->z==pMem->zMalloc ){
56477 pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
56485 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){
56486 memcpy(pMem->zMalloc, pMem->z, pMem->n);
56489 pMem->xDel((void *)(pMem->z));
56492 pMem->z = pMem->zMalloc;
56493 if( pMem->z==0 ){
56499 return (pMem->z ? SQLITE_OK : SQLITE_NOMEM);
56516 if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){
56520 pMem->z[pMem->n] = 0;
56521 pMem->z[pMem->n+1] = 0;
56552 memset(&pMem->z[pMem->n], 0, pMem->u.nZero);
56572 pMem->z[pMem->n] = 0;
56573 pMem->z[pMem->n+1] = 0;
56615 sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
56618 sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r);
56620 pMem->n = sqlite3Strlen30(pMem->z);
56673 p->xDel((void *)p->z);
56691 p->z = 0;
56759 assert( pMem->z || pMem->n==0 );
56760 testcase( pMem->z==0 );
56761 sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
56784 sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
56860 if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
56904 if( pMem->z ){
56906 memset(pMem->z, 0, n);
57078 const char *z, /* String pointer */
57091 if( !z ){
57105 for(nByte=0; nByte<=iLimit && z[nByte]; nByte++){}
57107 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
57127 memcpy(pMem->z, z, nAlloc);
57130 pMem->zMalloc = pMem->z = (char *)z;
57134 pMem->z = (char *)z;
57243 return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z);
57268 rc = memcmp(pMem1->z, pMem2->z, (pMem1->n>pMem2->n)?pMem2->n:pMem1->n);
57313 pMem->z = &zData[offset];
57320 rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
57322 rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
57324 pMem->z[amt] = 0;
57325 pMem->z[amt+1] = 0;
57360 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
57370 assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) );
57375 return pVal->z;
57517 const void *z, /* Text of the new string */
57521 if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
57601 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
57608 p->zSql = sqlite3DbStrNDup(p->db, z, n);
58320 pOp->p4.z = sqlite3DbStrNDup(p->db, zP4, n);
58467 zP4 = pMem->z;
58494 zP4 = pOp->p4.z;
58727 apSub = (SubProgram **)pSub->z;
58745 char *z;
58768 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
58769 assert( pMem->z!=0 );
58770 pMem->n = sqlite3Strlen30(pMem->z);
58787 apSub = (SubProgram **)pSub->z;
58815 z = displayP4(pOp, pMem->z, 32);
58816 if( z!=pMem->z ){
58817 sqlite3VdbeMemSetStr(pMem, z, -1, SQLITE_UTF8, 0);
58819 assert( pMem->z!=0 );
58820 pMem->n = sqlite3Strlen30(pMem->z);
58833 sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
58841 pMem->z = pOp->zComment;
58842 pMem->n = sqlite3Strlen30(pMem->z);
58870 if( pOp->opcode==OP_Trace && pOp->p4.z!=0 ){
58871 const char *z = pOp->p4.z;
58872 while( sqlite3Isspace(*z) ) z++;
58873 printf("SQL: [%s]\n", z);
58888 if( pOp->opcode==OP_Trace && pOp->p4.z!=0 ){
58890 char z[1000];
58891 sqlite3_snprintf(sizeof(z), z, "%s", pOp->p4.z);
58892 for(i=0; sqlite3Isspace(z[i]); i++){}
58893 for(j=0; z[i]; i++){
58894 if( sqlite3Isspace(z[i]) ){
58895 if( z[i-1]!=' ' ){
58896 z[j++] = ' ';
58899 z[j++] = z[i];
58902 z[j] = 0;
58903 sqlite3IoTrace("SQL %s\n", z);
60260 memcpy(buf, pMem->z, len);
60359 pMem->z = (char *)buf;
60632 (void)getVarint32((u8*)m.z, szHdr);
60641 (void)getVarint32((u8*)&m.z[szHdr-1], typeRowid);
60660 sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
60709 *res = sqlite3VdbeRecordCompare(m.n, m.z, pUnpacked);
60940 return p->n ? p->z : 0;
60988 const char *z, /* String pointer */
60993 if( sqlite3VdbeMemSetStr(&pCtx->s, z, n, enc, xDel)==SQLITE_TOOBIG ){
60999 const void *z,
61005 setResultStrOrError(pCtx, z, n, 0, xDel);
61011 SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
61014 sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
61017 SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
61020 sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
61037 const char *z,
61042 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
61047 const void *z,
61052 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
61056 const void *z,
61061 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
61065 const void *z,
61070 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
61372 pMem->z = 0;
61377 if( pMem->z ){
61378 memset(pMem->z, 0, nByte);
61382 return (void*)pMem->z;
61936 rc = sqlite3_bind_blob(pStmt, i, pValue->z, pValue->n,SQLITE_TRANSIENT);
61941 rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT,
61998 const char *z = p->azVar[i];
61999 if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){
62231 sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC);
62233 sqlite3XPrintf(&out, "'%.*q'", utf8.n, utf8.z);
62238 sqlite3XPrintf(&out, "'%.*q'", pVar->n, pVar->z);
62246 sqlite3XPrintf(&out, "%02x", pVar->z[i]&0xff);
62484 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
62489 pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))];
62493 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*nField*sizeof(u32)];
62512 if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return;
62513 if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){
62624 sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));
62628 char z = pMem->z[i];
62629 if( z<32 || z>126 ) *zCsr++ = '.';
62630 else *zCsr++ = z;
62660 u8 c = pMem->z[j];
63218 char *z; /* Text of the error report */
63321 char *z;
63609 if( pOp->p4.z ){
63611 sqlite3SetString(&p->zErrMsg, db, "%s", pOp->p4.z);
63613 sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pc, p->zSql, pOp->p4.z);
63670 assert( pOp->p4.z!=0 );
63672 pOp->p1 = sqlite3Strlen30(pOp->p4.z);
63676 rc = sqlite3VdbeMemSetStr(pOut, pOp->p4.z, -1, SQLITE_UTF8, SQLITE_STATIC);
63679 assert( pOut->zMalloc==pOut->z );
63685 sqlite3DbFree(db, pOp->p4.z);
63688 pOp->p4.z = pOut->z;
63703 assert( pOp->p4.z!=0 );
63705 pOut->z = pOp->p4.z;
63729 sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0);
63748 assert( pOp->p4.z==0 || pOp->p4.z==p->azVar[pOp->p1-1] );
63948 memcpy(pOut->z, pIn2->z, pIn2->n);
63950 memcpy(&pOut->z[pIn2->n], pIn1->z, pIn1->n);
63951 pOut->z[u.ae.nByte] = 0;
63952 pOut->z[u.ae.nByte+1] = 0;
64948 u.am.zRec = u.am.pReg->z;
65052 u.am.zData = u.am.sMem.z;
65116 u.am.zData = u.am.sMem.z;
65134 assert( u.am.sMem.z==u.am.sMem.zMalloc );
65136 assert( !(u.am.pDest->flags & (MEM_Blob|MEM_Str)) || u.am.pDest->z==u.am.sMem.z );
65139 u.am.pDest->z = u.am.sMem.z;
65165 u.an.zAffinity = pOp->p4.z;
65232 u.ao.zAffinity = pOp->p4.z;
65286 u.ao.zNewRecord = (u8 *)pOut->z;
65355 u.aq.zName = pOp->p4.z;
65980 (KeyInfo*)pOp->p4.z, u.ax.pCx->pCursor);
66332 u.bb.pIdxKey = sqlite3VdbeRecordUnpack(u.bb.pC->pKeyInfo, pIn3->n, pIn3->z,
66750 u.bf.pData->z = 0;
66763 u.bf.pData->z, u.bf.pData->n, u.bf.nZero,
66771 if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p4.z ){
66773 u.bf.zTbl = pOp->p4.z;
66817 if( db->xUpdateCallback && pOp->p4.z ){
66839 if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p4.z ){
66841 const char *zTbl = pOp->p4.z;
66935 rc = sqlite3BtreeKey(u.bh.pCrsr, 0, u.bh.n, pOut->z);
66937 rc = sqlite3BtreeData(u.bh.pCrsr, 0, u.bh.n, pOut->z);
67198 u.bn.zKey = pIn2->z;
67532 db->aDb[u.bu.iDb].zName, u.bu.zMaster, pOp->p4.z);
67574 sqlite3UnlinkAndDeleteTable(db, pOp->p1, pOp->p4.z);
67586 sqlite3UnlinkAndDeleteIndex(db, pOp->p1, pOp->p4.z);
67598 sqlite3UnlinkAndDeleteTrigger(db, pOp->p1, pOp->p4.z);
67630 char *z; /* Text of the error report */
67649 u.bv.z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p5].pBt, u.bv.aRoot, u.bv.nRoot,
67655 assert( u.bv.z==0 );
67656 }else if( u.bv.z==0 ){
67659 sqlite3VdbeMemSetStr(pIn1, u.bv.z, -1, SQLITE_UTF8, sqlite3_free);
68071 u.cb.ctx.s.z = 0;
68259 pOut->z = (char *)sqlite3JournalModename(u.ce.eNew);
68260 pOut->n = sqlite3Strlen30(pOut->z);
68346 const char *z = pOp->p4.z;
68347 sqlite3SetString(&p->zErrMsg, db, "database table is locked: %s", z);
68382 rc = sqlite3VtabCallCreate(db, pOp->p1, pOp->p4.z, &p->zErrMsg);
68395 rc = sqlite3VtabCallDestroy(db, pOp->p1, pOp->p4.z);
68500 rc = u.ci.pModule->xFilter(u.ci.pVtabCursor, u.ci.iQuery, pOp->p4.z, u.ci.nArg, u.ci.apArg);
68642 rc = u.cl.pVtab->pModule->xRename(u.cl.pVtab, u.cl.pName->z);
68771 char *z;
68774 if( db->xTrace && (u.cn.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 ){
68775 u.cn.z = sqlite3VdbeExpandSql(p, u.cn.zTrace);
68776 db->xTrace(db->pTraceArg, u.cn.z);
68777 sqlite3DbFree(db, u.cn.z);
68781 && (u.cn.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
69269 void *z,
69299 rc = xCall(p->pCsr, iOffset+p->iOffset, n, z);
69317 SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){
69318 return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData);
69324 SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
69325 return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData);
71611 if( op!=TK_INTEGER || pToken->z==0
71612 || sqlite3GetInt32(pToken->z, &iValue)==0 ){
71628 memcpy(pNew->u.zToken, pToken->z, pToken->n);
71631 && ((c = pToken->z[0])=='\'' || c=='"' || c=='[' || c=='`') ){
71654 x.z = zToken;
71769 const char *z;
71773 z = pExpr->u.zToken;
71774 assert( z!=0 );
71775 assert( z[0]!=0 );
71776 if( z[1]==0 ){
71778 assert( z[0]=='?' );
71782 u32 n = sqlite3Strlen30(z);
71783 if( z[0]=='?' ){
71787 int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
71808 if( pParse->azVar[i] && memcmp(pParse->azVar[i],z,n+1)==0 ){
71824 if( z[0]!='?' || pParse->azVar[x-1]==0 ){
71826 pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
72259 pItem->zName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n);
72545 SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
72546 if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1;
72547 if( sqlite3StrICmp(z, "ROWID")==0 ) return 1;
72548 if( sqlite3StrICmp(z, "OID")==0 ) return 1;
73151 static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
73152 if( ALWAYS(z!=0) ){
73155 sqlite3AtoF(z, &value, sqlite3Strlen30(z), SQLITE_UTF8);
73181 const char *z = pExpr->u.zToken;
73182 assert( z!=0 );
73183 c = sqlite3Atoi64(z, &value, sqlite3Strlen30(z), SQLITE_UTF8);
73191 sqlite3ErrorMsg(pParse, "oversized integer: %s%s", negFlag ? "-" : "", z);
73193 codeReal(v, z, negFlag, iMem);
73551 const char *z;
73556 z = &pExpr->u.zToken[2];
73557 n = sqlite3Strlen30(z) - 1;
73558 assert( z[n]=='\'' );
73559 zBlob = sqlite3HexToBlob(sqlite3VdbeDb(v), z, n);
75048 tname.z = (char*)zCsr;
75061 zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql,
75062 zTableName, tname.z+tname.n);
75095 unsigned const char *z; /* Pointer to token */
75100 for(z=zInput; *z; z=z+n){
75101 n = sqlite3GetToken(z, &token);
75105 z += n;
75106 n = sqlite3GetToken(z, &token);
75109 zParent = sqlite3DbStrNDup(db, (const char *)z, n);
75114 (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
75118 zInput = &z[n];
75170 tname.z = (char*)zCsr;
75200 zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql,
75201 zTableName, tname.z+tname.n);
75684 zCol = sqlite3DbStrNDup(db, (char*)pColDef->z, pColDef->n);
76251 char *z, *zDb;
76276 z = sqlite3NameFromToken(db, pName1);
76277 if( z ){
76278 if( (pIdx = sqlite3FindIndex(db, z, 0))!=0 ){
76280 }else if( (pTab = sqlite3LocateTable(pParse, 0, z, 0))!=0 ){
76283 sqlite3DbFree(db, z);
76291 z = sqlite3NameFromToken(db, pTableName);
76292 if( z ){
76293 if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
76295 }else if( (pTab = sqlite3LocateTable(pParse, 0, z, zDb))!=0 ){
76298 sqlite3DbFree(db, z);
76331 const char *z;
76349 z = argv[2];
76350 for(i=0; *z && i<=n; i++){
76352 while( (c=z[0])>='0' && c<='9' ){
76354 z++;
76359 if( *z==' ' ) z++;
76360 if( memcmp(z, "unordered", 10)==0 ){
76379 sqlite3DbFree(db, p->u.z);
76492 const char *z = (const char *)(
76503 pSample->u.z = 0;
76505 pSample->u.z = sqlite3DbStrNDup(0, z, n);
76506 if( pSample->u.z==0 ){
76634 char *z = db->aDb[i].zName;
76635 assert( z && zName );
76636 if( sqlite3StrICmp(z, zName)==0 ){
77924 zName = sqlite3DbStrNDup(db, (char*)pName->z, pName->n);
78287 char *z;
78297 z = sqlite3NameFromToken(db, pName);
78298 if( z==0 ) return;
78300 if( STRICMP(z, p->aCol[i].zName) ){
78301 sqlite3ErrorMsg(pParse, "duplicate column name: %s", z);
78302 sqlite3DbFree(db, z);
78310 sqlite3DbFree(db, z);
78317 pCol->zName = z;
78662 static int identLength(const char *z){
78664 for(n=0; *z; n++, z++){
78665 if( *z=='"' ){ n++; }
78683 static void identPut(char *z, int *pIdx, char *zSignedIdent){
78696 if( needQuote ) z[i++] = '"';
78698 z[i++] = zIdent[j];
78699 if( zIdent[j]=='"' ) z[i++] = '"';
78701 if( needQuote ) z[i++] = '"';
78702 z[i] = 0;
78920 n = (int)(pEnd->z - pParse->sNameToken.z) + 1;
78922 "CREATE %s %.*s", zType2, n, pParse->sNameToken.z
78986 const char *zName = (const char *)pParse->sNameToken.z;
78989 if( pCons->z==0 ){
78992 nName = (int)((const char *)pCons->z - zName);
79014 const char *z;
79059 if( ALWAYS(sEnd.z[0]!=0) && sEnd.z[0]!=';' ){
79060 sEnd.z += sEnd.n;
79063 n = (int)(sEnd.z - pBegin->z);
79064 z = pBegin->z;
79065 while( ALWAYS(n>0) && sqlite3Isspace(z[n-1]) ){ n--; }
79066 sEnd.z = &z[n-1];
79520 char *z;
79554 z = (char*)&pFKey->aCol[nCol];
79555 pFKey->zTo = z;
79556 memcpy(z, pTo->z, pTo->n);
79557 z[pTo->n] = 0;
79558 sqlite3Dequote(z);
79559 z += pTo->n+1;
79583 pFKey->aCol[i].zCol = z;
79584 memcpy(z, pToCol->a[i].zName, n);
79585 z[n] = 0;
79586 z += n+1;
79900 nullId.z = pTab->aCol[pTab->nCol-1].zName;
79901 nullId.n = sqlite3Strlen30((char*)nullId.z);
80134 pEnd->z - pName->z + 1,
80135 pName->z);
80334 char *z;
80347 z = (char*)pArray;
80348 memset(&z[*pnEntry * szEntry], 0, szEntry);
80530 if( pDatabase && pDatabase->z==0 ){
80646 if( pIndexedBy->n==1 && !pIndexedBy->z ){
80939 const char *z = pIndex->azColl[i];
80940 assert( z!=0 );
80941 if( 0==sqlite3StrICmp(z, zColl) ){
81007 char *z; /* Name of a table or index */
81024 }else if( NEVER(pName2==0) || pName2->z==0 ){
81026 assert( pName1->z );
81039 z = sqlite3NameFromToken(db, pObjName);
81040 if( z==0 ) return;
81042 pTab = sqlite3FindTable(db, z, zDb);
81045 sqlite3DbFree(db, z);
81048 pIndex = sqlite3FindIndex(db, z, zDb);
81049 sqlite3DbFree(db, z);
81150 char *z = pColl->zName;
81154 pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, 0);
82273 const char *z = 0;
82276 case SQLITE_INTEGER: z = "integer"; break;
82277 case SQLITE_TEXT: z = "text"; break;
82278 case SQLITE_FLOAT: z = "real"; break;
82279 case SQLITE_BLOB: z = "blob"; break;
82280 default: z = "null"; break;
82282 sqlite3_result_text(context, z, -1, SQLITE_STATIC);
82306 const unsigned char *z = sqlite3_value_text(argv[0]);
82307 if( z==0 ) return;
82309 while( *z ){
82311 SQLITE_SKIP_UTF8(z);
82384 const unsigned char *z;
82401 z = sqlite3_value_blob(argv[0]);
82402 if( z==0 ) return;
82405 z = sqlite3_value_text(argv[0]);
82406 if( z==0 ) return;
82409 for(z2=z; *z2; len++){
82444 while( *z && p1 ){
82445 SQLITE_SKIP_UTF8(z);
82448 for(z2=z; *z2 && p2; p2--){
82451 sqlite3_result_text(context, (char*)z, (int)(z2-z), SQLITE_TRANSIENT);
82457 sqlite3_result_blob(context, (char*)&z[p1], (int)p2, SQLITE_TRANSIENT);
82507 char *z;
82514 z = 0;
82516 z = sqlite3Malloc((int)nByte);
82517 if( !z ){
82521 return z;
83094 char *z;
83098 z = contextMalloc(context, ((i64)i)+((i64)n)+3);
83099 if( z ){
83100 z[0] = '\'';
83102 z[j++] = zArg[i];
83104 z[j++] = '\'';
83107 z[j++] = '\'';
83108 z[j] = 0;
83109 sqlite3_result_text(context, z, j, sqlite3_free);
83132 char *zHex, *z;
83138 z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
83142 *(z++) = hexdigits[(c>>4)&0xf];
83143 *(z++) = hexdigits[c&0xf];
83145 *z = 0;
83293 const unsigned char *z;
83294 for(z=zCharSet, nChar=0; *z; nChar++){
83295 SQLITE_SKIP_UTF8(z);
83303 for(z=zCharSet, nChar=0; *z; nChar++){
83304 azChar[nChar] = (unsigned char *)z;
83305 SQLITE_SKIP_UTF8(z);
83306 aLen[nChar] = (u8)(z - azChar[nChar]);
84805 tToCol.z = pIdx ? pTab->aCol[pIdx->aiColumn[i]].zName : "oid";
84806 tFromCol.z = pFKey->pFrom->aCol[iFromCol].zName;
84808 tToCol.n = sqlite3Strlen30(tToCol.z);
84809 tFromCol.n = sqlite3Strlen30(tFromCol.z);
84873 tFrom.z = zFrom;
84899 pStep->target.z = (char *)&pStep[1];
84901 memcpy((char *)pStep->target.z, zFrom, nFrom);
84991 const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo);
84992 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p);
88108 static u8 getSafetyLevel(const char *z){
88115 if( sqlite3Isdigit(*z) ){
88116 return (u8)sqlite3Atoi(z);
88118 n = sqlite3Strlen30(z);
88120 if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 ){
88130 SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z){
88131 return getSafetyLevel(z)&1;
88143 static int getLockingMode(const char *z){
88144 if( z ){
88145 if( 0==sqlite3StrICmp(z, "exclusive") ) return PAGER_LOCKINGMODE_EXCLUSIVE;
88146 if( 0==sqlite3StrICmp(z, "normal") ) return PAGER_LOCKINGMODE_NORMAL;
88158 static int getAutoVacuum(const char *z){
88160 if( 0==sqlite3StrICmp(z, "none") ) return BTREE_AUTOVACUUM_NONE;
88161 if( 0==sqlite3StrICmp(z, "full") ) return BTREE_AUTOVACUUM_FULL;
88162 if( 0==sqlite3StrICmp(z, "incremental") ) return BTREE_AUTOVACUUM_INCR;
88163 i = sqlite3Atoi(z);
88174 static int getTempStore(const char *z){
88175 if( z[0]>='0' && z[0]<='2' ){
88176 return z[0] - '0';
88177 }else if( sqlite3StrICmp(z, "file")==0 ){
88179 }else if( sqlite3StrICmp(z, "memory")==0 ){
89479 int iBt = (pId2->z?iDb:SQLITE_MAX_ATTACHED);
90620 && sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
91249 char *z;
91251 case TK_ALL: z = "UNION ALL"; break;
91252 case TK_INTERSECT: z = "INTERSECT"; break;
91253 case TK_EXCEPT: z = "EXCEPT"; break;
91254 default: z = "UNION"; break;
91256 return z;
91290 # define explainTempTable(y,z)
91291 # define explainSetInteger(y,z)
91328 # define explainComposite(v,w,x,y,z)
93822 sColname.z = zColname;
94985 char *z; /* A single column of result */
95009 z = sqlite3_mprintf("%s", colv[i]);
95010 if( z==0 ) goto malloc_failed;
95011 p->azResult[p->nData++] = z;
95027 z = 0;
95030 z = sqlite3_malloc( n );
95031 if( z==0 ) goto malloc_failed;
95032 memcpy(z, argv[i], n);
95034 p->azResult[p->nData++] = z;
95415 nameToken.z = pTrig->zName;
95416 nameToken.n = sqlite3Strlen30(nameToken.z);
95427 char *z;
95433 z = sqlite3DbStrNDup(db, (char*)pAll->z, pAll->n);
95437 pTrig->table, z);
95438 sqlite3DbFree(db, z);
95501 char *z = (char*)&pTriggerStep[1];
95502 memcpy(z, pName->z, pName->n);
95503 pTriggerStep->target.z = z;
97565 pParse->sNameToken.n = (int)(&pModuleName->z[pModuleName->n] - pName1->z);
97586 if( pParse->sArg.z && ALWAYS(pParse->pNewTable) ){
97587 const char *z = (const char*)pParse->sArg.z;
97590 addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n));
97604 pParse->sArg.z = 0;
97621 pParse->sNameToken.n = (int)(pEnd->z - pParse->sNameToken.z) + pEnd->n;
97682 pParse->sArg.z = 0;
97692 if( pArg->z==0 ){
97693 pArg->z = p->z;
97696 assert(pArg->z < p->z);
97697 pArg->n = (int)(&p->z[p->n] - pArg->z);
98208 unsigned char *z;
98228 for(z=(unsigned char*)zLowerName; *z; z++){
98229 *z = sqlite3UpperToLower[*z];
98979 const char *z = 0; /* String on RHS of LIKE operator */
99014 z = (char *)sqlite3_value_text(pVal);
99019 z = pRight->u.zToken;
99021 if( z ){
99023 while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
99026 if( cnt!=0 && 255!=(u8)z[cnt-1] ){
99028 *pisComplete = c==wc[0] && z[cnt+1]==0;
99029 pPrefix = sqlite3Expr(db, TK_STRING, z);
99049 z = 0;
99054 return (z!=0);
100640 const u8 *z;
100647 z = (const u8 *)sqlite3_value_blob(pVal);
100657 z = (const u8 *)sqlite3ValueText(pVal, pColl->enc);
100658 if( !z ){
100661 assert( z && pColl && pColl->xCmp );
100674 db, pColl->enc, aSample[i].u.z, aSample[i].nByte, &nSample
100680 c = pColl->xCmp(pColl->pUser, nSample, zSample, n, z);
100685 c = pColl->xCmp(pColl->pUser, aSample[i].nByte, aSample[i].u.z, n, z);
101913 # define explainOneScan(u,v,w,x,y,z)
103137 char *z;
103141 z = pTabItem->zAlias;
103142 if( z==0 ) z = pTabItem->pTab->zName;
103143 n = sqlite3Strlen30(z);
103149 memcpy(&sqlite3_query_plan[nQPlan], z, n);
103385 pOut->zStart = pStart->z;
103386 pOut->zEnd = &pEnd->z[pEnd->n];
103395 pOut->zStart = pValue->z;
103396 pOut->zEnd = &pValue->z[pValue->n];
103425 pOut->zEnd = &pPostOp->z[pPostOp->n];
103449 pOut->zStart = pPreOp->z;
105490 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
105491 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
105529 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
105530 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
105535 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
105536 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
105540 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].min…
105553 v.zStart = yymsp[-1].minor.yy0.z;
105624 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
105781 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
105814 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
105957 …if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->…
105973 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106121 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106134 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
106135 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106150 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106166 …tominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-…
106179 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
106180 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106192 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
106193 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106249 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
106276 all.z = yymsp[-3].minor.yy0.z;
106277 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
106370 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
106371 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106380 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
106381 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
106554 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
106828 static int keywordCode(const char *z, int n){
106949 h = ((charMap(z[0])*4) ^
106950 (charMap(z[n-1])*3) ^
106953 if( aLen[i]==n && sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){
107080 SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
107081 return keywordCode((char*)z, n);
107132 SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
107134 switch( *z ){
107136 testcase( z[0]==' ' );
107137 testcase( z[0]=='\t' );
107138 testcase( z[0]=='\n' );
107139 testcase( z[0]=='\f' );
107140 testcase( z[0]=='\r' );
107141 for(i=1; sqlite3Isspace(z[i]); i++){}
107146 if( z[1]=='-' ){
107148 for(i=2; (c=z[i])!=0 && c!='\n'; i++){}
107176 if( z[1]!='*' || z[2]==0 ){
107181 for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){}
107192 return 1 + (z[1]=='=');
107195 if( (c=z[1])=='=' ){
107210 if( (c=z[1])=='=' ){
107222 if( z[1]!='=' ){
107231 if( z[1]!='|' ){
107254 int delim = z[0];
107258 for(i=1; (c=z[i])!=0; i++){
107260 if( z[i+1]==delim ){
107280 if( !sqlite3Isdigit(z[1]) )
107291 testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' );
107292 testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' );
107293 testcase( z[0]=='6' ); testcase( z[0]=='7' ); testcase( z[0]=='8' );
107294 testcase( z[0]=='9' );
107296 for(i=0; sqlite3Isdigit(z[i]); i++){}
107298 if( z[i]=='.' ){
107300 while( sqlite3Isdigit(z[i]) ){ i++; }
107303 if( (z[i]=='e' || z[i]=='E') &&
107304 ( sqlite3Isdigit(z[i+1])
107305 || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2]))
107309 while( sqlite3Isdigit(z[i]) ){ i++; }
107313 while( IdChar(z[i]) ){
107320 for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){}
107326 for(i=1; sqlite3Isdigit(z[i]); i++){}
107330 for(i=1; sqlite3Isdigit(z[i]); i++){}
107346 testcase( z[0]=='$' ); testcase( z[0]=='@' ); testcase( z[0]==':' );
107348 for(i=1; (c=z[i])!=0; i++){
107355 }while( (c=z[i])!=0 && !sqlite3Isspace(c) && c!=')' );
107362 }else if( c==':' && z[i+1]==':' ){
107374 testcase( z[0]=='x' ); testcase( z[0]=='X' );
107375 if( z[1]=='\'' ){
107377 for(i=2; sqlite3Isxdigit(z[i]); i++){}
107378 if( z[i]!='\'' || i%2 ){
107380 while( z[i] && z[i]!='\'' ){ i++; }
107382 if( z[i] ) i++;
107389 if( !IdChar(*z) ){
107392 for(i=1; IdChar(z[i]); i++){}
107393 *tokenType = keywordCode((char*)z, i);
107441 pParse->sLastToken.z = &zSql[i];
108492 static int allSpaces(const char *z, int n){
108493 while( n>0 && z[n-1]==' ' ){ n--; }
109444 const char *z;
109453 z = sqlite3ErrStr(SQLITE_NOMEM);
109455 z = (char*)sqlite3_value_text(db->pErr);
109457 if( z==0 ){
109458 z = sqlite3ErrStr(db->errCode);
109462 return z;
109483 const void *z;
109492 z = (void *)outOfMem;
109494 z = sqlite3_value_text16(db->pErr);
109495 if( z==0 ){
109498 z = sqlite3_value_text16(db->pErr);
109508 return z;
109860 const char *z;
109896 for(i=0; aMode[i].z; i++){
109897 const char *z = aMode[i].z;
109898 if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){
112069 char *z; /* Text of the token */
112370 SQLITE_PRIVATE void sqlite3Fts3Dequote(char *z){
112373 quote = z[0];
112381 while( ALWAYS(z[iIn]) ){
112382 if( z[iIn]==quote ){
112383 if( z[iIn+1]!=quote ) break;
112384 z[iOut++] = quote;
112387 z[iOut++] = z[iIn++];
112390 z[iOut] = '\0';
112566 char *z = p->azColumn[i];
112567 zContentCols = sqlite3_mprintf("%z, 'c%d%q'", zContentCols, i, z);
112651 const char *z,
112656 const char *zCsr = z;
112663 *pnKey = (int)(zCsr-z);
112683 char *z;
112685 z = sqlite3_vmprintf(zFormat, ap);
112686 if( z && *pz ){
112687 char *z2 = sqlite3_mprintf("%s%s", *pz, z);
112688 sqlite3_free(z);
112689 z = z2;
112691 if( z==0 ) *pRc = SQLITE_NOMEM;
112694 *pz = z;
112715 char *z = zRet;
112716 *(z++) = '"';
112718 if( zInput[i]=='"' ) *(z++) = '"';
112719 *(z++) = zInput[i];
112721 *(z++) = '"';
112722 *(z++) = '\0';
112930 char const *z = argv[i];
112936 && strlen(z)>8
112937 && 0==sqlite3_strnicmp(z, "tokenize", 8)
112938 && 0==sqlite3Fts3IsIdChar(z[8])
112940 rc = sqlite3Fts3InitTokenizer(pHash, &z[9], &pTokenizer, pzErr);
112944 else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){
112963 if( nKey==pOp->nOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){
112968 *pzErr = sqlite3_mprintf("unrecognized parameter: %s", z);
113015 nString += (int)(strlen(z) + 1);
113016 aCol[nCol++] = z;
113084 char *z;
113086 z = (char *)sqlite3Fts3NextToken(aCol[iCol], &n);
113087 memcpy(zCsr, z, n);
114389 filter.zTerm = pTok->z;
115166 pToken->z, pToken->n, pToken->isPrefix, &pToken->pSegcsr
115379 pTab, pFirst->pSegcsr, iCol, pFirst->z, pFirst->n);
117056 const char *z, int n, /* Input string */
117067 rc = pModule->xOpen(pTokenizer, z, n, &pCursor);
117087 pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1];
117088 memcpy(pRet->pPhrase->aToken[0].z, zToken, nToken);
117090 if( iEnd<n && z[iEnd]=='*' ){
117094 if( !sqlite3_fts3_enable_parentheses && iStart>0 && z[iStart-1]=='-' ){
117220 p->pPhrase->aToken[jj].z = zBuf;
117255 const char *z, int n, /* Input string */
117260 char *z; /* Keyword text */
117276 const char *zInput = z;
117300 if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){
117331 *pnConsumed = (int)((zInput - z) + nKey);
117350 *pnConsumed = (int)((zInput - z) + 1 + nConsumed);
117357 *pnConsumed = (int)((zInput - z) + 1);
117369 *pnConsumed = (int)((zInput - z) + ii + 1);
117397 iColLen = (int)((zInput - z) + nStr + 1);
117401 rc = getNextToken(pParse, iCol, &z[iColLen], n-iColLen, ppExpr, pnConsumed);
117479 const char *z, int n, /* Text of MATCH query */
117487 const char *zIn = z;
117644 const char *z, int n, /* Text of MATCH query */
117655 if( z==0 ){
117660 n = (int)strlen(z);
117662 rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed);
117743 pPhrase->aToken[i].n, pPhrase->aToken[i].z,
117970 const char *z = (const char *)pKey;
117972 if( nKey<=0 ) nKey = (int) strlen(z);
117974 h = (h<<3) ^ h ^ *z++;
117989 const char *z = (const char *)pKey;
117991 h = (h<<3) ^ h ^ *(z++);
118402 static int isConsonant(const char *z){
118404 char x = *z;
118409 return z[1]==0 || isVowel(z + 1);
118411 static int isVowel(const char *z){
118413 char x = *z;
118418 return isConsonant(z + 1);
118440 static int m_gt_0(const char *z){
118441 while( isVowel(z) ){ z++; }
118442 if( *z==0 ) return 0;
118443 while( isConsonant(z) ){ z++; }
118444 return *z!=0;
118450 static int m_eq_1(const char *z){
118451 while( isVowel(z) ){ z++; }
118452 if( *z==0 ) return 0;
118453 while( isConsonant(z) ){ z++; }
118454 if( *z==0 ) return 0;
118455 while( isVowel(z) ){ z++; }
118456 if( *z==0 ) return 1;
118457 while( isConsonant(z) ){ z++; }
118458 return *z==0;
118464 static int m_gt_1(const char *z){
118465 while( isVowel(z) ){ z++; }
118466 if( *z==0 ) return 0;
118467 while( isConsonant(z) ){ z++; }
118468 if( *z==0 ) return 0;
118469 while( isVowel(z) ){ z++; }
118470 if( *z==0 ) return 0;
118471 while( isConsonant(z) ){ z++; }
118472 return *z!=0;
118478 static int hasVowel(const char *z){
118479 while( isConsonant(z) ){ z++; }
118480 return *z!=0;
118489 static int doubleConsonant(const char *z){
118490 return isConsonant(z) && z[0]==z[1];
118501 static int star_oh(const char *z){
118503 isConsonant(z) &&
118504 z[0]!='w' && z[0]!='x' && z[0]!='y' &&
118505 isVowel(z+1) &&
118506 isConsonant(z+2);
118527 char *z = *pz;
118528 while( *zFrom && *zFrom==*z ){ z++; zFrom++; }
118530 if( xCond && !xCond(z) ) return 1;
118532 *(--z) = *(zTo++);
118534 *pz = z;
118596 char *z, *z2;
118617 z = &zReverse[j+1];
118621 if( z[0]=='s' ){
118623 !stem(&z, "sess", "ss", 0) &&
118624 !stem(&z, "sei", "i", 0) &&
118625 !stem(&z, "ss", "ss", 0)
118627 z++;
118632 z2 = z;
118633 if( stem(&z, "dee", "ee", m_gt_0) ){
118636 (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel))
118637 && z!=z2
118639 if( stem(&z, "ta", "ate", 0) ||
118640 stem(&z, "lb", "ble", 0) ||
118641 stem(&z, "zi", "ize", 0) ){
118643 }else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){
118644 z++;
118645 }else if( m_eq_1(z) && star_oh(z) ){
118646 *(--z) = 'e';
118651 if( z[0]=='y' && hasVowel(z+1) ){
118652 z[0] = 'i';
118656 switch( z[1] ){
118658 stem(&z, "lanoita", "ate", m_gt_0) ||
118659 stem(&z, "lanoit", "tion", m_gt_0);
118662 stem(&z, "icne", "ence", m_gt_0) ||
118663 stem(&z, "icna", "ance", m_gt_0);
118666 stem(&z, "rezi", "ize", m_gt_0);
118669 stem(&z, "igol", "log", m_gt_0);
118672 stem(&z, "ilb", "ble", m_gt_0) ||
118673 stem(&z, "illa", "al", m_gt_0) ||
118674 stem(&z, "iltne", "ent", m_gt_0) ||
118675 stem(&z, "ile", "e", m_gt_0) ||
118676 stem(&z, "ilsuo", "ous", m_gt_0);
118679 stem(&z, "noitazi", "ize", m_gt_0) ||
118680 stem(&z, "noita", "ate", m_gt_0) ||
118681 stem(&z, "rota", "ate", m_gt_0);
118684 stem(&z, "msila", "al", m_gt_0) ||
118685 stem(&z, "ssenevi", "ive", m_gt_0) ||
118686 stem(&z, "ssenluf", "ful", m_gt_0) ||
118687 stem(&z, "ssensuo", "ous", m_gt_0);
118690 stem(&z, "itila", "al", m_gt_0) ||
118691 stem(&z, "itivi", "ive", m_gt_0) ||
118692 stem(&z, "itilib", "ble", m_gt_0);
118697 switch( z[0] ){
118699 stem(&z, "etaci", "ic", m_gt_0) ||
118700 stem(&z, "evita", "", m_gt_0) ||
118701 stem(&z, "ezila", "al", m_gt_0);
118704 stem(&z, "itici", "ic", m_gt_0);
118707 stem(&z, "laci", "ic", m_gt_0) ||
118708 stem(&z, "luf", "", m_gt_0);
118711 stem(&z, "ssen", "", m_gt_0);
118716 switch( z[1] ){
118718 if( z[0]=='l' && m_gt_1(z+2) ){
118719 z += 2;
118723 if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){
118724 z += 4;
118728 if( z[0]=='r' && m_gt_1(z+2) ){
118729 z += 2;
118733 if( z[0]=='c' && m_gt_1(z+2) ){
118734 z += 2;
118738 if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){
118739 z += 4;
118743 if( z[0]=='t' ){
118744 if( z[2]=='a' ){
118745 if( m_gt_1(z+3) ){
118746 z += 3;
118748 }else if( z[2]=='e' ){
118749 stem(&z, "tneme", "", m_gt_1) ||
118750 stem(&z, "tnem", "", m_gt_1) ||
118751 stem(&z, "tne", "", m_gt_1);
118756 if( z[0]=='u' ){
118757 if( m_gt_1(z+2) ){
118758 z += 2;
118760 }else if( z[3]=='s' || z[3]=='t' ){
118761 stem(&z, "noi", "", m_gt_1);
118765 if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){
118766 z += 3;
118770 stem(&z, "eta", "", m_gt_1) ||
118771 stem(&z, "iti", "", m_gt_1);
118774 if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){
118775 z += 3;
118780 if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){
118781 z += 3;
118787 if( z[0]=='e' ){
118788 if( m_gt_1(z+1) ){
118789 z++;
118790 }else if( m_eq_1(z+1) && !star_oh(z+1) ){
118791 z++;
118796 if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){
118797 z++;
118803 *pnOut = i = (int)strlen(z);
118805 while( *z ){
118806 zOut[--i] = *(z++);
118839 const char *z = c->zInput;
118845 while( c->iOffset<c->nInput && isDelim(z[c->iOffset]) ){
118851 while( c->iOffset<c->nInput && !isDelim(z[c->iOffset]) ){
118864 porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes);
119054 char *z = (char *)zArg;
119064 z = (char *)sqlite3Fts3NextToken(zCopy, &n);
119065 z[n] = '\0';
119066 sqlite3Fts3Dequote(z);
119068 m = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash,z,(int)strlen(z)+1);
119070 *pzErr = sqlite3_mprintf("unknown tokenizer: %s", z);
119075 z = &z[n+1];
119076 while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
119085 aArg[iArg++] = z;
119086 z[n] = '\0';
119087 sqlite3Fts3Dequote(z);
119088 z = &z[n+1];
121278 char *z, /* Pointer to buffer containing block data */
121285 sqlite3_bind_blob(pStmt, 2, z, n, SQLITE_STATIC);
122629 && (0==memcmp(zToken, pPT->z, pPT->n))
122988 char *z; /* Pointer to buffer containing string */
123381 char *zNew = sqlite3_realloc(pStr->z, nAlloc);
123385 pStr->z = zNew;
123390 memcpy(&pStr->z[pStr->n], zAppend, nAppend);
123392 pStr->z[pStr->n] = '\0';
124151 sqlite3_free(res.z);
124153 sqlite3_result_text(pCtx, res.z, -1, sqlite3_free);
124333 sqlite3_free(res.z);
124335 sqlite3_result_text(pCtx, res.z, res.n-1, sqlite3_free);