From 60585ddc7db958bddd6970d29a0a1d8649dbf771 Mon Sep 17 00:00:00 2001 From: danielk1977 Date: Thu, 3 Jan 2008 08:08:40 +0000 Subject: [PATCH] Combine the OP_Column and OP_DfltValue opcodes. (CVS 4664) FossilOrigin-Name: c30f8206353f32a08ef0b323c9fd0bdbeaa28b02 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/update.c | 3 +-- src/vdbe.c | 22 ++++------------------ 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/manifest b/manifest index 6064158bf8..895dec7f08 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sOP_OpenRead\sand\sOP_OpenWrite\sso\sthat\sthe\sdatabase\snumber\sis\sread\sfrom\sthe\sP3\soperand,\snot\sthe\sstack.\s(CVS\s4663) -D 2008-01-03T07:54:24 +C Combine\sthe\sOP_Column\sand\sOP_DfltValue\sopcodes.\s(CVS\s4664) +D 2008-01-03T08:08:40 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -164,11 +164,11 @@ F src/test_tclvar.c b2d1115e4d489179d3f029e765211b2ad527ba59 F src/test_thread.c e297dd41db0b249646e69f97d36ec13e56e8b730 F src/tokenize.c a4e04438c11fed2c67ec47fe3edbef9cca2d1b48 F src/trigger.c e7642cf61056655905aaba8db1ca51d299a1003b -F src/update.c c67129529717f420f2955d735e04bb4d28aa2e7b +F src/update.c 587df2777e78a47d2c4399059cdd7a2cea5e0b19 F src/utf.c ef4b7d83bae533b76c3e1bf635b113fdad86a736 F src/util.c 05f31144bbd3f1a24f4139ae029c42545cb72624 F src/vacuum.c 3f34f278809bf3eb0b62ec46ff779e9c385b28f0 -F src/vdbe.c 847acbfd9d55a59725fb02c004af8158a9cd09a0 +F src/vdbe.c 429493ced32e5bb3d17fabd4f893374ebe5ffdf2 F src/vdbe.h ad5fd7aa694928e54efa84ac8f8133b77053c97d F src/vdbeInt.h 2985f1369273e635898cf5952237efcb3fdb21f3 F src/vdbeapi.c bf615ff2cf2b121f1609cbadd4f52720289733b5 @@ -603,7 +603,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P b166c33a7b9a58d571619d2248019eda09651dd2 -R 8be529e6a54294a6d1844c01bcfcfc53 +P 35da261daf602b1e938f05bbad1ff99213d9f4b9 +R 20b90fa8179664d61eeec8c990a7aa2a U danielk1977 -Z d1a83a5d28422a97fb0c22148135704a +Z 86771e92c9dc1d8cb50d685596a6b3c2 diff --git a/manifest.uuid b/manifest.uuid index 62003a4aeb..5819fbe41e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -35da261daf602b1e938f05bbad1ff99213d9f4b9 \ No newline at end of file +c30f8206353f32a08ef0b323c9fd0bdbeaa28b02 \ No newline at end of file diff --git a/src/update.c b/src/update.c index 5791e52ad1..3146a1d839 100644 --- a/src/update.c +++ b/src/update.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** -** $Id: update.c,v 1.150 2008/01/03 07:54:24 danielk1977 Exp $ +** $Id: update.c,v 1.151 2008/01/03 08:08:40 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -64,7 +64,6 @@ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc, pCol->affinity, &pValue); if( pValue ){ - sqlite3VdbeAddOp2(v, OP_DfltValue, 0, 0); sqlite3VdbeChangeP4(v, -1, (const char *)pValue, P4_MEM); } } diff --git a/src/vdbe.c b/src/vdbe.c index c94bf4ab11..8320a76578 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.666 2008/01/03 07:54:24 danielk1977 Exp $ +** $Id: vdbe.c,v 1.667 2008/01/03 08:08:40 danielk1977 Exp $ */ #include "sqliteInt.h" #include @@ -2028,7 +2028,7 @@ case OP_SetNumColumns: { /* no-push */ break; } -/* Opcode: Column P1 P2 P3 * +/* Opcode: Column P1 P2 P3 P4 * ** ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional @@ -2259,9 +2259,8 @@ case OP_Column: { sqlite3VdbeSerialGet((u8*)zData, aType[p2], pDest); pDest->enc = encoding; }else{ - if( pOp[1].opcode==OP_DfltValue ){ - assert( pOp[1].p4type==P4_MEM ); - sqlite3VdbeMemShallowCopy(pDest, (Mem *)(pOp[1].p4.p), MEM_Static); + if( pOp->p4type==P4_MEM ){ + sqlite3VdbeMemShallowCopy(pDest, (Mem *)(pOp->p4.p), MEM_Static); }else{ assert( pDest->flags==MEM_Null ); } @@ -2286,22 +2285,9 @@ case OP_Column: { rc = sqlite3VdbeMemMakeWriteable(pDest); op_column_out: - if( pOp[1].opcode==OP_DfltValue ){ - pc++; - } break; } -/* Opcode: DfltValue * * P4 -** -** This instruction always follows an OP_Column. This instruction -** does nothing by itself. It is just a place holder for the default -** value for the previous OP_Column instruction. -*/ -case OP_DfltValue: { /* no-push */ - assert( 0 ); -} - /* Opcode: MakeRecord P1 P2 P4 ** ** Convert the top abs(P1) entries of the stack into a single entry -- 2.47.3