I solved it setting a variable before " /*A-overwrites-S*/", but I's still
confusing it's usage inside a wrapped "#ifdef" that supposed only will be
executed conditionally.  

Cheers !  

oneselect(A) ::= SELECT|XSELECT(S) distinct(D) selcollist(W) from(X)
where_opt(Y)
???????????????? groupby_opt(P) having_opt(Q) orderby_opt(Z)
limit_opt(L). {
? int isXSelect = @S == TK_XSELECT;
#if SELECTTRACE_ENABLED
? Token s = S; /*A-overwrites-S*/
#endif
? A = sqlite3SelectNew(pParse,W,X,Y,P,Q,Z,D,L.pLimit,L.pOffset);
? if(isXSelect) A->selFlags |= SF_NOFlattening;

#if SELECTTRACE_ENABLED
? /* Populate the Select.zSelName[] string that is used to help with
? ** query planner debugging, to differentiate between multiple Select
? ** objects in a complex query.
? **
? ** If the SELECT keyword is immediately followed by a C-style comment
? ** then extract the first few alphanumeric characters from within that
? ** comment to be the zSelName value.? Otherwise, the label is #N where
? ** is an integer that is incremented with each SELECT statement seen.
? */
? if( A!=0 ){
??? const char *z = s.z+ (isXSelect ? 7 : 6);
??? int i;
??? sqlite3_snprintf(sizeof(A->zSelName), A->zSelName, "#%d",
???????????????????? ++pParse->nSelect);
??? while( z[0]==' ' ) z++;
??? if( z[0]=='/' && z[1]=='*' ){
????? z += 2;
????? while( z[0]==' ' ) z++;
????? for(i=0; sqlite3Isalnum(z[i]); i++){}
????? sqlite3_snprintf(sizeof(A->zSelName), A->zSelName, "%.*s", i, z);
??? }
? }
#endif /* SELECTRACE_ENABLED */
}

Reply via email to