SQLite

Check-in [04e1edd8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to sqlite3SelectNew() to work around a false-positive warning from GCC-10. The code is very slightly larger and slower as a result.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 04e1edd8e5821a377407263829ed0d87968c708c9aeb1282107ea6f39a11c1cc
User & Date: drh 2020-05-26 11:10:25
Context
2020-05-26
11:23
Increase the version number to 3.33.0 to begin the next release cycle. (check-in: 790badb3 user: drh tags: trunk)
11:10
Changes to sqlite3SelectNew() to work around a false-positive warning from GCC-10. The code is very slightly larger and slower as a result. (check-in: 04e1edd8 user: drh tags: trunk)
10:54
Innocuous changes to help Coverity avoid false-positives. (check-in: 4ec8a5a2 user: drh tags: trunk)
2020-05-25
01:31
Attempt to work around a false-positive warning in the CGo compiler. (Closed-Leaf check-in: d4bf60f4 user: drh tags: cgo-warning-workaround)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/select.c.
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  Expr *pWhere,         /* the WHERE clause */
  ExprList *pGroupBy,   /* the GROUP BY clause */
  Expr *pHaving,        /* the HAVING clause */
  ExprList *pOrderBy,   /* the ORDER BY clause */
  u32 selFlags,         /* Flag parameters, such as SF_Distinct */
  Expr *pLimit          /* LIMIT value.  NULL means not used */
){
  Select *pNew;
  Select standin;
  pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
  if( pNew==0 ){
    assert( pParse->db->mallocFailed );
    pNew = &standin;
  }
  if( pEList==0 ){
    pEList = sqlite3ExprListAppend(pParse, 0,
                                   sqlite3Expr(pParse->db,TK_ASTERISK,0));







|

|







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  Expr *pWhere,         /* the WHERE clause */
  ExprList *pGroupBy,   /* the GROUP BY clause */
  Expr *pHaving,        /* the HAVING clause */
  ExprList *pOrderBy,   /* the ORDER BY clause */
  u32 selFlags,         /* Flag parameters, such as SF_Distinct */
  Expr *pLimit          /* LIMIT value.  NULL means not used */
){
  Select *pNew, *pAllocated;
  Select standin;
  pAllocated = pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
  if( pNew==0 ){
    assert( pParse->db->mallocFailed );
    pNew = &standin;
  }
  if( pEList==0 ){
    pEList = sqlite3ExprListAppend(pParse, 0,
                                   sqlite3Expr(pParse->db,TK_ASTERISK,0));
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
  pNew->pWith = 0;
#ifndef SQLITE_OMIT_WINDOWFUNC
  pNew->pWin = 0;
  pNew->pWinDefn = 0;
#endif
  if( pParse->db->mallocFailed ) {
    clearSelect(pParse->db, pNew, pNew!=&standin);
    pNew = 0;
  }else{
    assert( pNew->pSrc!=0 || pParse->nErr>0 );
  }
  assert( pNew!=&standin );
  return pNew;
}


/*
** Delete the given Select structure and all of its substructures.
*/
void sqlite3SelectDelete(sqlite3 *db, Select *p){







|



<
|







170
171
172
173
174
175
176
177
178
179
180

181
182
183
184
185
186
187
188
  pNew->pWith = 0;
#ifndef SQLITE_OMIT_WINDOWFUNC
  pNew->pWin = 0;
  pNew->pWinDefn = 0;
#endif
  if( pParse->db->mallocFailed ) {
    clearSelect(pParse->db, pNew, pNew!=&standin);
    pAllocated = 0;
  }else{
    assert( pNew->pSrc!=0 || pParse->nErr>0 );
  }

  return pAllocated;
}


/*
** Delete the given Select structure and all of its substructures.
*/
void sqlite3SelectDelete(sqlite3 *db, Select *p){