1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-03 08:01:19 +03:00

Fix CREATE TABLE ... AS so that it works with column names that are empty

strings.

FossilOrigin-Name: 632045f21c553e10f59a14c772d50d7824ca0c2c
This commit is contained in:
drh
2014-01-10 20:38:12 +00:00
parent 9871c59a2d
commit c740752470
4 changed files with 26 additions and 13 deletions

View File

@@ -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++){