/ Check-in [0a7649af]
Login

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

Overview
Comment:Enhance the sqlite3ExprCompare() routine so that it knows to compare the OVER clause of window functions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0a7649afebc9349bf44a0e3588e81ab595ea85be1c70de08859ea76a7b271f62
User & Date: drh 2018-07-10 06:47:07
Context
2018-07-10
07:25
Assert that if two functions compare equal in every other way, then they must both have OVER clauses, or neither has an OVER clause. Use this fact to simplify expression comparison. check-in: 52559ad5 user: drh tags: trunk
06:47
Enhance the sqlite3ExprCompare() routine so that it knows to compare the OVER clause of window functions. check-in: 0a7649af user: drh tags: trunk
06:32
Enhance the TreeView mechanism so that it shows the window function data structures as part of the abstract syntax tree. check-in: a2c0e1be user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  4947   4947       if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2;
  4948   4948       assert( (combinedFlags & EP_Reduced)==0 );
  4949   4949       if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){
  4950   4950         if( pA->iColumn!=pB->iColumn ) return 2;
  4951   4951         if( pA->iTable!=pB->iTable 
  4952   4952          && (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2;
  4953   4953       }
         4954  +#ifndef SQLITE_OMIT_WINDOWFUNC
         4955  +    if( pA->pWin!=0 ){
         4956  +      if( pB->pWin==0 ) return 2;
         4957  +      if( sqlite3WindowCompare(pParse,pA->pWin,pB->pWin)!=0 ) return 2;
         4958  +    }else if( pB->pWin!=0 ){
         4959  +      return 2;
         4960  +    }
         4961  +#endif
  4954   4962     }
  4955   4963     return 0;
  4956   4964   }
  4957   4965   
  4958   4966   /*
  4959   4967   ** Compare two ExprList objects.  Return 0 if they are identical and 
  4960   4968   ** non-zero if they differ in any way.