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

Make sure the columns of a VALUES() clause are named "column%d" even if

the VALUES() clause is a subquery in the FROM clause of an outer query.

FossilOrigin-Name: acf3b9cc9c3932431979995a1dceacc06c659ab400fad95ce3728ff8895a022b
This commit is contained in:
drh
2017-07-09 00:30:58 +00:00
parent 2aa31333c2
commit d7ca600ede
3 changed files with 12 additions and 8 deletions

View File

@@ -1704,7 +1704,11 @@ int sqlite3ColumnsFromExprList(
zName = pEList->a[i].zSpan;
}
}
zName = sqlite3MPrintf(db, "%s", zName);
if( zName ){
zName = sqlite3DbStrDup(db, zName);
}else{
zName = sqlite3MPrintf(db,"column%d",i);
}
/* Make sure the column name is unique. If the name is not unique,
** append an integer to the name so that it becomes unique.