Lines Matching defs:zSql
2490 const char *zSql, /* SQL to be evaluated */
3342 ** The second argument, "zSql", is the statement to be compiled, encoded
3347 ** ^If the nByte argument is less than zero, then zSql is read up to the
3349 ** number of bytes read from zSql. ^When nByte is non-negative, the
3350 ** zSql string ends at either the first '\000' or '\u0000' character or
3358 ** past the end of the first SQL statement in zSql. These routines only
3359 ** compile the first statement in zSql, so *pzTail is left pointing to
3413 const char *zSql, /* SQL statement, UTF-8 encoded */
3414 int nByte, /* Maximum length of zSql in bytes. */
3416 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3420 const char *zSql, /* SQL statement, UTF-8 encoded */
3421 int nByte, /* Maximum length of zSql in bytes. */
3423 const char **pzTail /* OUT: Pointer to unused portion of zSql */
3427 const void *zSql, /* SQL statement, UTF-16 encoded */
3428 int nByte, /* Maximum length of zSql in bytes. */
3430 const void **pzTail /* OUT: Pointer to unused portion of zSql */
3434 const void *zSql, /* SQL statement, UTF-16 encoded */
3435 int nByte, /* Maximum length of zSql in bytes. */
3437 const void **pzTail /* OUT: Pointer to unused portion of zSql */
12863 char *zSql; /* Text of the SQL statement that generated this */
58364 assert( p->zSql==0 );
58365 p->zSql = sqlite3DbStrNDup(p->db, z, n);
58374 return (p && p->isPrepareV2) ? p->zSql : 0;
58392 zTmp = pA->zSql;
58393 pA->zSql = pB->zSql;
58394 pB->zSql = zTmp;
60754 sqlite3DbFree(db, p->zSql);
61965 if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy && p->zSql ){
61968 db->xProfile(db->pProfileArg, p->zSql, (iNow - p->startTime)*1000000);
62542 "bind on a busy prepared statement: [%s]", p->zSql);
62873 ** zSql is a zero-terminated string of UTF-8 SQL text. Return the number of
62878 static int findNextHostParameter(const char *zSql, int *pnToken){
62884 while( zSql[0] ){
62885 n = sqlite3GetToken((u8*)zSql, &tokenType);
62892 zSql += n;
63978 char *zSql;
64381 sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pc, p->zSql, pOp->p4.z);
64384 sqlite3_log(pOp->p1, "constraint failed at %d in [%s]", pc, p->zSql);
68405 char *zSql;
68427 u.bx.zSql = sqlite3MPrintf(db,
68430 if( u.bx.zSql==0 ){
68437 rc = sqlite3_exec(db, u.bx.zSql, sqlite3InitCallback, &u.bx.initData, 0);
68439 sqlite3DbFree(db, u.bx.zSql);
69671 if( db->xTrace && (u.cq.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 ){
69678 && (u.cq.zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
69754 pc, p->zSql, p->zErrMsg);
76819 unsigned char const *zSql = sqlite3_value_text(argv[0]);
76824 unsigned char const *zCsr = zSql;
76836 if( zSql ){
76857 zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql,
76939 unsigned char const *zSql = sqlite3_value_text(argv[0]);
76945 unsigned char const *zCsr = zSql;
76957 if( zSql ){
76996 zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql,
78209 char *zSql;
78232 zSql = sqlite3MPrintf(db,
78234 if( zSql==0 ){
78237 rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
78238 sqlite3DbFree(db, zSql);
78250 zSql = sqlite3MPrintf(db,
78252 if( !zSql ){
78255 rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
78256 sqlite3DbFree(db, zSql);
79367 char *zSql;
79376 zSql = sqlite3VMPrintf(db, zFormat, ap);
79378 if( zSql==0 ){
79384 sqlite3RunParser(pParse, zSql, &zErrMsg);
79386 sqlite3DbFree(db, zSql);
88757 const char *zSql, /* The SQL to be executed */
88770 if( zSql==0 ) zSql = "";
88774 while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){
88779 rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
88786 zSql = zLeftover;
88838 zSql = zLeftover;
88839 while( sqlite3Isspace(zSql[0]) ) zSql++;
91803 char *zSql;
91804 zSql = sqlite3MPrintf(db,
91813 rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
91819 sqlite3DbFree(db, zSql);
92006 ** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
92010 const char *zSql, /* UTF-8 encoded SQL statement. */
92011 int nBytes, /* Length of zSql in bytes. */
92074 if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
92084 zSqlCopy = sqlite3DbStrNDup(db, zSql, nBytes);
92088 pParse->zTail = &zSql[pParse->zTail-zSqlCopy];
92090 pParse->zTail = &zSql[nBytes];
92093 sqlite3RunParser(pParse, zSql, &zErrMsg);
92138 sqlite3VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql), saveSqlFlag);
92170 const char *zSql, /* UTF-8 encoded SQL statement. */
92171 int nBytes, /* Length of zSql in bytes. */
92185 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
92188 rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
92206 const char *zSql;
92210 zSql = sqlite3_sql((sqlite3_stmt *)p);
92211 assert( zSql!=0 ); /* Reprepare only called for prepare_v2() statements */
92214 rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0);
92242 const char *zSql, /* UTF-8 encoded SQL statement. */
92243 int nBytes, /* Length of zSql in bytes. */
92248 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
92254 const char *zSql, /* UTF-8 encoded SQL statement. */
92255 int nBytes, /* Length of zSql in bytes. */
92260 rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,0,ppStmt,pzTail);
92268 ** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
92272 const void *zSql, /* UTF-16 encoded SQL statement. */
92273 int nBytes, /* Length of zSql in bytes. */
92292 zSql8 = sqlite3Utf16to8(db, zSql, nBytes, SQLITE_UTF16NATIVE);
92304 *pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed);
92322 const void *zSql, /* UTF-16 encoded SQL statement. */
92323 int nBytes, /* Length of zSql in bytes. */
92328 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
92334 const void *zSql, /* UTF-16 encoded SQL statement. */
92335 int nBytes, /* Length of zSql in bytes. */
92340 rc = sqlite3Prepare16(db,zSql,nBytes,1,ppStmt,pzTail);
97055 const char *zSql, /* The SQL to be executed */
97080 rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
98965 ** Execute zSql on database db. Return an error code.
98967 static int execSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
98970 if( !zSql ){
98973 if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
98983 ** Execute zSql on database db. The statement returns exactly
98986 static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
98990 rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
99029 char *zSql = 0; /* SQL statements */
99078 zSql = "ATTACH ':memory:' AS vacuum_db;";
99080 zSql = "ATTACH '' AS vacuum_db;";
99082 rc = execSql(db, pzErrMsg, zSql);
109630 SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
109646 pParse->zTail = zSql;
109661 while( !db->mallocFailed && zSql[i]!=0 ){
109663 pParse->sLastToken.z = &zSql[i];
109664 pParse->sLastToken.n = sqlite3GetToken((unsigned char*)&zSql[i],&tokenType);
109687 pParse->zTail = &zSql[i];
109701 if( zSql[i]==0 && nErr==0 && pParse->rc==SQLITE_OK ){
109704 pParse->zTail = &zSql[i];
109875 SQLITE_API int sqlite3_complete(const char *zSql){
109908 while( *zSql ){
109909 switch( *zSql ){
109923 if( zSql[1]!='*' ){
109927 zSql += 2;
109928 while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; }
109929 if( zSql[0]==0 ) return 0;
109930 zSql++;
109935 if( zSql[1]!='-' ){
109939 while( *zSql && *zSql!='\n' ){ zSql++; }
109940 if( *zSql==0 ) return state==1;
109945 zSql++;
109946 while( *zSql && *zSql!=']' ){ zSql++; }
109947 if( *zSql==0 ) return 0;
109954 int c = *zSql;
109955 zSql++;
109956 while( *zSql && *zSql!=c ){ zSql++; }
109957 if( *zSql==0 ) return 0;
109965 if( IdChar((u8)*zSql) ){
109968 for(nId=1; IdChar(zSql[nId]); nId++){}
109972 switch( *zSql ){
109974 if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
109982 if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
109984 }else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
109986 }else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
109994 if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
109998 if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
110013 zSql += nId-1;
110022 zSql++;
110033 SQLITE_API int sqlite3_complete16(const void *zSql){
110043 sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
114710 char *zSql;
114713 zSql = sqlite3_vmprintf(zFormat, ap);
114715 if( zSql==0 ){
114718 *pRc = sqlite3_exec(db, zSql, 0, 0, 0);
114719 sqlite3_free(zSql);
114759 char *zSql; /* SQL statement passed to declare_vtab() */
114771 zSql = sqlite3_mprintf(
114774 if( !zCols || !zSql ){
114777 rc = sqlite3_declare_vtab(p->db, zSql);
114780 sqlite3_free(zSql);
114857 char *zSql; /* SQL text "PRAGMA %Q.page_size" */
114860 zSql = sqlite3_mprintf("PRAGMA %Q.page_size", p->zDb);
114861 if( !zSql ){
114864 rc = sqlite3_prepare(p->db, zSql, -1, &pStmt, 0);
114875 sqlite3_free(zSql);
116872 char *zSql; /* SQL statement used to access %_content */
116935 zSql = sqlite3_mprintf(zTmpl, p->zReadExprlist, p->zDb, p->zName, zSort);
116938 zSql = sqlite3_mprintf(zTmpl, p->zReadExprlist, p->zDb, p->zName);
116940 if( !zSql ) return SQLITE_NOMEM;
116941 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pCsr->pStmt, 0);
116942 sqlite3_free(zSql);
120334 const char zSql[] = "SELECT fts3_tokenizer(?)";
120337 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
121865 const char zSql[] = "SELECT fts3_tokenizer(?, ?)";
121867 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
121887 const char zSql[] = "SELECT fts3_tokenizer(?)";
121890 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
122556 char *zSql;
122558 zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName, p->zWriteExprlist);
122560 zSql = sqlite3_mprintf(azSql[eStmt], p->zReadExprlist, p->zDb, p->zName);
122562 zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName);
122564 if( !zSql ){
122567 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, NULL);
122568 sqlite3_free(zSql);
129865 char *zSql = sqlite3_mprintf(
129873 if( zSql ){
129874 rc = sqlite3_exec(pRtree->db, zSql, 0, 0, 0);
129875 sqlite3_free(zSql);
129966 char *zSql = sqlite3_mprintf(azSql[i], zDb, zPrefix);
129967 if( zSql ){
129968 rc = sqlite3_prepare_v2(db, zSql, -1, appStmt[i], 0);
129972 sqlite3_free(zSql);
129985 static int getIntFromStmt(sqlite3 *db, const char *zSql, int *piVal){
129987 if( zSql ){
129989 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
130021 char *zSql;
130024 zSql = sqlite3_mprintf("PRAGMA %Q.page_size", pRtree->zDb);
130025 rc = getIntFromStmt(db, zSql, &iPageSize);
130033 zSql = sqlite3_mprintf(
130037 rc = getIntFromStmt(db, zSql, &pRtree->iNodeSize);
130040 sqlite3_free(zSql);
130111 char *zSql = sqlite3_mprintf("CREATE TABLE x(%s", argv[3]);
130114 for(ii=4; zSql && ii<argc; ii++){
130115 zTmp = zSql;
130116 zSql = sqlite3_mprintf("%s, %s", zTmp, argv[ii]);
130119 if( zSql ){
130120 zTmp = zSql;
130121 zSql = sqlite3_mprintf("%s);", zTmp);
130124 if( !zSql ){
130126 }else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){
130129 sqlite3_free(zSql);