diff options
author | drh <drh@noemail.net> | 2009-05-11 20:53:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-05-11 20:53:28 +0000 |
commit | c4a64facce89c5033fbfb308175a81975391c977 (patch) | |
tree | 15c7eb5cd7bb0494085b3a107593094d19753764 /src/expr.c | |
parent | aaac8b4e1bcd9d7e61d30ceb2ff0169c9e11a951 (diff) | |
download | sqlite-c4a64facce89c5033fbfb308175a81975391c977.tar.gz sqlite-c4a64facce89c5033fbfb308175a81975391c977.zip |
Rework the logic that generates a schema for tables created using
"CREATE TABLE ... AS SELECT ...". Instead of trying to copy the raw
datatype string from the right-hand side, just make the type one
of TEXT, INT, REAL, NUM, or nothing. This is much simpler than
trying to parse and quote datatype strings. Other minor
implifications to build.c are bundled with this change. (CVS 6626)
FossilOrigin-Name: 33cf83591e6e13875ef6ada5b8ac8ab07619d8bc
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index 9ec98b04b..b6aba9921 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.433 2009/05/09 00:18:38 drh Exp $ +** $Id: expr.c,v 1.434 2009/05/11 20:53:29 drh Exp $ */ #include "sqliteInt.h" @@ -69,7 +69,7 @@ Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pCollName){ sqlite3 *db = pParse->db; zColl = sqlite3NameFromToken(db, pCollName); if( pExpr && zColl ){ - pColl = sqlite3LocateCollSeq(pParse, zColl, -1); + pColl = sqlite3LocateCollSeq(pParse, zColl); if( pColl ){ pExpr->pColl = pColl; pExpr->flags |= EP_ExpCollate; @@ -99,7 +99,7 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ if( j>=0 ){ sqlite3 *db = pParse->db; zColl = p->pTab->aCol[j].zColl; - pColl = sqlite3FindCollSeq(db, ENC(db), zColl, -1, 0); + pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0); pExpr->pColl = pColl; } break; @@ -1377,7 +1377,7 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){ if( (pIdx->aiColumn[0]==iCol) - && (pReq==sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], -1, 0)) + && (pReq==sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], 0)) && (!mustBeUnique || (pIdx->nColumn==1 && pIdx->onError!=OE_None)) ){ int iMem = ++pParse->nMem; |