diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/printf.c | 6 | ||||
-rw-r--r-- | src/wherecode.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c index 48382143b..6f3b5681a 100644 --- a/src/printf.c +++ b/src/printf.c @@ -102,7 +102,7 @@ static const et_info fmtinfo[] = { /* Notes: ** ** %S Takes a pointer to SrcItem. Shows name or database.name -** %!S Like %S but also shows AS alias if an alias is available +** %!S Like %S but prefer the zName over the zAlias */ /* Floating point constants used for rounding */ @@ -864,7 +864,7 @@ void sqlite3_str_vappendf( if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return; pItem = va_arg(ap, SrcItem*); assert( bArgList==0 ); - if( pItem->zAlias ){ + if( pItem->zAlias && !flag_altform2 ){ sqlite3_str_appendall(pAccum, pItem->zAlias); }else if( pItem->zName ){ if( pItem->zDatabase ){ @@ -872,6 +872,8 @@ void sqlite3_str_vappendf( sqlite3_str_append(pAccum, ".", 1); } sqlite3_str_appendall(pAccum, pItem->zName); + }else if( pItem->zAlias ){ + sqlite3_str_appendall(pAccum, pItem->zAlias); }else if( pItem->pSelect ){ sqlite3_str_appendf(pAccum, "SUBQUERY %u", pItem->pSelect->selId); } diff --git a/src/wherecode.c b/src/wherecode.c index 195c08de3..771a50fc7 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -149,7 +149,7 @@ int sqlite3WhereExplainOneScan( sqlite3StrAccumInit(&str, db, zBuf, sizeof(zBuf), SQLITE_MAX_LENGTH); str.printfFlags = SQLITE_PRINTF_INTERNAL; - sqlite3_str_appendf(&str, "%s %!S", isSearch ? "SEARCH" : "SCAN", pItem); + sqlite3_str_appendf(&str, "%s %S", isSearch ? "SEARCH" : "SCAN", pItem); if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){ const char *zFmt = 0; Index *pIdx; |