aboutsummaryrefslogtreecommitdiff
path: root/src/build.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-05-01 21:13:36 +0000
committerdrh <drh@noemail.net>2009-05-01 21:13:36 +0000
commit24fb627afa360cc7efed23c6ddf1932a85c99b07 (patch)
treef3c7ecfe0f31f0ad33671e34bebe55f6fb36a3c1 /src/build.c
parentd51397a614dd2b5a20697e6084bc9eae260c49b1 (diff)
downloadsqlite-24fb627afa360cc7efed23c6ddf1932a85c99b07.tar.gz
sqlite-24fb627afa360cc7efed23c6ddf1932a85c99b07.zip
Record within the Token structure itself whether or not the token has
been dequoted. This steals one bit from the length of a token and thus limits the size of tokens to 1GiB. (CVS 6589) FossilOrigin-Name: 12bcb03d9b9e1a31c1a3c67cbb4263cc0af2f3d0
Diffstat (limited to 'src/build.c')
-rw-r--r--src/build.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c
index f6e325aa8..01222593a 100644
--- a/src/build.c
+++ b/src/build.c
@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.532 2009/04/28 13:01:09 drh Exp $
+** $Id: build.c,v 1.533 2009/05/01 21:13:37 drh Exp $
*/
#include "sqliteInt.h"
@@ -579,10 +579,13 @@ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
/*
** Given a token, return a string that consists of the text of that
-** token with any quotations removed. Space to hold the returned string
+** token. Space to hold the returned string
** is obtained from sqliteMalloc() and must be freed by the calling
** function.
**
+** Any quotation marks (ex: "name", 'name', [name], or `name`) that
+** surround the body of the token are removed.
+**
** Tokens are often just pointers into the original SQL text and so
** are not \000 terminated and are not persistent. The returned string
** is \000 terminated and is persistent.
@@ -591,7 +594,7 @@ char *sqlite3NameFromToken(sqlite3 *db, Token *pName){
char *zName;
if( pName ){
zName = sqlite3DbStrNDup(db, (char*)pName->z, pName->n);
- sqlite3Dequote(zName);
+ if( pName->quoted ) sqlite3Dequote(zName);
}else{
zName = 0;
}