diff options
author | drh <drh@noemail.net> | 2014-01-10 20:38:12 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-01-10 20:38:12 +0000 |
commit | c740752470a0557b03299c5fd5036e5e096b78e3 (patch) | |
tree | b58f4cbce5f28a7a12ab6cf116c05bdb9604fc6f /src | |
parent | 9871c59a2d18e0b07ef97118aa13843f666a6bb0 (diff) | |
download | sqlite-c740752470a0557b03299c5fd5036e5e096b78e3.tar.gz sqlite-c740752470a0557b03299c5fd5036e5e096b78e3.zip |
Fix CREATE TABLE ... AS so that it works with column names that are empty
strings.
FossilOrigin-Name: 632045f21c553e10f59a14c772d50d7824ca0c2c
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/build.c b/src/build.c index 15430fd28..fa82d56cc 100644 --- a/src/build.c +++ b/src/build.c @@ -1452,10 +1452,10 @@ static void identPut(char *z, int *pIdx, char *zSignedIdent){ for(j=0; zIdent[j]; j++){ if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; } - needQuote = sqlite3Isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID; - if( !needQuote ){ - needQuote = zIdent[j]; - } + needQuote = sqlite3Isdigit(zIdent[0]) + || sqlite3KeywordCode(zIdent, j)!=TK_ID + || zIdent[j]!=0 + || j==0; if( needQuote ) z[i++] = '"'; for(j=0; zIdent[j]; j++){ |