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

When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL

flag is cleared from column names from when the collating sequence name has
been removed.
[forum:/forumpost/6916dacf83|Forum post 6916dacf83].

FossilOrigin-Name: 8d9dcd7cfdd53034e21cdb2cb997b6f5fe3207ca5d0d7a0b841b8a68e6ce8624
This commit is contained in:
drh
2023-04-14 10:40:50 +00:00
parent a73f51447b
commit deabd6969b
3 changed files with 8 additions and 8 deletions

View File

@@ -2369,12 +2369,12 @@ void sqlite3SubqueryColumnTypes(
i64 m = sqlite3Strlen30(zType);
n = sqlite3Strlen30(pCol->zCnName);
pCol->zCnName = sqlite3DbReallocOrFree(db, pCol->zCnName, n+m+2);
pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
if( pCol->zCnName ){
memcpy(&pCol->zCnName[n+1], zType, m+1);
pCol->colFlags |= COLFLAG_HASTYPE;
}else{
testcase( pCol->colFlags & COLFLAG_HASTYPE );
pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
}
}
pColl = sqlite3ExprCollSeq(pParse, p);