]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Honor the full_column_names pragma on * results. Ticket #1263. (CVS 2493)
authordrh <drh@noemail.net>
Mon, 6 Jun 2005 16:34:33 +0000 (16:34 +0000)
committerdrh <drh@noemail.net>
Mon, 6 Jun 2005 16:34:33 +0000 (16:34 +0000)
FossilOrigin-Name: 0d57f851ae4f483985710db149c8f541e45cdb86

manifest
manifest.uuid
src/select.c

index 2997cb2937d55fb0ba8a8aa351925ec6224dbbad..61e1711cfc48d7b103dc29afb3571f85aaa331b9 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Do\snot\sallow\sparameters\sin\sVIEW\sdefinitions.\s\sTicket\s#1270.\s(CVS\s2492)
-D 2005-06-06T15:32:08
+C Honor\sthe\sfull_column_names\spragma\son\s*\sresults.\s\sTicket\s#1263.\s(CVS\s2493)
+D 2005-06-06T16:34:33
 F Makefile.in 8129e7f261d405db783676f9ca31e0841768c652
 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -60,7 +60,7 @@ F src/pragma.c 0ed94a1aa982802a9cf2a932c48d99b60683fa53
 F src/prepare.c d53602d2f8e097225ae7c76ec764ae68f759ba47
 F src/printf.c 3d20b21cfecadacecac3fb7274e746cb81d3d357
 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
-F src/select.c 071a484044efb74fb5d8f79560822cbfc7c906c3
+F src/select.c a057b1bb71ca2db3939e35994e16b718a83c93bf
 F src/shell.c 25b3217d7c64e6497225439d261a253a23efff26
 F src/sqlite.h.in f28f5b018f03a66aaf0bc1ab6985d8605d6b964f
 F src/sqliteInt.h 0aa1d1bd6f34db3955d8615b18b20426cfd15acc
@@ -281,7 +281,7 @@ F www/tclsqlite.tcl 425be741b8ae664f55cb1ef2371aab0a75109cf9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
 F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b
-P c1691004d6d81b683a4ca5b1723c0de8b9b4e376
-R 160f72ab1cdfc77fb0f6e3997ccf35b8
+P 0d46289f02aad526f462a3ceceb1bca1b9f6a543
+R 29792a52460a836b0b452524b5145772
 U drh
-Z 3ef2bc1a475fc394b6aaef446b604547
+Z 4bc021ee60e3eeed253efe0298ce7ec7
index 638f26ff24c1ad32243d4ca35f2e8c00b9584b67..c080dc087030c4011aab146b2c5cde2a5ed93f5f 100644 (file)
@@ -1 +1 @@
-0d46289f02aad526f462a3ceceb1bca1b9f6a543
\ No newline at end of file
+0d57f851ae4f483985710db149c8f541e45cdb86
\ No newline at end of file
index c1db85f02485d88276a7049df473d1f5422b15da..37b4a0f74cc2ce352b97c8729d194f3c8a34b73d 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle SELECT statements in SQLite.
 **
-** $Id: select.c,v 1.248 2005/05/26 14:41:47 danielk1977 Exp $
+** $Id: select.c,v 1.249 2005/06/06 16:34:33 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -1070,6 +1070,10 @@ static int prepSelectStmt(Parse *pParse, Select *p){
     */
     struct ExprList_item *a = pEList->a;
     ExprList *pNew = 0;
+    int flags = pParse->db->flags;
+    int longNames = (flags & SQLITE_FullColNames)!=0 &&
+                      (flags & SQLITE_ShortColNames)==0;
+
     for(k=0; k<pEList->nExpr; k++){
       Expr *pE = a[k].pExpr;
       if( pE->op!=TK_ALL &&
@@ -1122,7 +1126,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
             pRight = sqlite3Expr(TK_ID, 0, 0, 0);
             if( pRight==0 ) break;
             setToken(&pRight->token, zName);
-            if( zTabName && pTabList->nSrc>1 ){
+            if( zTabName && (longNames || pTabList->nSrc>1) ){
               pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
               pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0);
               if( pExpr==0 ) break;
@@ -1136,7 +1140,11 @@ static int prepSelectStmt(Parse *pParse, Select *p){
               pExpr = pRight;
               pExpr->span = pExpr->token;
             }
-            pNew = sqlite3ExprListAppend(pNew, pExpr, &pRight->token);
+            if( longNames ){
+              pNew = sqlite3ExprListAppend(pNew, pExpr, &pExpr->span);
+            }else{
+              pNew = sqlite3ExprListAppend(pNew, pExpr, &pRight->token);
+            }
           }
         }
         if( !tableSeen ){