Fix problems with types and the recognition of BLOB as having no affinity. (CVS 1418)
FossilOrigin-Name: 8411718f0ac17e9c2376fdf8b5fa0cc5fc88be9b
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@
|
||||
** ROLLBACK
|
||||
** PRAGMA
|
||||
**
|
||||
** $Id: build.c,v 1.188 2004/05/20 12:10:20 drh Exp $
|
||||
** $Id: build.c,v 1.189 2004/05/20 12:41:20 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -587,10 +587,10 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
|
||||
pCol->zName = z;
|
||||
|
||||
/* If there is no type specified, columns have the default affinity
|
||||
** 'NONE'. If there is a type specified, then sqlite3AddColumnType()
|
||||
** 'NUMERIC'. If there is a type specified, then sqlite3AddColumnType()
|
||||
** will be called next to set pCol->affinity correctly.
|
||||
*/
|
||||
pCol->affinity = SQLITE_AFF_NONE;
|
||||
pCol->affinity = SQLITE_AFF_NUMERIC;
|
||||
p->nCol++;
|
||||
}
|
||||
|
||||
|
||||
+3
-6
@@ -14,7 +14,7 @@
|
||||
** the parser. Lemon will also generate a header file containing
|
||||
** numeric codes for all of the tokens.
|
||||
**
|
||||
** @(#) $Id: parse.y,v 1.114 2004/05/18 10:06:25 danielk1977 Exp $
|
||||
** @(#) $Id: parse.y,v 1.115 2004/05/20 12:41:20 drh Exp $
|
||||
*/
|
||||
%token_prefix TK_
|
||||
%token_type {Token}
|
||||
@@ -162,8 +162,8 @@ type ::= typename(X) LP signed RP(Y). {sqlite3AddColumnType(pParse,&X,&Y);}
|
||||
type ::= typename(X) LP signed COMMA signed RP(Y).
|
||||
{sqlite3AddColumnType(pParse,&X,&Y);}
|
||||
%type typename {Token}
|
||||
typename(A) ::= ids(X). {A = X;}
|
||||
typename(A) ::= typename(X) ids. {A = X;}
|
||||
typename(A) ::= ids(X). {A = X;}
|
||||
typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=X.n+Addr(Y.z)-Addr(X.z);}
|
||||
%type signed {int}
|
||||
signed(A) ::= INTEGER(X). { A = atoi(X.z); }
|
||||
signed(A) ::= PLUS INTEGER(X). { A = atoi(X.z); }
|
||||
@@ -895,6 +895,3 @@ database_kw_opt ::= .
|
||||
cmd ::= DETACH database_kw_opt nm(D). {
|
||||
sqlite3Detach(pParse, &D);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user