|
1 | 1 | #ifndef USE_LIBSQLITE3
|
2 | 2 | /******************************************************************************
|
3 | 3 | ** This file is an amalgamation of many separate C source files from SQLite
|
4 |
| -** version 3.50.3. By combining all the individual C code files into this |
| 4 | +** version 3.50.4. By combining all the individual C code files into this |
5 | 5 | ** single large file, the entire code can be compiled as a single translation
|
6 | 6 | ** unit. This allows many compilers to do optimizations that would not be
|
7 | 7 | ** possible if the files were compiled separately. Performance improvements
|
|
19 | 19 | ** separate file. This file contains only code for the core SQLite library.
|
20 | 20 | **
|
21 | 21 | ** The content in this amalgamation comes from Fossil check-in
|
22 |
| -** 3ce993b8657d6d9deda380a93cdd6404a8c8 with changes in files: |
| 22 | +** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: |
23 | 23 | **
|
24 | 24 | **
|
25 | 25 | */
|
@@ -466,9 +466,9 @@ extern "C" {
|
466 | 466 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
467 | 467 | ** [sqlite_version()] and [sqlite_source_id()].
|
468 | 468 | */
|
469 |
| -#define SQLITE_VERSION "3.50.3" |
470 |
| -#define SQLITE_VERSION_NUMBER 3050003 |
471 |
| -#define SQLITE_SOURCE_ID "2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543" |
| 469 | +#define SQLITE_VERSION "3.50.4" |
| 470 | +#define SQLITE_VERSION_NUMBER 3050004 |
| 471 | +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" |
472 | 472 |
|
473 | 473 | /*
|
474 | 474 | ** CAPI3REF: Run-Time Library Version Numbers
|
@@ -19441,6 +19441,7 @@ struct Expr {
|
19441 | 19441 | Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
|
19442 | 19442 | ** for a column of an index on an expression */
|
19443 | 19443 | Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */
|
| 19444 | + int nReg; /* TK_NULLS: Number of registers to NULL out */ |
19444 | 19445 | struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
|
19445 | 19446 | int iAddr; /* Subroutine entry address */
|
19446 | 19447 | int regReturn; /* Register used to hold return address */
|
@@ -21475,6 +21476,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int)
|
21475 | 21476 | SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int);
|
21476 | 21477 | SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int);
|
21477 | 21478 | SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int);
|
| 21479 | +SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int); |
21478 | 21480 | SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*);
|
21479 | 21481 | SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int);
|
21480 | 21482 | SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8);
|
@@ -115242,6 +115244,12 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target)
|
115242 | 115244 | sqlite3VdbeLoadString(v, target, pExpr->u.zToken);
|
115243 | 115245 | return target;
|
115244 | 115246 | }
|
| 115247 | + case TK_NULLS: { |
| 115248 | + /* Set a range of registers to NULL. pExpr->y.nReg registers starting |
| 115249 | + ** with target */ |
| 115250 | + sqlite3VdbeAddOp3(v, OP_Null, 0, target, target + pExpr->y.nReg - 1); |
| 115251 | + return target; |
| 115252 | + } |
115245 | 115253 | default: {
|
115246 | 115254 | /* Make NULL the default case so that if a bug causes an illegal
|
115247 | 115255 | ** Expr node to be passed into this function, it will be handled
|
@@ -115926,6 +115934,25 @@ SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(
|
115926 | 115934 | return regDest;
|
115927 | 115935 | }
|
115928 | 115936 |
|
| 115937 | +/* |
| 115938 | +** Make arrangements to invoke OP_Null on a range of registers |
| 115939 | +** during initialization. |
| 115940 | +*/ |
| 115941 | +SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3ExprNullRegisterRange( |
| 115942 | + Parse *pParse, /* Parsing context */ |
| 115943 | + int iReg, /* First register to set to NULL */ |
| 115944 | + int nReg /* Number of sequential registers to NULL out */ |
| 115945 | +){ |
| 115946 | + u8 okConstFactor = pParse->okConstFactor; |
| 115947 | + Expr t; |
| 115948 | + memset(&t, 0, sizeof(t)); |
| 115949 | + t.op = TK_NULLS; |
| 115950 | + t.y.nReg = nReg; |
| 115951 | + pParse->okConstFactor = 1; |
| 115952 | + sqlite3ExprCodeRunJustOnce(pParse, &t, iReg); |
| 115953 | + pParse->okConstFactor = okConstFactor; |
| 115954 | +} |
| 115955 | + |
115929 | 115956 | /*
|
115930 | 115957 | ** Generate code to evaluate an expression and store the results
|
115931 | 115958 | ** into a register. Return the register number where the results
|
@@ -153176,6 +153203,7 @@ SQLITE_PRIVATE int sqlite3Select(
|
153176 | 153203 | sqlite3VdbeAddOp2(v, OP_Integer, 0, iAbortFlag);
|
153177 | 153204 | VdbeComment((v, "clear abort flag"));
|
153178 | 153205 | sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1);
|
| 153206 | + sqlite3ExprNullRegisterRange(pParse, iAMem, pGroupBy->nExpr); |
153179 | 153207 |
|
153180 | 153208 | /* Begin a loop that will extract all source rows in GROUP BY order.
|
153181 | 153209 | ** This might involve two separate loops with an OP_Sort in between, or
|
@@ -168471,6 +168499,7 @@ static int whereLoopAddBtree(
|
168471 | 168499 | pNew->u.btree.nEq = 0;
|
168472 | 168500 | pNew->u.btree.nBtm = 0;
|
168473 | 168501 | pNew->u.btree.nTop = 0;
|
| 168502 | + pNew->u.btree.nDistinctCol = 0; |
168474 | 168503 | pNew->nSkip = 0;
|
168475 | 168504 | pNew->nLTerm = 0;
|
168476 | 168505 | pNew->iSortIdx = 0;
|
@@ -169539,8 +169568,6 @@ static i8 wherePathSatisfiesOrderBy(
|
169539 | 169568 | obSat = obDone;
|
169540 | 169569 | }
|
169541 | 169570 | break;
|
169542 |
| - }else if( wctrlFlags & WHERE_DISTINCTBY ){ |
169543 |
| - pLoop->u.btree.nDistinctCol = 0; |
169544 | 169571 | }
|
169545 | 169572 | iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
|
169546 | 169573 |
|
@@ -257281,7 +257308,7 @@ static void fts5SourceIdFunc(
|
257281 | 257308 | ){
|
257282 | 257309 | assert( nArg==0 );
|
257283 | 257310 | UNUSED_PARAM2(nArg, apUnused);
|
257284 |
| - sqlite3_result_text(pCtx, "fts5: 2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543", -1, SQLITE_TRANSIENT); |
| 257311 | + sqlite3_result_text(pCtx, "fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3", -1, SQLITE_TRANSIENT); |
257285 | 257312 | }
|
257286 | 257313 |
|
257287 | 257314 | /*
|
|
0 commit comments