]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
This version still does not work. This is an incremental check-in to save
authordrh <>
Thu, 13 Feb 2025 11:10:12 +0000 (11:10 +0000)
committerdrh <>
Thu, 13 Feb 2025 11:10:12 +0000 (11:10 +0000)
my place so that I can work on other things.

FossilOrigin-Name: 2b73eb3fa7180b4a94b9d8837580eec13d411f1fc7ac4b80803cbc4dfaaead6a

manifest
manifest.uuid
src/expr.c
src/vdbe.c
src/vdbe.h

index 3aa5f46faddfc0872aa6888243ba0f5621329e7b..eab629daea8a86482f82a018f8f16a57eb425bfb 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C An\sattempt\sto\sallow\sthe\sDEFAULT\skeyword\sin\sthe\sVALUES\sclause\sof\san\sINSERT.\nThis\scheck-in\sdoes\snot\swork\sright.
-D 2025-02-12T20:54:32.402
+C This\sversion\sstill\sdoes\snot\swork.\s\sThis\sis\san\sincremental\scheck-in\sto\ssave\nmy\splace\sso\sthat\sI\scan\swork\son\sother\sthings.
+D 2025-02-13T11:10:12.666
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -729,7 +729,7 @@ F src/date.c 842c08ac143a56a627b05ac51d68624f2b7b03e3b4cba596205e735eed64ee57
 F src/dbpage.c 2e677acb658a29965e55398bbc61161cb7819da538057c8032adac7ab8e4a8c0
 F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
 F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
-F src/expr.c c1af6df70e460d0b24a2b6d417849ac198229ab349e1ddacad3918b9f48f6ce1
+F src/expr.c d5d87528151de24b85f8d49d8fd1eb35e503a231b3d4c4871531561743573b93
 F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
 F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
 F src/func.c b2fb33139972d7d65640b27ea962a49f1616265428001090cab39fcf270228e1
@@ -847,8 +847,8 @@ F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
 F src/utf.c 8b29d9a5956569ea2700f869669b8ef67a9662ee5e724ff77ab3c387e27094ba
 F src/util.c 9ff6470dabcf943fd796d2da766c98bd328c8f6fe036a31e5b338e628603f989
 F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40
-F src/vdbe.c a068cb6614035ca83ad454dbb55147a67d7426fcaa03222c7b45101c2d7efba8
-F src/vdbe.h 8cca1d3f90b18d5215913f6d569c022ff1d5b016b0e1afed22f77274a6f205d8
+F src/vdbe.c 22a2fbbda809f89480349ef6779467648c7d0d3fc9ea1737a2125973b839b1d4
+F src/vdbe.h bcb446c44fb6dabc1517d5e3804edf1adda6090da76c4057cd58d032f73d608d
 F src/vdbeInt.h 4836978baf3f70a8042d81c0649046d18e721a3ca64cc73f594869730873386f
 F src/vdbeapi.c 82fe278a7c71b653235c6f9fb5de0b5de589908dfcb011ba2a782e8becf06f86
 F src/vdbeaux.c 541d3d232714455960eab4ed10b34cb48b4bcd565d7539ef31092f5e73648e6b
@@ -2207,8 +2207,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 480d7c1a1abb4b543bbc6ee37db82c5232c69d0abc2722c00e262e6c64c860ff
-R 26905e85d686434917aa2e53862e881e
+P 85c108eb0ff8e47046ba6ec702accf46bd56dc077ada0afa3360ffa4fcdc0f34
+R 54f4e1e39836583df3358de85fb5dbad
 U drh
-Z e749e66dd6424beae3c3ec5070e0cc40
+Z 7bac26f5066159b12cc2cafe9b392705
 # Remove this line to create a well-formed Fossil manifest.
