Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch group-by-name-resolution Excluding Merge-Ins
This is equivalent to a diff from 6484fb5a to 401a0ca3
2014-06-12
| ||
15:46 | Simplify the estLog() routine. (check-in: 6c68d758 user: drh tags: trunk) | |
2014-06-10
| ||
20:18 | Proposed change to the fix for ticket [1c69be2dafc28b] such that legacy applications that were exploiting the older buggy behavior in SQLite continue to work. (Leaf check-in: 401a0ca3 user: drh tags: group-by-name-resolution) | |
2014-06-09
| ||
20:39 | Avoid an unnecessary initialization of the szFile field of unixFile in the unix VFS. (check-in: 6484fb5a user: drh tags: trunk) | |
20:24 | Enhance the unix VFS so that it keeps track of the size of unlinked files internally and thus avoids the need to call fstat() on those files, since fstat() does not work reliably on unlinked files on some implementations of FuseFS. (check-in: 10707d35 user: drh tags: trunk) | |
Changes to src/resolve.c.
︙ | |||
793 794 795 796 797 798 799 800 801 802 803 804 | 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | + + + + + + + + + + - + + + - + - + + + + + + + | ** This routine checks to see if pE is a simple identifier which corresponds ** to the AS-name of one of the terms of the expression list. If it is, ** this routine return an integer between 1 and N where N is the number of ** elements in pEList, corresponding to the matching entry. If there is ** no match, or if pE is not a simple identifier, then this routine ** return 0. ** ** The sameNameOnly flag is set if pE comes from a GROUP BY clause. The ** arguments of a GROUP BY clause are not supposed to be able to match ** against AS names in SQL. But early versions of SQLite allowed this ** behavior by mistake. To provide backwards compatibility, a GROUP BY ** term will match as AS alias only if the corresponding result set expression ** refers to a table column by the same name. In other words: ** ** SELECT t1.x AS x, t2.x AS y FROM t1,t2 GROUP BY x; -- match ** SELECT t1.y AS x, t2.y AS y FROM t1,t2 GROUP BY x; -- no match ** ** pEList has been resolved. pE has not. */ static int resolveAsName( Parse *pParse, /* Parsing context for error messages */ ExprList *pEList, /* List of expressions to scan */ |
︙ | |||
950 951 952 953 954 955 956 | 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | - + | pE = sqlite3ExprSkipCollate(pItem->pExpr); if( sqlite3ExprIsInteger(pE, &iCol) ){ if( iCol<=0 || iCol>pEList->nExpr ){ resolveOutOfRangeError(pParse, "ORDER", i+1, pEList->nExpr); return 1; } }else{ |
︙ | |||
1071 1072 1073 1074 1075 1076 1077 | 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 | - - - - - - - - - + + + + + + + + - | if( pOrderBy==0 ) return 0; nResult = pSelect->pEList->nExpr; pParse = pNC->pParse; for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){ Expr *pE = pItem->pExpr; Expr *pE2 = sqlite3ExprSkipCollate(pE); |
︙ |
Changes to test/resolver01.test.
︙ | |||
153 154 155 156 157 158 159 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - - - - + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + | # Test cases for ticket [1c69be2dafc28]: Make sure the GROUP BY binds # more tightly to the input tables in all cases. # # This first case case has been wrong in SQLite for time out of mind. # For SQLite version 3.7.17 the answer was two rows, which is wrong. # do_execsql_test resolver01-5.1 { |