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

Avoid leaking memory in an obscure case where the flattener adds an ORDER BY clause to the recursive part of a recursive query.

FossilOrigin-Name: 1f413aca00015100224273480e1ce39a76bf93ab
This commit is contained in:
dan
2014-03-21 19:27:54 +00:00
parent a22a75e5ca
commit 9afccba269
5 changed files with 45 additions and 12 deletions

View File

@@ -2283,7 +2283,7 @@ struct Select {
#define SRT_Discard 4 /* Do not save the results anywhere */
/* The ORDER BY clause is ignored for all of the above */
#define IgnorableOrderby(X) ((X->eDest)<=SRT_Discard)
#define IgnorableOrderby(X) ((X->eDest)<=SRT_Discard || (X->eDest)>SRT_Table)
#define SRT_Output 5 /* Output each row of result */
#define SRT_Mem 6 /* Store result in a memory cell */