index 7794ed129a6f4014f7afd12b8d71131e34eb8d10..cebfbbcee399d6ec4a4c542bbdf76eb652b485bf 100644 (file)
@@ -1 +1 @@
-85c108eb0ff8e47046ba6ec702accf46bd56dc077ada0afa3360ffa4fcdc0f34
+2b73eb3fa7180b4a94b9d8837580eec13d411f1fc7ac4b80803cbc4dfaaead6a
index d1b3d04785bacd5806d7c3260ace22b1ed43cc37..69b816c50127604507268c83ef7e11401929833e 100644 (file)
@@ -4897,7 +4897,7 @@ expr_code_doover:
       return target;
     }
     case TK_DEFAULT: {
-      sqlite3VdbeAddOp2(v, OP_Null, SQLITE_NULL_DEFAULT, target);
+      sqlite3VdbeAddOp1(v, OP_DfltNull, target);
       return target;
     }
     default: {
index e88c4b71b1faa3c99b12770992b0f08c4e7ca7e9..7af845831aeb450a55ca287dba02d866c153e93b 100644 (file)
@@ -581,7 +581,11 @@ static void memTracePrint(Mem *p){
   if( p->flags & MEM_Undefined ){
     printf(" undefined");
   }else if( p->flags & MEM_Null ){
-    printf(p->flags & MEM_Zero ? " NULL-nochng" : " NULL");
+    if( p->flags==(MEM_Null|MEM_Term|MEM_Subtype) && p->eSubtype==0 ){
+      printf(" NULL-default");
+    }else{
+      printf(p->flags & MEM_Zero ? " NULL-nochng" : " NULL");
+    }
   }else if( (p->flags & (MEM_Int|MEM_Str))==(MEM_Int|MEM_Str) ){
     printf(" si:%lld", p->u.i);
   }else if( (p->flags & (MEM_IntReal))!=0 ){
@@ -601,7 +605,11 @@ static void memTracePrint(Mem *p){
     sqlite3VdbeMemPrettyPrint(p, &acc);
     printf(" %s", sqlite3StrAccumFinish(&acc));
   }
-  if( p->flags & MEM_Subtype ) printf(" subtype=0x%02x", p->eSubtype);
+  if( (p->flags & MEM_Subtype)!=0
+   && (p->eSubtype!=0 || (p->flags & MEM_Null)==0)
+  ){
+    printf(" subtype=0x%02x", p->eSubtype);
+  }
 }
 static void registerTrace(int iReg, Mem *p){
   printf("R[%d] = ", iReg);
@@ -1476,8 +1484,7 @@ case OP_String: {          /* out2 */
 ** If the P1 value can be SQLITE_NULL_CLEARED to create a NULL value that 
 ** will not compare equal even if SQLITE_NULLEQ is set on OP_Ne or OP_Eq.
 ** In other words, SQLITE_NULL_CLEARED creates a NULL that never compares
-** equal to any other NULL.  Or P1 can be SQLITE_NULL_DEFAULT to indicate
-** that the NULL value started as a DEFAULT keyword.
+** equal to any other NULL.
 */
 case OP_BeginSubrtn:
 case OP_Null: {           /* out2 */
@@ -1486,9 +1493,8 @@ case OP_Null: {           /* out2 */
   pOut = out2Prerelease(p, pOp);
   cnt = pOp->p3-pOp->p2;
   assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
-  assert( pOp->p1==0 || pOp->p1==MEM_Cleared || pOp->p1==MEM_Zero );
+  assert( pOp->p1==0 || pOp->p1==MEM_Cleared );
   assert( SQLITE_NULL_CLEARED==MEM_Cleared );
-  assert( SQLITE_NULL_DEFAULT==MEM_Zero );
   pOut->flags = nullFlag = pOp->p1 | MEM_Null;
   pOut->n = 0;
 #ifdef SQLITE_DEBUG
@@ -1520,6 +1526,45 @@ case OP_SoftNull: {
   break;
 }
 
+/* Opcode: DfltNull P1 * * * *
+** Synopsis: r[P1]=DEFAULT-NULL
+**
+** Set register P1 to have the value NULL that has a special pointer
+** value to indicate that it originated as a DEFAULT keyword in a VALUES
+** clause.
+*/
+case OP_DfltNull: {
+  assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );
+  pOut = &aMem[pOp->p1];
+  memAboutToChange(p, pOut);
+  sqlite3VdbeMemSetNull(pOut);
+  pOut->flags = MEM_Null|MEM_Term|MEM_Subtype;
+  pOut->eSubtype = 0;
+  break;
+}
+
+/* Opcode: ToDefault P1 * * P4 *
+** Synopsis: if r[P1]==DEFAULT then r[P1]=P4
+**
+** If register P1 contains the special NULL value created by the
+** OP_DfltNull opcode that indicates that it originated from the
+** DEFAULT keyword in a VALUES clause, then change its value to
+** the value in P4.
+*/
+case OP_ToDefault: {            /* in1 */
+  assert( pOp->p4type==P4_MEM );
+  pIn1 = &aMem[pOp->p1];
+  if( pIn1->flags==(MEM_Null|MEM_Term|MEM_Subtype)
+   && pIn1->eSubtype==0
+  ){
+    memAboutToChange(p, pIn1);
+    sqlite3VdbeMemShallowCopy(pIn1, pOp->p4.pMem, MEM_Static);
+    UPDATE_MAX_BLOBSIZE(pIn1);
+    REGISTER_TRACE(pOp->p1, pIn1);
+  }
+  break;
+}
+
 /* Opcode: Blob P1 P2 * P4 *
 ** Synopsis: r[P2]=P4 (len=P1)
 **
@@ -2854,25 +2899,6 @@ case OP_NotNull: {            /* same as TK_NOTNULL, jump, in1 */
   break;
 }
 
-/* Opcode: ToDefault P1 * * P4 *
-** Synopsis: if r[P1]==DEFAULT then r[P1]=P4
-**
-** If register P1 contains the special NULL value that indicates
-** that it originated from the DEFAULT keyword in a VALUES clause,
-** then change its value to the value in P4.
-*/
-case OP_ToDefault: {            /* in1 */
-  assert( pOp->p4type==P4_MEM );
-  pIn1 = &aMem[pOp->p1];
-  if( (pIn1->flags & (MEM_Null|MEM_Zero))==(MEM_Null|MEM_Zero) ){
-    memAboutToChange(p, pIn1);
-    sqlite3VdbeMemShallowCopy(pIn1, pOp->p4.pMem, MEM_Static);
-    UPDATE_MAX_BLOBSIZE(pIn1);
-    REGISTER_TRACE(pOp->p1, pIn1);
-  }
-  break;
-}
-
 /* Opcode: IfNullRow P1 P2 P3 * *
 ** Synopsis: if P1.nullRow then r[P3]=NULL, goto P2
 **
index 28b3e7335e4a5d63bc4a465fbccf38e0bfbf710b..ed455f7fea83c0519b731b4fd2b0d36cb903efec 100644 (file)
@@ -191,7 +191,6 @@ typedef struct VdbeOpList VdbeOpList;
 /*
 ** Allowed P1 arguments to OP_Null for special kinds of NULLs.
 */
-#define SQLITE_NULL_DEFAULT  0x0400   /* NULL is really the DEFAULT keyword */
 #define SQLITE_NULL_CLEARED  0x0100   /* NULL always <> to other NULLs */
 
 /*