mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix the column name uniquifier so that it works with zero-length column names.
FossilOrigin-Name: 791761ebac26c82ab67bdf867117ec5b5d8b20b0
This commit is contained in:
@@ -1651,8 +1651,10 @@ int sqlite3ColumnsFromExprList(
|
||||
cnt = 0;
|
||||
while( zName && sqlite3HashFind(&ht, zName)!=0 ){
|
||||
nName = sqlite3Strlen30(zName);
|
||||
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){}
|
||||
if( zName[j]==':' ) nName = j;
|
||||
if( nName>0 ){
|
||||
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){}
|
||||
if( zName[j]==':' ) nName = j;
|
||||
}
|
||||
zName = sqlite3MPrintf(db, "%.*z:%u", nName, zName, ++cnt);
|
||||
if( cnt>3 ) sqlite3_randomness(sizeof(cnt), &cnt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user