Fossil SCM

Update to the latest SQLite. Add a Rebuild button on the Shun webpage. Add the test-detach CLI method.

drh 2008-11-10 00:40 trunk
Commit 3f6edbc779e7b604164a1f5ea6efebdd3af31d7d
--- src/rebuild.c
+++ src/rebuild.c
@@ -285,5 +285,26 @@
285285
db_end_transaction(1);
286286
}else{
287287
db_end_transaction(0);
288288
}
289289
}
290
+
291
+/*
292
+** COMMAND: test-detach
293
+**
294
+** Change the project-code and make other changes in order to prevent
295
+** the repository from ever again pushing or pulling to other
296
+** repositories. Used to create a "test" repository for development
297
+** testing by cloning a working project repository.
298
+*/
299
+void test_detach_cmd(void){
300
+ db_find_and_open_repository(1);
301
+ db_begin_transaction();
302
+ db_multi_exec(
303
+ "DELETE FROM config WHERE name='last-sync-url';"
304
+ "UPDATE config SET value=lower(hex(randomblob(20)))"
305
+ " WHERE name='project-code';"
306
+ "UPDATE config SET value='detached-' || value"
307
+ " WHERE name='project-name' AND value NOT GLOB 'detached-*';"
308
+ );
309
+ db_end_transaction(0);
310
+}
290311
--- src/rebuild.c
+++ src/rebuild.c
@@ -285,5 +285,26 @@
285 db_end_transaction(1);
286 }else{
287 db_end_transaction(0);
288 }
289 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
--- src/rebuild.c
+++ src/rebuild.c
@@ -285,5 +285,26 @@
285 db_end_transaction(1);
286 }else{
287 db_end_transaction(0);
288 }
289 }
290
291 /*
292 ** COMMAND: test-detach
293 **
294 ** Change the project-code and make other changes in order to prevent
295 ** the repository from ever again pushing or pulling to other
296 ** repositories. Used to create a "test" repository for development
297 ** testing by cloning a working project repository.
298 */
299 void test_detach_cmd(void){
300 db_find_and_open_repository(1);
301 db_begin_transaction();
302 db_multi_exec(
303 "DELETE FROM config WHERE name='last-sync-url';"
304 "UPDATE config SET value=lower(hex(randomblob(20)))"
305 " WHERE name='project-code';"
306 "UPDATE config SET value='detached-' || value"
307 " WHERE name='project-name' AND value NOT GLOB 'detached-*';"
308 );
309 db_end_transaction(0);
310 }
311
+16
--- src/shun.c
+++ src/shun.c
@@ -53,10 +53,15 @@
5353
5454
login_check_credentials();
5555
if( !g.okAdmin ){
5656
login_needed();
5757
}
58
+ if( P("rebuild") ){
59
+ db_begin_transaction();
60
+ rebuild_db(0,0);
61
+ db_end_transaction(0);
62
+ }
5863
if( zUuid ){
5964
nUuid = strlen(zUuid);
6065
if( nUuid!=40 || !validate16(zUuid, nUuid) ){
6166
zUuid = 0;
6267
}else{
@@ -145,10 +150,21 @@
145150
login_insert_csrf_secret();
146151
@ <input type="text" name="uuid" size="50">
147152
@ <input type="submit" name="sub" value="Accept">
148153
@ </form>
149154
@ </blockquote>
155
+ @
156
+ @ <p>Press the button below to rebuild the respository. The rebuild
157
+ @ may take several seconds, so be patient after pressing the button.</p>
158
+ @
159
+ @ <blockquote>
160
+ @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
161
+ login_insert_csrf_secret();
162
+ @ <input type="submit" name="rebuild" value="Rebuild">
163
+ @ </form>
164
+ @ </blockquote>
165
+ @
150166
style_footer();
151167
}
152168
153169
/*
154170
** Remove from the BLOB table all artifacts that are in the SHUN table.
155171
--- src/shun.c
+++ src/shun.c
@@ -53,10 +53,15 @@
53
54 login_check_credentials();
55 if( !g.okAdmin ){
56 login_needed();
57 }
 
 
 
 
 
58 if( zUuid ){
59 nUuid = strlen(zUuid);
60 if( nUuid!=40 || !validate16(zUuid, nUuid) ){
61 zUuid = 0;
62 }else{
@@ -145,10 +150,21 @@
145 login_insert_csrf_secret();
146 @ <input type="text" name="uuid" size="50">
147 @ <input type="submit" name="sub" value="Accept">
148 @ </form>
149 @ </blockquote>
 
 
 
 
 
 
 
 
 
 
 
150 style_footer();
151 }
152
153 /*
154 ** Remove from the BLOB table all artifacts that are in the SHUN table.
155
--- src/shun.c
+++ src/shun.c
@@ -53,10 +53,15 @@
53
54 login_check_credentials();
55 if( !g.okAdmin ){
56 login_needed();
57 }
58 if( P("rebuild") ){
59 db_begin_transaction();
60 rebuild_db(0,0);
61 db_end_transaction(0);
62 }
63 if( zUuid ){
64 nUuid = strlen(zUuid);
65 if( nUuid!=40 || !validate16(zUuid, nUuid) ){
66 zUuid = 0;
67 }else{
@@ -145,10 +150,21 @@
150 login_insert_csrf_secret();
151 @ <input type="text" name="uuid" size="50">
152 @ <input type="submit" name="sub" value="Accept">
153 @ </form>
154 @ </blockquote>
155 @
156 @ <p>Press the button below to rebuild the respository. The rebuild
157 @ may take several seconds, so be patient after pressing the button.</p>
158 @
159 @ <blockquote>
160 @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
161 login_insert_csrf_secret();
162 @ <input type="submit" name="rebuild" value="Rebuild">
163 @ </form>
164 @ </blockquote>
165 @
166 style_footer();
167 }
168
169 /*
170 ** Remove from the BLOB table all artifacts that are in the SHUN table.
171
+869 -807
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -9,17 +9,17 @@
99
**
1010
** This file is all you need to compile SQLite. To use SQLite in other
1111
** programs, you need this file and the "sqlite3.h" header file that defines
1212
** the programming interface to the SQLite library. (If you do not have
1313
** the "sqlite3.h" header file at hand, you will find a copy in the first
14
-** 6542 lines past this header comment.) Additional code files may be
14
+** 6569 lines past this header comment.) Additional code files may be
1515
** needed if you want a wrapper to interface SQLite with your choice of
1616
** programming language. The code for the "sqlite3" command-line shell
1717
** is also in a separate file. This file contains only code for the core
1818
** SQLite library.
1919
**
20
-** This amalgamation was generated on 2008-11-01 20:35:33 UTC.
20
+** This amalgamation was generated on 2008-11-10 00:14:36 UTC.
2121
*/
2222
#define SQLITE_CORE 1
2323
#define SQLITE_AMALGAMATION 1
2424
#ifndef SQLITE_PRIVATE
2525
# define SQLITE_PRIVATE static
@@ -39,11 +39,11 @@
3939
** May you share freely, never taking more than you give.
4040
**
4141
*************************************************************************
4242
** Internal interface definitions for SQLite.
4343
**
44
-** @(#) $Id: sqliteInt.h,v 1.787 2008/10/28 18:58:20 drh Exp $
44
+** @(#) $Id: sqliteInt.h,v 1.788 2008/11/05 16:37:35 drh Exp $
4545
*/
4646
#ifndef _SQLITEINT_H_
4747
#define _SQLITEINT_H_
4848
4949
/*
@@ -485,11 +485,11 @@
485485
** The name of this file under configuration management is "sqlite.h.in".
486486
** The makefile makes some minor changes to this file (such as inserting
487487
** the version number) and changes its name to "sqlite3.h" as
488488
** part of the build process.
489489
**
490
-** @(#) $Id: sqlite.h.in,v 1.406 2008/10/30 15:03:16 drh Exp $
490
+** @(#) $Id: sqlite.h.in,v 1.409 2008/11/07 00:06:18 drh Exp $
491491
*/
492492
#ifndef _SQLITE3_H_
493493
#define _SQLITE3_H_
494494
#include <stdarg.h> /* Needed for the definition of va_list */
495495
@@ -1137,10 +1137,16 @@
11371137
** that when data is appended to a file, the data is appended
11381138
** first then the size of the file is extended, never the other
11391139
** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
11401140
** information is written to disk in the same order as calls
11411141
** to xWrite().
1142
+**
1143
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
1144
+** in the unread portions of the buffer with zeros. A VFS that
1145
+** fails to zero-fill short reads might seem to work. However,
1146
+** failure to zero-fill short reads will eventually lead to
1147
+** database corruption.
11421148
*/
11431149
typedef struct sqlite3_io_methods sqlite3_io_methods;
11441150
struct sqlite3_io_methods {
11451151
int iVersion;
11461152
int (*xClose)(sqlite3_file*);
@@ -3126,10 +3132,20 @@
31263132
** text that describes the error, as either UTF-8 or UTF-16 respectively.
31273133
** Memory to hold the error message string is managed internally.
31283134
** The application does not need to worry about freeing the result.
31293135
** However, the error string might be overwritten or deallocated by
31303136
** subsequent calls to other SQLite interface functions.
3137
+**
3138
+** When the serialized [threading mode] is in use, it might be the
3139
+** case that a second error occurs on a separate thread in between
3140
+** the time of the first error and the call to these interfaces.
3141
+** When that happens, the second error will be reported since these
3142
+** interfaces always report the most recent result. To avoid
3143
+** this, each thread can obtain exclusive use of the [database connection] D
3144
+** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
3145
+** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
3146
+** all calls to the interfaces listed here are completed.
31313147
**
31323148
** If an interface fails with SQLITE_MISUSE, that means the interface
31333149
** was invoked incorrectly by the application. In that case, the
31343150
** error code and message may or may not be set.
31353151
**
@@ -6714,10 +6730,21 @@
67146730
#define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
67156731
#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
67166732
#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
67176733
#define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
67186734
6735
+/*
6736
+** CAPI3REF: Retrieve the mutex for a database connection {H17002} <H17000>
6737
+**
6738
+** This interface returns a pointer the [sqlite3_mutex] object that
6739
+** serializes access to the [database connection] given in the argument
6740
+** when the [threading mode] is Serialized.
6741
+** If the [threading mode] is Single-thread or Multi-thread then this
6742
+** routine returns a NULL pointer.
6743
+*/
6744
+SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6745
+
67196746
/*
67206747
** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
67216748
**
67226749
** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
67236750
** xFileControl method for the [sqlite3_io_methods] object associated
@@ -7909,145 +7936,145 @@
79097936
*/
79107937
/************** Include opcodes.h in the middle of vdbe.h ********************/
79117938
/************** Begin file opcodes.h *****************************************/
79127939
/* Automatically generated. Do not edit */
79137940
/* See the mkopcodeh.awk script for details */
7914
-#define OP_ReadCookie 1
7915
-#define OP_AutoCommit 2
7916
-#define OP_Found 3
7917
-#define OP_NullRow 4
7918
-#define OP_Lt 71 /* same as TK_LT */
7919
-#define OP_MoveLe 5
7920
-#define OP_Variable 6
7921
-#define OP_RealAffinity 7
7922
-#define OP_Sort 8
7923
-#define OP_Affinity 9
7924
-#define OP_IfNot 10
7925
-#define OP_Gosub 11
7926
-#define OP_Add 78 /* same as TK_PLUS */
7927
-#define OP_NotFound 12
7928
-#define OP_ResultRow 13
7929
-#define OP_IsNull 65 /* same as TK_ISNULL */
7930
-#define OP_MoveLt 14
7931
-#define OP_Rowid 15
7932
-#define OP_CreateIndex 17
7933
-#define OP_Explain 18
7934
-#define OP_Statement 19
7935
-#define OP_DropIndex 20
7936
-#define OP_Null 21
7941
+#define OP_VNext 1
7942
+#define OP_Affinity 2
7943
+#define OP_Column 3
7944
+#define OP_SetCookie 4
7945
+#define OP_Real 126 /* same as TK_FLOAT */
7946
+#define OP_Sequence 5
7947
+#define OP_MoveGt 6
7948
+#define OP_Ge 72 /* same as TK_GE */
7949
+#define OP_RowKey 7
7950
+#define OP_SCopy 8
7951
+#define OP_Eq 68 /* same as TK_EQ */
7952
+#define OP_OpenWrite 9
7953
+#define OP_NotNull 66 /* same as TK_NOTNULL */
7954
+#define OP_If 10
79377955
#define OP_ToInt 142 /* same as TK_TO_INT */
7938
-#define OP_Int64 22
7939
-#define OP_LoadAnalysis 23
7940
-#define OP_IdxInsert 24
7941
-#define OP_VUpdate 25
7942
-#define OP_Next 26
7943
-#define OP_SetNumColumns 27
7944
-#define OP_ToNumeric 141 /* same as TK_TO_NUMERIC*/
7945
-#define OP_Ge 72 /* same as TK_GE */
7946
-#define OP_BitNot 87 /* same as TK_BITNOT */
7947
-#define OP_Rewind 28
7956
+#define OP_String8 88 /* same as TK_STRING */
7957
+#define OP_VRowid 11
7958
+#define OP_CollSeq 12
7959
+#define OP_OpenRead 13
7960
+#define OP_Expire 14
7961
+#define OP_AutoCommit 15
7962
+#define OP_Gt 69 /* same as TK_GT */
7963
+#define OP_Pagecount 17
7964
+#define OP_IntegrityCk 18
7965
+#define OP_Sort 19
7966
+#define OP_Copy 20
7967
+#define OP_Trace 21
7968
+#define OP_Function 22
7969
+#define OP_IfNeg 23
7970
+#define OP_And 61 /* same as TK_AND */
7971
+#define OP_Subtract 79 /* same as TK_MINUS */
7972
+#define OP_Noop 24
7973
+#define OP_Return 25
7974
+#define OP_Remainder 82 /* same as TK_REM */
7975
+#define OP_NewRowid 26
79487976
#define OP_Multiply 80 /* same as TK_STAR */
7949
-#define OP_ToReal 143 /* same as TK_TO_REAL */
7950
-#define OP_Gt 69 /* same as TK_GT */
7951
-#define OP_Last 29
7952
-#define OP_MustBeInt 30
7953
-#define OP_Ne 67 /* same as TK_NE */
7954
-#define OP_MoveGe 31
7955
-#define OP_IncrVacuum 32
7956
-#define OP_String 33
7957
-#define OP_VFilter 34
7958
-#define OP_ForceInt 35
7959
-#define OP_Close 36
7960
-#define OP_AggFinal 37
7961
-#define OP_RowData 38
7962
-#define OP_IdxRowid 39
7963
-#define OP_Pagecount 40
7964
-#define OP_BitOr 75 /* same as TK_BITOR */
7965
-#define OP_NotNull 66 /* same as TK_NOTNULL */
7966
-#define OP_MoveGt 41
7967
-#define OP_Not 16 /* same as TK_NOT */
7968
-#define OP_OpenPseudo 42
7969
-#define OP_Halt 43
7970
-#define OP_Compare 44
7971
-#define OP_NewRowid 45
7972
-#define OP_Real 126 /* same as TK_FLOAT */
7973
-#define OP_IdxLT 46
7974
-#define OP_MemMax 47
7975
-#define OP_Function 48
7976
-#define OP_IntegrityCk 49
7977
-#define OP_Remainder 82 /* same as TK_REM */
7978
-#define OP_SCopy 50
7979
-#define OP_ShiftLeft 76 /* same as TK_LSHIFT */
7980
-#define OP_IfNeg 51
7981
-#define OP_FifoWrite 52
7977
+#define OP_Variable 27
7978
+#define OP_String 28
7979
+#define OP_RealAffinity 29
7980
+#define OP_VRename 30
7981
+#define OP_ParseSchema 31
7982
+#define OP_VOpen 32
7983
+#define OP_Close 33
7984
+#define OP_CreateIndex 34
7985
+#define OP_IsUnique 35
7986
+#define OP_NotFound 36
7987
+#define OP_Int64 37
7988
+#define OP_MustBeInt 38
7989
+#define OP_Halt 39
7990
+#define OP_Rowid 40
7991
+#define OP_IdxLT 41
7992
+#define OP_AddImm 42
7993
+#define OP_Statement 43
7994
+#define OP_RowData 44
7995
+#define OP_MemMax 45
7996
+#define OP_Or 60 /* same as TK_OR */
7997
+#define OP_NotExists 46
7998
+#define OP_Gosub 47
7999
+#define OP_Divide 81 /* same as TK_SLASH */
8000
+#define OP_Integer 48
8001
+#define OP_ToNumeric 141 /* same as TK_TO_NUMERIC*/
8002
+#define OP_Prev 49
8003
+#define OP_Concat 83 /* same as TK_CONCAT */
79828004
#define OP_BitAnd 74 /* same as TK_BITAND */
7983
-#define OP_Or 60 /* same as TK_OR */
7984
-#define OP_NotExists 53
7985
-#define OP_VDestroy 54
7986
-#define OP_IdxDelete 55
7987
-#define OP_Vacuum 56
7988
-#define OP_Copy 57
7989
-#define OP_If 58
7990
-#define OP_Jump 59
7991
-#define OP_Destroy 62
7992
-#define OP_AggStep 63
7993
-#define OP_Insert 64
7994
-#define OP_Clear 73
7995
-#define OP_Permutation 84
7996
-#define OP_VBegin 85
7997
-#define OP_OpenEphemeral 86
7998
-#define OP_IdxGE 89
7999
-#define OP_Trace 90
8000
-#define OP_Divide 81 /* same as TK_SLASH */
8001
-#define OP_String8 88 /* same as TK_STRING */
8002
-#define OP_Concat 83 /* same as TK_CONCAT */
8003
-#define OP_VRowid 91
8004
-#define OP_MakeRecord 92
8005
-#define OP_Yield 93
8006
-#define OP_SetCookie 94
8007
-#define OP_Prev 95
8008
-#define OP_ContextPush 96
8009
-#define OP_DropTrigger 97
8010
-#define OP_And 61 /* same as TK_AND */
8011
-#define OP_VColumn 98
8012
-#define OP_Return 99
8013
-#define OP_OpenWrite 100
8014
-#define OP_Integer 101
8005
+#define OP_VColumn 50
8006
+#define OP_CreateTable 51
8007
+#define OP_Last 52
8008
+#define OP_IsNull 65 /* same as TK_ISNULL */
8009
+#define OP_IncrVacuum 53
8010
+#define OP_IdxRowid 54
8011
+#define OP_ShiftRight 77 /* same as TK_RSHIFT */
8012
+#define OP_ResetCount 55
8013
+#define OP_FifoWrite 56
8014
+#define OP_ContextPush 57
8015
+#define OP_Yield 58
8016
+#define OP_DropTrigger 59
8017
+#define OP_DropIndex 62
8018
+#define OP_IdxGE 63
8019
+#define OP_IdxDelete 64
8020
+#define OP_Vacuum 73
8021
+#define OP_MoveLe 84
8022
+#define OP_IfNot 85
8023
+#define OP_DropTable 86
8024
+#define OP_MakeRecord 89
8025
+#define OP_ToBlob 140 /* same as TK_TO_BLOB */
8026
+#define OP_ResultRow 90
8027
+#define OP_Delete 91
8028
+#define OP_AggFinal 92
8029
+#define OP_Compare 93
8030
+#define OP_ShiftLeft 76 /* same as TK_LSHIFT */
8031
+#define OP_Goto 94
8032
+#define OP_TableLock 95
8033
+#define OP_FifoRead 96
8034
+#define OP_Clear 97
8035
+#define OP_MoveLt 98
8036
+#define OP_Le 70 /* same as TK_LE */
8037
+#define OP_VerifyCookie 99
8038
+#define OP_AggStep 100
8039
+#define OP_ToText 139 /* same as TK_TO_TEXT */
8040
+#define OP_Not 16 /* same as TK_NOT */
8041
+#define OP_ToReal 143 /* same as TK_TO_REAL */
8042
+#define OP_SetNumColumns 101
80158043
#define OP_Transaction 102
8016
-#define OP_IfPos 103
8017
-#define OP_CollSeq 104
8018
-#define OP_VRename 105
8019
-#define OP_ToBlob 140 /* same as TK_TO_BLOB */
8020
-#define OP_Sequence 106
8021
-#define OP_ContextPop 107
8022
-#define OP_ShiftRight 77 /* same as TK_RSHIFT */
8023
-#define OP_VCreate 108
8024
-#define OP_CreateTable 109
8025
-#define OP_AddImm 110
8026
-#define OP_ToText 139 /* same as TK_TO_TEXT */
8027
-#define OP_DropTable 111
8028
-#define OP_IsUnique 112
8029
-#define OP_VOpen 113
8030
-#define OP_IfZero 114
8031
-#define OP_Noop 115
8032
-#define OP_RowKey 116
8033
-#define OP_Expire 117
8034
-#define OP_FifoRead 118
8035
-#define OP_Delete 119
8036
-#define OP_Subtract 79 /* same as TK_MINUS */
8037
-#define OP_Blob 120
8038
-#define OP_Move 121
8039
-#define OP_Goto 122
8040
-#define OP_ParseSchema 123
8041
-#define OP_Eq 68 /* same as TK_EQ */
8042
-#define OP_VNext 124
8043
-#define OP_Le 70 /* same as TK_LE */
8044
-#define OP_TableLock 125
8045
-#define OP_VerifyCookie 127
8046
-#define OP_Column 128
8047
-#define OP_OpenRead 129
8048
-#define OP_ResetCount 130
8044
+#define OP_VFilter 103
8045
+#define OP_Ne 67 /* same as TK_NE */
8046
+#define OP_VDestroy 104
8047
+#define OP_ContextPop 105
8048
+#define OP_BitOr 75 /* same as TK_BITOR */
8049
+#define OP_Next 106
8050
+#define OP_IdxInsert 107
8051
+#define OP_Lt 71 /* same as TK_LT */
8052
+#define OP_Insert 108
8053
+#define OP_Destroy 109
8054
+#define OP_ReadCookie 110
8055
+#define OP_ForceInt 111
8056
+#define OP_LoadAnalysis 112
8057
+#define OP_Explain 113
8058
+#define OP_OpenPseudo 114
8059
+#define OP_OpenEphemeral 115
8060
+#define OP_Null 116
8061
+#define OP_Move 117
8062
+#define OP_Blob 118
8063
+#define OP_Add 78 /* same as TK_PLUS */
8064
+#define OP_Rewind 119
8065
+#define OP_MoveGe 120
8066
+#define OP_VBegin 121
8067
+#define OP_VUpdate 122
8068
+#define OP_IfZero 123
8069
+#define OP_BitNot 87 /* same as TK_BITNOT */
8070
+#define OP_VCreate 124
8071
+#define OP_Found 125
8072
+#define OP_IfPos 127
8073
+#define OP_NullRow 128
8074
+#define OP_Jump 129
8075
+#define OP_Permutation 130
80498076
80508077
/* The following opcode values are never used */
80518078
#define OP_NotUsed_131 131
80528079
#define OP_NotUsed_132 132
80538080
#define OP_NotUsed_133 133
@@ -8067,27 +8094,27 @@
80678094
#define OPFLG_IN1 0x0004 /* in1: P1 is an input */
80688095
#define OPFLG_IN2 0x0008 /* in2: P2 is an input */
80698096
#define OPFLG_IN3 0x0010 /* in3: P3 is an input */
80708097
#define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
80718098
#define OPFLG_INITIALIZER {\
8072
-/* 0 */ 0x00, 0x02, 0x00, 0x11, 0x00, 0x11, 0x02, 0x04,\
8073
-/* 8 */ 0x01, 0x00, 0x05, 0x01, 0x11, 0x00, 0x11, 0x02,\
8074
-/* 16 */ 0x04, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00,\
8075
-/* 24 */ 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x05, 0x11,\
8076
-/* 32 */ 0x01, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, 0x02,\
8077
-/* 40 */ 0x02, 0x11, 0x00, 0x00, 0x00, 0x02, 0x11, 0x0c,\
8078
-/* 48 */ 0x00, 0x00, 0x00, 0x05, 0x04, 0x11, 0x00, 0x00,\
8079
-/* 56 */ 0x00, 0x00, 0x05, 0x01, 0x2c, 0x2c, 0x02, 0x00,\
8099
+/* 0 */ 0x00, 0x01, 0x00, 0x00, 0x10, 0x02, 0x11, 0x00,\
8100
+/* 8 */ 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00,\
8101
+/* 16 */ 0x04, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05,\
8102
+/* 24 */ 0x00, 0x04, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00,\
8103
+/* 32 */ 0x00, 0x00, 0x02, 0x11, 0x11, 0x02, 0x05, 0x00,\
8104
+/* 40 */ 0x02, 0x11, 0x04, 0x00, 0x00, 0x0c, 0x11, 0x01,\
8105
+/* 48 */ 0x02, 0x01, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8106
+/* 56 */ 0x04, 0x00, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x11,\
80808107
/* 64 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
80818108
/* 72 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
8082
-/* 80 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x00, 0x00, 0x00, 0x04,\
8083
-/* 88 */ 0x02, 0x11, 0x00, 0x02, 0x00, 0x00, 0x10, 0x01,\
8084
-/* 96 */ 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x05,\
8085
-/* 104 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x04, 0x00,\
8086
-/* 112 */ 0x11, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,\
8087
-/* 120 */ 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00,\
8088
-/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8109
+/* 80 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x11, 0x05, 0x00, 0x04,\
8110
+/* 88 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,\
8111
+/* 96 */ 0x01, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01,\
8112
+/* 104 */ 0x00, 0x00, 0x01, 0x08, 0x00, 0x02, 0x02, 0x05,\
8113
+/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01,\
8114
+/* 120 */ 0x11, 0x00, 0x00, 0x05, 0x00, 0x11, 0x02, 0x05,\
8115
+/* 128 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
80898116
/* 136 */ 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04,\
80908117
}
80918118
80928119
/************** End of opcodes.h *********************************************/
80938120
/************** Continuing where we left off in vdbe.h ***********************/
@@ -9004,10 +9031,11 @@
90049031
} init;
90059032
int nExtension; /* Number of loaded extensions */
90069033
void **aExtension; /* Array of shared libraray handles */
90079034
struct Vdbe *pVdbe; /* List of active virtual machines */
90089035
int activeVdbeCnt; /* Number of vdbes currently executing */
9036
+ int writeVdbeCnt; /* Number of active VDBEs that are writing */
90099037
void (*xTrace)(void*,const char*); /* Trace function */
90109038
void *pTraceArg; /* Argument to the trace function */
90119039
void (*xProfile)(void*,const char*,u64); /* Profiling function */
90129040
void *pProfileArg; /* Argument to profile function */
90139041
void *pCommitArg; /* Argument to xCommitCallback() */
@@ -17401,11 +17429,11 @@
1740117429
**
1740217430
*************************************************************************
1740317431
** This file contains routines used to translate between UTF-8,
1740417432
** UTF-16, UTF-16BE, and UTF-16LE.
1740517433
**
17406
-** $Id: utf.c,v 1.65 2008/08/12 15:04:59 danielk1977 Exp $
17434
+** $Id: utf.c,v 1.66 2008/11/07 03:29:34 drh Exp $
1740717435
**
1740817436
** Notes on UTF-8:
1740917437
**
1741017438
** Byte-0 Byte-1 Byte-2 Byte-3 Value
1741117439
** 0xxxxxxx 00000000 00000000 0xxxxxxx
@@ -17443,11 +17471,11 @@
1744317471
** VDBE. This information used to all be at the top of the single
1744417472
** source code file "vdbe.c". When that file became too big (over
1744517473
** 6000 lines long) it was split up into several smaller files and
1744617474
** this header information was factored out.
1744717475
**
17448
-** $Id: vdbeInt.h,v 1.155 2008/10/07 23:46:38 drh Exp $
17476
+** $Id: vdbeInt.h,v 1.157 2008/11/05 16:37:35 drh Exp $
1744917477
*/
1745017478
#ifndef _VDBEINT_H_
1745117479
#define _VDBEINT_H_
1745217480
1745317481
/*
@@ -17478,16 +17506,16 @@
1747817506
** is currently pointing to.
1747917507
**
1748017508
** Every cursor that the virtual machine has open is represented by an
1748117509
** instance of the following structure.
1748217510
**
17483
-** If the Cursor.isTriggerRow flag is set it means that this cursor is
17511
+** If the VdbeCursor.isTriggerRow flag is set it means that this cursor is
1748417512
** really a single row that represents the NEW or OLD pseudo-table of
17485
-** a row trigger. The data for the row is stored in Cursor.pData and
17486
-** the rowid is in Cursor.iKey.
17513
+** a row trigger. The data for the row is stored in VdbeCursor.pData and
17514
+** the rowid is in VdbeCursor.iKey.
1748717515
*/
17488
-struct Cursor {
17516
+struct VdbeCursor {
1748917517
BtCursor *pCursor; /* The cursor structure of the backend */
1749017518
int iDb; /* Index of cursor database in db->aDb[] (or -1) */
1749117519
i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
1749217520
i64 nextRowid; /* Next rowid returned by OP_NewRowid */
1749317521
Bool zeroed; /* True if zeroed out and ready for reuse */
@@ -17521,14 +17549,14 @@
1752117549
int payloadSize; /* Total number of bytes in the record */
1752217550
u32 *aType; /* Type values for all entries in the record */
1752317551
u32 *aOffset; /* Cached offsets to the start of each columns data */
1752417552
u8 *aRow; /* Data for the current row, if all on one page */
1752517553
};
17526
-typedef struct Cursor Cursor;
17554
+typedef struct VdbeCursor VdbeCursor;
1752717555
1752817556
/*
17529
-** A value for Cursor.cacheValid that means the cache is always invalid.
17557
+** A value for VdbeCursor.cacheValid that means the cache is always invalid.
1753017558
*/
1753117559
#define CACHE_STALE 0
1753217560
1753317561
/*
1753417562
** Internally, the vdbe manipulates nearly all SQL values as Mem
@@ -17719,20 +17747,20 @@
1771917747
int nLabelAlloc; /* Number of slots allocated in aLabel[] */
1772017748
int *aLabel; /* Space to hold the labels */
1772117749
Mem **apArg; /* Arguments to currently executing user function */
1772217750
Mem *aColName; /* Column names to return */
1772317751
int nCursor; /* Number of slots in apCsr[] */
17724
- Cursor **apCsr; /* One element of this array for each open cursor */
17752
+ VdbeCursor **apCsr; /* One element of this array for each open cursor */
1772517753
int nVar; /* Number of entries in aVar[] */
1772617754
Mem *aVar; /* Values for the OP_Variable opcode. */
1772717755
char **azVar; /* Name of variables */
1772817756
int okVar; /* True if azVar[] has been initialized */
1772917757
int magic; /* Magic number for sanity checking */
1773017758
int nMem; /* Number of memory locations currently allocated */
1773117759
Mem *aMem; /* The memory locations */
1773217760
int nCallback; /* Number of callbacks invoked so far */
17733
- int cacheCtr; /* Cursor row cache generation counter */
17761
+ int cacheCtr; /* VdbeCursor row cache generation counter */
1773417762
Fifo sFifo; /* A list of ROWIDs */
1773517763
int contextStackTop; /* Index of top element in the context stack */
1773617764
int contextStackDepth; /* The size of the "context" stack */
1773717765
Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/
1773817766
int pc; /* The program counter */
@@ -17747,10 +17775,12 @@
1774717775
u8 explain; /* True if EXPLAIN present on SQL command */
1774817776
u8 changeCntOn; /* True to update the change-counter */
1774917777
u8 expired; /* True if the VM needs to be recompiled */
1775017778
u8 minWriteFileFormat; /* Minimum file format for writable database files */
1775117779
u8 inVtabMethod; /* See comments above */
17780
+ u8 usesStmtJournal; /* True if uses a statement journal */
17781
+ u8 readOnly; /* True for read-only statements */
1775217782
int nChange; /* Number of db changes made since last reset */
1775317783
i64 startTime; /* Time when query started - used for profiling */
1775417784
int btreeMask; /* Bitmask of db->aDb[] entries referenced */
1775517785
BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */
1775617786
int aCounter[2]; /* Counters used by sqlite3_stmt_status() */
@@ -17779,13 +17809,13 @@
1777917809
#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
1778017810
1778117811
/*
1778217812
** Function prototypes
1778317813
*/
17784
-SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
17814
+SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*);
1778517815
void sqliteVdbePopStack(Vdbe*,int);
17786
-SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor*);
17816
+SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor*);
1778717817
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
1778817818
SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*);
1778917819
#endif
1779017820
SQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32);
1779117821
SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
@@ -17792,11 +17822,11 @@
1779217822
SQLITE_PRIVATE int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
1779317823
SQLITE_PRIVATE int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
1779417824
SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
1779517825
1779617826
int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
17797
-SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(Cursor*,UnpackedRecord*,int*);
17827
+SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*);
1779817828
SQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
1779917829
SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
1780017830
SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
1780117831
SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
1780217832
SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
@@ -18040,11 +18070,11 @@
1804018070
if( rc!=SQLITE_OK ){
1804118071
assert( rc==SQLITE_NOMEM );
1804218072
return SQLITE_NOMEM;
1804318073
}
1804418074
zIn = (u8*)pMem->z;
18045
- zTerm = &zIn[pMem->n];
18075
+ zTerm = &zIn[pMem->n&~1];
1804618076
while( zIn<zTerm ){
1804718077
temp = *zIn;
1804818078
*zIn = *(zIn+1);
1804918079
zIn++;
1805018080
*zIn++ = temp;
@@ -18058,10 +18088,11 @@
1805818088
/* When converting from UTF-16, the maximum growth results from
1805918089
** translating a 2-byte character to a 4-byte UTF-8 character.
1806018090
** A single byte is required for the output string
1806118091
** nul-terminator.
1806218092
*/
18093
+ pMem->n &= ~1;
1806318094
len = pMem->n * 2 + 1;
1806418095
}else{
1806518096
/* When converting from UTF-8 to UTF-16 the maximum growth is caused
1806618097
** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
1806718098
** character. Two bytes are required in the output buffer for the
@@ -19606,83 +19637,83 @@
1960619637
/* Automatically generated. Do not edit */
1960719638
/* See the mkopcodec.awk script for details. */
1960819639
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
1960919640
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
1961019641
static const char *const azName[] = { "?",
19611
- /* 1 */ "ReadCookie",
19612
- /* 2 */ "AutoCommit",
19613
- /* 3 */ "Found",
19614
- /* 4 */ "NullRow",
19615
- /* 5 */ "MoveLe",
19616
- /* 6 */ "Variable",
19617
- /* 7 */ "RealAffinity",
19618
- /* 8 */ "Sort",
19619
- /* 9 */ "Affinity",
19620
- /* 10 */ "IfNot",
19621
- /* 11 */ "Gosub",
19622
- /* 12 */ "NotFound",
19623
- /* 13 */ "ResultRow",
19624
- /* 14 */ "MoveLt",
19625
- /* 15 */ "Rowid",
19642
+ /* 1 */ "VNext",
19643
+ /* 2 */ "Affinity",
19644
+ /* 3 */ "Column",
19645
+ /* 4 */ "SetCookie",
19646
+ /* 5 */ "Sequence",
19647
+ /* 6 */ "MoveGt",
19648
+ /* 7 */ "RowKey",
19649
+ /* 8 */ "SCopy",
19650
+ /* 9 */ "OpenWrite",
19651
+ /* 10 */ "If",
19652
+ /* 11 */ "VRowid",
19653
+ /* 12 */ "CollSeq",
19654
+ /* 13 */ "OpenRead",
19655
+ /* 14 */ "Expire",
19656
+ /* 15 */ "AutoCommit",
1962619657
/* 16 */ "Not",
19627
- /* 17 */ "CreateIndex",
19628
- /* 18 */ "Explain",
19629
- /* 19 */ "Statement",
19630
- /* 20 */ "DropIndex",
19631
- /* 21 */ "Null",
19632
- /* 22 */ "Int64",
19633
- /* 23 */ "LoadAnalysis",
19634
- /* 24 */ "IdxInsert",
19635
- /* 25 */ "VUpdate",
19636
- /* 26 */ "Next",
19637
- /* 27 */ "SetNumColumns",
19638
- /* 28 */ "Rewind",
19639
- /* 29 */ "Last",
19640
- /* 30 */ "MustBeInt",
19641
- /* 31 */ "MoveGe",
19642
- /* 32 */ "IncrVacuum",
19643
- /* 33 */ "String",
19644
- /* 34 */ "VFilter",
19645
- /* 35 */ "ForceInt",
19646
- /* 36 */ "Close",
19647
- /* 37 */ "AggFinal",
19648
- /* 38 */ "RowData",
19649
- /* 39 */ "IdxRowid",
19650
- /* 40 */ "Pagecount",
19651
- /* 41 */ "MoveGt",
19652
- /* 42 */ "OpenPseudo",
19653
- /* 43 */ "Halt",
19654
- /* 44 */ "Compare",
19655
- /* 45 */ "NewRowid",
19656
- /* 46 */ "IdxLT",
19657
- /* 47 */ "MemMax",
19658
- /* 48 */ "Function",
19659
- /* 49 */ "IntegrityCk",
19660
- /* 50 */ "SCopy",
19661
- /* 51 */ "IfNeg",
19662
- /* 52 */ "FifoWrite",
19663
- /* 53 */ "NotExists",
19664
- /* 54 */ "VDestroy",
19665
- /* 55 */ "IdxDelete",
19666
- /* 56 */ "Vacuum",
19667
- /* 57 */ "Copy",
19668
- /* 58 */ "If",
19669
- /* 59 */ "Jump",
19658
+ /* 17 */ "Pagecount",
19659
+ /* 18 */ "IntegrityCk",
19660
+ /* 19 */ "Sort",
19661
+ /* 20 */ "Copy",
19662
+ /* 21 */ "Trace",
19663
+ /* 22 */ "Function",
19664
+ /* 23 */ "IfNeg",
19665
+ /* 24 */ "Noop",
19666
+ /* 25 */ "Return",
19667
+ /* 26 */ "NewRowid",
19668
+ /* 27 */ "Variable",
19669
+ /* 28 */ "String",
19670
+ /* 29 */ "RealAffinity",
19671
+ /* 30 */ "VRename",
19672
+ /* 31 */ "ParseSchema",
19673
+ /* 32 */ "VOpen",
19674
+ /* 33 */ "Close",
19675
+ /* 34 */ "CreateIndex",
19676
+ /* 35 */ "IsUnique",
19677
+ /* 36 */ "NotFound",
19678
+ /* 37 */ "Int64",
19679
+ /* 38 */ "MustBeInt",
19680
+ /* 39 */ "Halt",
19681
+ /* 40 */ "Rowid",
19682
+ /* 41 */ "IdxLT",
19683
+ /* 42 */ "AddImm",
19684
+ /* 43 */ "Statement",
19685
+ /* 44 */ "RowData",
19686
+ /* 45 */ "MemMax",
19687
+ /* 46 */ "NotExists",
19688
+ /* 47 */ "Gosub",
19689
+ /* 48 */ "Integer",
19690
+ /* 49 */ "Prev",
19691
+ /* 50 */ "VColumn",
19692
+ /* 51 */ "CreateTable",
19693
+ /* 52 */ "Last",
19694
+ /* 53 */ "IncrVacuum",
19695
+ /* 54 */ "IdxRowid",
19696
+ /* 55 */ "ResetCount",
19697
+ /* 56 */ "FifoWrite",
19698
+ /* 57 */ "ContextPush",
19699
+ /* 58 */ "Yield",
19700
+ /* 59 */ "DropTrigger",
1967019701
/* 60 */ "Or",
1967119702
/* 61 */ "And",
19672
- /* 62 */ "Destroy",
19673
- /* 63 */ "AggStep",
19674
- /* 64 */ "Insert",
19703
+ /* 62 */ "DropIndex",
19704
+ /* 63 */ "IdxGE",
19705
+ /* 64 */ "IdxDelete",
1967519706
/* 65 */ "IsNull",
1967619707
/* 66 */ "NotNull",
1967719708
/* 67 */ "Ne",
1967819709
/* 68 */ "Eq",
1967919710
/* 69 */ "Gt",
1968019711
/* 70 */ "Le",
1968119712
/* 71 */ "Lt",
1968219713
/* 72 */ "Ge",
19683
- /* 73 */ "Clear",
19714
+ /* 73 */ "Vacuum",
1968419715
/* 74 */ "BitAnd",
1968519716
/* 75 */ "BitOr",
1968619717
/* 76 */ "ShiftLeft",
1968719718
/* 77 */ "ShiftRight",
1968819719
/* 78 */ "Add",
@@ -19689,57 +19720,57 @@
1968919720
/* 79 */ "Subtract",
1969019721
/* 80 */ "Multiply",
1969119722
/* 81 */ "Divide",
1969219723
/* 82 */ "Remainder",
1969319724
/* 83 */ "Concat",
19694
- /* 84 */ "Permutation",
19695
- /* 85 */ "VBegin",
19696
- /* 86 */ "OpenEphemeral",
19725
+ /* 84 */ "MoveLe",
19726
+ /* 85 */ "IfNot",
19727
+ /* 86 */ "DropTable",
1969719728
/* 87 */ "BitNot",
1969819729
/* 88 */ "String8",
19699
- /* 89 */ "IdxGE",
19700
- /* 90 */ "Trace",
19701
- /* 91 */ "VRowid",
19702
- /* 92 */ "MakeRecord",
19703
- /* 93 */ "Yield",
19704
- /* 94 */ "SetCookie",
19705
- /* 95 */ "Prev",
19706
- /* 96 */ "ContextPush",
19707
- /* 97 */ "DropTrigger",
19708
- /* 98 */ "VColumn",
19709
- /* 99 */ "Return",
19710
- /* 100 */ "OpenWrite",
19711
- /* 101 */ "Integer",
19730
+ /* 89 */ "MakeRecord",
19731
+ /* 90 */ "ResultRow",
19732
+ /* 91 */ "Delete",
19733
+ /* 92 */ "AggFinal",
19734
+ /* 93 */ "Compare",
19735
+ /* 94 */ "Goto",
19736
+ /* 95 */ "TableLock",
19737
+ /* 96 */ "FifoRead",
19738
+ /* 97 */ "Clear",
19739
+ /* 98 */ "MoveLt",
19740
+ /* 99 */ "VerifyCookie",
19741
+ /* 100 */ "AggStep",
19742
+ /* 101 */ "SetNumColumns",
1971219743
/* 102 */ "Transaction",
19713
- /* 103 */ "IfPos",
19714
- /* 104 */ "CollSeq",
19715
- /* 105 */ "VRename",
19716
- /* 106 */ "Sequence",
19717
- /* 107 */ "ContextPop",
19718
- /* 108 */ "VCreate",
19719
- /* 109 */ "CreateTable",
19720
- /* 110 */ "AddImm",
19721
- /* 111 */ "DropTable",
19722
- /* 112 */ "IsUnique",
19723
- /* 113 */ "VOpen",
19724
- /* 114 */ "IfZero",
19725
- /* 115 */ "Noop",
19726
- /* 116 */ "RowKey",
19727
- /* 117 */ "Expire",
19728
- /* 118 */ "FifoRead",
19729
- /* 119 */ "Delete",
19730
- /* 120 */ "Blob",
19731
- /* 121 */ "Move",
19732
- /* 122 */ "Goto",
19733
- /* 123 */ "ParseSchema",
19734
- /* 124 */ "VNext",
19735
- /* 125 */ "TableLock",
19744
+ /* 103 */ "VFilter",
19745
+ /* 104 */ "VDestroy",
19746
+ /* 105 */ "ContextPop",
19747
+ /* 106 */ "Next",
19748
+ /* 107 */ "IdxInsert",
19749
+ /* 108 */ "Insert",
19750
+ /* 109 */ "Destroy",
19751
+ /* 110 */ "ReadCookie",
19752
+ /* 111 */ "ForceInt",
19753
+ /* 112 */ "LoadAnalysis",
19754
+ /* 113 */ "Explain",
19755
+ /* 114 */ "OpenPseudo",
19756
+ /* 115 */ "OpenEphemeral",
19757
+ /* 116 */ "Null",
19758
+ /* 117 */ "Move",
19759
+ /* 118 */ "Blob",
19760
+ /* 119 */ "Rewind",
19761
+ /* 120 */ "MoveGe",
19762
+ /* 121 */ "VBegin",
19763
+ /* 122 */ "VUpdate",
19764
+ /* 123 */ "IfZero",
19765
+ /* 124 */ "VCreate",
19766
+ /* 125 */ "Found",
1973619767
/* 126 */ "Real",
19737
- /* 127 */ "VerifyCookie",
19738
- /* 128 */ "Column",
19739
- /* 129 */ "OpenRead",
19740
- /* 130 */ "ResetCount",
19768
+ /* 127 */ "IfPos",
19769
+ /* 128 */ "NullRow",
19770
+ /* 129 */ "Jump",
19771
+ /* 130 */ "Permutation",
1974119772
/* 131 */ "NotUsed_131",
1974219773
/* 132 */ "NotUsed_132",
1974319774
/* 133 */ "NotUsed_133",
1974419775
/* 134 */ "NotUsed_134",
1974519776
/* 135 */ "NotUsed_135",
@@ -19770,11 +19801,11 @@
1977019801
**
1977119802
******************************************************************************
1977219803
**
1977319804
** This file contains code that is specific to OS/2.
1977419805
**
19775
-** $Id: os_os2.c,v 1.57 2008/10/13 21:46:47 pweilbacher Exp $
19806
+** $Id: os_os2.c,v 1.58 2008/11/07 00:06:18 drh Exp $
1977619807
*/
1977719808
1977819809
1977919810
#if SQLITE_OS_OS2
1978019811
@@ -20113,10 +20144,11 @@
2011320144
return SQLITE_IOERR_READ;
2011420145
}
2011520146
if( got == (ULONG)amt )
2011620147
return SQLITE_OK;
2011720148
else {
20149
+ /* Unread portions of the input buffer must be zero-filled */
2011820150
memset(&((char*)pBuf)[got], 0, amt-got);
2011920151
return SQLITE_IOERR_SHORT_READ;
2012020152
}
2012120153
}
2012220154
@@ -21117,11 +21149,11 @@
2111721149
**
2111821150
******************************************************************************
2111921151
**
2112021152
** This file contains code that is specific to Unix systems.
2112121153
**
21122
-** $Id: os_unix.c,v 1.207 2008/10/16 13:27:41 danielk1977 Exp $
21154
+** $Id: os_unix.c,v 1.208 2008/11/07 00:06:18 drh Exp $
2112321155
*/
2112421156
#if SQLITE_OS_UNIX /* This file is used on unix only */
2112521157
2112621158
/*
2112721159
** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
@@ -22231,10 +22263,11 @@
2223122263
if( got==amt ){
2223222264
return SQLITE_OK;
2223322265
}else if( got<0 ){
2223422266
return SQLITE_IOERR_READ;
2223522267
}else{
22268
+ /* Unread parts of the buffer must be zero-filled */
2223622269
memset(&((char*)pBuf)[got], 0, amt-got);
2223722270
return SQLITE_IOERR_SHORT_READ;
2223822271
}
2223922272
}
2224022273
@@ -24340,11 +24373,11 @@
2434024373
**
2434124374
******************************************************************************
2434224375
**
2434324376
** This file contains code that is specific to windows.
2434424377
**
24345
-** $Id: os_win.c,v 1.136 2008/10/22 16:55:47 shane Exp $
24378
+** $Id: os_win.c,v 1.137 2008/11/07 00:06:18 drh Exp $
2434624379
*/
2434724380
#if SQLITE_OS_WIN /* This file is used for windows only */
2434824381
2434924382
2435024383
/*
@@ -25224,10 +25257,11 @@
2522425257
return SQLITE_IOERR_READ;
2522525258
}
2522625259
if( got==(DWORD)amt ){
2522725260
return SQLITE_OK;
2522825261
}else{
25262
+ /* Unread parts of the buffer must be zero-filled */
2522925263
memset(&((char*)pBuf)[got], 0, amt-got);
2523025264
return SQLITE_IOERR_SHORT_READ;
2523125265
}
2523225266
}
2523325267
@@ -26260,16 +26294,18 @@
2626026294
**
2626126295
*************************************************************************
2626226296
** This file implements an object that represents a fixed-length
2626326297
** bitmap. Bits are numbered starting with 1.
2626426298
**
26265
-** A bitmap is used to record what pages a database file have been
26266
-** journalled during a transaction. Usually only a few pages are
26267
-** journalled. So the bitmap is usually sparse and has low cardinality.
26299
+** A bitmap is used to record which pages of a database file have been
26300
+** journalled during a transaction, or which pages have the "dont-write"
26301
+** property. Usually only a few pages are meet either condition.
26302
+** So the bitmap is usually sparse and has low cardinality.
2626826303
** But sometimes (for example when during a DROP of a large table) most
26269
-** or all of the pages get journalled. In those cases, the bitmap becomes
26270
-** dense. The algorithm needs to handle both cases well.
26304
+** or all of the pages in a database can get journalled. In those cases,
26305
+** the bitmap becomes dense with high cardinality. The algorithm needs
26306
+** to handle both cases well.
2627126307
**
2627226308
** The size of the bitmap is fixed when the object is created.
2627326309
**
2627426310
** All bits are clear when the bitmap is created. Individual bits
2627526311
** may be set or cleared one at a time.
@@ -26280,11 +26316,11 @@
2628026316
** sometimes grow into tens of thousands or larger. The size of the
2628126317
** Bitvec object is the number of pages in the database file at the
2628226318
** start of a transaction, and is thus usually less than a few thousand,
2628326319
** but can be as large as 2 billion for a really big database.
2628426320
**
26285
-** @(#) $Id: bitvec.c,v 1.6 2008/06/20 14:59:51 danielk1977 Exp $
26321
+** @(#) $Id: bitvec.c,v 1.7 2008/11/03 20:55:07 drh Exp $
2628626322
*/
2628726323
2628826324
#define BITVEC_SZ 512
2628926325
/* Round the union size down to the nearest pointer boundary, since that's how
2629026326
** it will be aligned within the Bitvec struct. */
@@ -26372,10 +26408,18 @@
2637226408
}
2637326409
2637426410
/*
2637526411
** Set the i-th bit. Return 0 on success and an error code if
2637626412
** anything goes wrong.
26413
+**
26414
+** This routine might cause sub-bitmaps to be allocated. Failing
26415
+** to get the memory needed to hold the sub-bitmap is the only
26416
+** that can go wrong with an insert, assuming p and i are valid.
26417
+**
26418
+** The calling function must ensure that p is a valid Bitvec object
26419
+** and that the value for "i" is within range of the Bitvec object.
26420
+** Otherwise the behavior is undefined.
2637726421
*/
2637826422
SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec *p, u32 i){
2637926423
u32 h;
2638026424
assert( p!=0 );
2638126425
assert( i>0 );
@@ -27804,11 +27848,11 @@
2780427848
** is separate from the database file. The pager also implements file
2780527849
** locking to prevent two processes from writing the same database
2780627850
** file simultaneously, or one process from reading the database while
2780727851
** another is writing.
2780827852
**
27809
-** @(#) $Id: pager.c,v 1.500 2008/10/29 07:01:57 danielk1977 Exp $
27853
+** @(#) $Id: pager.c,v 1.502 2008/11/07 00:24:54 drh Exp $
2781027854
*/
2781127855
#ifndef SQLITE_OMIT_DISKIO
2781227856
2781327857
/*
2781427858
** Macros for troubleshooting. Normally turned off
@@ -27988,11 +28032,11 @@
2798828032
i64 journalOff; /* Current byte offset in the journal file */
2798928033
i64 journalHdr; /* Byte offset to previous journal header */
2799028034
i64 stmtHdrOff; /* First journal header written this statement */
2799128035
i64 stmtCksum; /* cksumInit when statement was started */
2799228036
i64 stmtJSize; /* Size of journal at stmt_begin() */
27993
- int sectorSize; /* Assumed sector size during rollback */
28037
+ u32 sectorSize; /* Assumed sector size during rollback */
2799428038
#ifdef SQLITE_TEST
2799528039
int nHit, nMiss; /* Cache hits and missing */
2799628040
int nRead, nWrite; /* Database pages read/written */
2799728041
#endif
2799828042
void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */
@@ -28541,12 +28585,16 @@
2854128585
** the process that created this journal. If this journal was
2854228586
** created by a process other than this one, then this routine
2854328587
** is being called from within pager_playback(). The local value
2854428588
** of Pager.sectorSize is restored at the end of that routine.
2854528589
*/
28546
- rc = read32bits(pPager->jfd, jrnlOff+12, (u32 *)&pPager->sectorSize);
28590
+ rc = read32bits(pPager->jfd, jrnlOff+12, &pPager->sectorSize);
2854728591
if( rc ) return rc;
28592
+ if( (pPager->sectorSize & (pPager->sectorSize-1))!=0
28593
+ || pPager->sectorSize>0x1000000 ){
28594
+ return SQLITE_DONE;
28595
+ }
2854828596
2854928597
pPager->journalOff += JOURNAL_HDR_SZ(pPager);
2855028598
return SQLITE_OK;
2855128599
}
2855228600
@@ -31186,11 +31234,13 @@
3118631234
#endif
3118731235
3118831236
/*
3118931237
** A call to this routine tells the pager that it is not necessary to
3119031238
** write the information on page pPg back to the disk, even though
31191
-** that page might be marked as dirty.
31239
+** that page might be marked as dirty. This happens, for example, when
31240
+** the page has been added as a leaf of the freelist and so its
31241
+** content no longer matters.
3119231242
**
3119331243
** The overlying software layer calls this routine when all of the data
3119431244
** on the given page is unused. The pager marks the page as clean so
3119531245
** that it does not get written to disk.
3119631246
**
@@ -32978,11 +33028,11 @@
3297833028
** May you do good and not evil.
3297933029
** May you find forgiveness for yourself and forgive others.
3298033030
** May you share freely, never taking more than you give.
3298133031
**
3298233032
*************************************************************************
32983
-** $Id: btree.c,v 1.526 2008/10/27 13:59:34 danielk1977 Exp $
33033
+** $Id: btree.c,v 1.527 2008/11/03 20:55:07 drh Exp $
3298433034
**
3298533035
** This file implements a external (disk-based) database using BTrees.
3298633036
** See the header comment on "btreeInt.h" for additional information.
3298733037
** Including a description of file format and an overview of operation.
3298833038
*/
@@ -33374,11 +33424,11 @@
3337433424
sqlite3BtreeRestoreCursorPosition(p) : \
3337533425
SQLITE_OK)
3337633426
3337733427
/*
3337833428
** Determine whether or not a cursor has moved from the position it
33379
-** was last placed at. Cursor can move when the row they are pointing
33429
+** was last placed at. Cursors can move when the row they are pointing
3338033430
** at is deleted out from under them.
3338133431
**
3338233432
** This routine returns an error code if something goes wrong. The
3338333433
** integer *pHasMoved is set to one if the cursor has moved and 0 if not.
3338433434
*/
@@ -40501,11 +40551,11 @@
4050140551
** This file contains code use to manipulate "Mem" structure. A "Mem"
4050240552
** stores a single value in the VDBE. Mem is an opaque structure visible
4050340553
** only within the VDBE. Interface routines refer to a Mem using the
4050440554
** name sqlite_value
4050540555
**
40506
-** $Id: vdbemem.c,v 1.124 2008/10/30 17:21:13 danielk1977 Exp $
40556
+** $Id: vdbemem.c,v 1.125 2008/11/05 17:41:19 drh Exp $
4050740557
*/
4050840558
4050940559
/*
4051040560
** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
4051140561
** P if required.
@@ -41089,13 +41139,10 @@
4108941139
}else{
4109041140
for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
4109141141
}
4109241142
flags |= MEM_Term;
4109341143
}
41094
- if( nByte>iLimit ){
41095
- return SQLITE_TOOBIG;
41096
- }
4109741144
4109841145
/* The following block sets the new values of Mem.z and Mem.xDel. It
4109941146
** also sets a flag in local variable "flags" to indicate the memory
4110041147
** management (one of MEM_Dyn or MEM_Static).
4110141148
*/
@@ -41102,10 +41149,13 @@
4110241149
if( xDel==SQLITE_TRANSIENT ){
4110341150
int nAlloc = nByte;
4110441151
if( flags&MEM_Term ){
4110541152
nAlloc += (enc==SQLITE_UTF8?1:2);
4110641153
}
41154
+ if( nByte>iLimit ){
41155
+ return SQLITE_TOOBIG;
41156
+ }
4110741157
if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
4110841158
return SQLITE_NOMEM;
4110941159
}
4111041160
memcpy(pMem->z, z, nAlloc);
4111141161
}else if( xDel==SQLITE_DYNAMIC ){
@@ -41116,10 +41166,13 @@
4111641166
sqlite3VdbeMemRelease(pMem);
4111741167
pMem->z = (char *)z;
4111841168
pMem->xDel = xDel;
4111941169
flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
4112041170
}
41171
+ if( nByte>iLimit ){
41172
+ return SQLITE_TOOBIG;
41173
+ }
4112141174
4112241175
pMem->n = nByte;
4112341176
pMem->flags = flags;
4112441177
pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
4112541178
pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
@@ -41543,11 +41596,11 @@
4154341596
** This file contains code used for creating, destroying, and populating
4154441597
** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
4154541598
** to version 2.8.7, all this code was combined into the vdbe.c source file.
4154641599
** But that file was getting too big so this subroutines were split out.
4154741600
**
41548
-** $Id: vdbeaux.c,v 1.413 2008/10/31 10:53:23 danielk1977 Exp $
41601
+** $Id: vdbeaux.c,v 1.418 2008/11/05 17:41:19 drh Exp $
4154941602
*/
4155041603
4155141604
4155241605
4155341606
/*
@@ -41793,10 +41846,12 @@
4179341846
int nMaxArgs = 0;
4179441847
Op *pOp;
4179541848
int *aLabel = p->aLabel;
4179641849
int doesStatementRollback = 0;
4179741850
int hasStatementBegin = 0;
41851
+ p->readOnly = 1;
41852
+ p->usesStmtJournal = 0;
4179841853
for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
4179941854
u8 opcode = pOp->opcode;
4180041855
4180141856
if( opcode==OP_Function || opcode==OP_AggStep ){
4180241857
if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5;
@@ -41809,12 +41864,15 @@
4180941864
if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
4181041865
doesStatementRollback = 1;
4181141866
}
4181241867
}else if( opcode==OP_Statement ){
4181341868
hasStatementBegin = 1;
41869
+ p->usesStmtJournal = 1;
4181441870
}else if( opcode==OP_Destroy ){
4181541871
doesStatementRollback = 1;
41872
+ }else if( opcode==OP_Transaction && pOp->p2!=0 ){
41873
+ p->readOnly = 0;
4181641874
#ifndef SQLITE_OMIT_VIRTUALTABLE
4181741875
}else if( opcode==OP_VUpdate || opcode==OP_VRename ){
4181841876
doesStatementRollback = 1;
4181941877
}else if( opcode==OP_VFilter ){
4182041878
int n;
@@ -41839,10 +41897,11 @@
4183941897
** transactions are not needed. So change every OP_Statement
4184041898
** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive()
4184141899
** which can be expensive on some platforms.
4184241900
*/
4184341901
if( hasStatementBegin && !doesStatementRollback ){
41902
+ p->usesStmtJournal = 0;
4184441903
for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
4184541904
if( pOp->opcode==OP_Statement ){
4184641905
pOp->opcode = OP_Noop;
4184741906
}
4184841907
}
@@ -42547,11 +42606,11 @@
4254742606
p->magic = VDBE_MAGIC_RUN;
4254842607
4254942608
/* For each cursor required, also allocate a memory cell. Memory
4255042609
** cells (nMem+1-nCursor)..nMem, inclusive, will never be used by
4255142610
** the vdbe program. Instead they are used to allocate space for
42552
- ** Cursor/BtCursor structures. The blob of memory associated with
42611
+ ** VdbeCursor/BtCursor structures. The blob of memory associated with
4255342612
** cursor 0 is stored in memory cell nMem. Memory cell (nMem-1)
4255442613
** stores the blob of memory associated with cursor 1, etc.
4255542614
**
4255642615
** See also: allocateCursor().
4255742616
*/
@@ -42564,28 +42623,28 @@
4256442623
int nArg; /* Maximum number of args passed to a user function. */
4256542624
resolveP2Values(p, &nArg);
4256642625
/*resizeOpArray(p, p->nOp);*/
4256742626
assert( nVar>=0 );
4256842627
if( isExplain && nMem<10 ){
42569
- p->nMem = nMem = 10;
42628
+ nMem = 10;
4257042629
}
4257142630
p->aMem = sqlite3DbMallocZero(db,
4257242631
nMem*sizeof(Mem) /* aMem */
4257342632
+ nVar*sizeof(Mem) /* aVar */
4257442633
+ nArg*sizeof(Mem*) /* apArg */
4257542634
+ nVar*sizeof(char*) /* azVar */
42576
- + nCursor*sizeof(Cursor*) + 1 /* apCsr */
42635
+ + nCursor*sizeof(VdbeCursor*)+1 /* apCsr */
4257742636
);
4257842637
if( !db->mallocFailed ){
4257942638
p->aMem--; /* aMem[] goes from 1..nMem */
4258042639
p->nMem = nMem; /* not from 0..nMem-1 */
4258142640
p->aVar = &p->aMem[nMem+1];
4258242641
p->nVar = nVar;
4258342642
p->okVar = 0;
4258442643
p->apArg = (Mem**)&p->aVar[nVar];
4258542644
p->azVar = (char**)&p->apArg[nArg];
42586
- p->apCsr = (Cursor**)&p->azVar[nVar];
42645
+ p->apCsr = (VdbeCursor**)&p->azVar[nVar];
4258742646
p->nCursor = nCursor;
4258842647
for(n=0; n<nVar; n++){
4258942648
p->aVar[n].flags = MEM_Null;
4259042649
p->aVar[n].db = db;
4259142650
}
@@ -42624,11 +42683,11 @@
4262442683
4262542684
/*
4262642685
** Close a VDBE cursor and release all the resources that cursor
4262742686
** happens to hold.
4262842687
*/
42629
-SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
42688
+SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
4263042689
if( pCx==0 ){
4263142690
return;
4263242691
}
4263342692
if( pCx->pBt ){
4263442693
sqlite3BtreeClose(pCx->pBt);
@@ -42659,11 +42718,11 @@
4265942718
*/
4266042719
static void closeAllCursorsExceptActiveVtabs(Vdbe *p){
4266142720
int i;
4266242721
if( p->apCsr==0 ) return;
4266342722
for(i=0; i<p->nCursor; i++){
42664
- Cursor *pC = p->apCsr[i];
42723
+ VdbeCursor *pC = p->apCsr[i];
4266542724
if( pC && (!p->inVtabMethod || !pC->pVtabCursor) ){
4266642725
sqlite3VdbeFreeCursor(p, pC);
4266742726
p->apCsr[i] = 0;
4266842727
}
4266942728
}
@@ -42749,11 +42808,11 @@
4274942808
return SQLITE_NOMEM;
4275042809
}
4275142810
assert( p->aColName!=0 );
4275242811
pColName = &(p->aColName[idx+var*p->nResColumn]);
4275342812
rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, xDel);
42754
- assert( p->db->mallocFailed || !zName || pColName->flags&MEM_Term );
42813
+ assert( rc!=0 || !zName || (pColName->flags&MEM_Term)!=0 );
4275542814
return rc;
4275642815
}
4275742816
4275842817
/*
4275942818
** A read or write transaction may or may not be active on database handle
@@ -42980,18 +43039,21 @@
4298043039
*/
4298143040
#ifndef NDEBUG
4298243041
static void checkActiveVdbeCnt(sqlite3 *db){
4298343042
Vdbe *p;
4298443043
int cnt = 0;
43044
+ int nWrite = 0;
4298543045
p = db->pVdbe;
4298643046
while( p ){
4298743047
if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){
4298843048
cnt++;
43049
+ if( p->readOnly==0 ) nWrite++;
4298943050
}
4299043051
p = p->pNext;
4299143052
}
4299243053
assert( cnt==db->activeVdbeCnt );
43054
+ assert( nWrite==db->writeVdbeCnt );
4299343055
}
4299443056
#else
4299543057
#define checkActiveVdbeCnt(x)
4299643058
#endif
4299743059
@@ -43075,46 +43137,19 @@
4307543137
/* Check for one of the special errors */
4307643138
mrc = p->rc & 0xff;
4307743139
isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR
4307843140
|| mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL;
4307943141
if( isSpecialError ){
43080
- /* This loop does static analysis of the query to see which of the
43081
- ** following three categories it falls into:
43082
- **
43083
- ** Read-only
43084
- ** Query with statement journal
43085
- ** Query without statement journal
43086
- **
43087
- ** We could do something more elegant than this static analysis (i.e.
43088
- ** store the type of query as part of the compliation phase), but
43089
- ** handling malloc() or IO failure is a fairly obscure edge case so
43090
- ** this is probably easier. Todo: Might be an opportunity to reduce
43091
- ** code size a very small amount though...
43092
- */
43093
- int notReadOnly = 0;
43094
- int isStatement = 0;
43095
- assert(p->aOp || p->nOp==0);
43096
- for(i=0; i<p->nOp; i++){
43097
- switch( p->aOp[i].opcode ){
43098
- case OP_Transaction:
43099
- notReadOnly |= p->aOp[i].p2;
43100
- break;
43101
- case OP_Statement:
43102
- isStatement = 1;
43103
- break;
43104
- }
43105
- }
43106
-
43107
-
4310843142
/* If the query was read-only, we need do no rollback at all. Otherwise,
4310943143
** proceed with the special handling.
4311043144
*/
43111
- if( notReadOnly || mrc!=SQLITE_INTERRUPT ){
43112
- if( p->rc==SQLITE_IOERR_BLOCKED && isStatement ){
43145
+ if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){
43146
+ if( p->rc==SQLITE_IOERR_BLOCKED && p->usesStmtJournal ){
4311343147
xFunc = sqlite3BtreeRollbackStmt;
4311443148
p->rc = SQLITE_BUSY;
43115
- } else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && isStatement ){
43149
+ }else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL)
43150
+ && p->usesStmtJournal ){
4311643151
xFunc = sqlite3BtreeRollbackStmt;
4311743152
}else{
4311843153
/* We are forced to roll back the active transaction. Before doing
4311943154
** so, abort any other statements this handle currently has active.
4312043155
*/
@@ -43127,13 +43162,13 @@
4312743162
4312843163
/* If the auto-commit flag is set and this is the only active vdbe, then
4312943164
** we do either a commit or rollback of the current transaction.
4313043165
**
4313143166
** Note: This block also runs if one of the special errors handled
43132
- ** above has occured.
43167
+ ** above has occurred.
4313343168
*/
43134
- if( db->autoCommit && db->activeVdbeCnt==1 ){
43169
+ if( db->autoCommit && db->writeVdbeCnt==(p->readOnly==0) ){
4313543170
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
4313643171
/* The auto-commit flag is true, and the vdbe program was
4313743172
** successful or hit an 'OR FAIL' constraint. This means a commit
4313843173
** is required.
4313943174
*/
@@ -43209,10 +43244,14 @@
4320943244
}
4321043245
4321143246
/* We have successfully halted and closed the VM. Record this fact. */
4321243247
if( p->pc>=0 ){
4321343248
db->activeVdbeCnt--;
43249
+ if( !p->readOnly ){
43250
+ db->writeVdbeCnt--;
43251
+ }
43252
+ assert( db->activeVdbeCnt>=db->writeVdbeCnt );
4321443253
}
4321543254
p->magic = VDBE_MAGIC_HALT;
4321643255
checkActiveVdbeCnt(db);
4321743256
if( p->db->mallocFailed ){
4321843257
p->rc = SQLITE_NOMEM;
@@ -43392,11 +43431,11 @@
4339243431
/*
4339343432
** If a MoveTo operation is pending on the given cursor, then do that
4339443433
** MoveTo now. Return an error code. If no MoveTo is pending, this
4339543434
** routine does nothing and returns SQLITE_OK.
4339643435
*/
43397
-SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
43436
+SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){
4339843437
if( p->deferredMoveto ){
4339943438
int res, rc;
4340043439
#ifdef SQLITE_TEST
4340143440
extern int sqlite3_search_count;
4340243441
#endif
@@ -43495,11 +43534,11 @@
4349543534
return 6;
4349643535
}
4349743536
if( flags&MEM_Real ){
4349843537
return 7;
4349943538
}
43500
- assert( flags&(MEM_Str|MEM_Blob) );
43539
+ assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
4350143540
n = pMem->n;
4350243541
if( flags & MEM_Zero ){
4350343542
n += pMem->u.i;
4350443543
}
4350543544
assert( n>=0 );
@@ -43959,11 +43998,11 @@
4395943998
**
4396043999
** pUnpacked may be an unpacked version of pKey,nKey. If pUnpacked is
4396144000
** supplied it is used in place of pKey,nKey.
4396244001
*/
4396344002
SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
43964
- Cursor *pC, /* The cursor to compare against */
44003
+ VdbeCursor *pC, /* The cursor to compare against */
4396544004
UnpackedRecord *pUnpacked, /* Unpacked version of pKey and nKey */
4396644005
int *res /* Write the comparison result here */
4396744006
){
4396844007
i64 nCellKey = 0;
4396944008
int rc;
@@ -44045,11 +44084,11 @@
4404544084
*************************************************************************
4404644085
**
4404744086
** This file contains code use to implement APIs that are part of the
4404844087
** VDBE.
4404944088
**
44050
-** $Id: vdbeapi.c,v 1.147 2008/10/13 10:37:50 danielk1977 Exp $
44089
+** $Id: vdbeapi.c,v 1.148 2008/11/05 16:37:35 drh Exp $
4405144090
*/
4405244091
4405344092
#if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
4405444093
/*
4405544094
** The following structure contains pointers to the end points of a
@@ -44498,10 +44537,11 @@
4449844537
p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0;
4449944538
}
4450044539
#endif
4450144540
4450244541
db->activeVdbeCnt++;
44542
+ if( p->readOnly==0 ) db->writeVdbeCnt++;
4450344543
p->pc = 0;
4450444544
stmtLruRemove(p);
4450544545
}
4450644546
#ifndef SQLITE_OMIT_EXPLAIN
4450744547
if( p->explain ){
@@ -45383,11 +45423,11 @@
4538345423
** documentation, headers files, or other derived files. The formatting
4538445424
** of the code in this file is, therefore, important. See other comments
4538545425
** in this file for details. If in doubt, do not deviate from existing
4538645426
** commenting and indentation practices when changing or adding code.
4538745427
**
45388
-** $Id: vdbe.c,v 1.784 2008/10/30 15:03:16 drh Exp $
45428
+** $Id: vdbe.c,v 1.786 2008/11/05 16:37:35 drh Exp $
4538945429
*/
4539045430
4539145431
/*
4539245432
** The following global variable is incremented every time a cursor
4539345433
** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test
@@ -45519,24 +45559,24 @@
4551945559
assert( opcode>0 && opcode<sizeof(opcodeProperty) );
4552045560
return (opcodeProperty[opcode]&mask)!=0;
4552145561
}
4552245562
4552345563
/*
45524
-** Allocate cursor number iCur. Return a pointer to it. Return NULL
45564
+** Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL
4552545565
** if we run out of memory.
4552645566
*/
45527
-static Cursor *allocateCursor(
45528
- Vdbe *p,
45529
- int iCur,
45530
- Op *pOp,
45531
- int iDb,
45532
- int isBtreeCursor
45567
+static VdbeCursor *allocateCursor(
45568
+ Vdbe *p, /* The virtual machine */
45569
+ int iCur, /* Index of the new VdbeCursor */
45570
+ Op *pOp, /* */
45571
+ int iDb, /* */
45572
+ int isBtreeCursor /* */
4553345573
){
4553445574
/* Find the memory cell that will be used to store the blob of memory
45535
- ** required for this Cursor structure. It is convenient to use a
45575
+ ** required for this VdbeCursor structure. It is convenient to use a
4553645576
** vdbe memory cell to manage the memory allocation required for a
45537
- ** Cursor structure for the following reasons:
45577
+ ** VdbeCursor structure for the following reasons:
4553845578
**
4553945579
** * Sometimes cursor numbers are used for a couple of different
4554045580
** purposes in a vdbe program. The different uses might require
4554145581
** different sized allocations. Memory cells provide growable
4554245582
** allocations.
@@ -45550,40 +45590,41 @@
4555045590
** cursor 1 is managed by memory cell (p->nMem-1), etc.
4555145591
*/
4555245592
Mem *pMem = &p->aMem[p->nMem-iCur];
4555345593
4555445594
int nByte;
45555
- Cursor *pCx = 0;
45595
+ VdbeCursor *pCx = 0;
4555645596
/* If the opcode of pOp is OP_SetNumColumns, then pOp->p2 contains
4555745597
** the number of fields in the records contained in the table or
4555845598
** index being opened. Use this to reserve space for the
45559
- ** Cursor.aType[] array.
45599
+ ** VdbeCursor.aType[] array.
4556045600
*/
4556145601
int nField = 0;
4556245602
if( pOp->opcode==OP_SetNumColumns || pOp->opcode==OP_OpenEphemeral ){
4556345603
nField = pOp->p2;
4556445604
}
4556545605
nByte =
45566
- sizeof(Cursor) +
45606
+ sizeof(VdbeCursor) +
4556745607
(isBtreeCursor?sqlite3BtreeCursorSize():0) +
4556845608
2*nField*sizeof(u32);
4556945609
4557045610
assert( iCur<p->nCursor );
4557145611
if( p->apCsr[iCur] ){
4557245612
sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
4557345613
p->apCsr[iCur] = 0;
4557445614
}
4557545615
if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
45576
- p->apCsr[iCur] = pCx = (Cursor *)pMem->z;
45616
+ p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
4557745617
memset(pMem->z, 0, nByte);
4557845618
pCx->iDb = iDb;
4557945619
pCx->nField = nField;
4558045620
if( nField ){
45581
- pCx->aType = (u32 *)&pMem->z[sizeof(Cursor)];
45621
+ pCx->aType = (u32 *)&pMem->z[sizeof(VdbeCursor)];
4558245622
}
4558345623
if( isBtreeCursor ){
45584
- pCx->pCursor = (BtCursor *)&pMem->z[sizeof(Cursor)+2*nField*sizeof(u32)];
45624
+ pCx->pCursor = (BtCursor*)
45625
+ &pMem->z[sizeof(VdbeCursor)+2*nField*sizeof(u32)];
4558545626
}
4558645627
}
4558745628
return pCx;
4558845629
}
4558945630
@@ -47386,22 +47427,19 @@
4738647427
** from this record. If there are less that (P2+1)
4738747428
** values in the record, extract a NULL.
4738847429
**
4738947430
** The value extracted is stored in register P3.
4739047431
**
47391
-** If the KeyAsData opcode has previously executed on this cursor, then the
47392
-** field might be extracted from the key rather than the data.
47393
-**
4739447432
** If the column contains fewer than P2 fields, then extract a NULL. Or,
4739547433
** if the P4 argument is a P4_MEM use the value of the P4 argument as
4739647434
** the result.
4739747435
*/
4739847436
case OP_Column: {
4739947437
u32 payloadSize; /* Number of bytes in the record */
4740047438
int p1 = pOp->p1; /* P1 value of the opcode */
4740147439
int p2 = pOp->p2; /* column number to retrieve */
47402
- Cursor *pC = 0; /* The VDBE cursor */
47440
+ VdbeCursor *pC = 0;/* The VDBE cursor */
4740347441
char *zRec; /* Pointer to complete record-data */
4740447442
BtCursor *pCrsr; /* The BTree cursor */
4740547443
u32 *aType; /* aType[i] holds the numeric type of the i-th column */
4740647444
u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
4740747445
u32 nField; /* number of fields in the record */
@@ -47427,11 +47465,11 @@
4742747465
** If the record is stored in a cursor, the complete record text
4742847466
** might be available in the pC->aRow cache. Or it might not be.
4742947467
** If the data is unavailable, zRec is set to NULL.
4743047468
**
4743147469
** We also compute the number of columns in the record. For cursors,
47432
- ** the number of columns is stored in the Cursor.nField element.
47470
+ ** the number of columns is stored in the VdbeCursor.nField element.
4743347471
*/
4743447472
pC = p->apCsr[p1];
4743547473
assert( pC!=0 );
4743647474
#ifndef SQLITE_OMIT_VIRTUALTABLE
4743747475
assert( pC->pVtabCursor==0 );
@@ -47823,37 +47861,44 @@
4782347861
** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails.
4782447862
**
4782547863
** This instruction causes the VM to halt.
4782647864
*/
4782747865
case OP_AutoCommit: {
47828
- u8 i = pOp->p1;
47829
- u8 rollback = pOp->p2;
47866
+ int desiredAutoCommit = pOp->p1;
47867
+ int rollback = pOp->p2;
47868
+ int turnOnAC = desiredAutoCommit && !db->autoCommit;
4783047869
47831
- assert( i==1 || i==0 );
47832
- assert( i==1 || rollback==0 );
47870
+ assert( desiredAutoCommit==1 || desiredAutoCommit==0 );
47871
+ assert( desiredAutoCommit==1 || rollback==0 );
4783347872
4783447873
assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */
4783547874
47836
- if( db->activeVdbeCnt>1 && i && !db->autoCommit ){
47837
- /* If this instruction implements a COMMIT or ROLLBACK, other VMs are
47875
+ if( turnOnAC && rollback && db->activeVdbeCnt>1 ){
47876
+ /* If this instruction implements a ROLLBACK and other VMs are
4783847877
** still running, and a transaction is active, return an error indicating
4783947878
** that the other VMs must complete first.
4784047879
*/
47841
- sqlite3SetString(&p->zErrMsg, db, "cannot %s transaction - "
47842
- "SQL statements in progress",
47843
- rollback ? "rollback" : "commit");
47880
+ sqlite3SetString(&p->zErrMsg, db, "cannot rollback transaction - "
47881
+ "SQL statements in progress");
47882
+ rc = SQLITE_BUSY;
47883
+ }else if( turnOnAC && !rollback && db->writeVdbeCnt>1 ){
47884
+ /* If this instruction implements a COMMIT and other VMs are writing
47885
+ ** return an error indicating that the other VMs must complete first.
47886
+ */
47887
+ sqlite3SetString(&p->zErrMsg, db, "cannot commit transaction - "
47888
+ "SQL statements in progress");
4784447889
rc = SQLITE_BUSY;
47845
- }else if( i!=db->autoCommit ){
47890
+ }else if( desiredAutoCommit!=db->autoCommit ){
4784647891
if( pOp->p2 ){
47847
- assert( i==1 );
47892
+ assert( desiredAutoCommit==1 );
4784847893
sqlite3RollbackAll(db);
4784947894
db->autoCommit = 1;
4785047895
}else{
47851
- db->autoCommit = i;
47896
+ db->autoCommit = desiredAutoCommit;
4785247897
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
4785347898
p->pc = pc;
47854
- db->autoCommit = 1-i;
47899
+ db->autoCommit = 1-desiredAutoCommit;
4785547900
p->rc = rc = SQLITE_BUSY;
4785647901
goto vdbe_return;
4785747902
}
4785847903
}
4785947904
if( p->rc==SQLITE_OK ){
@@ -47862,11 +47907,11 @@
4786247907
rc = SQLITE_ERROR;
4786347908
}
4786447909
goto vdbe_return;
4786547910
}else{
4786647911
sqlite3SetString(&p->zErrMsg, db,
47867
- (!i)?"cannot start a transaction within a transaction":(
47912
+ (!desiredAutoCommit)?"cannot start a transaction within a transaction":(
4786847913
(rollback)?"cannot rollback - no transaction is active":
4786947914
"cannot commit - no transaction is active"));
4787047915
4787147916
rc = SQLITE_ERROR;
4787247917
}
@@ -48099,11 +48144,11 @@
4809948144
int i = pOp->p1;
4810048145
int p2 = pOp->p2;
4810148146
int iDb = pOp->p3;
4810248147
int wrFlag;
4810348148
Btree *pX;
48104
- Cursor *pCur;
48149
+ VdbeCursor *pCur;
4810548150
Db *pDb;
4810648151
4810748152
assert( iDb>=0 && iDb<db->nDb );
4810848153
assert( (p->btreeMask & (1<<iDb))!=0 );
4810948154
pDb = &db->aDb[iDb];
@@ -48199,11 +48244,11 @@
4819948244
** this opcode. Then this opcode was call OpenVirtual. But
4820048245
** that created confusion with the whole virtual-table idea.
4820148246
*/
4820248247
case OP_OpenEphemeral: {
4820348248
int i = pOp->p1;
48204
- Cursor *pCx;
48249
+ VdbeCursor *pCx;
4820548250
static const int openFlags =
4820648251
SQLITE_OPEN_READWRITE |
4820748252
SQLITE_OPEN_CREATE |
4820848253
SQLITE_OPEN_EXCLUSIVE |
4820948254
SQLITE_OPEN_DELETEONCLOSE |
@@ -48265,11 +48310,11 @@
4826548310
** memory cell containing the row data is not overwritten until the
4826648311
** pseudo table is closed (or a new row is inserted into it).
4826748312
*/
4826848313
case OP_OpenPseudo: {
4826948314
int i = pOp->p1;
48270
- Cursor *pCx;
48315
+ VdbeCursor *pCx;
4827148316
assert( i>=0 );
4827248317
pCx = allocateCursor(p, i, &pOp[-1], -1, 0);
4827348318
if( pCx==0 ) goto no_mem;
4827448319
pCx->nullRow = 1;
4827548320
pCx->pseudoTable = 1;
@@ -48354,11 +48399,11 @@
4835448399
case OP_MoveLt: /* jump, in3 */
4835548400
case OP_MoveLe: /* jump, in3 */
4835648401
case OP_MoveGe: /* jump, in3 */
4835748402
case OP_MoveGt: { /* jump, in3 */
4835848403
int i = pOp->p1;
48359
- Cursor *pC;
48404
+ VdbeCursor *pC;
4836048405
4836148406
assert( i>=0 && i<p->nCursor );
4836248407
pC = p->apCsr[i];
4836348408
assert( pC!=0 );
4836448409
if( pC->pCursor!=0 ){
@@ -48471,11 +48516,11 @@
4847148516
*/
4847248517
case OP_NotFound: /* jump, in3 */
4847348518
case OP_Found: { /* jump, in3 */
4847448519
int i = pOp->p1;
4847548520
int alreadyExists = 0;
48476
- Cursor *pC;
48521
+ VdbeCursor *pC;
4847748522
assert( i>=0 && i<p->nCursor );
4847848523
assert( p->apCsr[i]!=0 );
4847948524
if( (pC = p->apCsr[i])->pCursor!=0 ){
4848048525
int res;
4848148526
UnpackedRecord *pIdxKey;
@@ -48527,11 +48572,11 @@
4852748572
**
4852848573
** See also: NotFound, NotExists, Found
4852948574
*/
4853048575
case OP_IsUnique: { /* jump, in3 */
4853148576
int i = pOp->p1;
48532
- Cursor *pCx;
48577
+ VdbeCursor *pCx;
4853348578
BtCursor *pCrsr;
4853448579
Mem *pK;
4853548580
i64 R;
4853648581
4853748582
/* Pop the value R off the top of the stack
@@ -48624,11 +48669,11 @@
4862448669
**
4862548670
** See also: Found, NotFound, IsUnique
4862648671
*/
4862748672
case OP_NotExists: { /* jump, in3 */
4862848673
int i = pOp->p1;
48629
- Cursor *pC;
48674
+ VdbeCursor *pC;
4863048675
BtCursor *pCrsr;
4863148676
assert( i>=0 && i<p->nCursor );
4863248677
assert( p->apCsr[i]!=0 );
4863348678
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
4863448679
int res;
@@ -48693,11 +48738,11 @@
4869348738
** AUTOINCREMENT feature.
4869448739
*/
4869548740
case OP_NewRowid: { /* out2-prerelease */
4869648741
int i = pOp->p1;
4869748742
i64 v = 0;
48698
- Cursor *pC;
48743
+ VdbeCursor *pC;
4869948744
assert( i>=0 && i<p->nCursor );
4870048745
assert( p->apCsr[i]!=0 );
4870148746
if( (pC = p->apCsr[i])->pCursor==0 ){
4870248747
/* The zero initialization above is all that is needed */
4870348748
}else{
@@ -48861,11 +48906,11 @@
4886148906
Mem *pData = &p->aMem[pOp->p2];
4886248907
Mem *pKey = &p->aMem[pOp->p3];
4886348908
4886448909
i64 iKey; /* The integer ROWID or key for the record to be inserted */
4886548910
int i = pOp->p1;
48866
- Cursor *pC;
48911
+ VdbeCursor *pC;
4886748912
assert( i>=0 && i<p->nCursor );
4886848913
pC = p->apCsr[i];
4886948914
assert( pC!=0 );
4887048915
assert( pC->pCursor!=0 || pC->pseudoTable );
4887148916
assert( pKey->flags & MEM_Int );
@@ -48955,11 +49000,11 @@
4895549000
** using OP_NotFound prior to invoking this opcode.
4895649001
*/
4895749002
case OP_Delete: {
4895849003
int i = pOp->p1;
4895949004
i64 iKey;
48960
- Cursor *pC;
49005
+ VdbeCursor *pC;
4896149006
4896249007
assert( i>=0 && i<p->nCursor );
4896349008
pC = p->apCsr[i];
4896449009
assert( pC!=0 );
4896549010
assert( pC->pCursor!=0 ); /* Only valid for real tables, no pseudotables */
@@ -49026,11 +49071,11 @@
4902649071
** of a real table, not a pseudo-table.
4902749072
*/
4902849073
case OP_RowKey:
4902949074
case OP_RowData: {
4903049075
int i = pOp->p1;
49031
- Cursor *pC;
49076
+ VdbeCursor *pC;
4903249077
BtCursor *pCrsr;
4903349078
u32 n;
4903449079
4903549080
pOut = &p->aMem[pOp->p2];
4903649081
@@ -49080,11 +49125,11 @@
4908049125
** Store in register P2 an integer which is the key of the table entry that
4908149126
** P1 is currently point to.
4908249127
*/
4908349128
case OP_Rowid: { /* out2-prerelease */
4908449129
int i = pOp->p1;
49085
- Cursor *pC;
49130
+ VdbeCursor *pC;
4908649131
i64 v;
4908749132
4908849133
assert( i>=0 && i<p->nCursor );
4908949134
pC = p->apCsr[i];
4909049135
assert( pC!=0 );
@@ -49113,11 +49158,11 @@
4911349158
** that occur while the cursor is on the null row will always
4911449159
** write a NULL.
4911549160
*/
4911649161
case OP_NullRow: {
4911749162
int i = pOp->p1;
49118
- Cursor *pC;
49163
+ VdbeCursor *pC;
4911949164
4912049165
assert( i>=0 && i<p->nCursor );
4912149166
pC = p->apCsr[i];
4912249167
assert( pC!=0 );
4912349168
pC->nullRow = 1;
@@ -49136,11 +49181,11 @@
4913649181
** If P2 is 0 or if the table or index is not empty, fall through
4913749182
** to the following instruction.
4913849183
*/
4913949184
case OP_Last: { /* jump */
4914049185
int i = pOp->p1;
49141
- Cursor *pC;
49186
+ VdbeCursor *pC;
4914249187
BtCursor *pCrsr;
4914349188
int res;
4914449189
4914549190
assert( i>=0 && i<p->nCursor );
4914649191
pC = p->apCsr[i];
@@ -49186,11 +49231,11 @@
4918649231
** If P2 is 0 or if the table or index is not empty, fall through
4918749232
** to the following instruction.
4918849233
*/
4918949234
case OP_Rewind: { /* jump */
4919049235
int i = pOp->p1;
49191
- Cursor *pC;
49236
+ VdbeCursor *pC;
4919249237
BtCursor *pCrsr;
4919349238
int res;
4919449239
4919549240
assert( i>=0 && i<p->nCursor );
4919649241
pC = p->apCsr[i];
@@ -49231,11 +49276,11 @@
4923149276
**
4923249277
** The P1 cursor must be for a real table, not a pseudo-table.
4923349278
*/
4923449279
case OP_Prev: /* jump */
4923549280
case OP_Next: { /* jump */
49236
- Cursor *pC;
49281
+ VdbeCursor *pC;
4923749282
BtCursor *pCrsr;
4923849283
int res;
4923949284
4924049285
CHECK_FOR_INTERRUPT;
4924149286
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -49274,11 +49319,11 @@
4927449319
** This instruction only works for indices. The equivalent instruction
4927549320
** for tables is OP_Insert.
4927649321
*/
4927749322
case OP_IdxInsert: { /* in2 */
4927849323
int i = pOp->p1;
49279
- Cursor *pC;
49324
+ VdbeCursor *pC;
4928049325
BtCursor *pCrsr;
4928149326
assert( i>=0 && i<p->nCursor );
4928249327
assert( p->apCsr[i]!=0 );
4928349328
assert( pIn2->flags & MEM_Blob );
4928449329
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
@@ -49301,11 +49346,11 @@
4930149346
** an unpacked index key. This opcode removes that entry from the
4930249347
** index opened by cursor P1.
4930349348
*/
4930449349
case OP_IdxDelete: {
4930549350
int i = pOp->p1;
49306
- Cursor *pC;
49351
+ VdbeCursor *pC;
4930749352
BtCursor *pCrsr;
4930849353
assert( pOp->p3>0 );
4930949354
assert( pOp->p2>0 && pOp->p2+pOp->p3<=p->nMem );
4931049355
assert( i>=0 && i<p->nCursor );
4931149356
assert( p->apCsr[i]!=0 );
@@ -49335,11 +49380,11 @@
4933549380
** See also: Rowid, MakeIdxRec.
4933649381
*/
4933749382
case OP_IdxRowid: { /* out2-prerelease */
4933849383
int i = pOp->p1;
4933949384
BtCursor *pCrsr;
49340
- Cursor *pC;
49385
+ VdbeCursor *pC;
4934149386
4934249387
assert( i>=0 && i<p->nCursor );
4934349388
assert( p->apCsr[i]!=0 );
4934449389
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
4934549390
i64 rowid;
@@ -49385,11 +49430,11 @@
4938549430
** to the comparison. This makes the opcode work like IdxLE.
4938649431
*/
4938749432
case OP_IdxLT: /* jump, in3 */
4938849433
case OP_IdxGE: { /* jump, in3 */
4938949434
int i= pOp->p1;
49390
- Cursor *pC;
49435
+ VdbeCursor *pC;
4939149436
4939249437
assert( i>=0 && i<p->nCursor );
4939349438
assert( p->apCsr[i]!=0 );
4939449439
if( (pC = p->apCsr[i])->pCursor!=0 ){
4939549440
int res;
@@ -50068,11 +50113,11 @@
5006850113
** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
5006950114
** P1 is a cursor number. This opcode opens a cursor to the virtual
5007050115
** table and stores that cursor in P1.
5007150116
*/
5007250117
case OP_VOpen: {
50073
- Cursor *pCur = 0;
50118
+ VdbeCursor *pCur = 0;
5007450119
sqlite3_vtab_cursor *pVtabCursor = 0;
5007550120
5007650121
sqlite3_vtab *pVtab = pOp->p4.pVtab;
5007750122
sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule;
5007850123
@@ -50127,11 +50172,11 @@
5012750172
Mem *pQuery = &p->aMem[pOp->p3];
5012850173
Mem *pArgc = &pQuery[1];
5012950174
sqlite3_vtab_cursor *pVtabCursor;
5013050175
sqlite3_vtab *pVtab;
5013150176
50132
- Cursor *pCur = p->apCsr[pOp->p1];
50177
+ VdbeCursor *pCur = p->apCsr[pOp->p1];
5013350178
5013450179
REGISTER_TRACE(pOp->p3, pQuery);
5013550180
assert( pCur->pVtabCursor );
5013650181
pVtabCursor = pCur->pVtabCursor;
5013750182
pVtab = pVtabCursor->pVtab;
@@ -50184,11 +50229,11 @@
5018450229
*/
5018550230
case OP_VRowid: { /* out2-prerelease */
5018650231
sqlite3_vtab *pVtab;
5018750232
const sqlite3_module *pModule;
5018850233
sqlite_int64 iRow;
50189
- Cursor *pCur = p->apCsr[pOp->p1];
50234
+ VdbeCursor *pCur = p->apCsr[pOp->p1];
5019050235
5019150236
assert( pCur->pVtabCursor );
5019250237
if( pCur->nullRow ){
5019350238
break;
5019450239
}
@@ -50218,11 +50263,11 @@
5021850263
sqlite3_vtab *pVtab;
5021950264
const sqlite3_module *pModule;
5022050265
Mem *pDest;
5022150266
sqlite3_context sContext;
5022250267
50223
- Cursor *pCur = p->apCsr[pOp->p1];
50268
+ VdbeCursor *pCur = p->apCsr[pOp->p1];
5022450269
assert( pCur->pVtabCursor );
5022550270
assert( pOp->p3>0 && pOp->p3<=p->nMem );
5022650271
pDest = &p->aMem[pOp->p3];
5022750272
if( pCur->nullRow ){
5022850273
sqlite3VdbeMemSetNull(pDest);
@@ -50276,11 +50321,11 @@
5027650321
case OP_VNext: { /* jump */
5027750322
sqlite3_vtab *pVtab;
5027850323
const sqlite3_module *pModule;
5027950324
int res = 0;
5028050325
50281
- Cursor *pCur = p->apCsr[pOp->p1];
50326
+ VdbeCursor *pCur = p->apCsr[pOp->p1];
5028250327
assert( pCur->pVtabCursor );
5028350328
if( pCur->nullRow ){
5028450329
break;
5028550330
}
5028650331
pVtab = pCur->pVtabCursor->pVtab;
@@ -51153,15 +51198,11 @@
5115351198
#endif
5115451199
5115551200
/************** End of journal.c *********************************************/
5115651201
/************** Begin file memjournal.c **************************************/
5115751202
/*
51158
-<<<<<<< memjournal.c
51159
-** 2008 October 17
51160
-=======
5116151203
** 2008 October 7
51162
->>>>>>> 1.2
5116351204
**
5116451205
** The author disclaims copyright to this source code. In place of
5116551206
** a legal notice, here is a blessing:
5116651207
**
5116751208
** May you do good and not evil.
@@ -52715,11 +52756,11 @@
5271552756
**
5271652757
*************************************************************************
5271752758
** This file contains routines used for analyzing expressions and
5271852759
** for generating VDBE code that evaluates expressions in SQLite.
5271952760
**
52720
-** $Id: expr.c,v 1.400 2008/10/25 15:03:21 drh Exp $
52761
+** $Id: expr.c,v 1.401 2008/11/06 15:33:04 drh Exp $
5272152762
*/
5272252763
5272352764
/*
5272452765
** Return the 'affinity' of the expression pExpr if any.
5272552766
**
@@ -54565,10 +54606,14 @@
5456554606
testcase( to_op==OP_ToText );
5456654607
testcase( to_op==OP_ToBlob );
5456754608
testcase( to_op==OP_ToNumeric );
5456854609
testcase( to_op==OP_ToInt );
5456954610
testcase( to_op==OP_ToReal );
54611
+ if( inReg!=target ){
54612
+ sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target);
54613
+ inReg = target;
54614
+ }
5457054615
sqlite3VdbeAddOp1(v, to_op, inReg);
5457154616
testcase( usedAsColumnCache(pParse, inReg, inReg) );
5457254617
sqlite3ExprCacheAffinityChange(pParse, inReg, 1);
5457354618
break;
5457454619
}
@@ -56430,11 +56475,11 @@
5643056475
** May you share freely, never taking more than you give.
5643156476
**
5643256477
*************************************************************************
5643356478
** This file contains code associated with the ANALYZE command.
5643456479
**
56435
-** @(#) $Id: analyze.c,v 1.43 2008/07/28 19:34:53 drh Exp $
56480
+** @(#) $Id: analyze.c,v 1.44 2008/11/03 20:55:07 drh Exp $
5643656481
*/
5643756482
#ifndef SQLITE_OMIT_ANALYZE
5643856483
5643956484
/*
5644056485
** This routine generates code that opens the sqlite_stat1 table on cursor
@@ -56504,15 +56549,15 @@
5650456549
** a single table.
5650556550
*/
5650656551
static void analyzeOneTable(
5650756552
Parse *pParse, /* Parser context */
5650856553
Table *pTab, /* Table whose indices are to be analyzed */
56509
- int iStatCur, /* Cursor that writes to the sqlite_stat1 table */
56554
+ int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */
5651056555
int iMem /* Available memory locations begin here */
5651156556
){
5651256557
Index *pIdx; /* An index to being analyzed */
56513
- int iIdxCur; /* Cursor number for index being analyzed */
56558
+ int iIdxCur; /* Index of VdbeCursor for index being analyzed */
5651456559
int nCol; /* Number of columns in the index */
5651556560
Vdbe *v; /* The virtual machine being built up */
5651656561
int i; /* Loop counter */
5651756562
int topOfLoop; /* The top of the loop */
5651856563
int endOfLoop; /* The end of the loop */
@@ -57640,11 +57685,11 @@
5764057685
** creating ID lists
5764157686
** BEGIN TRANSACTION
5764257687
** COMMIT
5764357688
** ROLLBACK
5764457689
**
57645
-** $Id: build.c,v 1.499 2008/10/22 10:45:38 danielk1977 Exp $
57690
+** $Id: build.c,v 1.500 2008/11/03 20:55:07 drh Exp $
5764657691
*/
5764757692
5764857693
/*
5764957694
** This routine is called when a new SQL statement is beginning to
5765057695
** be parsed. Initialize the pParse structure as needed.
@@ -60673,11 +60718,11 @@
6067360718
pList->nSrc++;
6067460719
return pList;
6067560720
}
6067660721
6067760722
/*
60678
-** Assign cursors to all tables in a SrcList
60723
+** Assign VdbeCursor index numbers to all tables in a SrcList
6067960724
*/
6068060725
SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
6068160726
int i;
6068260727
struct SrcList_item *pItem;
6068360728
assert(pList || pParse->db->mallocFailed );
@@ -63616,11 +63661,11 @@
6361663661
**
6361763662
*************************************************************************
6361863663
** This file contains C code routines that are called by the parser
6361963664
** to handle INSERT statements in SQLite.
6362063665
**
63621
-** $Id: insert.c,v 1.250 2008/10/31 10:53:23 danielk1977 Exp $
63666
+** $Id: insert.c,v 1.251 2008/11/03 20:55:07 drh Exp $
6362263667
*/
6362363668
6362463669
/*
6362563670
** Set P4 of the most recently inserted opcode to a column affinity
6362663671
** string for index pIdx. A column affinity string has one character
@@ -64988,11 +65033,11 @@
6498865033
** Return the number of indices on the table.
6498965034
*/
6499065035
SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
6499165036
Parse *pParse, /* Parsing context */
6499265037
Table *pTab, /* Table to be opened */
64993
- int baseCur, /* Cursor number assigned to the table */
65038
+ int baseCur, /* Cursor number assigned to the table */
6499465039
int op /* OP_OpenRead or OP_OpenWrite */
6499565040
){
6499665041
int i;
6499765042
int iDb;
6499865043
Index *pIdx;
@@ -75667,11 +75712,11 @@
7566775712
** generating the code that loops through a table looking for applicable
7566875713
** rows. Indices are selected and used to speed the search when doing
7566975714
** so is applicable. Because this module is responsible for selecting
7567075715
** indices, you might also think of this module as the "query optimizer".
7567175716
**
75672
-** $Id: where.c,v 1.327 2008/10/25 15:03:21 drh Exp $
75717
+** $Id: where.c,v 1.328 2008/11/03 09:06:06 danielk1977 Exp $
7567375718
*/
7567475719
7567575720
/*
7567675721
** The number of bits in a Bitmask. "BMS" means "BitMask Size".
7567775722
*/
@@ -78122,20 +78167,30 @@
7812278167
pStart = pEnd;
7812378168
pEnd = pTerm;
7812478169
}
7812578170
if( pStart ){
7812678171
Expr *pX;
78127
- int r1, regFree1;
78172
+ int r1;
7812878173
pX = pStart->pExpr;
7812978174
assert( pX!=0 );
7813078175
assert( pStart->leftCursor==iCur );
78131
- r1 = sqlite3ExprCodeTemp(pParse, pX->pRight, &regFree1);
78176
+
78177
+ /* The ForceInt instruction may modify the register that it operates
78178
+ ** on. For example it may replace a real value with an integer one,
78179
+ ** or if p3 is true it may increment the register value. For this
78180
+ ** reason we need to make sure that register r1 is really a newly
78181
+ ** allocated temporary register, and not part of the column-cache.
78182
+ ** For this reason we cannot use sqlite3ExprCodeTemp() here.
78183
+ */
78184
+ r1 = sqlite3GetTempReg(pParse);
78185
+ sqlite3ExprCode(pParse, pX->pRight, r1);
78186
+
7813278187
sqlite3VdbeAddOp3(v, OP_ForceInt, r1, brk,
7813378188
pX->op==TK_LE || pX->op==TK_GT);
7813478189
sqlite3VdbeAddOp3(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk, r1);
7813578190
VdbeComment((v, "pk"));
78136
- sqlite3ReleaseTempReg(pParse, regFree1);
78191
+ sqlite3ReleaseTempReg(pParse, r1);
7813778192
disableTerm(pLevel, pStart);
7813878193
}else{
7813978194
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, brk);
7814078195
}
7814178196
if( pEnd ){
@@ -78764,424 +78819,424 @@
7876478819
** yy_reduce_ofst[] For each state, the offset into yy_action for
7876578820
** shifting non-terminals after a reduce.
7876678821
** yy_default[] Default action for each state.
7876778822
*/
7876878823
static const YYACTIONTYPE yy_action[] = {
78769
- /* 0 */ 296, 914, 125, 485, 2, 181, 539, 539, 92, 92,
78770
- /* 10 */ 92, 92, 489, 94, 94, 94, 94, 95, 95, 96,
78771
- /* 20 */ 96, 96, 76, 215, 264, 303, 527, 518, 57, 94,
78772
- /* 30 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78773
- /* 40 */ 68, 468, 87, 154, 91, 72, 305, 512, 510, 516,
78774
- /* 50 */ 516, 93, 93, 92, 92, 92, 92, 217, 94, 94,
78775
- /* 60 */ 94, 94, 95, 95, 96, 96, 96, 76, 215, 296,
78776
- /* 70 */ 10, 539, 539, 303, 489, 84, 482, 467, 463, 298,
78777
- /* 80 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78778
- /* 90 */ 215, 489, 475, 221, 179, 527, 518, 521, 295, 74,
78779
- /* 100 */ 114, 239, 349, 283, 350, 171, 409, 60, 404, 403,
78780
- /* 110 */ 536, 567, 256, 91, 72, 305, 512, 510, 516, 516,
78781
- /* 120 */ 93, 93, 92, 92, 92, 92, 215, 94, 94, 94,
78782
- /* 130 */ 94, 95, 95, 96, 96, 96, 76, 215, 296, 467,
78783
- /* 140 */ 463, 221, 415, 531, 531, 531, 482, 192, 114, 239,
78784
- /* 150 */ 349, 283, 350, 171, 369, 589, 467, 463, 196, 372,
78785
- /* 160 */ 256, 351, 354, 355, 527, 518, 150, 151, 68, 343,
78786
- /* 170 */ 87, 154, 356, 454, 323, 68, 409, 87, 154, 557,
78787
- /* 180 */ 536, 296, 91, 72, 305, 512, 510, 516, 516, 93,
78788
- /* 190 */ 93, 92, 92, 92, 92, 572, 94, 94, 94, 94,
78789
- /* 200 */ 95, 95, 96, 96, 96, 76, 215, 527, 518, 76,
78790
- /* 210 */ 215, 452, 322, 531, 531, 531, 95, 95, 96, 96,
78791
- /* 220 */ 96, 76, 215, 595, 594, 91, 72, 305, 512, 510,
78792
- /* 230 */ 516, 516, 93, 93, 92, 92, 92, 92, 233, 94,
78793
- /* 240 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78794
- /* 250 */ 515, 506, 317, 324, 296, 507, 507, 464, 289, 152,
78795
- /* 260 */ 157, 379, 257, 232, 462, 318, 513, 547, 342, 489,
78796
- /* 270 */ 225, 188, 217, 317, 551, 26, 181, 197, 539, 196,
78797
- /* 280 */ 527, 518, 351, 354, 355, 546, 545, 96, 96, 96,
78798
- /* 290 */ 76, 215, 231, 356, 548, 551, 33, 86, 91, 72,
78799
- /* 300 */ 305, 512, 510, 516, 516, 93, 93, 92, 92, 92,
78800
- /* 310 */ 92, 548, 94, 94, 94, 94, 95, 95, 96, 96,
78801
- /* 320 */ 96, 76, 215, 296, 492, 210, 549, 196, 108, 317,
78802
- /* 330 */ 351, 354, 355, 317, 467, 463, 386, 324, 317, 507,
78803
- /* 340 */ 507, 356, 311, 539, 543, 544, 155, 542, 209, 527,
78804
- /* 350 */ 518, 551, 33, 407, 291, 551, 44, 486, 553, 172,
78805
- /* 360 */ 551, 36, 564, 394, 632, 431, 296, 91, 72, 305,
78806
- /* 370 */ 512, 510, 516, 516, 93, 93, 92, 92, 92, 92,
78807
- /* 380 */ 548, 94, 94, 94, 94, 95, 95, 96, 96, 96,
78808
- /* 390 */ 76, 215, 527, 518, 67, 481, 337, 219, 309, 249,
78809
- /* 400 */ 588, 583, 417, 335, 248, 575, 579, 587, 334, 296,
78810
- /* 410 */ 91, 72, 305, 512, 510, 516, 516, 93, 93, 92,
78811
- /* 420 */ 92, 92, 92, 410, 94, 94, 94, 94, 95, 95,
78812
- /* 430 */ 96, 96, 96, 76, 215, 527, 518, 266, 216, 271,
78813
- /* 440 */ 446, 246, 238, 452, 244, 56, 310, 499, 498, 284,
78814
- /* 450 */ 489, 175, 247, 91, 72, 305, 512, 510, 516, 516,
78815
- /* 460 */ 93, 93, 92, 92, 92, 92, 194, 94, 94, 94,
78816
- /* 470 */ 94, 95, 95, 96, 96, 96, 76, 215, 359, 421,
78817
- /* 480 */ 180, 324, 296, 507, 507, 560, 476, 62, 324, 561,
78818
- /* 490 */ 507, 507, 460, 379, 257, 232, 376, 68, 474, 87,
78819
- /* 500 */ 154, 457, 526, 523, 217, 194, 408, 418, 527, 518,
78820
- /* 510 */ 209, 473, 332, 331, 548, 467, 463, 437, 1, 259,
78821
- /* 520 */ 174, 299, 489, 520, 519, 63, 91, 72, 305, 512,
78822
- /* 530 */ 510, 516, 516, 93, 93, 92, 92, 92, 92, 377,
78823
- /* 540 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78824
- /* 550 */ 215, 296, 522, 158, 548, 411, 18, 476, 317, 19,
78825
- /* 560 */ 299, 380, 220, 317, 554, 256, 173, 159, 156, 474,
78826
- /* 570 */ 279, 574, 344, 591, 21, 495, 495, 527, 518, 302,
78827
- /* 580 */ 551, 36, 473, 146, 402, 551, 44, 467, 463, 438,
78828
- /* 590 */ 905, 573, 905, 457, 597, 91, 72, 305, 512, 510,
78829
- /* 600 */ 516, 516, 93, 93, 92, 92, 92, 92, 8, 94,
78830
- /* 610 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78831
- /* 620 */ 296, 554, 363, 335, 584, 433, 317, 218, 346, 525,
78832
- /* 630 */ 586, 21, 578, 552, 326, 499, 498, 489, 191, 340,
78833
- /* 640 */ 430, 558, 234, 306, 429, 577, 527, 518, 551, 36,
78834
- /* 650 */ 201, 164, 170, 558, 149, 590, 368, 537, 441, 547,
78835
- /* 660 */ 179, 180, 381, 296, 91, 72, 305, 512, 510, 516,
78836
- /* 670 */ 516, 93, 93, 92, 92, 92, 92, 546, 94, 94,
78837
- /* 680 */ 94, 94, 95, 95, 96, 96, 96, 76, 215, 527,
78838
- /* 690 */ 518, 339, 492, 570, 288, 548, 438, 904, 209, 904,
78839
- /* 700 */ 455, 444, 467, 463, 492, 210, 296, 91, 72, 305,
78840
- /* 710 */ 512, 510, 516, 516, 93, 93, 92, 92, 92, 92,
78841
- /* 720 */ 377, 94, 94, 94, 94, 95, 95, 96, 96, 96,
78842
- /* 730 */ 76, 215, 527, 518, 554, 391, 525, 333, 85, 389,
78843
- /* 740 */ 209, 837, 373, 470, 21, 486, 327, 172, 282, 296,
78844
- /* 750 */ 91, 64, 305, 512, 510, 516, 516, 93, 93, 92,
78845
- /* 760 */ 92, 92, 92, 569, 94, 94, 94, 94, 95, 95,
78846
- /* 770 */ 96, 96, 96, 76, 215, 527, 518, 598, 534, 395,
78847
- /* 780 */ 425, 366, 425, 494, 290, 294, 393, 388, 445, 434,
78848
- /* 790 */ 426, 89, 296, 70, 72, 305, 512, 510, 516, 516,
78849
- /* 800 */ 93, 93, 92, 92, 92, 92, 217, 94, 94, 94,
78850
- /* 810 */ 94, 95, 95, 96, 96, 96, 76, 215, 527, 518,
78851
- /* 820 */ 387, 358, 533, 175, 80, 504, 20, 23, 144, 489,
78852
- /* 830 */ 288, 489, 534, 395, 288, 446, 437, 175, 305, 512,
78853
- /* 840 */ 510, 516, 516, 93, 93, 92, 92, 92, 92, 217,
78854
- /* 850 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78855
- /* 860 */ 215, 69, 328, 378, 4, 169, 22, 317, 315, 288,
78856
- /* 870 */ 539, 505, 193, 159, 224, 500, 325, 304, 118, 345,
78857
- /* 880 */ 347, 6, 317, 458, 260, 69, 328, 446, 4, 551,
78858
- /* 890 */ 35, 317, 315, 330, 467, 463, 467, 463, 316, 548,
78859
- /* 900 */ 325, 551, 3, 482, 551, 100, 317, 560, 317, 288,
78860
- /* 910 */ 286, 561, 592, 551, 48, 437, 317, 330, 317, 313,
78861
- /* 920 */ 449, 317, 453, 83, 77, 420, 280, 482, 551, 49,
78862
- /* 930 */ 551, 28, 90, 320, 321, 539, 487, 536, 551, 47,
78863
- /* 940 */ 551, 11, 236, 551, 46, 317, 275, 83, 77, 203,
78864
- /* 950 */ 508, 443, 568, 175, 175, 252, 90, 320, 321, 317,
78865
- /* 960 */ 270, 536, 440, 2, 317, 436, 317, 551, 98, 288,
78866
- /* 970 */ 531, 531, 531, 529, 528, 16, 288, 367, 317, 217,
78867
- /* 980 */ 317, 551, 29, 548, 260, 189, 551, 24, 551, 43,
78868
- /* 990 */ 268, 230, 254, 104, 531, 531, 531, 529, 528, 16,
78869
- /* 1000 */ 551, 17, 551, 54, 288, 371, 187, 202, 258, 317,
78870
- /* 1010 */ 211, 69, 328, 580, 4, 240, 317, 212, 315, 223,
78871
- /* 1020 */ 483, 160, 80, 376, 439, 317, 325, 168, 317, 452,
78872
- /* 1030 */ 374, 551, 42, 165, 317, 447, 186, 317, 551, 31,
78873
- /* 1040 */ 317, 548, 317, 330, 317, 237, 317, 551, 55, 317,
78874
- /* 1050 */ 551, 41, 471, 482, 317, 548, 551, 45, 288, 551,
78875
- /* 1060 */ 37, 206, 551, 110, 551, 112, 551, 25, 551, 34,
78876
- /* 1070 */ 317, 551, 50, 83, 77, 269, 551, 27, 317, 384,
78877
- /* 1080 */ 241, 232, 90, 320, 321, 297, 317, 536, 317, 213,
78878
- /* 1090 */ 217, 317, 551, 32, 317, 548, 317, 260, 260, 511,
78879
- /* 1100 */ 551, 113, 260, 450, 403, 317, 253, 317, 551, 51,
78880
- /* 1110 */ 551, 39, 491, 551, 40, 390, 551, 52, 551, 38,
78881
- /* 1120 */ 531, 531, 531, 529, 528, 16, 255, 551, 30, 551,
78882
- /* 1130 */ 111, 317, 314, 312, 317, 273, 317, 308, 317, 375,
78883
- /* 1140 */ 317, 115, 317, 497, 582, 267, 559, 496, 162, 245,
78884
- /* 1150 */ 242, 235, 263, 551, 53, 532, 551, 99, 551, 97,
78885
- /* 1160 */ 551, 102, 551, 103, 551, 109, 493, 243, 385, 524,
78886
- /* 1170 */ 329, 538, 466, 261, 148, 556, 400, 563, 465, 461,
78887
- /* 1180 */ 185, 562, 413, 117, 353, 565, 182, 250, 65, 583,
78888
- /* 1190 */ 469, 136, 207, 214, 134, 360, 204, 126, 348, 406,
78889
- /* 1200 */ 581, 362, 451, 75, 129, 85, 541, 200, 397, 398,
78890
- /* 1210 */ 300, 596, 199, 517, 383, 251, 133, 592, 501, 593,
78891
- /* 1220 */ 488, 422, 405, 71, 227, 190, 555, 262, 338, 131,
78892
- /* 1230 */ 274, 382, 88, 341, 122, 265, 293, 442, 120, 423,
78893
- /* 1240 */ 142, 370, 132, 428, 566, 73, 277, 222, 228, 176,
78894
- /* 1250 */ 336, 278, 66, 7, 319, 307, 585, 540, 281, 571,
78895
- /* 1260 */ 79, 364, 478, 107, 416, 576, 427, 101, 163, 419,
78896
- /* 1270 */ 292, 530, 226, 399, 105, 633, 634, 285, 208, 514,
78897
- /* 1280 */ 509, 82, 480, 503, 484, 145, 161, 167, 479, 477,
78898
- /* 1290 */ 448, 119, 472, 5, 14, 61, 12, 137, 301, 177,
78899
- /* 1300 */ 435, 139, 153, 414, 412, 229, 78, 116, 124, 195,
78900
- /* 1310 */ 272, 123, 81, 121, 247, 361, 143, 401, 141, 179,
78901
- /* 1320 */ 352, 357, 365, 276, 178, 140, 138, 432, 9, 456,
78902
- /* 1330 */ 424, 135, 183, 13, 184, 490, 205, 502, 130, 198,
78903
- /* 1340 */ 128, 127, 166, 15, 106, 550, 147, 287, 535, 396,
78904
- /* 1350 */ 915, 459, 915, 59, 915, 392, 58,
78824
+ /* 0 */ 296, 914, 120, 597, 2, 172, 425, 425, 62, 62,
78825
+ /* 10 */ 62, 62, 210, 64, 64, 64, 64, 65, 65, 66,
78826
+ /* 20 */ 66, 66, 67, 212, 398, 395, 432, 438, 69, 64,
78827
+ /* 30 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78828
+ /* 40 */ 458, 456, 327, 168, 61, 60, 301, 442, 443, 439,
78829
+ /* 50 */ 439, 63, 63, 62, 62, 62, 62, 256, 64, 64,
78830
+ /* 60 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296,
78831
+ /* 70 */ 498, 425, 425, 212, 427, 83, 68, 469, 70, 154,
78832
+ /* 80 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78833
+ /* 90 */ 212, 68, 307, 70, 154, 432, 438, 454, 214, 59,
78834
+ /* 100 */ 65, 65, 66, 66, 66, 67, 212, 429, 429, 429,
78835
+ /* 110 */ 497, 583, 296, 61, 60, 301, 442, 443, 439, 439,
78836
+ /* 120 */ 63, 63, 62, 62, 62, 62, 321, 64, 64, 64,
78837
+ /* 130 */ 64, 65, 65, 66, 66, 66, 67, 212, 432, 438,
78838
+ /* 140 */ 95, 66, 66, 66, 67, 212, 403, 256, 421, 35,
78839
+ /* 150 */ 57, 67, 212, 175, 417, 499, 61, 60, 301, 442,
78840
+ /* 160 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 19,
78841
+ /* 170 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78842
+ /* 180 */ 212, 296, 225, 532, 299, 581, 109, 422, 242, 458,
78843
+ /* 190 */ 416, 335, 414, 21, 502, 503, 346, 403, 527, 176,
78844
+ /* 200 */ 160, 454, 214, 580, 579, 344, 500, 432, 438, 149,
78845
+ /* 210 */ 150, 404, 405, 539, 514, 418, 151, 541, 8, 498,
78846
+ /* 220 */ 538, 577, 578, 427, 296, 61, 60, 301, 442, 443,
78847
+ /* 230 */ 439, 439, 63, 63, 62, 62, 62, 62, 196, 64,
78848
+ /* 240 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78849
+ /* 250 */ 432, 438, 454, 598, 398, 395, 429, 429, 429, 369,
78850
+ /* 260 */ 558, 481, 404, 405, 372, 576, 213, 296, 61, 60,
78851
+ /* 270 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62,
78852
+ /* 280 */ 62, 321, 64, 64, 64, 64, 65, 65, 66, 66,
78853
+ /* 290 */ 66, 67, 212, 432, 438, 555, 503, 304, 557, 532,
78854
+ /* 300 */ 218, 557, 552, 421, 36, 234, 397, 2, 542, 21,
78855
+ /* 310 */ 540, 61, 60, 301, 442, 443, 439, 439, 63, 63,
78856
+ /* 320 */ 62, 62, 62, 62, 388, 64, 64, 64, 64, 65,
78857
+ /* 330 */ 65, 66, 66, 66, 67, 212, 415, 530, 85, 381,
78858
+ /* 340 */ 78, 323, 296, 210, 304, 527, 493, 492, 379, 274,
78859
+ /* 350 */ 273, 379, 274, 273, 347, 463, 241, 387, 268, 210,
78860
+ /* 360 */ 533, 581, 210, 403, 20, 224, 144, 464, 432, 438,
78861
+ /* 370 */ 485, 164, 114, 248, 349, 253, 350, 177, 554, 580,
78862
+ /* 380 */ 465, 420, 331, 81, 257, 419, 61, 60, 301, 442,
78863
+ /* 390 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 391,
78864
+ /* 400 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78865
+ /* 410 */ 212, 296, 224, 203, 249, 496, 403, 440, 837, 114,
78866
+ /* 420 */ 248, 349, 253, 350, 177, 250, 321, 152, 404, 405,
78867
+ /* 430 */ 321, 257, 303, 324, 155, 445, 445, 432, 438, 317,
78868
+ /* 440 */ 400, 389, 213, 68, 209, 70, 154, 422, 421, 35,
78869
+ /* 450 */ 393, 202, 421, 42, 481, 61, 60, 301, 442, 443,
78870
+ /* 460 */ 439, 439, 63, 63, 62, 62, 62, 62, 422, 64,
78871
+ /* 470 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78872
+ /* 480 */ 296, 404, 405, 183, 513, 422, 351, 354, 355, 403,
78873
+ /* 490 */ 77, 335, 79, 489, 216, 183, 334, 356, 351, 354,
78874
+ /* 500 */ 355, 433, 434, 406, 407, 408, 432, 438, 235, 356,
78875
+ /* 510 */ 386, 68, 291, 70, 154, 456, 531, 168, 198, 302,
78876
+ /* 520 */ 449, 450, 436, 437, 61, 60, 301, 442, 443, 439,
78877
+ /* 530 */ 439, 63, 63, 62, 62, 62, 62, 394, 64, 64,
78878
+ /* 540 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296,
78879
+ /* 550 */ 321, 435, 422, 260, 404, 405, 321, 183, 153, 321,
78880
+ /* 560 */ 351, 354, 355, 446, 332, 321, 595, 905, 321, 905,
78881
+ /* 570 */ 1, 356, 421, 28, 403, 432, 438, 376, 421, 42,
78882
+ /* 580 */ 477, 421, 35, 213, 548, 366, 548, 421, 50, 159,
78883
+ /* 590 */ 421, 50, 422, 61, 60, 301, 442, 443, 439, 439,
78884
+ /* 600 */ 63, 63, 62, 62, 62, 62, 592, 64, 64, 64,
78885
+ /* 610 */ 64, 65, 65, 66, 66, 66, 67, 212, 296, 337,
78886
+ /* 620 */ 217, 463, 256, 94, 339, 326, 449, 450, 172, 340,
78887
+ /* 630 */ 425, 345, 532, 464, 312, 595, 904, 313, 904, 404,
78888
+ /* 640 */ 405, 588, 21, 226, 432, 438, 465, 243, 504, 324,
78889
+ /* 650 */ 322, 445, 445, 421, 3, 459, 230, 308, 505, 194,
78890
+ /* 660 */ 278, 296, 61, 60, 301, 442, 443, 439, 439, 63,
78891
+ /* 670 */ 63, 62, 62, 62, 62, 592, 64, 64, 64, 64,
78892
+ /* 680 */ 65, 65, 66, 66, 66, 67, 212, 432, 438, 213,
78893
+ /* 690 */ 179, 180, 181, 422, 324, 425, 445, 445, 281, 262,
78894
+ /* 700 */ 279, 402, 194, 481, 296, 61, 60, 301, 442, 443,
78895
+ /* 710 */ 439, 439, 63, 63, 62, 62, 62, 62, 377, 64,
78896
+ /* 720 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78897
+ /* 730 */ 432, 438, 591, 295, 115, 268, 422, 266, 211, 264,
78898
+ /* 740 */ 373, 324, 246, 445, 445, 56, 256, 296, 61, 71,
78899
+ /* 750 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62,
78900
+ /* 760 */ 62, 377, 64, 64, 64, 64, 65, 65, 66, 66,
78901
+ /* 770 */ 66, 67, 212, 432, 438, 550, 269, 474, 18, 549,
78902
+ /* 780 */ 280, 309, 343, 380, 171, 160, 256, 268, 5, 268,
78903
+ /* 790 */ 296, 368, 60, 301, 442, 443, 439, 439, 63, 63,
78904
+ /* 800 */ 62, 62, 62, 62, 321, 64, 64, 64, 64, 65,
78905
+ /* 810 */ 65, 66, 66, 66, 67, 212, 432, 438, 403, 10,
78906
+ /* 820 */ 403, 310, 268, 403, 268, 485, 421, 29, 566, 22,
78907
+ /* 830 */ 568, 420, 428, 425, 376, 419, 301, 442, 443, 439,
78908
+ /* 840 */ 439, 63, 63, 62, 62, 62, 62, 321, 64, 64,
78909
+ /* 850 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 73,
78910
+ /* 860 */ 328, 485, 4, 569, 268, 570, 300, 268, 147, 421,
78911
+ /* 870 */ 24, 321, 359, 321, 325, 73, 328, 491, 4, 455,
78912
+ /* 880 */ 321, 342, 300, 404, 405, 404, 405, 367, 404, 405,
78913
+ /* 890 */ 325, 330, 321, 421, 33, 421, 54, 321, 425, 178,
78914
+ /* 900 */ 229, 458, 421, 53, 321, 227, 321, 330, 228, 478,
78915
+ /* 910 */ 165, 321, 315, 119, 421, 99, 333, 458, 321, 421,
78916
+ /* 920 */ 97, 76, 75, 311, 268, 519, 421, 102, 421, 103,
78917
+ /* 930 */ 74, 319, 320, 421, 108, 427, 467, 76, 75, 490,
78918
+ /* 940 */ 421, 110, 452, 452, 321, 520, 74, 319, 320, 73,
78919
+ /* 950 */ 328, 427, 4, 210, 298, 321, 300, 321, 156, 257,
78920
+ /* 960 */ 321, 210, 185, 182, 325, 284, 421, 17, 429, 429,
78921
+ /* 970 */ 429, 430, 431, 12, 593, 378, 188, 421, 100, 421,
78922
+ /* 980 */ 34, 330, 421, 98, 429, 429, 429, 430, 431, 12,
78923
+ /* 990 */ 475, 458, 422, 162, 480, 321, 422, 306, 231, 232,
78924
+ /* 1000 */ 233, 105, 484, 632, 476, 321, 486, 447, 321, 23,
78925
+ /* 1010 */ 422, 76, 75, 594, 207, 178, 286, 421, 25, 254,
78926
+ /* 1020 */ 74, 319, 320, 287, 321, 427, 321, 421, 55, 321,
78927
+ /* 1030 */ 421, 111, 321, 471, 321, 205, 515, 557, 511, 363,
78928
+ /* 1040 */ 472, 204, 321, 516, 206, 321, 421, 112, 421, 113,
78929
+ /* 1050 */ 321, 421, 26, 321, 421, 37, 421, 38, 429, 429,
78930
+ /* 1060 */ 429, 430, 431, 12, 421, 27, 521, 421, 39, 321,
78931
+ /* 1070 */ 298, 158, 421, 40, 255, 421, 41, 321, 483, 321,
78932
+ /* 1080 */ 173, 523, 321, 182, 321, 522, 321, 384, 283, 273,
78933
+ /* 1090 */ 321, 421, 43, 297, 534, 321, 476, 321, 210, 421,
78934
+ /* 1100 */ 44, 421, 45, 321, 421, 30, 421, 31, 421, 46,
78935
+ /* 1110 */ 508, 509, 421, 47, 259, 321, 182, 421, 48, 421,
78936
+ /* 1120 */ 49, 321, 358, 390, 182, 421, 32, 321, 261, 518,
78937
+ /* 1130 */ 517, 553, 561, 182, 173, 412, 191, 421, 11, 562,
78938
+ /* 1140 */ 573, 92, 92, 421, 51, 590, 263, 294, 265, 421,
78939
+ /* 1150 */ 52, 267, 272, 371, 146, 374, 375, 275, 276, 277,
78940
+ /* 1160 */ 565, 575, 285, 288, 289, 587, 470, 451, 236, 453,
78941
+ /* 1170 */ 329, 244, 473, 514, 251, 524, 560, 163, 401, 572,
78942
+ /* 1180 */ 426, 525, 282, 528, 409, 7, 410, 411, 385, 318,
78943
+ /* 1190 */ 85, 237, 338, 526, 84, 336, 353, 58, 80, 215,
78944
+ /* 1200 */ 170, 468, 121, 86, 341, 348, 305, 501, 506, 124,
78945
+ /* 1210 */ 511, 222, 360, 423, 252, 186, 512, 510, 221, 223,
78946
+ /* 1220 */ 238, 507, 239, 535, 240, 292, 424, 529, 536, 537,
78947
+ /* 1230 */ 293, 543, 187, 189, 245, 362, 482, 488, 247, 190,
78948
+ /* 1240 */ 364, 89, 545, 192, 117, 370, 132, 556, 563, 195,
78949
+ /* 1250 */ 382, 383, 314, 133, 134, 571, 138, 135, 136, 584,
78950
+ /* 1260 */ 589, 585, 142, 399, 101, 413, 220, 586, 270, 104,
78951
+ /* 1270 */ 141, 633, 634, 166, 167, 441, 444, 72, 460, 448,
78952
+ /* 1280 */ 457, 546, 143, 157, 6, 461, 14, 479, 169, 462,
78953
+ /* 1290 */ 93, 466, 82, 122, 13, 174, 487, 96, 123, 161,
78954
+ /* 1300 */ 494, 495, 87, 125, 126, 116, 258, 88, 127, 184,
78955
+ /* 1310 */ 250, 361, 219, 107, 544, 145, 128, 193, 365, 118,
78956
+ /* 1320 */ 352, 357, 173, 271, 130, 9, 316, 559, 197, 90,
78957
+ /* 1330 */ 547, 131, 129, 15, 199, 551, 564, 200, 567, 201,
78958
+ /* 1340 */ 139, 137, 582, 91, 16, 106, 140, 208, 574, 392,
78959
+ /* 1350 */ 396, 290, 148, 596,
7890578960
};
7890678961
static const YYCODETYPE yy_lookahead[] = {
7890778962
/* 0 */ 16, 140, 141, 142, 143, 21, 23, 23, 69, 70,
78908
- /* 10 */ 71, 72, 23, 74, 75, 76, 77, 78, 79, 80,
78909
- /* 20 */ 81, 82, 83, 84, 205, 16, 42, 43, 73, 74,
78963
+ /* 10 */ 71, 72, 110, 74, 75, 76, 77, 78, 79, 80,
78964
+ /* 20 */ 81, 82, 83, 84, 1, 2, 42, 43, 73, 74,
7891078965
/* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78911
- /* 40 */ 219, 220, 221, 222, 60, 61, 62, 63, 64, 65,
78912
- /* 50 */ 66, 67, 68, 69, 70, 71, 72, 110, 74, 75,
78966
+ /* 40 */ 58, 162, 163, 164, 60, 61, 62, 63, 64, 65,
78967
+ /* 50 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75,
7891378968
/* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
78914
- /* 70 */ 19, 88, 88, 16, 23, 22, 58, 88, 89, 151,
78969
+ /* 70 */ 88, 88, 88, 84, 92, 22, 219, 220, 221, 222,
7891578970
/* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78916
- /* 90 */ 84, 23, 20, 84, 22, 42, 43, 245, 246, 46,
78917
- /* 100 */ 91, 92, 93, 94, 95, 96, 88, 19, 186, 187,
78918
- /* 110 */ 92, 23, 103, 60, 61, 62, 63, 64, 65, 66,
78919
- /* 120 */ 67, 68, 69, 70, 71, 72, 84, 74, 75, 76,
78920
- /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 88,
78921
- /* 140 */ 89, 84, 20, 125, 126, 127, 58, 90, 91, 92,
78922
- /* 150 */ 93, 94, 95, 96, 226, 182, 88, 89, 90, 231,
78923
- /* 160 */ 103, 93, 94, 95, 42, 43, 78, 79, 219, 16,
78924
- /* 170 */ 221, 222, 104, 11, 16, 219, 88, 221, 222, 182,
78925
- /* 180 */ 92, 16, 60, 61, 62, 63, 64, 65, 66, 67,
78926
- /* 190 */ 68, 69, 70, 71, 72, 239, 74, 75, 76, 77,
78927
- /* 200 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 83,
78928
- /* 210 */ 84, 49, 148, 125, 126, 127, 78, 79, 80, 81,
78929
- /* 220 */ 82, 83, 84, 7, 8, 60, 61, 62, 63, 64,
78930
- /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 148, 74,
78971
+ /* 90 */ 84, 219, 183, 221, 222, 42, 43, 78, 79, 46,
78972
+ /* 100 */ 78, 79, 80, 81, 82, 83, 84, 125, 126, 127,
78973
+ /* 110 */ 170, 239, 16, 60, 61, 62, 63, 64, 65, 66,
78974
+ /* 120 */ 67, 68, 69, 70, 71, 72, 148, 74, 75, 76,
78975
+ /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
78976
+ /* 140 */ 44, 80, 81, 82, 83, 84, 23, 148, 170, 171,
78977
+ /* 150 */ 19, 83, 84, 156, 23, 170, 60, 61, 62, 63,
78978
+ /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 19,
78979
+ /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78980
+ /* 180 */ 84, 16, 183, 148, 151, 148, 21, 190, 148, 58,
78981
+ /* 190 */ 169, 213, 157, 158, 186, 187, 218, 23, 177, 202,
78982
+ /* 200 */ 203, 78, 79, 166, 167, 208, 161, 42, 43, 78,
78983
+ /* 210 */ 79, 88, 89, 177, 178, 170, 181, 182, 68, 88,
78984
+ /* 220 */ 184, 98, 99, 92, 16, 60, 61, 62, 63, 64,
78985
+ /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 22, 74,
7893178986
/* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78932
- /* 250 */ 92, 20, 148, 106, 16, 108, 109, 27, 20, 22,
78933
- /* 260 */ 156, 99, 100, 101, 34, 144, 145, 148, 115, 23,
78934
- /* 270 */ 149, 19, 110, 148, 170, 171, 21, 156, 23, 90,
78935
- /* 280 */ 42, 43, 93, 94, 95, 166, 167, 80, 81, 82,
78936
- /* 290 */ 83, 84, 191, 104, 190, 170, 171, 132, 60, 61,
78937
- /* 300 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
78938
- /* 310 */ 72, 190, 74, 75, 76, 77, 78, 79, 80, 81,
78939
- /* 320 */ 82, 83, 84, 16, 78, 79, 20, 90, 21, 148,
78940
- /* 330 */ 93, 94, 95, 148, 88, 89, 215, 106, 148, 108,
78941
- /* 340 */ 109, 104, 217, 88, 98, 99, 156, 228, 229, 42,
78942
- /* 350 */ 43, 170, 171, 161, 159, 170, 171, 162, 163, 164,
78943
- /* 360 */ 170, 171, 170, 242, 112, 59, 16, 60, 61, 62,
78944
- /* 370 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
78945
- /* 380 */ 190, 74, 75, 76, 77, 78, 79, 80, 81, 82,
78946
- /* 390 */ 83, 84, 42, 43, 44, 20, 211, 212, 217, 14,
78947
- /* 400 */ 177, 178, 20, 213, 14, 91, 92, 184, 218, 16,
78948
- /* 410 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
78949
- /* 420 */ 70, 71, 72, 170, 74, 75, 76, 77, 78, 79,
78950
- /* 430 */ 80, 81, 82, 83, 84, 42, 43, 52, 193, 54,
78951
- /* 440 */ 162, 92, 52, 49, 54, 200, 165, 166, 167, 20,
78952
- /* 450 */ 23, 22, 103, 60, 61, 62, 63, 64, 65, 66,
78953
- /* 460 */ 67, 68, 69, 70, 71, 72, 43, 74, 75, 76,
78954
- /* 470 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 201,
78955
- /* 480 */ 156, 106, 16, 108, 109, 107, 12, 21, 106, 111,
78956
- /* 490 */ 108, 109, 22, 99, 100, 101, 148, 219, 24, 221,
78957
- /* 500 */ 222, 22, 42, 43, 110, 43, 170, 80, 42, 43,
78958
- /* 510 */ 229, 37, 187, 39, 190, 88, 89, 148, 19, 134,
78959
- /* 520 */ 156, 98, 23, 63, 64, 132, 60, 61, 62, 63,
78960
- /* 530 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 215,
78961
- /* 540 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78962
- /* 550 */ 84, 16, 92, 148, 190, 20, 232, 12, 148, 19,
78963
- /* 560 */ 98, 237, 214, 148, 148, 103, 202, 203, 89, 24,
78964
- /* 570 */ 154, 30, 208, 157, 158, 125, 126, 42, 43, 210,
78965
- /* 580 */ 170, 171, 37, 113, 39, 170, 171, 88, 89, 19,
78966
- /* 590 */ 20, 50, 22, 114, 49, 60, 61, 62, 63, 64,
78967
- /* 600 */ 65, 66, 67, 68, 69, 70, 71, 72, 68, 74,
78968
- /* 610 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78969
- /* 620 */ 16, 148, 234, 213, 20, 18, 148, 212, 218, 59,
78970
- /* 630 */ 157, 158, 168, 169, 165, 166, 167, 23, 22, 148,
78971
- /* 640 */ 25, 177, 148, 102, 29, 169, 42, 43, 170, 171,
78972
- /* 650 */ 99, 100, 101, 177, 181, 182, 41, 148, 20, 148,
78973
- /* 660 */ 22, 156, 55, 16, 60, 61, 62, 63, 64, 65,
78974
- /* 670 */ 66, 67, 68, 69, 70, 71, 72, 166, 74, 75,
78975
- /* 680 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 42,
78976
- /* 690 */ 43, 213, 78, 179, 148, 190, 19, 20, 229, 22,
78977
- /* 700 */ 148, 94, 88, 89, 78, 79, 16, 60, 61, 62,
78978
- /* 710 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
78979
- /* 720 */ 215, 74, 75, 76, 77, 78, 79, 80, 81, 82,
78980
- /* 730 */ 83, 84, 42, 43, 148, 189, 59, 148, 122, 228,
78981
- /* 740 */ 229, 134, 237, 157, 158, 162, 163, 164, 148, 16,
78982
- /* 750 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
78983
- /* 760 */ 70, 71, 72, 179, 74, 75, 76, 77, 78, 79,
78984
- /* 770 */ 80, 81, 82, 83, 84, 42, 43, 0, 1, 2,
78985
- /* 780 */ 99, 100, 101, 20, 148, 22, 240, 91, 7, 8,
78986
- /* 790 */ 9, 131, 16, 133, 61, 62, 63, 64, 65, 66,
78987
- /* 800 */ 67, 68, 69, 70, 71, 72, 110, 74, 75, 76,
78988
- /* 810 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
78989
- /* 820 */ 124, 20, 20, 22, 22, 20, 19, 22, 21, 23,
78990
- /* 830 */ 148, 23, 1, 2, 148, 162, 148, 22, 62, 63,
78991
- /* 840 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 110,
78992
- /* 850 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78993
- /* 860 */ 84, 16, 17, 124, 19, 156, 19, 148, 23, 148,
78994
- /* 870 */ 23, 189, 202, 203, 201, 189, 31, 243, 244, 148,
78995
- /* 880 */ 80, 192, 148, 204, 148, 16, 17, 162, 19, 170,
78996
- /* 890 */ 171, 148, 23, 48, 88, 89, 88, 89, 210, 190,
78997
- /* 900 */ 31, 170, 171, 58, 170, 171, 148, 107, 148, 148,
78998
- /* 910 */ 189, 111, 97, 170, 171, 148, 148, 48, 148, 183,
78999
- /* 920 */ 114, 148, 114, 78, 79, 80, 201, 58, 170, 171,
79000
- /* 930 */ 170, 171, 87, 88, 89, 88, 162, 92, 170, 171,
79001
- /* 940 */ 170, 171, 223, 170, 171, 148, 148, 78, 79, 156,
79002
- /* 950 */ 189, 20, 20, 22, 22, 146, 87, 88, 89, 148,
79003
- /* 960 */ 148, 92, 142, 143, 148, 148, 148, 170, 171, 148,
79004
- /* 970 */ 125, 126, 127, 128, 129, 130, 148, 210, 148, 110,
79005
- /* 980 */ 148, 170, 171, 190, 148, 5, 170, 171, 170, 171,
79006
- /* 990 */ 10, 11, 12, 13, 125, 126, 127, 128, 129, 130,
79007
- /* 1000 */ 170, 171, 170, 171, 148, 148, 26, 156, 28, 148,
79008
- /* 1010 */ 189, 16, 17, 179, 19, 35, 148, 189, 23, 183,
79009
- /* 1020 */ 20, 156, 22, 148, 148, 148, 31, 47, 148, 49,
79010
- /* 1030 */ 148, 170, 171, 53, 148, 148, 56, 148, 170, 171,
79011
- /* 1040 */ 148, 190, 148, 48, 148, 189, 148, 170, 171, 148,
79012
- /* 1050 */ 170, 171, 148, 58, 148, 190, 170, 171, 148, 170,
79013
- /* 1060 */ 171, 156, 170, 171, 170, 171, 170, 171, 170, 171,
79014
- /* 1070 */ 148, 170, 171, 78, 79, 148, 170, 171, 148, 99,
79015
- /* 1080 */ 100, 101, 87, 88, 89, 105, 148, 92, 148, 214,
79016
- /* 1090 */ 110, 148, 170, 171, 148, 190, 148, 148, 148, 189,
79017
- /* 1100 */ 170, 171, 148, 186, 187, 148, 148, 148, 170, 171,
79018
- /* 1110 */ 170, 171, 148, 170, 171, 135, 170, 171, 170, 171,
79019
- /* 1120 */ 125, 126, 127, 128, 129, 130, 148, 170, 171, 170,
79020
- /* 1130 */ 171, 148, 183, 183, 148, 148, 148, 183, 148, 148,
79021
- /* 1140 */ 148, 148, 148, 230, 148, 148, 148, 148, 233, 148,
79022
- /* 1150 */ 148, 148, 148, 170, 171, 148, 170, 171, 170, 171,
79023
- /* 1160 */ 170, 171, 170, 171, 170, 171, 230, 205, 205, 195,
79024
- /* 1170 */ 225, 162, 195, 194, 192, 162, 150, 162, 173, 173,
79025
- /* 1180 */ 6, 173, 147, 60, 174, 173, 112, 173, 131, 178,
79026
- /* 1190 */ 153, 153, 153, 224, 19, 15, 152, 216, 98, 172,
79027
- /* 1200 */ 33, 153, 185, 238, 185, 122, 190, 152, 172, 153,
79028
- /* 1210 */ 40, 180, 152, 195, 15, 172, 188, 97, 147, 174,
79029
- /* 1220 */ 195, 153, 147, 238, 84, 185, 180, 195, 119, 188,
79030
- /* 1230 */ 196, 153, 98, 117, 19, 206, 175, 207, 188, 147,
79031
- /* 1240 */ 216, 153, 188, 153, 172, 120, 197, 227, 227, 152,
79032
- /* 1250 */ 118, 198, 121, 22, 155, 153, 172, 199, 206, 172,
79033
- /* 1260 */ 131, 38, 138, 241, 153, 172, 207, 160, 112, 236,
79034
- /* 1270 */ 175, 1, 176, 20, 176, 112, 112, 235, 112, 92,
79035
- /* 1280 */ 107, 19, 11, 20, 20, 19, 19, 22, 20, 20,
79036
- /* 1290 */ 114, 244, 20, 116, 116, 22, 22, 19, 247, 116,
79037
- /* 1300 */ 115, 20, 112, 20, 20, 44, 19, 32, 19, 96,
79038
- /* 1310 */ 20, 19, 19, 19, 103, 16, 21, 17, 98, 22,
79039
- /* 1320 */ 44, 44, 36, 134, 98, 45, 19, 45, 5, 1,
79040
- /* 1330 */ 51, 102, 123, 19, 113, 1, 14, 17, 113, 117,
79041
- /* 1340 */ 102, 123, 136, 19, 14, 20, 19, 137, 124, 3,
79042
- /* 1350 */ 248, 4, 248, 68, 248, 57, 68,
78987
+ /* 250 */ 42, 43, 78, 0, 1, 2, 125, 126, 127, 226,
78988
+ /* 260 */ 11, 162, 88, 89, 231, 228, 229, 16, 60, 61,
78989
+ /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
78990
+ /* 280 */ 72, 148, 74, 75, 76, 77, 78, 79, 80, 81,
78991
+ /* 290 */ 82, 83, 84, 42, 43, 186, 187, 16, 49, 148,
78992
+ /* 300 */ 201, 49, 18, 170, 171, 154, 142, 143, 157, 158,
78993
+ /* 310 */ 182, 60, 61, 62, 63, 64, 65, 66, 67, 68,
78994
+ /* 320 */ 69, 70, 71, 72, 91, 74, 75, 76, 77, 78,
78995
+ /* 330 */ 79, 80, 81, 82, 83, 84, 168, 169, 122, 55,
78996
+ /* 340 */ 132, 16, 16, 110, 16, 177, 20, 20, 99, 100,
78997
+ /* 350 */ 101, 99, 100, 101, 80, 12, 223, 124, 148, 110,
78998
+ /* 360 */ 182, 148, 110, 23, 19, 84, 21, 24, 42, 43,
78999
+ /* 370 */ 148, 90, 91, 92, 93, 94, 95, 96, 94, 166,
79000
+ /* 380 */ 37, 107, 39, 132, 103, 111, 60, 61, 62, 63,
79001
+ /* 390 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 189,
79002
+ /* 400 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
79003
+ /* 410 */ 84, 16, 84, 156, 92, 20, 23, 92, 134, 91,
79004
+ /* 420 */ 92, 93, 94, 95, 96, 103, 148, 22, 88, 89,
79005
+ /* 430 */ 148, 103, 210, 106, 156, 108, 109, 42, 43, 144,
79006
+ /* 440 */ 145, 228, 229, 219, 149, 221, 222, 190, 170, 171,
79007
+ /* 450 */ 240, 156, 170, 171, 162, 60, 61, 62, 63, 64,
79008
+ /* 460 */ 65, 66, 67, 68, 69, 70, 71, 72, 190, 74,
79009
+ /* 470 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
79010
+ /* 480 */ 16, 88, 89, 90, 20, 190, 93, 94, 95, 23,
79011
+ /* 490 */ 131, 213, 133, 201, 212, 90, 218, 104, 93, 94,
79012
+ /* 500 */ 95, 42, 43, 7, 8, 9, 42, 43, 191, 104,
79013
+ /* 510 */ 215, 219, 159, 221, 222, 162, 163, 164, 156, 165,
79014
+ /* 520 */ 166, 167, 63, 64, 60, 61, 62, 63, 64, 65,
79015
+ /* 530 */ 66, 67, 68, 69, 70, 71, 72, 242, 74, 75,
79016
+ /* 540 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
79017
+ /* 550 */ 148, 92, 190, 20, 88, 89, 148, 90, 156, 148,
79018
+ /* 560 */ 93, 94, 95, 20, 187, 148, 19, 20, 148, 22,
79019
+ /* 570 */ 19, 104, 170, 171, 23, 42, 43, 148, 170, 171,
79020
+ /* 580 */ 114, 170, 171, 229, 99, 100, 101, 170, 171, 148,
79021
+ /* 590 */ 170, 171, 190, 60, 61, 62, 63, 64, 65, 66,
79022
+ /* 600 */ 67, 68, 69, 70, 71, 72, 59, 74, 75, 76,
79023
+ /* 610 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 211,
79024
+ /* 620 */ 212, 12, 148, 21, 213, 165, 166, 167, 21, 148,
79025
+ /* 630 */ 23, 148, 148, 24, 217, 19, 20, 217, 22, 88,
79026
+ /* 640 */ 89, 157, 158, 214, 42, 43, 37, 148, 39, 106,
79027
+ /* 650 */ 148, 108, 109, 170, 171, 20, 146, 183, 49, 156,
79028
+ /* 660 */ 14, 16, 60, 61, 62, 63, 64, 65, 66, 67,
79029
+ /* 670 */ 68, 69, 70, 71, 72, 59, 74, 75, 76, 77,
79030
+ /* 680 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 229,
79031
+ /* 690 */ 99, 100, 101, 190, 106, 88, 108, 109, 52, 14,
79032
+ /* 700 */ 54, 148, 156, 162, 16, 60, 61, 62, 63, 64,
79033
+ /* 710 */ 65, 66, 67, 68, 69, 70, 71, 72, 215, 74,
79034
+ /* 720 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
79035
+ /* 730 */ 42, 43, 245, 246, 148, 148, 190, 52, 193, 54,
79036
+ /* 740 */ 237, 106, 201, 108, 109, 200, 148, 16, 60, 61,
79037
+ /* 750 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
79038
+ /* 760 */ 72, 215, 74, 75, 76, 77, 78, 79, 80, 81,
79039
+ /* 770 */ 82, 83, 84, 42, 43, 25, 189, 22, 232, 29,
79040
+ /* 780 */ 134, 183, 16, 237, 202, 203, 148, 148, 192, 148,
79041
+ /* 790 */ 16, 41, 61, 62, 63, 64, 65, 66, 67, 68,
79042
+ /* 800 */ 69, 70, 71, 72, 148, 74, 75, 76, 77, 78,
79043
+ /* 810 */ 79, 80, 81, 82, 83, 84, 42, 43, 23, 19,
79044
+ /* 820 */ 23, 183, 148, 23, 148, 148, 170, 171, 189, 19,
79045
+ /* 830 */ 189, 107, 148, 23, 148, 111, 62, 63, 64, 65,
79046
+ /* 840 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75,
79047
+ /* 850 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
79048
+ /* 860 */ 17, 148, 19, 189, 148, 189, 23, 148, 113, 170,
79049
+ /* 870 */ 171, 148, 16, 148, 31, 16, 17, 80, 19, 162,
79050
+ /* 880 */ 148, 115, 23, 88, 89, 88, 89, 210, 88, 89,
79051
+ /* 890 */ 31, 48, 148, 170, 171, 170, 171, 148, 88, 43,
79052
+ /* 900 */ 214, 58, 170, 171, 148, 189, 148, 48, 189, 114,
79053
+ /* 910 */ 19, 148, 243, 244, 170, 171, 148, 58, 148, 170,
79054
+ /* 920 */ 171, 78, 79, 210, 148, 30, 170, 171, 170, 171,
79055
+ /* 930 */ 87, 88, 89, 170, 171, 92, 148, 78, 79, 80,
79056
+ /* 940 */ 170, 171, 125, 126, 148, 50, 87, 88, 89, 16,
79057
+ /* 950 */ 17, 92, 19, 110, 98, 148, 23, 148, 156, 103,
79058
+ /* 960 */ 148, 110, 156, 22, 31, 189, 170, 171, 125, 126,
79059
+ /* 970 */ 127, 128, 129, 130, 20, 124, 156, 170, 171, 170,
79060
+ /* 980 */ 171, 48, 170, 171, 125, 126, 127, 128, 129, 130,
79061
+ /* 990 */ 204, 58, 190, 5, 148, 148, 190, 102, 10, 11,
79062
+ /* 1000 */ 12, 13, 148, 112, 22, 148, 148, 20, 148, 22,
79063
+ /* 1010 */ 190, 78, 79, 59, 26, 43, 28, 170, 171, 148,
79064
+ /* 1020 */ 87, 88, 89, 35, 148, 92, 148, 170, 171, 148,
79065
+ /* 1030 */ 170, 171, 148, 27, 148, 47, 148, 49, 97, 234,
79066
+ /* 1040 */ 34, 53, 148, 179, 56, 148, 170, 171, 170, 171,
79067
+ /* 1050 */ 148, 170, 171, 148, 170, 171, 170, 171, 125, 126,
79068
+ /* 1060 */ 127, 128, 129, 130, 170, 171, 179, 170, 171, 148,
79069
+ /* 1070 */ 98, 89, 170, 171, 148, 170, 171, 148, 20, 148,
79070
+ /* 1080 */ 22, 20, 148, 22, 148, 179, 148, 99, 100, 101,
79071
+ /* 1090 */ 148, 170, 171, 105, 148, 148, 114, 148, 110, 170,
79072
+ /* 1100 */ 171, 170, 171, 148, 170, 171, 170, 171, 170, 171,
79073
+ /* 1110 */ 7, 8, 170, 171, 20, 148, 22, 170, 171, 170,
79074
+ /* 1120 */ 171, 148, 20, 135, 22, 170, 171, 148, 148, 91,
79075
+ /* 1130 */ 92, 20, 20, 22, 22, 150, 233, 170, 171, 20,
79076
+ /* 1140 */ 20, 22, 22, 170, 171, 20, 148, 22, 148, 170,
79077
+ /* 1150 */ 171, 148, 148, 148, 192, 148, 148, 148, 148, 148,
79078
+ /* 1160 */ 148, 148, 148, 148, 148, 148, 173, 230, 194, 230,
79079
+ /* 1170 */ 225, 205, 173, 178, 173, 173, 195, 6, 147, 195,
79080
+ /* 1180 */ 162, 162, 205, 162, 147, 22, 147, 147, 205, 155,
79081
+ /* 1190 */ 122, 195, 119, 173, 120, 118, 174, 121, 131, 224,
79082
+ /* 1200 */ 112, 153, 153, 98, 117, 98, 40, 172, 172, 19,
79083
+ /* 1210 */ 97, 84, 15, 190, 172, 152, 172, 174, 227, 227,
79084
+ /* 1220 */ 196, 180, 197, 172, 198, 175, 199, 180, 172, 172,
79085
+ /* 1230 */ 175, 153, 152, 152, 206, 153, 207, 207, 206, 153,
79086
+ /* 1240 */ 38, 131, 153, 152, 60, 153, 19, 185, 195, 185,
79087
+ /* 1250 */ 153, 15, 153, 188, 188, 195, 185, 188, 188, 33,
79088
+ /* 1260 */ 138, 153, 216, 1, 160, 20, 176, 153, 235, 176,
79089
+ /* 1270 */ 216, 112, 112, 112, 112, 92, 107, 19, 11, 20,
79090
+ /* 1280 */ 20, 236, 19, 19, 116, 20, 116, 114, 22, 20,
79091
+ /* 1290 */ 238, 20, 22, 19, 22, 116, 115, 238, 20, 112,
79092
+ /* 1300 */ 20, 20, 19, 19, 19, 32, 20, 19, 19, 96,
79093
+ /* 1310 */ 103, 16, 44, 241, 17, 21, 98, 98, 36, 244,
79094
+ /* 1320 */ 44, 44, 22, 134, 19, 5, 247, 1, 123, 68,
79095
+ /* 1330 */ 51, 102, 45, 19, 113, 45, 1, 14, 17, 117,
79096
+ /* 1340 */ 102, 113, 20, 68, 19, 14, 123, 136, 124, 57,
79097
+ /* 1350 */ 3, 137, 19, 4,
7904379098
};
79044
-#define YY_SHIFT_USE_DFLT (-62)
79099
+#define YY_SHIFT_USE_DFLT (-99)
7904579100
#define YY_SHIFT_MAX 396
7904679101
static const short yy_shift_ofst[] = {
79047
- /* 0 */ 831, 869, 980, -16, 869, 995, 995, 68, 246, 394,
79048
- /* 10 */ -53, 350, 995, 995, 995, 995, 995, -45, 162, 614,
79049
- /* 20 */ -11, -17, 626, 626, 53, 604, 122, 238, 535, 393,
79050
- /* 30 */ 165, 466, 307, 647, 647, 647, 647, 647, 647, 647,
79051
- /* 40 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
79052
- /* 50 */ 647, 647, 690, 733, 776, 776, 845, 995, 995, 995,
79053
- /* 60 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79054
- /* 70 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79055
- /* 80 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79056
- /* 90 */ 995, 995, 995, 995, 995, 995, 995, -61, -61, 6,
79057
- /* 100 */ 6, 57, 138, 207, 607, 462, -11, -11, -17, 126,
79058
- /* 110 */ 42, -62, -62, -62, 88, 9, 545, 545, 677, 570,
79059
- /* 120 */ -11, -11, -11, -11, -11, 777, 696, -11, -11, -11,
79060
- /* 130 */ -11, -11, -11, -11, -11, -11, 255, -11, -11, 255,
79061
- /* 140 */ -11, -11, 739, -53, -53, -53, -62, -62, -62, 237,
79062
- /* 150 */ 18, 18, 189, 427, 499, 231, 808, 382, 806, 51,
79063
- /* 160 */ 375, 474, 681, -11, 541, -11, -11, -11, -11, 147,
79064
- /* 170 */ 541, -11, 847, 479, 147, -11, -11, -11, -11, -11,
79065
- /* 180 */ 147, -11, -11, -11, -11, -11, -11, -11, 800, 781,
79066
- /* 190 */ -11, -11, -11, 479, -11, -11, -11, 147, -11, -11,
79067
- /* 200 */ -11, 541, 147, 147, -11, -11, 147, 615, -11, 450,
79068
- /* 210 */ 450, 153, 153, 616, 660, -17, 470, 378, 230, 230,
79069
- /* 220 */ 616, -17, 230, 815, 153, 807, 423, -17, 230, 230,
79070
- /* 230 */ 1174, -53, 1123, 1074, 1074, 1074, 1057, 1175, 1180, 1100,
79071
- /* 240 */ 1167, 1123, 1074, 1083, 1180, 1074, 1100, 1170, 1180, 1199,
79072
- /* 250 */ 1100, 1120, 1174, 1083, 1174, 1074, 1170, 1123, 1167, 1199,
79073
- /* 260 */ 1140, 1083, 1109, 1074, 1134, 1116, 1199, 1215, 1174, 1175,
79074
- /* 270 */ 1074, 1199, 1100, 1074, 1125, 1140, 1180, 1132, 1131, 1231,
79075
- /* 280 */ 1134, 1116, 1074, 1100, 1100, 1129, 1223, 1124, 1074, 1100,
79076
- /* 290 */ 1215, -62, -62, -62, -62, -62, 460, 385, 390, 551,
79077
- /* 300 */ 216, 306, 72, 349, 763, 158, 314, 540, 801, 802,
79078
- /* 310 */ 805, 1000, 932, 931, 429, 252, 638, 1156, 1270, 1253,
79079
- /* 320 */ 1163, 1164, 1166, 1187, 1173, 1262, 1263, 1264, 1266, 1271,
79080
- /* 330 */ 1267, 1268, 1265, 1269, 1272, 1273, 1177, 1274, 1178, 1273,
79081
- /* 340 */ 1176, 1278, 1183, 1185, 1281, 1190, 1283, 1284, 1275, 1261,
79082
- /* 350 */ 1287, 1276, 1289, 1290, 1292, 1293, 1277, 1294, 1213, 1211,
79083
- /* 360 */ 1299, 1300, 1295, 1220, 1286, 1279, 1280, 1297, 1282, 1189,
79084
- /* 370 */ 1226, 1307, 1323, 1328, 1229, 1285, 1288, 1209, 1314, 1221,
79085
- /* 380 */ 1334, 1322, 1222, 1320, 1225, 1238, 1218, 1324, 1224, 1325,
79086
- /* 390 */ 1330, 1298, 1206, 1210, 1327, 1346, 1347,
79102
+ /* 0 */ 23, 843, 988, -16, 843, 933, 933, 393, 123, 252,
79103
+ /* 10 */ -98, 96, 933, 933, 933, 933, 933, -45, 249, 174,
79104
+ /* 20 */ 340, -17, 19, 19, 53, 165, 208, 251, 326, 395,
79105
+ /* 30 */ 464, 533, 602, 645, 688, 645, 645, 645, 645, 645,
79106
+ /* 40 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
79107
+ /* 50 */ 645, 645, 645, 731, 774, 774, 859, 933, 933, 933,
79108
+ /* 60 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79109
+ /* 70 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79110
+ /* 80 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79111
+ /* 90 */ 933, 933, 933, 933, 933, 933, 933, -61, -61, 6,
79112
+ /* 100 */ 6, 281, 22, 61, 856, 284, 340, 340, 68, -17,
79113
+ /* 110 */ -11, -99, -99, -99, 131, 328, 609, 609, 547, 616,
79114
+ /* 120 */ 253, 607, 340, 607, 340, 340, 340, 340, 340, 340,
79115
+ /* 130 */ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
79116
+ /* 140 */ 340, 233, 851, -98, -98, -98, -99, -99, -99, -18,
79117
+ /* 150 */ -18, 405, 467, 327, 551, 543, 635, 343, 466, 795,
79118
+ /* 160 */ 800, 797, 496, 340, 340, 274, 340, 340, 810, 340,
79119
+ /* 170 */ 340, 982, 340, 340, 340, 588, 982, 340, 340, 895,
79120
+ /* 180 */ 895, 895, 340, 340, 340, 588, 340, 340, 588, 340,
79121
+ /* 190 */ 750, 485, 340, 340, 588, 340, 340, 340, 588, 340,
79122
+ /* 200 */ 340, 340, 588, 588, 340, 340, 340, 340, 340, 345,
79123
+ /* 210 */ 724, 755, -17, 817, 817, 359, 1006, 1006, 766, 1006,
79124
+ /* 220 */ 972, 1006, -17, 1006, -17, 941, 216, 766, 766, 216,
79125
+ /* 230 */ 1171, 1171, 1171, 1171, 1163, -98, 1068, 1073, 1074, 1077,
79126
+ /* 240 */ 1076, 1067, 1088, 1088, 1105, 1087, 1105, 1087, 1107, 1107,
79127
+ /* 250 */ 1166, 1107, 1113, 1107, 1190, 1127, 1127, 1166, 1107, 1107,
79128
+ /* 260 */ 1107, 1190, 1197, 1088, 1197, 1088, 1197, 1088, 1088, 1202,
79129
+ /* 270 */ 1110, 1197, 1088, 1184, 1184, 1227, 1068, 1088, 1236, 1236,
79130
+ /* 280 */ 1236, 1236, 1068, 1184, 1227, 1088, 1226, 1226, 1088, 1088,
79131
+ /* 290 */ 1122, -99, -99, -99, -99, -99, 459, 646, 591, 685,
79132
+ /* 300 */ 891, 325, 987, 1058, 322, 1103, 1038, 1061, 1094, 1102,
79133
+ /* 310 */ 1111, 1112, 1119, 1120, 150, 1125, 954, 1262, 1245, 1159,
79134
+ /* 320 */ 1160, 1161, 1162, 1183, 1169, 1258, 1259, 1260, 1263, 1267,
79135
+ /* 330 */ 1264, 1265, 1266, 1269, 1271, 1270, 1168, 1272, 1170, 1270,
79136
+ /* 340 */ 1173, 1274, 1179, 1181, 1278, 1187, 1280, 1281, 1273, 1268,
79137
+ /* 350 */ 1283, 1276, 1284, 1286, 1285, 1288, 1277, 1289, 1213, 1207,
79138
+ /* 360 */ 1295, 1297, 1294, 1218, 1282, 1279, 1287, 1300, 1290, 1189,
79139
+ /* 370 */ 1219, 1305, 1320, 1326, 1229, 1261, 1275, 1205, 1314, 1221,
79140
+ /* 380 */ 1335, 1323, 1222, 1321, 1228, 1238, 1223, 1325, 1224, 1322,
79141
+ /* 390 */ 1331, 1292, 1211, 1214, 1333, 1347, 1349,
7908779142
};
79088
-#define YY_REDUCE_USE_DFLT (-182)
79143
+#define YY_REDUCE_USE_DFLT (-144)
7908979144
#define YY_REDUCE_MAX 295
7909079145
static const short yy_reduce_ofst[] = {
79091
- /* 0 */ -139, 190, 121, 278, 104, 185, 410, 473, 119, 324,
79092
- /* 10 */ 364, -44, 415, 125, 478, 181, 719, -179, 505, 511,
79093
- /* 20 */ 416, 195, 281, 469, -51, -51, -51, -51, -51, -51,
79094
- /* 30 */ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
79095
- /* 40 */ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
79096
- /* 50 */ -51, -51, -51, -51, -51, -51, 731, 734, 743, 758,
79097
- /* 60 */ 760, 768, 770, 773, 797, 811, 816, 818, 830, 832,
79098
- /* 70 */ 861, 868, 877, 880, 886, 889, 892, 894, 896, 898,
79099
- /* 80 */ 901, 906, 922, 930, 938, 940, 943, 946, 948, 957,
79100
- /* 90 */ 959, 983, 986, 988, 990, 992, 994, -51, -51, -51,
79101
- /* 100 */ -51, 464, -51, -51, -72, 223, 546, 586, 583, -51,
79102
- /* 110 */ -51, -51, -51, -51, 192, 476, -78, 917, -148, -148,
79103
- /* 120 */ 910, 954, 950, 949, 836, 820, 905, 856, 875, 828,
79104
- /* 130 */ 821, 761, 682, 686, 369, 348, 673, 688, 736, 725,
79105
- /* 140 */ 767, 721, 709, 793, 851, 865, 670, 634, 245, -27,
79106
- /* 150 */ 253, 336, -3, 64, 90, 101, 405, 101, 491, 494,
79107
- /* 160 */ 101, 325, 388, 64, 514, 509, 552, 589, 600, 101,
79108
- /* 170 */ 584, 636, 774, 679, 101, 798, 812, 817, 857, 876,
79109
- /* 180 */ 101, 887, 904, 927, 958, 964, 978, 987, 689, 809,
79110
- /* 190 */ 882, 991, 993, 679, 996, 997, 998, 101, 999, 1001,
79111
- /* 200 */ 1002, 834, 101, 101, 1003, 1004, 101, 915, 1007, 913,
79112
- /* 210 */ 936, 962, 963, 974, 945, 1009, 979, 982, 1005, 1006,
79113
- /* 220 */ 977, 1013, 1008, 1010, -181, 1026, 1011, 1015, 1012, 1014,
79114
- /* 230 */ 1035, 1016, 1017, 1037, 1038, 1039, 969, 981, 1044, 1027,
79115
- /* 240 */ 965, 1019, 1048, 1018, 1055, 1056, 1036, 1031, 1060, 1028,
79116
- /* 250 */ 1043, 1045, 1071, 1025, 1075, 1068, 1046, 1040, 985, 1041,
79117
- /* 260 */ 1020, 1032, 1034, 1078, 1029, 1030, 1050, 1061, 1092, 1024,
79118
- /* 270 */ 1088, 1054, 1072, 1090, 1049, 1021, 1097, 1053, 1058, 1099,
79119
- /* 280 */ 1052, 1059, 1102, 1084, 1087, 1033, 1042, 1022, 1111, 1093,
79120
- /* 290 */ 1095, 1107, 1096, 1098, 1047, 1051,
79146
+ /* 0 */ -139, 278, 295, 292, 402, -22, 408, 35, 37, 546,
79147
+ /* 10 */ -3, -128, 133, 282, 411, 417, 420, -143, 503, 213,
79148
+ /* 20 */ 151, 353, 354, 460, 224, 224, 224, 224, 224, 224,
79149
+ /* 30 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
79150
+ /* 40 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
79151
+ /* 50 */ 224, 224, 224, 224, 224, 224, 483, 656, 699, 723,
79152
+ /* 60 */ 725, 732, 744, 749, 756, 758, 763, 770, 796, 807,
79153
+ /* 70 */ 809, 812, 847, 857, 860, 876, 878, 881, 884, 886,
79154
+ /* 80 */ 894, 897, 902, 905, 921, 929, 931, 934, 936, 938,
79155
+ /* 90 */ 942, 947, 949, 955, 967, 973, 979, 224, 224, 224,
79156
+ /* 100 */ 224, 168, 224, 224, 36, 33, 210, 484, 224, -121,
79157
+ /* 110 */ 224, 224, 224, 224, 45, 21, 8, 109, 487, 487,
79158
+ /* 120 */ 164, 99, 222, 541, -91, -1, 474, 598, 587, 677,
79159
+ /* 130 */ 638, 429, 713, 639, 641, 674, 676, 716, 719, 686,
79160
+ /* 140 */ 776, 257, 362, 802, 806, 820, 545, 582, 669, -60,
79161
+ /* 150 */ -15, 128, 178, 317, 40, 317, 317, 377, 441, 481,
79162
+ /* 160 */ 499, 502, 510, 553, 586, 596, 502, 684, 717, 768,
79163
+ /* 170 */ 788, 786, 846, 854, 858, 317, 786, 871, 888, 864,
79164
+ /* 180 */ 887, 906, 926, 946, 980, 317, 998, 1000, 317, 1003,
79165
+ /* 190 */ 903, 805, 1004, 1005, 317, 1007, 1008, 1009, 317, 1010,
79166
+ /* 200 */ 1011, 1012, 317, 317, 1013, 1014, 1015, 1016, 1017, 985,
79167
+ /* 210 */ 962, 974, 1018, 937, 939, 945, 993, 999, 966, 1001,
79168
+ /* 220 */ 995, 1002, 1019, 1020, 1021, 1022, 981, 977, 983, 984,
79169
+ /* 230 */ 1031, 1037, 1039, 1040, 1034, 1023, 996, 1024, 1025, 1026,
79170
+ /* 240 */ 1027, 975, 1048, 1049, 1028, 1029, 1032, 1030, 1035, 1036,
79171
+ /* 250 */ 1041, 1042, 1043, 1044, 1050, 991, 992, 1047, 1051, 1056,
79172
+ /* 260 */ 1057, 1055, 1063, 1078, 1080, 1082, 1081, 1086, 1089, 1033,
79173
+ /* 270 */ 1045, 1091, 1092, 1062, 1064, 1046, 1053, 1097, 1065, 1066,
79174
+ /* 280 */ 1069, 1070, 1060, 1071, 1054, 1099, 1052, 1059, 1108, 1114,
79175
+ /* 290 */ 1072, 1104, 1090, 1093, 1075, 1079,
7912179176
};
7912279177
static const YYACTIONTYPE yy_default[] = {
79123
- /* 0 */ 603, 832, 913, 719, 913, 913, 832, 913, 859, 913,
79124
- /* 10 */ 723, 888, 913, 913, 913, 913, 830, 804, 913, 859,
79178
+ /* 0 */ 603, 832, 913, 719, 913, 832, 913, 913, 859, 913,
79179
+ /* 10 */ 723, 888, 830, 913, 913, 913, 913, 804, 913, 859,
7912579180
/* 20 */ 913, 635, 859, 859, 755, 913, 913, 913, 913, 913,
79126
- /* 30 */ 913, 913, 913, 770, 872, 829, 834, 887, 735, 760,
79127
- /* 40 */ 825, 753, 827, 889, 746, 756, 826, 833, 763, 762,
79128
- /* 50 */ 769, 757, 913, 792, 810, 791, 913, 913, 913, 913,
79181
+ /* 30 */ 913, 913, 913, 756, 913, 834, 829, 825, 827, 826,
79182
+ /* 40 */ 833, 757, 746, 753, 760, 735, 872, 762, 763, 769,
79183
+ /* 50 */ 770, 889, 887, 792, 791, 810, 913, 913, 913, 913,
7912979184
/* 60 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7913079185
/* 70 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7913179186
/* 80 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7913279187
/* 90 */ 913, 913, 913, 913, 913, 913, 913, 794, 816, 793,
79133
- /* 100 */ 803, 628, 795, 796, 623, 688, 913, 913, 913, 797,
79188
+ /* 100 */ 803, 628, 795, 796, 688, 623, 913, 913, 797, 913,
7913479189
/* 110 */ 798, 811, 812, 813, 913, 913, 913, 913, 913, 913,
79135
- /* 120 */ 913, 913, 913, 913, 913, 603, 913, 913, 913, 913,
79136
- /* 130 */ 913, 913, 913, 913, 913, 913, 719, 913, 913, 719,
79137
- /* 140 */ 913, 913, 913, 913, 913, 913, 723, 906, 713, 679,
79138
- /* 150 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79139
- /* 160 */ 913, 913, 913, 913, 913, 845, 913, 913, 913, 877,
79140
- /* 170 */ 913, 913, 637, 727, 726, 913, 913, 913, 913, 913,
79141
- /* 180 */ 879, 913, 913, 913, 913, 609, 892, 894, 711, 611,
79142
- /* 190 */ 913, 913, 913, 721, 913, 913, 913, 702, 913, 913,
79143
- /* 200 */ 913, 913, 625, 700, 913, 913, 765, 865, 913, 913,
79144
- /* 210 */ 913, 737, 737, 759, 828, 913, 720, 711, 749, 749,
79145
- /* 220 */ 759, 913, 749, 661, 737, 913, 658, 913, 749, 749,
79146
- /* 230 */ 608, 913, 692, 728, 728, 728, 913, 771, 620, 690,
79147
- /* 240 */ 891, 692, 728, 759, 620, 728, 690, 675, 620, 699,
79148
- /* 250 */ 690, 661, 608, 759, 608, 728, 675, 692, 891, 699,
79149
- /* 260 */ 842, 759, 750, 728, 736, 741, 699, 838, 608, 771,
79150
- /* 270 */ 728, 699, 690, 728, 752, 842, 620, 742, 754, 678,
79151
- /* 280 */ 736, 741, 728, 690, 690, 871, 869, 899, 728, 690,
79152
- /* 290 */ 838, 645, 663, 663, 906, 911, 913, 913, 913, 913,
79153
- /* 300 */ 913, 913, 913, 913, 913, 913, 913, 852, 913, 913,
79154
- /* 310 */ 913, 913, 913, 913, 913, 778, 913, 913, 913, 913,
79155
- /* 320 */ 783, 779, 780, 913, 705, 913, 913, 913, 913, 913,
79190
+ /* 120 */ 603, 719, 913, 719, 913, 913, 913, 913, 913, 913,
79191
+ /* 130 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79192
+ /* 140 */ 913, 913, 913, 913, 913, 913, 713, 723, 906, 913,
79193
+ /* 150 */ 913, 679, 913, 913, 913, 913, 913, 913, 913, 913,
79194
+ /* 160 */ 913, 913, 611, 609, 913, 711, 913, 913, 637, 913,
79195
+ /* 170 */ 913, 721, 913, 913, 913, 726, 727, 913, 913, 913,
79196
+ /* 180 */ 913, 913, 913, 913, 913, 625, 913, 913, 700, 913,
79197
+ /* 190 */ 865, 913, 913, 913, 879, 913, 913, 913, 877, 913,
79198
+ /* 200 */ 913, 913, 702, 765, 845, 913, 892, 894, 913, 913,
79199
+ /* 210 */ 711, 720, 913, 913, 913, 828, 749, 749, 737, 749,
79200
+ /* 220 */ 658, 749, 913, 749, 913, 661, 759, 737, 737, 759,
79201
+ /* 230 */ 608, 608, 608, 608, 678, 913, 759, 750, 752, 742,
79202
+ /* 240 */ 754, 913, 728, 728, 736, 741, 736, 741, 690, 690,
79203
+ /* 250 */ 675, 690, 661, 690, 838, 842, 842, 675, 690, 690,
79204
+ /* 260 */ 690, 838, 620, 728, 620, 728, 620, 728, 728, 869,
79205
+ /* 270 */ 871, 620, 728, 692, 692, 771, 759, 728, 699, 699,
79206
+ /* 280 */ 699, 699, 759, 692, 771, 728, 891, 891, 728, 728,
79207
+ /* 290 */ 899, 645, 663, 663, 906, 911, 913, 913, 913, 913,
79208
+ /* 300 */ 778, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79209
+ /* 310 */ 913, 913, 913, 913, 852, 913, 913, 913, 913, 783,
79210
+ /* 320 */ 779, 913, 780, 913, 705, 913, 913, 913, 913, 913,
7915679211
/* 330 */ 913, 913, 913, 913, 913, 831, 913, 743, 913, 751,
7915779212
/* 340 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7915879213
/* 350 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7915979214
/* 360 */ 913, 913, 913, 913, 913, 913, 867, 868, 913, 913,
7916079215
/* 370 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
7916179216
/* 380 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79162
- /* 390 */ 913, 898, 913, 913, 901, 604, 913, 654, 619, 624,
79163
- /* 400 */ 618, 621, 695, 694, 691, 617, 653, 652, 651, 783,
79164
- /* 410 */ 650, 649, 789, 616, 788, 776, 730, 820, 716, 861,
79165
- /* 420 */ 715, 714, 893, 615, 870, 866, 614, 725, 895, 862,
79166
- /* 430 */ 863, 912, 864, 622, 613, 739, 738, 774, 910, 773,
79167
- /* 440 */ 599, 740, 724, 835, 836, 612, 718, 717, 734, 733,
79168
- /* 450 */ 693, 767, 768, 732, 860, 896, 873, 731, 722, 605,
79169
- /* 460 */ 712, 745, 748, 634, 747, 744, 875, 633, 805, 822,
79170
- /* 470 */ 897, 729, 819, 884, 883, 772, 882, 881, 900, 880,
79171
- /* 480 */ 824, 823, 790, 876, 787, 600, 640, 641, 878, 632,
79172
- /* 490 */ 874, 610, 858, 856, 902, 857, 903, 855, 643, 642,
79173
- /* 500 */ 697, 607, 698, 639, 638, 701, 821, 707, 844, 706,
79174
- /* 510 */ 817, 885, 814, 606, 809, 807, 806, 758, 801, 818,
79175
- /* 520 */ 815, 907, 808, 802, 761, 908, 800, 799, 785, 784,
79176
- /* 530 */ 602, 782, 781, 764, 601, 766, 777, 846, 786, 631,
79177
- /* 540 */ 708, 704, 847, 848, 849, 850, 853, 854, 703, 909,
79178
- /* 550 */ 851, 775, 647, 636, 629, 674, 660, 680, 659, 683,
79179
- /* 560 */ 710, 709, 841, 843, 648, 840, 684, 630, 839, 668,
79180
- /* 570 */ 667, 685, 886, 672, 671, 670, 686, 646, 644, 669,
79181
- /* 580 */ 666, 890, 665, 664, 657, 656, 626, 687, 689, 681,
79182
- /* 590 */ 682, 627, 662, 655, 677, 676, 673, 696,
79217
+ /* 390 */ 913, 898, 913, 913, 901, 604, 913, 599, 601, 602,
79218
+ /* 400 */ 606, 607, 610, 632, 633, 634, 612, 613, 614, 615,
79219
+ /* 410 */ 616, 617, 618, 624, 626, 644, 646, 630, 648, 709,
79220
+ /* 420 */ 710, 775, 703, 704, 708, 631, 786, 777, 781, 782,
79221
+ /* 430 */ 784, 785, 799, 800, 802, 808, 815, 818, 801, 806,
79222
+ /* 440 */ 807, 809, 814, 817, 706, 707, 821, 638, 639, 642,
79223
+ /* 450 */ 643, 855, 857, 856, 858, 641, 640, 787, 790, 823,
79224
+ /* 460 */ 824, 880, 881, 882, 883, 884, 819, 729, 822, 805,
79225
+ /* 470 */ 744, 747, 748, 745, 712, 722, 731, 732, 733, 734,
79226
+ /* 480 */ 717, 718, 724, 740, 773, 774, 738, 739, 725, 714,
79227
+ /* 490 */ 715, 716, 820, 776, 788, 789, 649, 650, 783, 651,
79228
+ /* 500 */ 652, 653, 691, 694, 695, 696, 654, 673, 676, 677,
79229
+ /* 510 */ 655, 662, 656, 657, 664, 665, 666, 669, 670, 671,
79230
+ /* 520 */ 672, 667, 668, 839, 840, 843, 841, 659, 660, 674,
79231
+ /* 530 */ 647, 636, 629, 680, 683, 684, 685, 686, 687, 689,
79232
+ /* 540 */ 681, 682, 627, 619, 621, 730, 861, 870, 866, 862,
79233
+ /* 550 */ 863, 864, 622, 835, 836, 693, 767, 768, 860, 873,
79234
+ /* 560 */ 875, 772, 876, 878, 874, 903, 697, 698, 701, 844,
79235
+ /* 570 */ 885, 758, 761, 764, 766, 846, 847, 848, 849, 850,
79236
+ /* 580 */ 853, 854, 851, 886, 890, 893, 895, 896, 897, 900,
79237
+ /* 590 */ 902, 907, 908, 909, 912, 910, 605, 600,
7918379238
};
7918479239
#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
7918579240
7918679241
/* The next table maps tokens into fallback tokens. If a construct
7918779242
** like the following:
@@ -81856,40 +81911,40 @@
8185681911
"WHENWHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT"
8185781912
"CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAILFROM"
8185881913
"FULLGLOBYIFINTOFFSETISNULLORDERIGHTOUTEROLLBACKROWUNIONUSINGVACUUM"
8185981914
"VIEWINITIALLY";
8186081915
static const unsigned char aHash[127] = {
81861
- 65, 94, 110, 63, 0, 45, 0, 0, 71, 0, 66, 0, 0,
81916
+ 65, 94, 110, 63, 0, 44, 0, 0, 71, 0, 66, 0, 0,
8186281917
104, 12, 67, 15, 0, 108, 74, 105, 101, 0, 19, 0, 0,
8186381918
114, 0, 112, 78, 0, 22, 82, 0, 9, 0, 0, 59, 60,
81864
- 0, 58, 6, 0, 39, 79, 91, 0, 111, 89, 0, 0, 44,
81919
+ 0, 58, 6, 0, 39, 79, 91, 0, 111, 90, 0, 0, 45,
8186581920
0, 92, 24, 0, 17, 0, 115, 40, 23, 0, 5, 99, 25,
8186681921
85, 0, 0, 117, 95, 50, 116, 47, 7, 42, 0, 80, 0,
81867
- 90, 26, 0, 88, 0, 0, 0, 84, 81, 86, 77, 98, 14,
81922
+ 89, 26, 0, 88, 0, 0, 0, 84, 81, 86, 77, 98, 14,
8186881923
34, 97, 0, 70, 0, 18, 76, 100, 31, 0, 113, 69, 106,
81869
- 51, 46, 73, 0, 0, 83, 102, 0, 109, 0, 35, 0, 0,
81870
- 28, 0, 75, 48, 53, 0, 20, 52, 0, 43,
81924
+ 52, 46, 73, 0, 0, 83, 102, 0, 109, 0, 35, 0, 0,
81925
+ 28, 0, 75, 48, 53, 0, 20, 51, 0, 43,
8187181926
};
8187281927
static const unsigned char aNext[117] = {
8187381928
0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
8187481929
0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
8187581930
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81876
- 0, 0, 3, 38, 32, 0, 21, 0, 0, 0, 0, 0, 29,
81931
+ 0, 0, 3, 38, 0, 32, 21, 0, 0, 0, 0, 29, 0,
8187781932
0, 37, 0, 0, 0, 1, 55, 0, 0, 56, 0, 0, 0,
8187881933
0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 30, 0,
81879
- 16, 33, 10, 0, 0, 0, 0, 0, 0, 0, 61, 11, 68,
81934
+ 16, 33, 10, 0, 0, 0, 0, 0, 0, 0, 11, 61, 68,
8188081935
0, 8, 0, 93, 87, 0, 96, 0, 49, 0, 0, 64, 0,
8188181936
41, 103, 0, 27, 107, 36, 62, 72, 0, 0, 57, 0, 0,
8188281937
};
8188381938
static const unsigned char aLen[117] = {
8188481939
7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
8188581940
7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
8188681941
11, 2, 7, 5, 5, 9, 6, 10, 9, 7, 10, 6, 5,
81887
- 6, 6, 5, 6, 9, 4, 2, 5, 5, 6, 7, 3, 7,
81942
+ 6, 6, 5, 6, 4, 9, 2, 5, 5, 6, 7, 7, 3,
8188881943
4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6,
8188981944
5, 4, 7, 6, 5, 6, 7, 5, 4, 5, 7, 5, 8,
81890
- 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 12, 17, 7,
81945
+ 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7,
8189181946
8, 8, 2, 4, 4, 4, 4, 4, 2, 2, 4, 6, 2,
8189281947
3, 6, 5, 5, 5, 8, 3, 5, 5, 6, 4, 9, 3,
8189381948
};
8189481949
static const unsigned short int aOffset[117] = {
8189581950
0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
@@ -81911,11 +81966,11 @@
8191181966
TK_EXCEPT, TK_TRANSACTION,TK_ON, TK_JOIN_KW, TK_ALTER,
8191281967
TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, TK_INTERSECT,
8191381968
TK_TRIGGER, TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_ATTACH,
8191481969
TK_HAVING, TK_GROUP, TK_UPDATE, TK_TEMP, TK_TEMP,
8191581970
TK_OR, TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN,
81916
- TK_NOT, TK_NOTNULL, TK_NULL, TK_LIKE_KW, TK_CASCADE,
81971
+ TK_NOTNULL, TK_NOT, TK_NULL, TK_LIKE_KW, TK_CASCADE,
8191781972
TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
8191881973
TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
8191981974
TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
8192081975
TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN, TK_WHERE,
8192181976
TK_REPLACE, TK_AFTER, TK_RESTRICT, TK_AND, TK_DEFAULT,
@@ -82690,11 +82745,11 @@
8269082745
** Main file for the SQLite library. The routines in this file
8269182746
** implement the programmer interface to the library. Routines in
8269282747
** other files are for internal use by SQLite and should not be
8269382748
** accessed by users of the library.
8269482749
**
82695
-** $Id: main.c,v 1.509 2008/10/30 15:03:16 drh Exp $
82750
+** $Id: main.c,v 1.510 2008/11/04 13:46:28 drh Exp $
8269682751
*/
8269782752
8269882753
#ifdef SQLITE_ENABLE_FTS3
8269982754
/************** Include fts3.h in the middle of main.c ***********************/
8270082755
/************** Begin file fts3.h ********************************************/
@@ -83176,10 +83231,17 @@
8317683231
db->lookaside.pEnd = 0;
8317783232
db->lookaside.bEnabled = 0;
8317883233
}
8317983234
return SQLITE_OK;
8318083235
}
83236
+
83237
+/*
83238
+** Return the mutex associated with a database connection.
83239
+*/
83240
+SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
83241
+ return db->mutex;
83242
+}
8318183243
8318283244
/*
8318383245
** Configuration settings for an individual database connection
8318483246
*/
8318583247
SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
8318683248
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -9,17 +9,17 @@
9 **
10 ** This file is all you need to compile SQLite. To use SQLite in other
11 ** programs, you need this file and the "sqlite3.h" header file that defines
12 ** the programming interface to the SQLite library. (If you do not have
13 ** the "sqlite3.h" header file at hand, you will find a copy in the first
14 ** 6542 lines past this header comment.) Additional code files may be
15 ** needed if you want a wrapper to interface SQLite with your choice of
16 ** programming language. The code for the "sqlite3" command-line shell
17 ** is also in a separate file. This file contains only code for the core
18 ** SQLite library.
19 **
20 ** This amalgamation was generated on 2008-11-01 20:35:33 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -39,11 +39,11 @@
39 ** May you share freely, never taking more than you give.
40 **
41 *************************************************************************
42 ** Internal interface definitions for SQLite.
43 **
44 ** @(#) $Id: sqliteInt.h,v 1.787 2008/10/28 18:58:20 drh Exp $
45 */
46 #ifndef _SQLITEINT_H_
47 #define _SQLITEINT_H_
48
49 /*
@@ -485,11 +485,11 @@
485 ** The name of this file under configuration management is "sqlite.h.in".
486 ** The makefile makes some minor changes to this file (such as inserting
487 ** the version number) and changes its name to "sqlite3.h" as
488 ** part of the build process.
489 **
490 ** @(#) $Id: sqlite.h.in,v 1.406 2008/10/30 15:03:16 drh Exp $
491 */
492 #ifndef _SQLITE3_H_
493 #define _SQLITE3_H_
494 #include <stdarg.h> /* Needed for the definition of va_list */
495
@@ -1137,10 +1137,16 @@
1137 ** that when data is appended to a file, the data is appended
1138 ** first then the size of the file is extended, never the other
1139 ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
1140 ** information is written to disk in the same order as calls
1141 ** to xWrite().
 
 
 
 
 
 
1142 */
1143 typedef struct sqlite3_io_methods sqlite3_io_methods;
1144 struct sqlite3_io_methods {
1145 int iVersion;
1146 int (*xClose)(sqlite3_file*);
@@ -3126,10 +3132,20 @@
3126 ** text that describes the error, as either UTF-8 or UTF-16 respectively.
3127 ** Memory to hold the error message string is managed internally.
3128 ** The application does not need to worry about freeing the result.
3129 ** However, the error string might be overwritten or deallocated by
3130 ** subsequent calls to other SQLite interface functions.
 
 
 
 
 
 
 
 
 
 
3131 **
3132 ** If an interface fails with SQLITE_MISUSE, that means the interface
3133 ** was invoked incorrectly by the application. In that case, the
3134 ** error code and message may or may not be set.
3135 **
@@ -6714,10 +6730,21 @@
6714 #define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
6715 #define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
6716 #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
6717 #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
6718
 
 
 
 
 
 
 
 
 
 
 
6719 /*
6720 ** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
6721 **
6722 ** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
6723 ** xFileControl method for the [sqlite3_io_methods] object associated
@@ -7909,145 +7936,145 @@
7909 */
7910 /************** Include opcodes.h in the middle of vdbe.h ********************/
7911 /************** Begin file opcodes.h *****************************************/
7912 /* Automatically generated. Do not edit */
7913 /* See the mkopcodeh.awk script for details */
7914 #define OP_ReadCookie 1
7915 #define OP_AutoCommit 2
7916 #define OP_Found 3
7917 #define OP_NullRow 4
7918 #define OP_Lt 71 /* same as TK_LT */
7919 #define OP_MoveLe 5
7920 #define OP_Variable 6
7921 #define OP_RealAffinity 7
7922 #define OP_Sort 8
7923 #define OP_Affinity 9
7924 #define OP_IfNot 10
7925 #define OP_Gosub 11
7926 #define OP_Add 78 /* same as TK_PLUS */
7927 #define OP_NotFound 12
7928 #define OP_ResultRow 13
7929 #define OP_IsNull 65 /* same as TK_ISNULL */
7930 #define OP_MoveLt 14
7931 #define OP_Rowid 15
7932 #define OP_CreateIndex 17
7933 #define OP_Explain 18
7934 #define OP_Statement 19
7935 #define OP_DropIndex 20
7936 #define OP_Null 21
7937 #define OP_ToInt 142 /* same as TK_TO_INT */
7938 #define OP_Int64 22
7939 #define OP_LoadAnalysis 23
7940 #define OP_IdxInsert 24
7941 #define OP_VUpdate 25
7942 #define OP_Next 26
7943 #define OP_SetNumColumns 27
7944 #define OP_ToNumeric 141 /* same as TK_TO_NUMERIC*/
7945 #define OP_Ge 72 /* same as TK_GE */
7946 #define OP_BitNot 87 /* same as TK_BITNOT */
7947 #define OP_Rewind 28
 
 
 
 
 
 
 
 
 
 
7948 #define OP_Multiply 80 /* same as TK_STAR */
7949 #define OP_ToReal 143 /* same as TK_TO_REAL */
7950 #define OP_Gt 69 /* same as TK_GT */
7951 #define OP_Last 29
7952 #define OP_MustBeInt 30
7953 #define OP_Ne 67 /* same as TK_NE */
7954 #define OP_MoveGe 31
7955 #define OP_IncrVacuum 32
7956 #define OP_String 33
7957 #define OP_VFilter 34
7958 #define OP_ForceInt 35
7959 #define OP_Close 36
7960 #define OP_AggFinal 37
7961 #define OP_RowData 38
7962 #define OP_IdxRowid 39
7963 #define OP_Pagecount 40
7964 #define OP_BitOr 75 /* same as TK_BITOR */
7965 #define OP_NotNull 66 /* same as TK_NOTNULL */
7966 #define OP_MoveGt 41
7967 #define OP_Not 16 /* same as TK_NOT */
7968 #define OP_OpenPseudo 42
7969 #define OP_Halt 43
7970 #define OP_Compare 44
7971 #define OP_NewRowid 45
7972 #define OP_Real 126 /* same as TK_FLOAT */
7973 #define OP_IdxLT 46
7974 #define OP_MemMax 47
7975 #define OP_Function 48
7976 #define OP_IntegrityCk 49
7977 #define OP_Remainder 82 /* same as TK_REM */
7978 #define OP_SCopy 50
7979 #define OP_ShiftLeft 76 /* same as TK_LSHIFT */
7980 #define OP_IfNeg 51
7981 #define OP_FifoWrite 52
7982 #define OP_BitAnd 74 /* same as TK_BITAND */
7983 #define OP_Or 60 /* same as TK_OR */
7984 #define OP_NotExists 53
7985 #define OP_VDestroy 54
7986 #define OP_IdxDelete 55
7987 #define OP_Vacuum 56
7988 #define OP_Copy 57
7989 #define OP_If 58
7990 #define OP_Jump 59
7991 #define OP_Destroy 62
7992 #define OP_AggStep 63
7993 #define OP_Insert 64
7994 #define OP_Clear 73
7995 #define OP_Permutation 84
7996 #define OP_VBegin 85
7997 #define OP_OpenEphemeral 86
7998 #define OP_IdxGE 89
7999 #define OP_Trace 90
8000 #define OP_Divide 81 /* same as TK_SLASH */
8001 #define OP_String8 88 /* same as TK_STRING */
8002 #define OP_Concat 83 /* same as TK_CONCAT */
8003 #define OP_VRowid 91
8004 #define OP_MakeRecord 92
8005 #define OP_Yield 93
8006 #define OP_SetCookie 94
8007 #define OP_Prev 95
8008 #define OP_ContextPush 96
8009 #define OP_DropTrigger 97
8010 #define OP_And 61 /* same as TK_AND */
8011 #define OP_VColumn 98
8012 #define OP_Return 99
8013 #define OP_OpenWrite 100
8014 #define OP_Integer 101
 
 
 
 
 
 
8015 #define OP_Transaction 102
8016 #define OP_IfPos 103
8017 #define OP_CollSeq 104
8018 #define OP_VRename 105
8019 #define OP_ToBlob 140 /* same as TK_TO_BLOB */
8020 #define OP_Sequence 106
8021 #define OP_ContextPop 107
8022 #define OP_ShiftRight 77 /* same as TK_RSHIFT */
8023 #define OP_VCreate 108
8024 #define OP_CreateTable 109
8025 #define OP_AddImm 110
8026 #define OP_ToText 139 /* same as TK_TO_TEXT */
8027 #define OP_DropTable 111
8028 #define OP_IsUnique 112
8029 #define OP_VOpen 113
8030 #define OP_IfZero 114
8031 #define OP_Noop 115
8032 #define OP_RowKey 116
8033 #define OP_Expire 117
8034 #define OP_FifoRead 118
8035 #define OP_Delete 119
8036 #define OP_Subtract 79 /* same as TK_MINUS */
8037 #define OP_Blob 120
8038 #define OP_Move 121
8039 #define OP_Goto 122
8040 #define OP_ParseSchema 123
8041 #define OP_Eq 68 /* same as TK_EQ */
8042 #define OP_VNext 124
8043 #define OP_Le 70 /* same as TK_LE */
8044 #define OP_TableLock 125
8045 #define OP_VerifyCookie 127
8046 #define OP_Column 128
8047 #define OP_OpenRead 129
8048 #define OP_ResetCount 130
8049
8050 /* The following opcode values are never used */
8051 #define OP_NotUsed_131 131
8052 #define OP_NotUsed_132 132
8053 #define OP_NotUsed_133 133
@@ -8067,27 +8094,27 @@
8067 #define OPFLG_IN1 0x0004 /* in1: P1 is an input */
8068 #define OPFLG_IN2 0x0008 /* in2: P2 is an input */
8069 #define OPFLG_IN3 0x0010 /* in3: P3 is an input */
8070 #define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
8071 #define OPFLG_INITIALIZER {\
8072 /* 0 */ 0x00, 0x02, 0x00, 0x11, 0x00, 0x11, 0x02, 0x04,\
8073 /* 8 */ 0x01, 0x00, 0x05, 0x01, 0x11, 0x00, 0x11, 0x02,\
8074 /* 16 */ 0x04, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00,\
8075 /* 24 */ 0x08, 0x00, 0x01, 0x00, 0x01, 0x01, 0x05, 0x11,\
8076 /* 32 */ 0x01, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, 0x02,\
8077 /* 40 */ 0x02, 0x11, 0x00, 0x00, 0x00, 0x02, 0x11, 0x0c,\
8078 /* 48 */ 0x00, 0x00, 0x00, 0x05, 0x04, 0x11, 0x00, 0x00,\
8079 /* 56 */ 0x00, 0x00, 0x05, 0x01, 0x2c, 0x2c, 0x02, 0x00,\
8080 /* 64 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8081 /* 72 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
8082 /* 80 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x00, 0x00, 0x00, 0x04,\
8083 /* 88 */ 0x02, 0x11, 0x00, 0x02, 0x00, 0x00, 0x10, 0x01,\
8084 /* 96 */ 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x05,\
8085 /* 104 */ 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x04, 0x00,\
8086 /* 112 */ 0x11, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,\
8087 /* 120 */ 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00,\
8088 /* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8089 /* 136 */ 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04,\
8090 }
8091
8092 /************** End of opcodes.h *********************************************/
8093 /************** Continuing where we left off in vdbe.h ***********************/
@@ -9004,10 +9031,11 @@
9004 } init;
9005 int nExtension; /* Number of loaded extensions */
9006 void **aExtension; /* Array of shared libraray handles */
9007 struct Vdbe *pVdbe; /* List of active virtual machines */
9008 int activeVdbeCnt; /* Number of vdbes currently executing */
 
9009 void (*xTrace)(void*,const char*); /* Trace function */
9010 void *pTraceArg; /* Argument to the trace function */
9011 void (*xProfile)(void*,const char*,u64); /* Profiling function */
9012 void *pProfileArg; /* Argument to profile function */
9013 void *pCommitArg; /* Argument to xCommitCallback() */
@@ -17401,11 +17429,11 @@
17401 **
17402 *************************************************************************
17403 ** This file contains routines used to translate between UTF-8,
17404 ** UTF-16, UTF-16BE, and UTF-16LE.
17405 **
17406 ** $Id: utf.c,v 1.65 2008/08/12 15:04:59 danielk1977 Exp $
17407 **
17408 ** Notes on UTF-8:
17409 **
17410 ** Byte-0 Byte-1 Byte-2 Byte-3 Value
17411 ** 0xxxxxxx 00000000 00000000 0xxxxxxx
@@ -17443,11 +17471,11 @@
17443 ** VDBE. This information used to all be at the top of the single
17444 ** source code file "vdbe.c". When that file became too big (over
17445 ** 6000 lines long) it was split up into several smaller files and
17446 ** this header information was factored out.
17447 **
17448 ** $Id: vdbeInt.h,v 1.155 2008/10/07 23:46:38 drh Exp $
17449 */
17450 #ifndef _VDBEINT_H_
17451 #define _VDBEINT_H_
17452
17453 /*
@@ -17478,16 +17506,16 @@
17478 ** is currently pointing to.
17479 **
17480 ** Every cursor that the virtual machine has open is represented by an
17481 ** instance of the following structure.
17482 **
17483 ** If the Cursor.isTriggerRow flag is set it means that this cursor is
17484 ** really a single row that represents the NEW or OLD pseudo-table of
17485 ** a row trigger. The data for the row is stored in Cursor.pData and
17486 ** the rowid is in Cursor.iKey.
17487 */
17488 struct Cursor {
17489 BtCursor *pCursor; /* The cursor structure of the backend */
17490 int iDb; /* Index of cursor database in db->aDb[] (or -1) */
17491 i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
17492 i64 nextRowid; /* Next rowid returned by OP_NewRowid */
17493 Bool zeroed; /* True if zeroed out and ready for reuse */
@@ -17521,14 +17549,14 @@
17521 int payloadSize; /* Total number of bytes in the record */
17522 u32 *aType; /* Type values for all entries in the record */
17523 u32 *aOffset; /* Cached offsets to the start of each columns data */
17524 u8 *aRow; /* Data for the current row, if all on one page */
17525 };
17526 typedef struct Cursor Cursor;
17527
17528 /*
17529 ** A value for Cursor.cacheValid that means the cache is always invalid.
17530 */
17531 #define CACHE_STALE 0
17532
17533 /*
17534 ** Internally, the vdbe manipulates nearly all SQL values as Mem
@@ -17719,20 +17747,20 @@
17719 int nLabelAlloc; /* Number of slots allocated in aLabel[] */
17720 int *aLabel; /* Space to hold the labels */
17721 Mem **apArg; /* Arguments to currently executing user function */
17722 Mem *aColName; /* Column names to return */
17723 int nCursor; /* Number of slots in apCsr[] */
17724 Cursor **apCsr; /* One element of this array for each open cursor */
17725 int nVar; /* Number of entries in aVar[] */
17726 Mem *aVar; /* Values for the OP_Variable opcode. */
17727 char **azVar; /* Name of variables */
17728 int okVar; /* True if azVar[] has been initialized */
17729 int magic; /* Magic number for sanity checking */
17730 int nMem; /* Number of memory locations currently allocated */
17731 Mem *aMem; /* The memory locations */
17732 int nCallback; /* Number of callbacks invoked so far */
17733 int cacheCtr; /* Cursor row cache generation counter */
17734 Fifo sFifo; /* A list of ROWIDs */
17735 int contextStackTop; /* Index of top element in the context stack */
17736 int contextStackDepth; /* The size of the "context" stack */
17737 Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/
17738 int pc; /* The program counter */
@@ -17747,10 +17775,12 @@
17747 u8 explain; /* True if EXPLAIN present on SQL command */
17748 u8 changeCntOn; /* True to update the change-counter */
17749 u8 expired; /* True if the VM needs to be recompiled */
17750 u8 minWriteFileFormat; /* Minimum file format for writable database files */
17751 u8 inVtabMethod; /* See comments above */
 
 
17752 int nChange; /* Number of db changes made since last reset */
17753 i64 startTime; /* Time when query started - used for profiling */
17754 int btreeMask; /* Bitmask of db->aDb[] entries referenced */
17755 BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */
17756 int aCounter[2]; /* Counters used by sqlite3_stmt_status() */
@@ -17779,13 +17809,13 @@
17779 #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
17780
17781 /*
17782 ** Function prototypes
17783 */
17784 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
17785 void sqliteVdbePopStack(Vdbe*,int);
17786 SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor*);
17787 #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
17788 SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*);
17789 #endif
17790 SQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32);
17791 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
@@ -17792,11 +17822,11 @@
17792 SQLITE_PRIVATE int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
17793 SQLITE_PRIVATE int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
17794 SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
17795
17796 int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
17797 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(Cursor*,UnpackedRecord*,int*);
17798 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
17799 SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
17800 SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
17801 SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
17802 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
@@ -18040,11 +18070,11 @@
18040 if( rc!=SQLITE_OK ){
18041 assert( rc==SQLITE_NOMEM );
18042 return SQLITE_NOMEM;
18043 }
18044 zIn = (u8*)pMem->z;
18045 zTerm = &zIn[pMem->n];
18046 while( zIn<zTerm ){
18047 temp = *zIn;
18048 *zIn = *(zIn+1);
18049 zIn++;
18050 *zIn++ = temp;
@@ -18058,10 +18088,11 @@
18058 /* When converting from UTF-16, the maximum growth results from
18059 ** translating a 2-byte character to a 4-byte UTF-8 character.
18060 ** A single byte is required for the output string
18061 ** nul-terminator.
18062 */
 
18063 len = pMem->n * 2 + 1;
18064 }else{
18065 /* When converting from UTF-8 to UTF-16 the maximum growth is caused
18066 ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
18067 ** character. Two bytes are required in the output buffer for the
@@ -19606,83 +19637,83 @@
19606 /* Automatically generated. Do not edit */
19607 /* See the mkopcodec.awk script for details. */
19608 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
19609 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
19610 static const char *const azName[] = { "?",
19611 /* 1 */ "ReadCookie",
19612 /* 2 */ "AutoCommit",
19613 /* 3 */ "Found",
19614 /* 4 */ "NullRow",
19615 /* 5 */ "MoveLe",
19616 /* 6 */ "Variable",
19617 /* 7 */ "RealAffinity",
19618 /* 8 */ "Sort",
19619 /* 9 */ "Affinity",
19620 /* 10 */ "IfNot",
19621 /* 11 */ "Gosub",
19622 /* 12 */ "NotFound",
19623 /* 13 */ "ResultRow",
19624 /* 14 */ "MoveLt",
19625 /* 15 */ "Rowid",
19626 /* 16 */ "Not",
19627 /* 17 */ "CreateIndex",
19628 /* 18 */ "Explain",
19629 /* 19 */ "Statement",
19630 /* 20 */ "DropIndex",
19631 /* 21 */ "Null",
19632 /* 22 */ "Int64",
19633 /* 23 */ "LoadAnalysis",
19634 /* 24 */ "IdxInsert",
19635 /* 25 */ "VUpdate",
19636 /* 26 */ "Next",
19637 /* 27 */ "SetNumColumns",
19638 /* 28 */ "Rewind",
19639 /* 29 */ "Last",
19640 /* 30 */ "MustBeInt",
19641 /* 31 */ "MoveGe",
19642 /* 32 */ "IncrVacuum",
19643 /* 33 */ "String",
19644 /* 34 */ "VFilter",
19645 /* 35 */ "ForceInt",
19646 /* 36 */ "Close",
19647 /* 37 */ "AggFinal",
19648 /* 38 */ "RowData",
19649 /* 39 */ "IdxRowid",
19650 /* 40 */ "Pagecount",
19651 /* 41 */ "MoveGt",
19652 /* 42 */ "OpenPseudo",
19653 /* 43 */ "Halt",
19654 /* 44 */ "Compare",
19655 /* 45 */ "NewRowid",
19656 /* 46 */ "IdxLT",
19657 /* 47 */ "MemMax",
19658 /* 48 */ "Function",
19659 /* 49 */ "IntegrityCk",
19660 /* 50 */ "SCopy",
19661 /* 51 */ "IfNeg",
19662 /* 52 */ "FifoWrite",
19663 /* 53 */ "NotExists",
19664 /* 54 */ "VDestroy",
19665 /* 55 */ "IdxDelete",
19666 /* 56 */ "Vacuum",
19667 /* 57 */ "Copy",
19668 /* 58 */ "If",
19669 /* 59 */ "Jump",
19670 /* 60 */ "Or",
19671 /* 61 */ "And",
19672 /* 62 */ "Destroy",
19673 /* 63 */ "AggStep",
19674 /* 64 */ "Insert",
19675 /* 65 */ "IsNull",
19676 /* 66 */ "NotNull",
19677 /* 67 */ "Ne",
19678 /* 68 */ "Eq",
19679 /* 69 */ "Gt",
19680 /* 70 */ "Le",
19681 /* 71 */ "Lt",
19682 /* 72 */ "Ge",
19683 /* 73 */ "Clear",
19684 /* 74 */ "BitAnd",
19685 /* 75 */ "BitOr",
19686 /* 76 */ "ShiftLeft",
19687 /* 77 */ "ShiftRight",
19688 /* 78 */ "Add",
@@ -19689,57 +19720,57 @@
19689 /* 79 */ "Subtract",
19690 /* 80 */ "Multiply",
19691 /* 81 */ "Divide",
19692 /* 82 */ "Remainder",
19693 /* 83 */ "Concat",
19694 /* 84 */ "Permutation",
19695 /* 85 */ "VBegin",
19696 /* 86 */ "OpenEphemeral",
19697 /* 87 */ "BitNot",
19698 /* 88 */ "String8",
19699 /* 89 */ "IdxGE",
19700 /* 90 */ "Trace",
19701 /* 91 */ "VRowid",
19702 /* 92 */ "MakeRecord",
19703 /* 93 */ "Yield",
19704 /* 94 */ "SetCookie",
19705 /* 95 */ "Prev",
19706 /* 96 */ "ContextPush",
19707 /* 97 */ "DropTrigger",
19708 /* 98 */ "VColumn",
19709 /* 99 */ "Return",
19710 /* 100 */ "OpenWrite",
19711 /* 101 */ "Integer",
19712 /* 102 */ "Transaction",
19713 /* 103 */ "IfPos",
19714 /* 104 */ "CollSeq",
19715 /* 105 */ "VRename",
19716 /* 106 */ "Sequence",
19717 /* 107 */ "ContextPop",
19718 /* 108 */ "VCreate",
19719 /* 109 */ "CreateTable",
19720 /* 110 */ "AddImm",
19721 /* 111 */ "DropTable",
19722 /* 112 */ "IsUnique",
19723 /* 113 */ "VOpen",
19724 /* 114 */ "IfZero",
19725 /* 115 */ "Noop",
19726 /* 116 */ "RowKey",
19727 /* 117 */ "Expire",
19728 /* 118 */ "FifoRead",
19729 /* 119 */ "Delete",
19730 /* 120 */ "Blob",
19731 /* 121 */ "Move",
19732 /* 122 */ "Goto",
19733 /* 123 */ "ParseSchema",
19734 /* 124 */ "VNext",
19735 /* 125 */ "TableLock",
19736 /* 126 */ "Real",
19737 /* 127 */ "VerifyCookie",
19738 /* 128 */ "Column",
19739 /* 129 */ "OpenRead",
19740 /* 130 */ "ResetCount",
19741 /* 131 */ "NotUsed_131",
19742 /* 132 */ "NotUsed_132",
19743 /* 133 */ "NotUsed_133",
19744 /* 134 */ "NotUsed_134",
19745 /* 135 */ "NotUsed_135",
@@ -19770,11 +19801,11 @@
19770 **
19771 ******************************************************************************
19772 **
19773 ** This file contains code that is specific to OS/2.
19774 **
19775 ** $Id: os_os2.c,v 1.57 2008/10/13 21:46:47 pweilbacher Exp $
19776 */
19777
19778
19779 #if SQLITE_OS_OS2
19780
@@ -20113,10 +20144,11 @@
20113 return SQLITE_IOERR_READ;
20114 }
20115 if( got == (ULONG)amt )
20116 return SQLITE_OK;
20117 else {
 
20118 memset(&((char*)pBuf)[got], 0, amt-got);
20119 return SQLITE_IOERR_SHORT_READ;
20120 }
20121 }
20122
@@ -21117,11 +21149,11 @@
21117 **
21118 ******************************************************************************
21119 **
21120 ** This file contains code that is specific to Unix systems.
21121 **
21122 ** $Id: os_unix.c,v 1.207 2008/10/16 13:27:41 danielk1977 Exp $
21123 */
21124 #if SQLITE_OS_UNIX /* This file is used on unix only */
21125
21126 /*
21127 ** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
@@ -22231,10 +22263,11 @@
22231 if( got==amt ){
22232 return SQLITE_OK;
22233 }else if( got<0 ){
22234 return SQLITE_IOERR_READ;
22235 }else{
 
22236 memset(&((char*)pBuf)[got], 0, amt-got);
22237 return SQLITE_IOERR_SHORT_READ;
22238 }
22239 }
22240
@@ -24340,11 +24373,11 @@
24340 **
24341 ******************************************************************************
24342 **
24343 ** This file contains code that is specific to windows.
24344 **
24345 ** $Id: os_win.c,v 1.136 2008/10/22 16:55:47 shane Exp $
24346 */
24347 #if SQLITE_OS_WIN /* This file is used for windows only */
24348
24349
24350 /*
@@ -25224,10 +25257,11 @@
25224 return SQLITE_IOERR_READ;
25225 }
25226 if( got==(DWORD)amt ){
25227 return SQLITE_OK;
25228 }else{
 
25229 memset(&((char*)pBuf)[got], 0, amt-got);
25230 return SQLITE_IOERR_SHORT_READ;
25231 }
25232 }
25233
@@ -26260,16 +26294,18 @@
26260 **
26261 *************************************************************************
26262 ** This file implements an object that represents a fixed-length
26263 ** bitmap. Bits are numbered starting with 1.
26264 **
26265 ** A bitmap is used to record what pages a database file have been
26266 ** journalled during a transaction. Usually only a few pages are
26267 ** journalled. So the bitmap is usually sparse and has low cardinality.
 
26268 ** But sometimes (for example when during a DROP of a large table) most
26269 ** or all of the pages get journalled. In those cases, the bitmap becomes
26270 ** dense. The algorithm needs to handle both cases well.
 
26271 **
26272 ** The size of the bitmap is fixed when the object is created.
26273 **
26274 ** All bits are clear when the bitmap is created. Individual bits
26275 ** may be set or cleared one at a time.
@@ -26280,11 +26316,11 @@
26280 ** sometimes grow into tens of thousands or larger. The size of the
26281 ** Bitvec object is the number of pages in the database file at the
26282 ** start of a transaction, and is thus usually less than a few thousand,
26283 ** but can be as large as 2 billion for a really big database.
26284 **
26285 ** @(#) $Id: bitvec.c,v 1.6 2008/06/20 14:59:51 danielk1977 Exp $
26286 */
26287
26288 #define BITVEC_SZ 512
26289 /* Round the union size down to the nearest pointer boundary, since that's how
26290 ** it will be aligned within the Bitvec struct. */
@@ -26372,10 +26408,18 @@
26372 }
26373
26374 /*
26375 ** Set the i-th bit. Return 0 on success and an error code if
26376 ** anything goes wrong.
 
 
 
 
 
 
 
 
26377 */
26378 SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec *p, u32 i){
26379 u32 h;
26380 assert( p!=0 );
26381 assert( i>0 );
@@ -27804,11 +27848,11 @@
27804 ** is separate from the database file. The pager also implements file
27805 ** locking to prevent two processes from writing the same database
27806 ** file simultaneously, or one process from reading the database while
27807 ** another is writing.
27808 **
27809 ** @(#) $Id: pager.c,v 1.500 2008/10/29 07:01:57 danielk1977 Exp $
27810 */
27811 #ifndef SQLITE_OMIT_DISKIO
27812
27813 /*
27814 ** Macros for troubleshooting. Normally turned off
@@ -27988,11 +28032,11 @@
27988 i64 journalOff; /* Current byte offset in the journal file */
27989 i64 journalHdr; /* Byte offset to previous journal header */
27990 i64 stmtHdrOff; /* First journal header written this statement */
27991 i64 stmtCksum; /* cksumInit when statement was started */
27992 i64 stmtJSize; /* Size of journal at stmt_begin() */
27993 int sectorSize; /* Assumed sector size during rollback */
27994 #ifdef SQLITE_TEST
27995 int nHit, nMiss; /* Cache hits and missing */
27996 int nRead, nWrite; /* Database pages read/written */
27997 #endif
27998 void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */
@@ -28541,12 +28585,16 @@
28541 ** the process that created this journal. If this journal was
28542 ** created by a process other than this one, then this routine
28543 ** is being called from within pager_playback(). The local value
28544 ** of Pager.sectorSize is restored at the end of that routine.
28545 */
28546 rc = read32bits(pPager->jfd, jrnlOff+12, (u32 *)&pPager->sectorSize);
28547 if( rc ) return rc;
 
 
 
 
28548
28549 pPager->journalOff += JOURNAL_HDR_SZ(pPager);
28550 return SQLITE_OK;
28551 }
28552
@@ -31186,11 +31234,13 @@
31186 #endif
31187
31188 /*
31189 ** A call to this routine tells the pager that it is not necessary to
31190 ** write the information on page pPg back to the disk, even though
31191 ** that page might be marked as dirty.
 
 
31192 **
31193 ** The overlying software layer calls this routine when all of the data
31194 ** on the given page is unused. The pager marks the page as clean so
31195 ** that it does not get written to disk.
31196 **
@@ -32978,11 +33028,11 @@
32978 ** May you do good and not evil.
32979 ** May you find forgiveness for yourself and forgive others.
32980 ** May you share freely, never taking more than you give.
32981 **
32982 *************************************************************************
32983 ** $Id: btree.c,v 1.526 2008/10/27 13:59:34 danielk1977 Exp $
32984 **
32985 ** This file implements a external (disk-based) database using BTrees.
32986 ** See the header comment on "btreeInt.h" for additional information.
32987 ** Including a description of file format and an overview of operation.
32988 */
@@ -33374,11 +33424,11 @@
33374 sqlite3BtreeRestoreCursorPosition(p) : \
33375 SQLITE_OK)
33376
33377 /*
33378 ** Determine whether or not a cursor has moved from the position it
33379 ** was last placed at. Cursor can move when the row they are pointing
33380 ** at is deleted out from under them.
33381 **
33382 ** This routine returns an error code if something goes wrong. The
33383 ** integer *pHasMoved is set to one if the cursor has moved and 0 if not.
33384 */
@@ -40501,11 +40551,11 @@
40501 ** This file contains code use to manipulate "Mem" structure. A "Mem"
40502 ** stores a single value in the VDBE. Mem is an opaque structure visible
40503 ** only within the VDBE. Interface routines refer to a Mem using the
40504 ** name sqlite_value
40505 **
40506 ** $Id: vdbemem.c,v 1.124 2008/10/30 17:21:13 danielk1977 Exp $
40507 */
40508
40509 /*
40510 ** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
40511 ** P if required.
@@ -41089,13 +41139,10 @@
41089 }else{
41090 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
41091 }
41092 flags |= MEM_Term;
41093 }
41094 if( nByte>iLimit ){
41095 return SQLITE_TOOBIG;
41096 }
41097
41098 /* The following block sets the new values of Mem.z and Mem.xDel. It
41099 ** also sets a flag in local variable "flags" to indicate the memory
41100 ** management (one of MEM_Dyn or MEM_Static).
41101 */
@@ -41102,10 +41149,13 @@
41102 if( xDel==SQLITE_TRANSIENT ){
41103 int nAlloc = nByte;
41104 if( flags&MEM_Term ){
41105 nAlloc += (enc==SQLITE_UTF8?1:2);
41106 }
 
 
 
41107 if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
41108 return SQLITE_NOMEM;
41109 }
41110 memcpy(pMem->z, z, nAlloc);
41111 }else if( xDel==SQLITE_DYNAMIC ){
@@ -41116,10 +41166,13 @@
41116 sqlite3VdbeMemRelease(pMem);
41117 pMem->z = (char *)z;
41118 pMem->xDel = xDel;
41119 flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
41120 }
 
 
 
41121
41122 pMem->n = nByte;
41123 pMem->flags = flags;
41124 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
41125 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
@@ -41543,11 +41596,11 @@
41543 ** This file contains code used for creating, destroying, and populating
41544 ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
41545 ** to version 2.8.7, all this code was combined into the vdbe.c source file.
41546 ** But that file was getting too big so this subroutines were split out.
41547 **
41548 ** $Id: vdbeaux.c,v 1.413 2008/10/31 10:53:23 danielk1977 Exp $
41549 */
41550
41551
41552
41553 /*
@@ -41793,10 +41846,12 @@
41793 int nMaxArgs = 0;
41794 Op *pOp;
41795 int *aLabel = p->aLabel;
41796 int doesStatementRollback = 0;
41797 int hasStatementBegin = 0;
 
 
41798 for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
41799 u8 opcode = pOp->opcode;
41800
41801 if( opcode==OP_Function || opcode==OP_AggStep ){
41802 if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5;
@@ -41809,12 +41864,15 @@
41809 if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
41810 doesStatementRollback = 1;
41811 }
41812 }else if( opcode==OP_Statement ){
41813 hasStatementBegin = 1;
 
41814 }else if( opcode==OP_Destroy ){
41815 doesStatementRollback = 1;
 
 
41816 #ifndef SQLITE_OMIT_VIRTUALTABLE
41817 }else if( opcode==OP_VUpdate || opcode==OP_VRename ){
41818 doesStatementRollback = 1;
41819 }else if( opcode==OP_VFilter ){
41820 int n;
@@ -41839,10 +41897,11 @@
41839 ** transactions are not needed. So change every OP_Statement
41840 ** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive()
41841 ** which can be expensive on some platforms.
41842 */
41843 if( hasStatementBegin && !doesStatementRollback ){
 
41844 for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
41845 if( pOp->opcode==OP_Statement ){
41846 pOp->opcode = OP_Noop;
41847 }
41848 }
@@ -42547,11 +42606,11 @@
42547 p->magic = VDBE_MAGIC_RUN;
42548
42549 /* For each cursor required, also allocate a memory cell. Memory
42550 ** cells (nMem+1-nCursor)..nMem, inclusive, will never be used by
42551 ** the vdbe program. Instead they are used to allocate space for
42552 ** Cursor/BtCursor structures. The blob of memory associated with
42553 ** cursor 0 is stored in memory cell nMem. Memory cell (nMem-1)
42554 ** stores the blob of memory associated with cursor 1, etc.
42555 **
42556 ** See also: allocateCursor().
42557 */
@@ -42564,28 +42623,28 @@
42564 int nArg; /* Maximum number of args passed to a user function. */
42565 resolveP2Values(p, &nArg);
42566 /*resizeOpArray(p, p->nOp);*/
42567 assert( nVar>=0 );
42568 if( isExplain && nMem<10 ){
42569 p->nMem = nMem = 10;
42570 }
42571 p->aMem = sqlite3DbMallocZero(db,
42572 nMem*sizeof(Mem) /* aMem */
42573 + nVar*sizeof(Mem) /* aVar */
42574 + nArg*sizeof(Mem*) /* apArg */
42575 + nVar*sizeof(char*) /* azVar */
42576 + nCursor*sizeof(Cursor*) + 1 /* apCsr */
42577 );
42578 if( !db->mallocFailed ){
42579 p->aMem--; /* aMem[] goes from 1..nMem */
42580 p->nMem = nMem; /* not from 0..nMem-1 */
42581 p->aVar = &p->aMem[nMem+1];
42582 p->nVar = nVar;
42583 p->okVar = 0;
42584 p->apArg = (Mem**)&p->aVar[nVar];
42585 p->azVar = (char**)&p->apArg[nArg];
42586 p->apCsr = (Cursor**)&p->azVar[nVar];
42587 p->nCursor = nCursor;
42588 for(n=0; n<nVar; n++){
42589 p->aVar[n].flags = MEM_Null;
42590 p->aVar[n].db = db;
42591 }
@@ -42624,11 +42683,11 @@
42624
42625 /*
42626 ** Close a VDBE cursor and release all the resources that cursor
42627 ** happens to hold.
42628 */
42629 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
42630 if( pCx==0 ){
42631 return;
42632 }
42633 if( pCx->pBt ){
42634 sqlite3BtreeClose(pCx->pBt);
@@ -42659,11 +42718,11 @@
42659 */
42660 static void closeAllCursorsExceptActiveVtabs(Vdbe *p){
42661 int i;
42662 if( p->apCsr==0 ) return;
42663 for(i=0; i<p->nCursor; i++){
42664 Cursor *pC = p->apCsr[i];
42665 if( pC && (!p->inVtabMethod || !pC->pVtabCursor) ){
42666 sqlite3VdbeFreeCursor(p, pC);
42667 p->apCsr[i] = 0;
42668 }
42669 }
@@ -42749,11 +42808,11 @@
42749 return SQLITE_NOMEM;
42750 }
42751 assert( p->aColName!=0 );
42752 pColName = &(p->aColName[idx+var*p->nResColumn]);
42753 rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, xDel);
42754 assert( p->db->mallocFailed || !zName || pColName->flags&MEM_Term );
42755 return rc;
42756 }
42757
42758 /*
42759 ** A read or write transaction may or may not be active on database handle
@@ -42980,18 +43039,21 @@
42980 */
42981 #ifndef NDEBUG
42982 static void checkActiveVdbeCnt(sqlite3 *db){
42983 Vdbe *p;
42984 int cnt = 0;
 
42985 p = db->pVdbe;
42986 while( p ){
42987 if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){
42988 cnt++;
 
42989 }
42990 p = p->pNext;
42991 }
42992 assert( cnt==db->activeVdbeCnt );
 
42993 }
42994 #else
42995 #define checkActiveVdbeCnt(x)
42996 #endif
42997
@@ -43075,46 +43137,19 @@
43075 /* Check for one of the special errors */
43076 mrc = p->rc & 0xff;
43077 isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR
43078 || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL;
43079 if( isSpecialError ){
43080 /* This loop does static analysis of the query to see which of the
43081 ** following three categories it falls into:
43082 **
43083 ** Read-only
43084 ** Query with statement journal
43085 ** Query without statement journal
43086 **
43087 ** We could do something more elegant than this static analysis (i.e.
43088 ** store the type of query as part of the compliation phase), but
43089 ** handling malloc() or IO failure is a fairly obscure edge case so
43090 ** this is probably easier. Todo: Might be an opportunity to reduce
43091 ** code size a very small amount though...
43092 */
43093 int notReadOnly = 0;
43094 int isStatement = 0;
43095 assert(p->aOp || p->nOp==0);
43096 for(i=0; i<p->nOp; i++){
43097 switch( p->aOp[i].opcode ){
43098 case OP_Transaction:
43099 notReadOnly |= p->aOp[i].p2;
43100 break;
43101 case OP_Statement:
43102 isStatement = 1;
43103 break;
43104 }
43105 }
43106
43107
43108 /* If the query was read-only, we need do no rollback at all. Otherwise,
43109 ** proceed with the special handling.
43110 */
43111 if( notReadOnly || mrc!=SQLITE_INTERRUPT ){
43112 if( p->rc==SQLITE_IOERR_BLOCKED && isStatement ){
43113 xFunc = sqlite3BtreeRollbackStmt;
43114 p->rc = SQLITE_BUSY;
43115 } else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && isStatement ){
 
43116 xFunc = sqlite3BtreeRollbackStmt;
43117 }else{
43118 /* We are forced to roll back the active transaction. Before doing
43119 ** so, abort any other statements this handle currently has active.
43120 */
@@ -43127,13 +43162,13 @@
43127
43128 /* If the auto-commit flag is set and this is the only active vdbe, then
43129 ** we do either a commit or rollback of the current transaction.
43130 **
43131 ** Note: This block also runs if one of the special errors handled
43132 ** above has occured.
43133 */
43134 if( db->autoCommit && db->activeVdbeCnt==1 ){
43135 if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
43136 /* The auto-commit flag is true, and the vdbe program was
43137 ** successful or hit an 'OR FAIL' constraint. This means a commit
43138 ** is required.
43139 */
@@ -43209,10 +43244,14 @@
43209 }
43210
43211 /* We have successfully halted and closed the VM. Record this fact. */
43212 if( p->pc>=0 ){
43213 db->activeVdbeCnt--;
 
 
 
 
43214 }
43215 p->magic = VDBE_MAGIC_HALT;
43216 checkActiveVdbeCnt(db);
43217 if( p->db->mallocFailed ){
43218 p->rc = SQLITE_NOMEM;
@@ -43392,11 +43431,11 @@
43392 /*
43393 ** If a MoveTo operation is pending on the given cursor, then do that
43394 ** MoveTo now. Return an error code. If no MoveTo is pending, this
43395 ** routine does nothing and returns SQLITE_OK.
43396 */
43397 SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(Cursor *p){
43398 if( p->deferredMoveto ){
43399 int res, rc;
43400 #ifdef SQLITE_TEST
43401 extern int sqlite3_search_count;
43402 #endif
@@ -43495,11 +43534,11 @@
43495 return 6;
43496 }
43497 if( flags&MEM_Real ){
43498 return 7;
43499 }
43500 assert( flags&(MEM_Str|MEM_Blob) );
43501 n = pMem->n;
43502 if( flags & MEM_Zero ){
43503 n += pMem->u.i;
43504 }
43505 assert( n>=0 );
@@ -43959,11 +43998,11 @@
43959 **
43960 ** pUnpacked may be an unpacked version of pKey,nKey. If pUnpacked is
43961 ** supplied it is used in place of pKey,nKey.
43962 */
43963 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
43964 Cursor *pC, /* The cursor to compare against */
43965 UnpackedRecord *pUnpacked, /* Unpacked version of pKey and nKey */
43966 int *res /* Write the comparison result here */
43967 ){
43968 i64 nCellKey = 0;
43969 int rc;
@@ -44045,11 +44084,11 @@
44045 *************************************************************************
44046 **
44047 ** This file contains code use to implement APIs that are part of the
44048 ** VDBE.
44049 **
44050 ** $Id: vdbeapi.c,v 1.147 2008/10/13 10:37:50 danielk1977 Exp $
44051 */
44052
44053 #if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
44054 /*
44055 ** The following structure contains pointers to the end points of a
@@ -44498,10 +44537,11 @@
44498 p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0;
44499 }
44500 #endif
44501
44502 db->activeVdbeCnt++;
 
44503 p->pc = 0;
44504 stmtLruRemove(p);
44505 }
44506 #ifndef SQLITE_OMIT_EXPLAIN
44507 if( p->explain ){
@@ -45383,11 +45423,11 @@
45383 ** documentation, headers files, or other derived files. The formatting
45384 ** of the code in this file is, therefore, important. See other comments
45385 ** in this file for details. If in doubt, do not deviate from existing
45386 ** commenting and indentation practices when changing or adding code.
45387 **
45388 ** $Id: vdbe.c,v 1.784 2008/10/30 15:03:16 drh Exp $
45389 */
45390
45391 /*
45392 ** The following global variable is incremented every time a cursor
45393 ** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test
@@ -45519,24 +45559,24 @@
45519 assert( opcode>0 && opcode<sizeof(opcodeProperty) );
45520 return (opcodeProperty[opcode]&mask)!=0;
45521 }
45522
45523 /*
45524 ** Allocate cursor number iCur. Return a pointer to it. Return NULL
45525 ** if we run out of memory.
45526 */
45527 static Cursor *allocateCursor(
45528 Vdbe *p,
45529 int iCur,
45530 Op *pOp,
45531 int iDb,
45532 int isBtreeCursor
45533 ){
45534 /* Find the memory cell that will be used to store the blob of memory
45535 ** required for this Cursor structure. It is convenient to use a
45536 ** vdbe memory cell to manage the memory allocation required for a
45537 ** Cursor structure for the following reasons:
45538 **
45539 ** * Sometimes cursor numbers are used for a couple of different
45540 ** purposes in a vdbe program. The different uses might require
45541 ** different sized allocations. Memory cells provide growable
45542 ** allocations.
@@ -45550,40 +45590,41 @@
45550 ** cursor 1 is managed by memory cell (p->nMem-1), etc.
45551 */
45552 Mem *pMem = &p->aMem[p->nMem-iCur];
45553
45554 int nByte;
45555 Cursor *pCx = 0;
45556 /* If the opcode of pOp is OP_SetNumColumns, then pOp->p2 contains
45557 ** the number of fields in the records contained in the table or
45558 ** index being opened. Use this to reserve space for the
45559 ** Cursor.aType[] array.
45560 */
45561 int nField = 0;
45562 if( pOp->opcode==OP_SetNumColumns || pOp->opcode==OP_OpenEphemeral ){
45563 nField = pOp->p2;
45564 }
45565 nByte =
45566 sizeof(Cursor) +
45567 (isBtreeCursor?sqlite3BtreeCursorSize():0) +
45568 2*nField*sizeof(u32);
45569
45570 assert( iCur<p->nCursor );
45571 if( p->apCsr[iCur] ){
45572 sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
45573 p->apCsr[iCur] = 0;
45574 }
45575 if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
45576 p->apCsr[iCur] = pCx = (Cursor *)pMem->z;
45577 memset(pMem->z, 0, nByte);
45578 pCx->iDb = iDb;
45579 pCx->nField = nField;
45580 if( nField ){
45581 pCx->aType = (u32 *)&pMem->z[sizeof(Cursor)];
45582 }
45583 if( isBtreeCursor ){
45584 pCx->pCursor = (BtCursor *)&pMem->z[sizeof(Cursor)+2*nField*sizeof(u32)];
 
45585 }
45586 }
45587 return pCx;
45588 }
45589
@@ -47386,22 +47427,19 @@
47386 ** from this record. If there are less that (P2+1)
47387 ** values in the record, extract a NULL.
47388 **
47389 ** The value extracted is stored in register P3.
47390 **
47391 ** If the KeyAsData opcode has previously executed on this cursor, then the
47392 ** field might be extracted from the key rather than the data.
47393 **
47394 ** If the column contains fewer than P2 fields, then extract a NULL. Or,
47395 ** if the P4 argument is a P4_MEM use the value of the P4 argument as
47396 ** the result.
47397 */
47398 case OP_Column: {
47399 u32 payloadSize; /* Number of bytes in the record */
47400 int p1 = pOp->p1; /* P1 value of the opcode */
47401 int p2 = pOp->p2; /* column number to retrieve */
47402 Cursor *pC = 0; /* The VDBE cursor */
47403 char *zRec; /* Pointer to complete record-data */
47404 BtCursor *pCrsr; /* The BTree cursor */
47405 u32 *aType; /* aType[i] holds the numeric type of the i-th column */
47406 u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
47407 u32 nField; /* number of fields in the record */
@@ -47427,11 +47465,11 @@
47427 ** If the record is stored in a cursor, the complete record text
47428 ** might be available in the pC->aRow cache. Or it might not be.
47429 ** If the data is unavailable, zRec is set to NULL.
47430 **
47431 ** We also compute the number of columns in the record. For cursors,
47432 ** the number of columns is stored in the Cursor.nField element.
47433 */
47434 pC = p->apCsr[p1];
47435 assert( pC!=0 );
47436 #ifndef SQLITE_OMIT_VIRTUALTABLE
47437 assert( pC->pVtabCursor==0 );
@@ -47823,37 +47861,44 @@
47823 ** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails.
47824 **
47825 ** This instruction causes the VM to halt.
47826 */
47827 case OP_AutoCommit: {
47828 u8 i = pOp->p1;
47829 u8 rollback = pOp->p2;
 
47830
47831 assert( i==1 || i==0 );
47832 assert( i==1 || rollback==0 );
47833
47834 assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */
47835
47836 if( db->activeVdbeCnt>1 && i && !db->autoCommit ){
47837 /* If this instruction implements a COMMIT or ROLLBACK, other VMs are
47838 ** still running, and a transaction is active, return an error indicating
47839 ** that the other VMs must complete first.
47840 */
47841 sqlite3SetString(&p->zErrMsg, db, "cannot %s transaction - "
47842 "SQL statements in progress",
47843 rollback ? "rollback" : "commit");
 
 
 
 
 
 
47844 rc = SQLITE_BUSY;
47845 }else if( i!=db->autoCommit ){
47846 if( pOp->p2 ){
47847 assert( i==1 );
47848 sqlite3RollbackAll(db);
47849 db->autoCommit = 1;
47850 }else{
47851 db->autoCommit = i;
47852 if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
47853 p->pc = pc;
47854 db->autoCommit = 1-i;
47855 p->rc = rc = SQLITE_BUSY;
47856 goto vdbe_return;
47857 }
47858 }
47859 if( p->rc==SQLITE_OK ){
@@ -47862,11 +47907,11 @@
47862 rc = SQLITE_ERROR;
47863 }
47864 goto vdbe_return;
47865 }else{
47866 sqlite3SetString(&p->zErrMsg, db,
47867 (!i)?"cannot start a transaction within a transaction":(
47868 (rollback)?"cannot rollback - no transaction is active":
47869 "cannot commit - no transaction is active"));
47870
47871 rc = SQLITE_ERROR;
47872 }
@@ -48099,11 +48144,11 @@
48099 int i = pOp->p1;
48100 int p2 = pOp->p2;
48101 int iDb = pOp->p3;
48102 int wrFlag;
48103 Btree *pX;
48104 Cursor *pCur;
48105 Db *pDb;
48106
48107 assert( iDb>=0 && iDb<db->nDb );
48108 assert( (p->btreeMask & (1<<iDb))!=0 );
48109 pDb = &db->aDb[iDb];
@@ -48199,11 +48244,11 @@
48199 ** this opcode. Then this opcode was call OpenVirtual. But
48200 ** that created confusion with the whole virtual-table idea.
48201 */
48202 case OP_OpenEphemeral: {
48203 int i = pOp->p1;
48204 Cursor *pCx;
48205 static const int openFlags =
48206 SQLITE_OPEN_READWRITE |
48207 SQLITE_OPEN_CREATE |
48208 SQLITE_OPEN_EXCLUSIVE |
48209 SQLITE_OPEN_DELETEONCLOSE |
@@ -48265,11 +48310,11 @@
48265 ** memory cell containing the row data is not overwritten until the
48266 ** pseudo table is closed (or a new row is inserted into it).
48267 */
48268 case OP_OpenPseudo: {
48269 int i = pOp->p1;
48270 Cursor *pCx;
48271 assert( i>=0 );
48272 pCx = allocateCursor(p, i, &pOp[-1], -1, 0);
48273 if( pCx==0 ) goto no_mem;
48274 pCx->nullRow = 1;
48275 pCx->pseudoTable = 1;
@@ -48354,11 +48399,11 @@
48354 case OP_MoveLt: /* jump, in3 */
48355 case OP_MoveLe: /* jump, in3 */
48356 case OP_MoveGe: /* jump, in3 */
48357 case OP_MoveGt: { /* jump, in3 */
48358 int i = pOp->p1;
48359 Cursor *pC;
48360
48361 assert( i>=0 && i<p->nCursor );
48362 pC = p->apCsr[i];
48363 assert( pC!=0 );
48364 if( pC->pCursor!=0 ){
@@ -48471,11 +48516,11 @@
48471 */
48472 case OP_NotFound: /* jump, in3 */
48473 case OP_Found: { /* jump, in3 */
48474 int i = pOp->p1;
48475 int alreadyExists = 0;
48476 Cursor *pC;
48477 assert( i>=0 && i<p->nCursor );
48478 assert( p->apCsr[i]!=0 );
48479 if( (pC = p->apCsr[i])->pCursor!=0 ){
48480 int res;
48481 UnpackedRecord *pIdxKey;
@@ -48527,11 +48572,11 @@
48527 **
48528 ** See also: NotFound, NotExists, Found
48529 */
48530 case OP_IsUnique: { /* jump, in3 */
48531 int i = pOp->p1;
48532 Cursor *pCx;
48533 BtCursor *pCrsr;
48534 Mem *pK;
48535 i64 R;
48536
48537 /* Pop the value R off the top of the stack
@@ -48624,11 +48669,11 @@
48624 **
48625 ** See also: Found, NotFound, IsUnique
48626 */
48627 case OP_NotExists: { /* jump, in3 */
48628 int i = pOp->p1;
48629 Cursor *pC;
48630 BtCursor *pCrsr;
48631 assert( i>=0 && i<p->nCursor );
48632 assert( p->apCsr[i]!=0 );
48633 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
48634 int res;
@@ -48693,11 +48738,11 @@
48693 ** AUTOINCREMENT feature.
48694 */
48695 case OP_NewRowid: { /* out2-prerelease */
48696 int i = pOp->p1;
48697 i64 v = 0;
48698 Cursor *pC;
48699 assert( i>=0 && i<p->nCursor );
48700 assert( p->apCsr[i]!=0 );
48701 if( (pC = p->apCsr[i])->pCursor==0 ){
48702 /* The zero initialization above is all that is needed */
48703 }else{
@@ -48861,11 +48906,11 @@
48861 Mem *pData = &p->aMem[pOp->p2];
48862 Mem *pKey = &p->aMem[pOp->p3];
48863
48864 i64 iKey; /* The integer ROWID or key for the record to be inserted */
48865 int i = pOp->p1;
48866 Cursor *pC;
48867 assert( i>=0 && i<p->nCursor );
48868 pC = p->apCsr[i];
48869 assert( pC!=0 );
48870 assert( pC->pCursor!=0 || pC->pseudoTable );
48871 assert( pKey->flags & MEM_Int );
@@ -48955,11 +49000,11 @@
48955 ** using OP_NotFound prior to invoking this opcode.
48956 */
48957 case OP_Delete: {
48958 int i = pOp->p1;
48959 i64 iKey;
48960 Cursor *pC;
48961
48962 assert( i>=0 && i<p->nCursor );
48963 pC = p->apCsr[i];
48964 assert( pC!=0 );
48965 assert( pC->pCursor!=0 ); /* Only valid for real tables, no pseudotables */
@@ -49026,11 +49071,11 @@
49026 ** of a real table, not a pseudo-table.
49027 */
49028 case OP_RowKey:
49029 case OP_RowData: {
49030 int i = pOp->p1;
49031 Cursor *pC;
49032 BtCursor *pCrsr;
49033 u32 n;
49034
49035 pOut = &p->aMem[pOp->p2];
49036
@@ -49080,11 +49125,11 @@
49080 ** Store in register P2 an integer which is the key of the table entry that
49081 ** P1 is currently point to.
49082 */
49083 case OP_Rowid: { /* out2-prerelease */
49084 int i = pOp->p1;
49085 Cursor *pC;
49086 i64 v;
49087
49088 assert( i>=0 && i<p->nCursor );
49089 pC = p->apCsr[i];
49090 assert( pC!=0 );
@@ -49113,11 +49158,11 @@
49113 ** that occur while the cursor is on the null row will always
49114 ** write a NULL.
49115 */
49116 case OP_NullRow: {
49117 int i = pOp->p1;
49118 Cursor *pC;
49119
49120 assert( i>=0 && i<p->nCursor );
49121 pC = p->apCsr[i];
49122 assert( pC!=0 );
49123 pC->nullRow = 1;
@@ -49136,11 +49181,11 @@
49136 ** If P2 is 0 or if the table or index is not empty, fall through
49137 ** to the following instruction.
49138 */
49139 case OP_Last: { /* jump */
49140 int i = pOp->p1;
49141 Cursor *pC;
49142 BtCursor *pCrsr;
49143 int res;
49144
49145 assert( i>=0 && i<p->nCursor );
49146 pC = p->apCsr[i];
@@ -49186,11 +49231,11 @@
49186 ** If P2 is 0 or if the table or index is not empty, fall through
49187 ** to the following instruction.
49188 */
49189 case OP_Rewind: { /* jump */
49190 int i = pOp->p1;
49191 Cursor *pC;
49192 BtCursor *pCrsr;
49193 int res;
49194
49195 assert( i>=0 && i<p->nCursor );
49196 pC = p->apCsr[i];
@@ -49231,11 +49276,11 @@
49231 **
49232 ** The P1 cursor must be for a real table, not a pseudo-table.
49233 */
49234 case OP_Prev: /* jump */
49235 case OP_Next: { /* jump */
49236 Cursor *pC;
49237 BtCursor *pCrsr;
49238 int res;
49239
49240 CHECK_FOR_INTERRUPT;
49241 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -49274,11 +49319,11 @@
49274 ** This instruction only works for indices. The equivalent instruction
49275 ** for tables is OP_Insert.
49276 */
49277 case OP_IdxInsert: { /* in2 */
49278 int i = pOp->p1;
49279 Cursor *pC;
49280 BtCursor *pCrsr;
49281 assert( i>=0 && i<p->nCursor );
49282 assert( p->apCsr[i]!=0 );
49283 assert( pIn2->flags & MEM_Blob );
49284 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
@@ -49301,11 +49346,11 @@
49301 ** an unpacked index key. This opcode removes that entry from the
49302 ** index opened by cursor P1.
49303 */
49304 case OP_IdxDelete: {
49305 int i = pOp->p1;
49306 Cursor *pC;
49307 BtCursor *pCrsr;
49308 assert( pOp->p3>0 );
49309 assert( pOp->p2>0 && pOp->p2+pOp->p3<=p->nMem );
49310 assert( i>=0 && i<p->nCursor );
49311 assert( p->apCsr[i]!=0 );
@@ -49335,11 +49380,11 @@
49335 ** See also: Rowid, MakeIdxRec.
49336 */
49337 case OP_IdxRowid: { /* out2-prerelease */
49338 int i = pOp->p1;
49339 BtCursor *pCrsr;
49340 Cursor *pC;
49341
49342 assert( i>=0 && i<p->nCursor );
49343 assert( p->apCsr[i]!=0 );
49344 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
49345 i64 rowid;
@@ -49385,11 +49430,11 @@
49385 ** to the comparison. This makes the opcode work like IdxLE.
49386 */
49387 case OP_IdxLT: /* jump, in3 */
49388 case OP_IdxGE: { /* jump, in3 */
49389 int i= pOp->p1;
49390 Cursor *pC;
49391
49392 assert( i>=0 && i<p->nCursor );
49393 assert( p->apCsr[i]!=0 );
49394 if( (pC = p->apCsr[i])->pCursor!=0 ){
49395 int res;
@@ -50068,11 +50113,11 @@
50068 ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
50069 ** P1 is a cursor number. This opcode opens a cursor to the virtual
50070 ** table and stores that cursor in P1.
50071 */
50072 case OP_VOpen: {
50073 Cursor *pCur = 0;
50074 sqlite3_vtab_cursor *pVtabCursor = 0;
50075
50076 sqlite3_vtab *pVtab = pOp->p4.pVtab;
50077 sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule;
50078
@@ -50127,11 +50172,11 @@
50127 Mem *pQuery = &p->aMem[pOp->p3];
50128 Mem *pArgc = &pQuery[1];
50129 sqlite3_vtab_cursor *pVtabCursor;
50130 sqlite3_vtab *pVtab;
50131
50132 Cursor *pCur = p->apCsr[pOp->p1];
50133
50134 REGISTER_TRACE(pOp->p3, pQuery);
50135 assert( pCur->pVtabCursor );
50136 pVtabCursor = pCur->pVtabCursor;
50137 pVtab = pVtabCursor->pVtab;
@@ -50184,11 +50229,11 @@
50184 */
50185 case OP_VRowid: { /* out2-prerelease */
50186 sqlite3_vtab *pVtab;
50187 const sqlite3_module *pModule;
50188 sqlite_int64 iRow;
50189 Cursor *pCur = p->apCsr[pOp->p1];
50190
50191 assert( pCur->pVtabCursor );
50192 if( pCur->nullRow ){
50193 break;
50194 }
@@ -50218,11 +50263,11 @@
50218 sqlite3_vtab *pVtab;
50219 const sqlite3_module *pModule;
50220 Mem *pDest;
50221 sqlite3_context sContext;
50222
50223 Cursor *pCur = p->apCsr[pOp->p1];
50224 assert( pCur->pVtabCursor );
50225 assert( pOp->p3>0 && pOp->p3<=p->nMem );
50226 pDest = &p->aMem[pOp->p3];
50227 if( pCur->nullRow ){
50228 sqlite3VdbeMemSetNull(pDest);
@@ -50276,11 +50321,11 @@
50276 case OP_VNext: { /* jump */
50277 sqlite3_vtab *pVtab;
50278 const sqlite3_module *pModule;
50279 int res = 0;
50280
50281 Cursor *pCur = p->apCsr[pOp->p1];
50282 assert( pCur->pVtabCursor );
50283 if( pCur->nullRow ){
50284 break;
50285 }
50286 pVtab = pCur->pVtabCursor->pVtab;
@@ -51153,15 +51198,11 @@
51153 #endif
51154
51155 /************** End of journal.c *********************************************/
51156 /************** Begin file memjournal.c **************************************/
51157 /*
51158 <<<<<<< memjournal.c
51159 ** 2008 October 17
51160 =======
51161 ** 2008 October 7
51162 >>>>>>> 1.2
51163 **
51164 ** The author disclaims copyright to this source code. In place of
51165 ** a legal notice, here is a blessing:
51166 **
51167 ** May you do good and not evil.
@@ -52715,11 +52756,11 @@
52715 **
52716 *************************************************************************
52717 ** This file contains routines used for analyzing expressions and
52718 ** for generating VDBE code that evaluates expressions in SQLite.
52719 **
52720 ** $Id: expr.c,v 1.400 2008/10/25 15:03:21 drh Exp $
52721 */
52722
52723 /*
52724 ** Return the 'affinity' of the expression pExpr if any.
52725 **
@@ -54565,10 +54606,14 @@
54565 testcase( to_op==OP_ToText );
54566 testcase( to_op==OP_ToBlob );
54567 testcase( to_op==OP_ToNumeric );
54568 testcase( to_op==OP_ToInt );
54569 testcase( to_op==OP_ToReal );
 
 
 
 
54570 sqlite3VdbeAddOp1(v, to_op, inReg);
54571 testcase( usedAsColumnCache(pParse, inReg, inReg) );
54572 sqlite3ExprCacheAffinityChange(pParse, inReg, 1);
54573 break;
54574 }
@@ -56430,11 +56475,11 @@
56430 ** May you share freely, never taking more than you give.
56431 **
56432 *************************************************************************
56433 ** This file contains code associated with the ANALYZE command.
56434 **
56435 ** @(#) $Id: analyze.c,v 1.43 2008/07/28 19:34:53 drh Exp $
56436 */
56437 #ifndef SQLITE_OMIT_ANALYZE
56438
56439 /*
56440 ** This routine generates code that opens the sqlite_stat1 table on cursor
@@ -56504,15 +56549,15 @@
56504 ** a single table.
56505 */
56506 static void analyzeOneTable(
56507 Parse *pParse, /* Parser context */
56508 Table *pTab, /* Table whose indices are to be analyzed */
56509 int iStatCur, /* Cursor that writes to the sqlite_stat1 table */
56510 int iMem /* Available memory locations begin here */
56511 ){
56512 Index *pIdx; /* An index to being analyzed */
56513 int iIdxCur; /* Cursor number for index being analyzed */
56514 int nCol; /* Number of columns in the index */
56515 Vdbe *v; /* The virtual machine being built up */
56516 int i; /* Loop counter */
56517 int topOfLoop; /* The top of the loop */
56518 int endOfLoop; /* The end of the loop */
@@ -57640,11 +57685,11 @@
57640 ** creating ID lists
57641 ** BEGIN TRANSACTION
57642 ** COMMIT
57643 ** ROLLBACK
57644 **
57645 ** $Id: build.c,v 1.499 2008/10/22 10:45:38 danielk1977 Exp $
57646 */
57647
57648 /*
57649 ** This routine is called when a new SQL statement is beginning to
57650 ** be parsed. Initialize the pParse structure as needed.
@@ -60673,11 +60718,11 @@
60673 pList->nSrc++;
60674 return pList;
60675 }
60676
60677 /*
60678 ** Assign cursors to all tables in a SrcList
60679 */
60680 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
60681 int i;
60682 struct SrcList_item *pItem;
60683 assert(pList || pParse->db->mallocFailed );
@@ -63616,11 +63661,11 @@
63616 **
63617 *************************************************************************
63618 ** This file contains C code routines that are called by the parser
63619 ** to handle INSERT statements in SQLite.
63620 **
63621 ** $Id: insert.c,v 1.250 2008/10/31 10:53:23 danielk1977 Exp $
63622 */
63623
63624 /*
63625 ** Set P4 of the most recently inserted opcode to a column affinity
63626 ** string for index pIdx. A column affinity string has one character
@@ -64988,11 +65033,11 @@
64988 ** Return the number of indices on the table.
64989 */
64990 SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
64991 Parse *pParse, /* Parsing context */
64992 Table *pTab, /* Table to be opened */
64993 int baseCur, /* Cursor number assigned to the table */
64994 int op /* OP_OpenRead or OP_OpenWrite */
64995 ){
64996 int i;
64997 int iDb;
64998 Index *pIdx;
@@ -75667,11 +75712,11 @@
75667 ** generating the code that loops through a table looking for applicable
75668 ** rows. Indices are selected and used to speed the search when doing
75669 ** so is applicable. Because this module is responsible for selecting
75670 ** indices, you might also think of this module as the "query optimizer".
75671 **
75672 ** $Id: where.c,v 1.327 2008/10/25 15:03:21 drh Exp $
75673 */
75674
75675 /*
75676 ** The number of bits in a Bitmask. "BMS" means "BitMask Size".
75677 */
@@ -78122,20 +78167,30 @@
78122 pStart = pEnd;
78123 pEnd = pTerm;
78124 }
78125 if( pStart ){
78126 Expr *pX;
78127 int r1, regFree1;
78128 pX = pStart->pExpr;
78129 assert( pX!=0 );
78130 assert( pStart->leftCursor==iCur );
78131 r1 = sqlite3ExprCodeTemp(pParse, pX->pRight, &regFree1);
 
 
 
 
 
 
 
 
 
 
78132 sqlite3VdbeAddOp3(v, OP_ForceInt, r1, brk,
78133 pX->op==TK_LE || pX->op==TK_GT);
78134 sqlite3VdbeAddOp3(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk, r1);
78135 VdbeComment((v, "pk"));
78136 sqlite3ReleaseTempReg(pParse, regFree1);
78137 disableTerm(pLevel, pStart);
78138 }else{
78139 sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, brk);
78140 }
78141 if( pEnd ){
@@ -78764,424 +78819,424 @@
78764 ** yy_reduce_ofst[] For each state, the offset into yy_action for
78765 ** shifting non-terminals after a reduce.
78766 ** yy_default[] Default action for each state.
78767 */
78768 static const YYACTIONTYPE yy_action[] = {
78769 /* 0 */ 296, 914, 125, 485, 2, 181, 539, 539, 92, 92,
78770 /* 10 */ 92, 92, 489, 94, 94, 94, 94, 95, 95, 96,
78771 /* 20 */ 96, 96, 76, 215, 264, 303, 527, 518, 57, 94,
78772 /* 30 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78773 /* 40 */ 68, 468, 87, 154, 91, 72, 305, 512, 510, 516,
78774 /* 50 */ 516, 93, 93, 92, 92, 92, 92, 217, 94, 94,
78775 /* 60 */ 94, 94, 95, 95, 96, 96, 96, 76, 215, 296,
78776 /* 70 */ 10, 539, 539, 303, 489, 84, 482, 467, 463, 298,
78777 /* 80 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78778 /* 90 */ 215, 489, 475, 221, 179, 527, 518, 521, 295, 74,
78779 /* 100 */ 114, 239, 349, 283, 350, 171, 409, 60, 404, 403,
78780 /* 110 */ 536, 567, 256, 91, 72, 305, 512, 510, 516, 516,
78781 /* 120 */ 93, 93, 92, 92, 92, 92, 215, 94, 94, 94,
78782 /* 130 */ 94, 95, 95, 96, 96, 96, 76, 215, 296, 467,
78783 /* 140 */ 463, 221, 415, 531, 531, 531, 482, 192, 114, 239,
78784 /* 150 */ 349, 283, 350, 171, 369, 589, 467, 463, 196, 372,
78785 /* 160 */ 256, 351, 354, 355, 527, 518, 150, 151, 68, 343,
78786 /* 170 */ 87, 154, 356, 454, 323, 68, 409, 87, 154, 557,
78787 /* 180 */ 536, 296, 91, 72, 305, 512, 510, 516, 516, 93,
78788 /* 190 */ 93, 92, 92, 92, 92, 572, 94, 94, 94, 94,
78789 /* 200 */ 95, 95, 96, 96, 96, 76, 215, 527, 518, 76,
78790 /* 210 */ 215, 452, 322, 531, 531, 531, 95, 95, 96, 96,
78791 /* 220 */ 96, 76, 215, 595, 594, 91, 72, 305, 512, 510,
78792 /* 230 */ 516, 516, 93, 93, 92, 92, 92, 92, 233, 94,
78793 /* 240 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78794 /* 250 */ 515, 506, 317, 324, 296, 507, 507, 464, 289, 152,
78795 /* 260 */ 157, 379, 257, 232, 462, 318, 513, 547, 342, 489,
78796 /* 270 */ 225, 188, 217, 317, 551, 26, 181, 197, 539, 196,
78797 /* 280 */ 527, 518, 351, 354, 355, 546, 545, 96, 96, 96,
78798 /* 290 */ 76, 215, 231, 356, 548, 551, 33, 86, 91, 72,
78799 /* 300 */ 305, 512, 510, 516, 516, 93, 93, 92, 92, 92,
78800 /* 310 */ 92, 548, 94, 94, 94, 94, 95, 95, 96, 96,
78801 /* 320 */ 96, 76, 215, 296, 492, 210, 549, 196, 108, 317,
78802 /* 330 */ 351, 354, 355, 317, 467, 463, 386, 324, 317, 507,
78803 /* 340 */ 507, 356, 311, 539, 543, 544, 155, 542, 209, 527,
78804 /* 350 */ 518, 551, 33, 407, 291, 551, 44, 486, 553, 172,
78805 /* 360 */ 551, 36, 564, 394, 632, 431, 296, 91, 72, 305,
78806 /* 370 */ 512, 510, 516, 516, 93, 93, 92, 92, 92, 92,
78807 /* 380 */ 548, 94, 94, 94, 94, 95, 95, 96, 96, 96,
78808 /* 390 */ 76, 215, 527, 518, 67, 481, 337, 219, 309, 249,
78809 /* 400 */ 588, 583, 417, 335, 248, 575, 579, 587, 334, 296,
78810 /* 410 */ 91, 72, 305, 512, 510, 516, 516, 93, 93, 92,
78811 /* 420 */ 92, 92, 92, 410, 94, 94, 94, 94, 95, 95,
78812 /* 430 */ 96, 96, 96, 76, 215, 527, 518, 266, 216, 271,
78813 /* 440 */ 446, 246, 238, 452, 244, 56, 310, 499, 498, 284,
78814 /* 450 */ 489, 175, 247, 91, 72, 305, 512, 510, 516, 516,
78815 /* 460 */ 93, 93, 92, 92, 92, 92, 194, 94, 94, 94,
78816 /* 470 */ 94, 95, 95, 96, 96, 96, 76, 215, 359, 421,
78817 /* 480 */ 180, 324, 296, 507, 507, 560, 476, 62, 324, 561,
78818 /* 490 */ 507, 507, 460, 379, 257, 232, 376, 68, 474, 87,
78819 /* 500 */ 154, 457, 526, 523, 217, 194, 408, 418, 527, 518,
78820 /* 510 */ 209, 473, 332, 331, 548, 467, 463, 437, 1, 259,
78821 /* 520 */ 174, 299, 489, 520, 519, 63, 91, 72, 305, 512,
78822 /* 530 */ 510, 516, 516, 93, 93, 92, 92, 92, 92, 377,
78823 /* 540 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78824 /* 550 */ 215, 296, 522, 158, 548, 411, 18, 476, 317, 19,
78825 /* 560 */ 299, 380, 220, 317, 554, 256, 173, 159, 156, 474,
78826 /* 570 */ 279, 574, 344, 591, 21, 495, 495, 527, 518, 302,
78827 /* 580 */ 551, 36, 473, 146, 402, 551, 44, 467, 463, 438,
78828 /* 590 */ 905, 573, 905, 457, 597, 91, 72, 305, 512, 510,
78829 /* 600 */ 516, 516, 93, 93, 92, 92, 92, 92, 8, 94,
78830 /* 610 */ 94, 94, 94, 95, 95, 96, 96, 96, 76, 215,
78831 /* 620 */ 296, 554, 363, 335, 584, 433, 317, 218, 346, 525,
78832 /* 630 */ 586, 21, 578, 552, 326, 499, 498, 489, 191, 340,
78833 /* 640 */ 430, 558, 234, 306, 429, 577, 527, 518, 551, 36,
78834 /* 650 */ 201, 164, 170, 558, 149, 590, 368, 537, 441, 547,
78835 /* 660 */ 179, 180, 381, 296, 91, 72, 305, 512, 510, 516,
78836 /* 670 */ 516, 93, 93, 92, 92, 92, 92, 546, 94, 94,
78837 /* 680 */ 94, 94, 95, 95, 96, 96, 96, 76, 215, 527,
78838 /* 690 */ 518, 339, 492, 570, 288, 548, 438, 904, 209, 904,
78839 /* 700 */ 455, 444, 467, 463, 492, 210, 296, 91, 72, 305,
78840 /* 710 */ 512, 510, 516, 516, 93, 93, 92, 92, 92, 92,
78841 /* 720 */ 377, 94, 94, 94, 94, 95, 95, 96, 96, 96,
78842 /* 730 */ 76, 215, 527, 518, 554, 391, 525, 333, 85, 389,
78843 /* 740 */ 209, 837, 373, 470, 21, 486, 327, 172, 282, 296,
78844 /* 750 */ 91, 64, 305, 512, 510, 516, 516, 93, 93, 92,
78845 /* 760 */ 92, 92, 92, 569, 94, 94, 94, 94, 95, 95,
78846 /* 770 */ 96, 96, 96, 76, 215, 527, 518, 598, 534, 395,
78847 /* 780 */ 425, 366, 425, 494, 290, 294, 393, 388, 445, 434,
78848 /* 790 */ 426, 89, 296, 70, 72, 305, 512, 510, 516, 516,
78849 /* 800 */ 93, 93, 92, 92, 92, 92, 217, 94, 94, 94,
78850 /* 810 */ 94, 95, 95, 96, 96, 96, 76, 215, 527, 518,
78851 /* 820 */ 387, 358, 533, 175, 80, 504, 20, 23, 144, 489,
78852 /* 830 */ 288, 489, 534, 395, 288, 446, 437, 175, 305, 512,
78853 /* 840 */ 510, 516, 516, 93, 93, 92, 92, 92, 92, 217,
78854 /* 850 */ 94, 94, 94, 94, 95, 95, 96, 96, 96, 76,
78855 /* 860 */ 215, 69, 328, 378, 4, 169, 22, 317, 315, 288,
78856 /* 870 */ 539, 505, 193, 159, 224, 500, 325, 304, 118, 345,
78857 /* 880 */ 347, 6, 317, 458, 260, 69, 328, 446, 4, 551,
78858 /* 890 */ 35, 317, 315, 330, 467, 463, 467, 463, 316, 548,
78859 /* 900 */ 325, 551, 3, 482, 551, 100, 317, 560, 317, 288,
78860 /* 910 */ 286, 561, 592, 551, 48, 437, 317, 330, 317, 313,
78861 /* 920 */ 449, 317, 453, 83, 77, 420, 280, 482, 551, 49,
78862 /* 930 */ 551, 28, 90, 320, 321, 539, 487, 536, 551, 47,
78863 /* 940 */ 551, 11, 236, 551, 46, 317, 275, 83, 77, 203,
78864 /* 950 */ 508, 443, 568, 175, 175, 252, 90, 320, 321, 317,
78865 /* 960 */ 270, 536, 440, 2, 317, 436, 317, 551, 98, 288,
78866 /* 970 */ 531, 531, 531, 529, 528, 16, 288, 367, 317, 217,
78867 /* 980 */ 317, 551, 29, 548, 260, 189, 551, 24, 551, 43,
78868 /* 990 */ 268, 230, 254, 104, 531, 531, 531, 529, 528, 16,
78869 /* 1000 */ 551, 17, 551, 54, 288, 371, 187, 202, 258, 317,
78870 /* 1010 */ 211, 69, 328, 580, 4, 240, 317, 212, 315, 223,
78871 /* 1020 */ 483, 160, 80, 376, 439, 317, 325, 168, 317, 452,
78872 /* 1030 */ 374, 551, 42, 165, 317, 447, 186, 317, 551, 31,
78873 /* 1040 */ 317, 548, 317, 330, 317, 237, 317, 551, 55, 317,
78874 /* 1050 */ 551, 41, 471, 482, 317, 548, 551, 45, 288, 551,
78875 /* 1060 */ 37, 206, 551, 110, 551, 112, 551, 25, 551, 34,
78876 /* 1070 */ 317, 551, 50, 83, 77, 269, 551, 27, 317, 384,
78877 /* 1080 */ 241, 232, 90, 320, 321, 297, 317, 536, 317, 213,
78878 /* 1090 */ 217, 317, 551, 32, 317, 548, 317, 260, 260, 511,
78879 /* 1100 */ 551, 113, 260, 450, 403, 317, 253, 317, 551, 51,
78880 /* 1110 */ 551, 39, 491, 551, 40, 390, 551, 52, 551, 38,
78881 /* 1120 */ 531, 531, 531, 529, 528, 16, 255, 551, 30, 551,
78882 /* 1130 */ 111, 317, 314, 312, 317, 273, 317, 308, 317, 375,
78883 /* 1140 */ 317, 115, 317, 497, 582, 267, 559, 496, 162, 245,
78884 /* 1150 */ 242, 235, 263, 551, 53, 532, 551, 99, 551, 97,
78885 /* 1160 */ 551, 102, 551, 103, 551, 109, 493, 243, 385, 524,
78886 /* 1170 */ 329, 538, 466, 261, 148, 556, 400, 563, 465, 461,
78887 /* 1180 */ 185, 562, 413, 117, 353, 565, 182, 250, 65, 583,
78888 /* 1190 */ 469, 136, 207, 214, 134, 360, 204, 126, 348, 406,
78889 /* 1200 */ 581, 362, 451, 75, 129, 85, 541, 200, 397, 398,
78890 /* 1210 */ 300, 596, 199, 517, 383, 251, 133, 592, 501, 593,
78891 /* 1220 */ 488, 422, 405, 71, 227, 190, 555, 262, 338, 131,
78892 /* 1230 */ 274, 382, 88, 341, 122, 265, 293, 442, 120, 423,
78893 /* 1240 */ 142, 370, 132, 428, 566, 73, 277, 222, 228, 176,
78894 /* 1250 */ 336, 278, 66, 7, 319, 307, 585, 540, 281, 571,
78895 /* 1260 */ 79, 364, 478, 107, 416, 576, 427, 101, 163, 419,
78896 /* 1270 */ 292, 530, 226, 399, 105, 633, 634, 285, 208, 514,
78897 /* 1280 */ 509, 82, 480, 503, 484, 145, 161, 167, 479, 477,
78898 /* 1290 */ 448, 119, 472, 5, 14, 61, 12, 137, 301, 177,
78899 /* 1300 */ 435, 139, 153, 414, 412, 229, 78, 116, 124, 195,
78900 /* 1310 */ 272, 123, 81, 121, 247, 361, 143, 401, 141, 179,
78901 /* 1320 */ 352, 357, 365, 276, 178, 140, 138, 432, 9, 456,
78902 /* 1330 */ 424, 135, 183, 13, 184, 490, 205, 502, 130, 198,
78903 /* 1340 */ 128, 127, 166, 15, 106, 550, 147, 287, 535, 396,
78904 /* 1350 */ 915, 459, 915, 59, 915, 392, 58,
78905 };
78906 static const YYCODETYPE yy_lookahead[] = {
78907 /* 0 */ 16, 140, 141, 142, 143, 21, 23, 23, 69, 70,
78908 /* 10 */ 71, 72, 23, 74, 75, 76, 77, 78, 79, 80,
78909 /* 20 */ 81, 82, 83, 84, 205, 16, 42, 43, 73, 74,
78910 /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78911 /* 40 */ 219, 220, 221, 222, 60, 61, 62, 63, 64, 65,
78912 /* 50 */ 66, 67, 68, 69, 70, 71, 72, 110, 74, 75,
78913 /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
78914 /* 70 */ 19, 88, 88, 16, 23, 22, 58, 88, 89, 151,
78915 /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78916 /* 90 */ 84, 23, 20, 84, 22, 42, 43, 245, 246, 46,
78917 /* 100 */ 91, 92, 93, 94, 95, 96, 88, 19, 186, 187,
78918 /* 110 */ 92, 23, 103, 60, 61, 62, 63, 64, 65, 66,
78919 /* 120 */ 67, 68, 69, 70, 71, 72, 84, 74, 75, 76,
78920 /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 88,
78921 /* 140 */ 89, 84, 20, 125, 126, 127, 58, 90, 91, 92,
78922 /* 150 */ 93, 94, 95, 96, 226, 182, 88, 89, 90, 231,
78923 /* 160 */ 103, 93, 94, 95, 42, 43, 78, 79, 219, 16,
78924 /* 170 */ 221, 222, 104, 11, 16, 219, 88, 221, 222, 182,
78925 /* 180 */ 92, 16, 60, 61, 62, 63, 64, 65, 66, 67,
78926 /* 190 */ 68, 69, 70, 71, 72, 239, 74, 75, 76, 77,
78927 /* 200 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 83,
78928 /* 210 */ 84, 49, 148, 125, 126, 127, 78, 79, 80, 81,
78929 /* 220 */ 82, 83, 84, 7, 8, 60, 61, 62, 63, 64,
78930 /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 148, 74,
78931 /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78932 /* 250 */ 92, 20, 148, 106, 16, 108, 109, 27, 20, 22,
78933 /* 260 */ 156, 99, 100, 101, 34, 144, 145, 148, 115, 23,
78934 /* 270 */ 149, 19, 110, 148, 170, 171, 21, 156, 23, 90,
78935 /* 280 */ 42, 43, 93, 94, 95, 166, 167, 80, 81, 82,
78936 /* 290 */ 83, 84, 191, 104, 190, 170, 171, 132, 60, 61,
78937 /* 300 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
78938 /* 310 */ 72, 190, 74, 75, 76, 77, 78, 79, 80, 81,
78939 /* 320 */ 82, 83, 84, 16, 78, 79, 20, 90, 21, 148,
78940 /* 330 */ 93, 94, 95, 148, 88, 89, 215, 106, 148, 108,
78941 /* 340 */ 109, 104, 217, 88, 98, 99, 156, 228, 229, 42,
78942 /* 350 */ 43, 170, 171, 161, 159, 170, 171, 162, 163, 164,
78943 /* 360 */ 170, 171, 170, 242, 112, 59, 16, 60, 61, 62,
78944 /* 370 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
78945 /* 380 */ 190, 74, 75, 76, 77, 78, 79, 80, 81, 82,
78946 /* 390 */ 83, 84, 42, 43, 44, 20, 211, 212, 217, 14,
78947 /* 400 */ 177, 178, 20, 213, 14, 91, 92, 184, 218, 16,
78948 /* 410 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
78949 /* 420 */ 70, 71, 72, 170, 74, 75, 76, 77, 78, 79,
78950 /* 430 */ 80, 81, 82, 83, 84, 42, 43, 52, 193, 54,
78951 /* 440 */ 162, 92, 52, 49, 54, 200, 165, 166, 167, 20,
78952 /* 450 */ 23, 22, 103, 60, 61, 62, 63, 64, 65, 66,
78953 /* 460 */ 67, 68, 69, 70, 71, 72, 43, 74, 75, 76,
78954 /* 470 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 201,
78955 /* 480 */ 156, 106, 16, 108, 109, 107, 12, 21, 106, 111,
78956 /* 490 */ 108, 109, 22, 99, 100, 101, 148, 219, 24, 221,
78957 /* 500 */ 222, 22, 42, 43, 110, 43, 170, 80, 42, 43,
78958 /* 510 */ 229, 37, 187, 39, 190, 88, 89, 148, 19, 134,
78959 /* 520 */ 156, 98, 23, 63, 64, 132, 60, 61, 62, 63,
78960 /* 530 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 215,
78961 /* 540 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78962 /* 550 */ 84, 16, 92, 148, 190, 20, 232, 12, 148, 19,
78963 /* 560 */ 98, 237, 214, 148, 148, 103, 202, 203, 89, 24,
78964 /* 570 */ 154, 30, 208, 157, 158, 125, 126, 42, 43, 210,
78965 /* 580 */ 170, 171, 37, 113, 39, 170, 171, 88, 89, 19,
78966 /* 590 */ 20, 50, 22, 114, 49, 60, 61, 62, 63, 64,
78967 /* 600 */ 65, 66, 67, 68, 69, 70, 71, 72, 68, 74,
78968 /* 610 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78969 /* 620 */ 16, 148, 234, 213, 20, 18, 148, 212, 218, 59,
78970 /* 630 */ 157, 158, 168, 169, 165, 166, 167, 23, 22, 148,
78971 /* 640 */ 25, 177, 148, 102, 29, 169, 42, 43, 170, 171,
78972 /* 650 */ 99, 100, 101, 177, 181, 182, 41, 148, 20, 148,
78973 /* 660 */ 22, 156, 55, 16, 60, 61, 62, 63, 64, 65,
78974 /* 670 */ 66, 67, 68, 69, 70, 71, 72, 166, 74, 75,
78975 /* 680 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 42,
78976 /* 690 */ 43, 213, 78, 179, 148, 190, 19, 20, 229, 22,
78977 /* 700 */ 148, 94, 88, 89, 78, 79, 16, 60, 61, 62,
78978 /* 710 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
78979 /* 720 */ 215, 74, 75, 76, 77, 78, 79, 80, 81, 82,
78980 /* 730 */ 83, 84, 42, 43, 148, 189, 59, 148, 122, 228,
78981 /* 740 */ 229, 134, 237, 157, 158, 162, 163, 164, 148, 16,
78982 /* 750 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
78983 /* 760 */ 70, 71, 72, 179, 74, 75, 76, 77, 78, 79,
78984 /* 770 */ 80, 81, 82, 83, 84, 42, 43, 0, 1, 2,
78985 /* 780 */ 99, 100, 101, 20, 148, 22, 240, 91, 7, 8,
78986 /* 790 */ 9, 131, 16, 133, 61, 62, 63, 64, 65, 66,
78987 /* 800 */ 67, 68, 69, 70, 71, 72, 110, 74, 75, 76,
78988 /* 810 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
78989 /* 820 */ 124, 20, 20, 22, 22, 20, 19, 22, 21, 23,
78990 /* 830 */ 148, 23, 1, 2, 148, 162, 148, 22, 62, 63,
78991 /* 840 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 110,
78992 /* 850 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78993 /* 860 */ 84, 16, 17, 124, 19, 156, 19, 148, 23, 148,
78994 /* 870 */ 23, 189, 202, 203, 201, 189, 31, 243, 244, 148,
78995 /* 880 */ 80, 192, 148, 204, 148, 16, 17, 162, 19, 170,
78996 /* 890 */ 171, 148, 23, 48, 88, 89, 88, 89, 210, 190,
78997 /* 900 */ 31, 170, 171, 58, 170, 171, 148, 107, 148, 148,
78998 /* 910 */ 189, 111, 97, 170, 171, 148, 148, 48, 148, 183,
78999 /* 920 */ 114, 148, 114, 78, 79, 80, 201, 58, 170, 171,
79000 /* 930 */ 170, 171, 87, 88, 89, 88, 162, 92, 170, 171,
79001 /* 940 */ 170, 171, 223, 170, 171, 148, 148, 78, 79, 156,
79002 /* 950 */ 189, 20, 20, 22, 22, 146, 87, 88, 89, 148,
79003 /* 960 */ 148, 92, 142, 143, 148, 148, 148, 170, 171, 148,
79004 /* 970 */ 125, 126, 127, 128, 129, 130, 148, 210, 148, 110,
79005 /* 980 */ 148, 170, 171, 190, 148, 5, 170, 171, 170, 171,
79006 /* 990 */ 10, 11, 12, 13, 125, 126, 127, 128, 129, 130,
79007 /* 1000 */ 170, 171, 170, 171, 148, 148, 26, 156, 28, 148,
79008 /* 1010 */ 189, 16, 17, 179, 19, 35, 148, 189, 23, 183,
79009 /* 1020 */ 20, 156, 22, 148, 148, 148, 31, 47, 148, 49,
79010 /* 1030 */ 148, 170, 171, 53, 148, 148, 56, 148, 170, 171,
79011 /* 1040 */ 148, 190, 148, 48, 148, 189, 148, 170, 171, 148,
79012 /* 1050 */ 170, 171, 148, 58, 148, 190, 170, 171, 148, 170,
79013 /* 1060 */ 171, 156, 170, 171, 170, 171, 170, 171, 170, 171,
79014 /* 1070 */ 148, 170, 171, 78, 79, 148, 170, 171, 148, 99,
79015 /* 1080 */ 100, 101, 87, 88, 89, 105, 148, 92, 148, 214,
79016 /* 1090 */ 110, 148, 170, 171, 148, 190, 148, 148, 148, 189,
79017 /* 1100 */ 170, 171, 148, 186, 187, 148, 148, 148, 170, 171,
79018 /* 1110 */ 170, 171, 148, 170, 171, 135, 170, 171, 170, 171,
79019 /* 1120 */ 125, 126, 127, 128, 129, 130, 148, 170, 171, 170,
79020 /* 1130 */ 171, 148, 183, 183, 148, 148, 148, 183, 148, 148,
79021 /* 1140 */ 148, 148, 148, 230, 148, 148, 148, 148, 233, 148,
79022 /* 1150 */ 148, 148, 148, 170, 171, 148, 170, 171, 170, 171,
79023 /* 1160 */ 170, 171, 170, 171, 170, 171, 230, 205, 205, 195,
79024 /* 1170 */ 225, 162, 195, 194, 192, 162, 150, 162, 173, 173,
79025 /* 1180 */ 6, 173, 147, 60, 174, 173, 112, 173, 131, 178,
79026 /* 1190 */ 153, 153, 153, 224, 19, 15, 152, 216, 98, 172,
79027 /* 1200 */ 33, 153, 185, 238, 185, 122, 190, 152, 172, 153,
79028 /* 1210 */ 40, 180, 152, 195, 15, 172, 188, 97, 147, 174,
79029 /* 1220 */ 195, 153, 147, 238, 84, 185, 180, 195, 119, 188,
79030 /* 1230 */ 196, 153, 98, 117, 19, 206, 175, 207, 188, 147,
79031 /* 1240 */ 216, 153, 188, 153, 172, 120, 197, 227, 227, 152,
79032 /* 1250 */ 118, 198, 121, 22, 155, 153, 172, 199, 206, 172,
79033 /* 1260 */ 131, 38, 138, 241, 153, 172, 207, 160, 112, 236,
79034 /* 1270 */ 175, 1, 176, 20, 176, 112, 112, 235, 112, 92,
79035 /* 1280 */ 107, 19, 11, 20, 20, 19, 19, 22, 20, 20,
79036 /* 1290 */ 114, 244, 20, 116, 116, 22, 22, 19, 247, 116,
79037 /* 1300 */ 115, 20, 112, 20, 20, 44, 19, 32, 19, 96,
79038 /* 1310 */ 20, 19, 19, 19, 103, 16, 21, 17, 98, 22,
79039 /* 1320 */ 44, 44, 36, 134, 98, 45, 19, 45, 5, 1,
79040 /* 1330 */ 51, 102, 123, 19, 113, 1, 14, 17, 113, 117,
79041 /* 1340 */ 102, 123, 136, 19, 14, 20, 19, 137, 124, 3,
79042 /* 1350 */ 248, 4, 248, 68, 248, 57, 68,
79043 };
79044 #define YY_SHIFT_USE_DFLT (-62)
79045 #define YY_SHIFT_MAX 396
79046 static const short yy_shift_ofst[] = {
79047 /* 0 */ 831, 869, 980, -16, 869, 995, 995, 68, 246, 394,
79048 /* 10 */ -53, 350, 995, 995, 995, 995, 995, -45, 162, 614,
79049 /* 20 */ -11, -17, 626, 626, 53, 604, 122, 238, 535, 393,
79050 /* 30 */ 165, 466, 307, 647, 647, 647, 647, 647, 647, 647,
79051 /* 40 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
79052 /* 50 */ 647, 647, 690, 733, 776, 776, 845, 995, 995, 995,
79053 /* 60 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79054 /* 70 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79055 /* 80 */ 995, 995, 995, 995, 995, 995, 995, 995, 995, 995,
79056 /* 90 */ 995, 995, 995, 995, 995, 995, 995, -61, -61, 6,
79057 /* 100 */ 6, 57, 138, 207, 607, 462, -11, -11, -17, 126,
79058 /* 110 */ 42, -62, -62, -62, 88, 9, 545, 545, 677, 570,
79059 /* 120 */ -11, -11, -11, -11, -11, 777, 696, -11, -11, -11,
79060 /* 130 */ -11, -11, -11, -11, -11, -11, 255, -11, -11, 255,
79061 /* 140 */ -11, -11, 739, -53, -53, -53, -62, -62, -62, 237,
79062 /* 150 */ 18, 18, 189, 427, 499, 231, 808, 382, 806, 51,
79063 /* 160 */ 375, 474, 681, -11, 541, -11, -11, -11, -11, 147,
79064 /* 170 */ 541, -11, 847, 479, 147, -11, -11, -11, -11, -11,
79065 /* 180 */ 147, -11, -11, -11, -11, -11, -11, -11, 800, 781,
79066 /* 190 */ -11, -11, -11, 479, -11, -11, -11, 147, -11, -11,
79067 /* 200 */ -11, 541, 147, 147, -11, -11, 147, 615, -11, 450,
79068 /* 210 */ 450, 153, 153, 616, 660, -17, 470, 378, 230, 230,
79069 /* 220 */ 616, -17, 230, 815, 153, 807, 423, -17, 230, 230,
79070 /* 230 */ 1174, -53, 1123, 1074, 1074, 1074, 1057, 1175, 1180, 1100,
79071 /* 240 */ 1167, 1123, 1074, 1083, 1180, 1074, 1100, 1170, 1180, 1199,
79072 /* 250 */ 1100, 1120, 1174, 1083, 1174, 1074, 1170, 1123, 1167, 1199,
79073 /* 260 */ 1140, 1083, 1109, 1074, 1134, 1116, 1199, 1215, 1174, 1175,
79074 /* 270 */ 1074, 1199, 1100, 1074, 1125, 1140, 1180, 1132, 1131, 1231,
79075 /* 280 */ 1134, 1116, 1074, 1100, 1100, 1129, 1223, 1124, 1074, 1100,
79076 /* 290 */ 1215, -62, -62, -62, -62, -62, 460, 385, 390, 551,
79077 /* 300 */ 216, 306, 72, 349, 763, 158, 314, 540, 801, 802,
79078 /* 310 */ 805, 1000, 932, 931, 429, 252, 638, 1156, 1270, 1253,
79079 /* 320 */ 1163, 1164, 1166, 1187, 1173, 1262, 1263, 1264, 1266, 1271,
79080 /* 330 */ 1267, 1268, 1265, 1269, 1272, 1273, 1177, 1274, 1178, 1273,
79081 /* 340 */ 1176, 1278, 1183, 1185, 1281, 1190, 1283, 1284, 1275, 1261,
79082 /* 350 */ 1287, 1276, 1289, 1290, 1292, 1293, 1277, 1294, 1213, 1211,
79083 /* 360 */ 1299, 1300, 1295, 1220, 1286, 1279, 1280, 1297, 1282, 1189,
79084 /* 370 */ 1226, 1307, 1323, 1328, 1229, 1285, 1288, 1209, 1314, 1221,
79085 /* 380 */ 1334, 1322, 1222, 1320, 1225, 1238, 1218, 1324, 1224, 1325,
79086 /* 390 */ 1330, 1298, 1206, 1210, 1327, 1346, 1347,
79087 };
79088 #define YY_REDUCE_USE_DFLT (-182)
79089 #define YY_REDUCE_MAX 295
79090 static const short yy_reduce_ofst[] = {
79091 /* 0 */ -139, 190, 121, 278, 104, 185, 410, 473, 119, 324,
79092 /* 10 */ 364, -44, 415, 125, 478, 181, 719, -179, 505, 511,
79093 /* 20 */ 416, 195, 281, 469, -51, -51, -51, -51, -51, -51,
79094 /* 30 */ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
79095 /* 40 */ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
79096 /* 50 */ -51, -51, -51, -51, -51, -51, 731, 734, 743, 758,
79097 /* 60 */ 760, 768, 770, 773, 797, 811, 816, 818, 830, 832,
79098 /* 70 */ 861, 868, 877, 880, 886, 889, 892, 894, 896, 898,
79099 /* 80 */ 901, 906, 922, 930, 938, 940, 943, 946, 948, 957,
79100 /* 90 */ 959, 983, 986, 988, 990, 992, 994, -51, -51, -51,
79101 /* 100 */ -51, 464, -51, -51, -72, 223, 546, 586, 583, -51,
79102 /* 110 */ -51, -51, -51, -51, 192, 476, -78, 917, -148, -148,
79103 /* 120 */ 910, 954, 950, 949, 836, 820, 905, 856, 875, 828,
79104 /* 130 */ 821, 761, 682, 686, 369, 348, 673, 688, 736, 725,
79105 /* 140 */ 767, 721, 709, 793, 851, 865, 670, 634, 245, -27,
79106 /* 150 */ 253, 336, -3, 64, 90, 101, 405, 101, 491, 494,
79107 /* 160 */ 101, 325, 388, 64, 514, 509, 552, 589, 600, 101,
79108 /* 170 */ 584, 636, 774, 679, 101, 798, 812, 817, 857, 876,
79109 /* 180 */ 101, 887, 904, 927, 958, 964, 978, 987, 689, 809,
79110 /* 190 */ 882, 991, 993, 679, 996, 997, 998, 101, 999, 1001,
79111 /* 200 */ 1002, 834, 101, 101, 1003, 1004, 101, 915, 1007, 913,
79112 /* 210 */ 936, 962, 963, 974, 945, 1009, 979, 982, 1005, 1006,
79113 /* 220 */ 977, 1013, 1008, 1010, -181, 1026, 1011, 1015, 1012, 1014,
79114 /* 230 */ 1035, 1016, 1017, 1037, 1038, 1039, 969, 981, 1044, 1027,
79115 /* 240 */ 965, 1019, 1048, 1018, 1055, 1056, 1036, 1031, 1060, 1028,
79116 /* 250 */ 1043, 1045, 1071, 1025, 1075, 1068, 1046, 1040, 985, 1041,
79117 /* 260 */ 1020, 1032, 1034, 1078, 1029, 1030, 1050, 1061, 1092, 1024,
79118 /* 270 */ 1088, 1054, 1072, 1090, 1049, 1021, 1097, 1053, 1058, 1099,
79119 /* 280 */ 1052, 1059, 1102, 1084, 1087, 1033, 1042, 1022, 1111, 1093,
79120 /* 290 */ 1095, 1107, 1096, 1098, 1047, 1051,
79121 };
79122 static const YYACTIONTYPE yy_default[] = {
79123 /* 0 */ 603, 832, 913, 719, 913, 913, 832, 913, 859, 913,
79124 /* 10 */ 723, 888, 913, 913, 913, 913, 830, 804, 913, 859,
79125 /* 20 */ 913, 635, 859, 859, 755, 913, 913, 913, 913, 913,
79126 /* 30 */ 913, 913, 913, 770, 872, 829, 834, 887, 735, 760,
79127 /* 40 */ 825, 753, 827, 889, 746, 756, 826, 833, 763, 762,
79128 /* 50 */ 769, 757, 913, 792, 810, 791, 913, 913, 913, 913,
79129 /* 60 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79130 /* 70 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79131 /* 80 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79132 /* 90 */ 913, 913, 913, 913, 913, 913, 913, 794, 816, 793,
79133 /* 100 */ 803, 628, 795, 796, 623, 688, 913, 913, 913, 797,
79134 /* 110 */ 798, 811, 812, 813, 913, 913, 913, 913, 913, 913,
79135 /* 120 */ 913, 913, 913, 913, 913, 603, 913, 913, 913, 913,
79136 /* 130 */ 913, 913, 913, 913, 913, 913, 719, 913, 913, 719,
79137 /* 140 */ 913, 913, 913, 913, 913, 913, 723, 906, 713, 679,
79138 /* 150 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79139 /* 160 */ 913, 913, 913, 913, 913, 845, 913, 913, 913, 877,
79140 /* 170 */ 913, 913, 637, 727, 726, 913, 913, 913, 913, 913,
79141 /* 180 */ 879, 913, 913, 913, 913, 609, 892, 894, 711, 611,
79142 /* 190 */ 913, 913, 913, 721, 913, 913, 913, 702, 913, 913,
79143 /* 200 */ 913, 913, 625, 700, 913, 913, 765, 865, 913, 913,
79144 /* 210 */ 913, 737, 737, 759, 828, 913, 720, 711, 749, 749,
79145 /* 220 */ 759, 913, 749, 661, 737, 913, 658, 913, 749, 749,
79146 /* 230 */ 608, 913, 692, 728, 728, 728, 913, 771, 620, 690,
79147 /* 240 */ 891, 692, 728, 759, 620, 728, 690, 675, 620, 699,
79148 /* 250 */ 690, 661, 608, 759, 608, 728, 675, 692, 891, 699,
79149 /* 260 */ 842, 759, 750, 728, 736, 741, 699, 838, 608, 771,
79150 /* 270 */ 728, 699, 690, 728, 752, 842, 620, 742, 754, 678,
79151 /* 280 */ 736, 741, 728, 690, 690, 871, 869, 899, 728, 690,
79152 /* 290 */ 838, 645, 663, 663, 906, 911, 913, 913, 913, 913,
79153 /* 300 */ 913, 913, 913, 913, 913, 913, 913, 852, 913, 913,
79154 /* 310 */ 913, 913, 913, 913, 913, 778, 913, 913, 913, 913,
79155 /* 320 */ 783, 779, 780, 913, 705, 913, 913, 913, 913, 913,
79156 /* 330 */ 913, 913, 913, 913, 913, 831, 913, 743, 913, 751,
79157 /* 340 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79158 /* 350 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79159 /* 360 */ 913, 913, 913, 913, 913, 913, 867, 868, 913, 913,
79160 /* 370 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79161 /* 380 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79162 /* 390 */ 913, 898, 913, 913, 901, 604, 913, 654, 619, 624,
79163 /* 400 */ 618, 621, 695, 694, 691, 617, 653, 652, 651, 783,
79164 /* 410 */ 650, 649, 789, 616, 788, 776, 730, 820, 716, 861,
79165 /* 420 */ 715, 714, 893, 615, 870, 866, 614, 725, 895, 862,
79166 /* 430 */ 863, 912, 864, 622, 613, 739, 738, 774, 910, 773,
79167 /* 440 */ 599, 740, 724, 835, 836, 612, 718, 717, 734, 733,
79168 /* 450 */ 693, 767, 768, 732, 860, 896, 873, 731, 722, 605,
79169 /* 460 */ 712, 745, 748, 634, 747, 744, 875, 633, 805, 822,
79170 /* 470 */ 897, 729, 819, 884, 883, 772, 882, 881, 900, 880,
79171 /* 480 */ 824, 823, 790, 876, 787, 600, 640, 641, 878, 632,
79172 /* 490 */ 874, 610, 858, 856, 902, 857, 903, 855, 643, 642,
79173 /* 500 */ 697, 607, 698, 639, 638, 701, 821, 707, 844, 706,
79174 /* 510 */ 817, 885, 814, 606, 809, 807, 806, 758, 801, 818,
79175 /* 520 */ 815, 907, 808, 802, 761, 908, 800, 799, 785, 784,
79176 /* 530 */ 602, 782, 781, 764, 601, 766, 777, 846, 786, 631,
79177 /* 540 */ 708, 704, 847, 848, 849, 850, 853, 854, 703, 909,
79178 /* 550 */ 851, 775, 647, 636, 629, 674, 660, 680, 659, 683,
79179 /* 560 */ 710, 709, 841, 843, 648, 840, 684, 630, 839, 668,
79180 /* 570 */ 667, 685, 886, 672, 671, 670, 686, 646, 644, 669,
79181 /* 580 */ 666, 890, 665, 664, 657, 656, 626, 687, 689, 681,
79182 /* 590 */ 682, 627, 662, 655, 677, 676, 673, 696,
79183 };
79184 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
79185
79186 /* The next table maps tokens into fallback tokens. If a construct
79187 ** like the following:
@@ -81856,40 +81911,40 @@
81856 "WHENWHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT"
81857 "CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAILFROM"
81858 "FULLGLOBYIFINTOFFSETISNULLORDERIGHTOUTEROLLBACKROWUNIONUSINGVACUUM"
81859 "VIEWINITIALLY";
81860 static const unsigned char aHash[127] = {
81861 65, 94, 110, 63, 0, 45, 0, 0, 71, 0, 66, 0, 0,
81862 104, 12, 67, 15, 0, 108, 74, 105, 101, 0, 19, 0, 0,
81863 114, 0, 112, 78, 0, 22, 82, 0, 9, 0, 0, 59, 60,
81864 0, 58, 6, 0, 39, 79, 91, 0, 111, 89, 0, 0, 44,
81865 0, 92, 24, 0, 17, 0, 115, 40, 23, 0, 5, 99, 25,
81866 85, 0, 0, 117, 95, 50, 116, 47, 7, 42, 0, 80, 0,
81867 90, 26, 0, 88, 0, 0, 0, 84, 81, 86, 77, 98, 14,
81868 34, 97, 0, 70, 0, 18, 76, 100, 31, 0, 113, 69, 106,
81869 51, 46, 73, 0, 0, 83, 102, 0, 109, 0, 35, 0, 0,
81870 28, 0, 75, 48, 53, 0, 20, 52, 0, 43,
81871 };
81872 static const unsigned char aNext[117] = {
81873 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
81874 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
81875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81876 0, 0, 3, 38, 32, 0, 21, 0, 0, 0, 0, 0, 29,
81877 0, 37, 0, 0, 0, 1, 55, 0, 0, 56, 0, 0, 0,
81878 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 30, 0,
81879 16, 33, 10, 0, 0, 0, 0, 0, 0, 0, 61, 11, 68,
81880 0, 8, 0, 93, 87, 0, 96, 0, 49, 0, 0, 64, 0,
81881 41, 103, 0, 27, 107, 36, 62, 72, 0, 0, 57, 0, 0,
81882 };
81883 static const unsigned char aLen[117] = {
81884 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
81885 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
81886 11, 2, 7, 5, 5, 9, 6, 10, 9, 7, 10, 6, 5,
81887 6, 6, 5, 6, 9, 4, 2, 5, 5, 6, 7, 3, 7,
81888 4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6,
81889 5, 4, 7, 6, 5, 6, 7, 5, 4, 5, 7, 5, 8,
81890 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 12, 17, 7,
81891 8, 8, 2, 4, 4, 4, 4, 4, 2, 2, 4, 6, 2,
81892 3, 6, 5, 5, 5, 8, 3, 5, 5, 6, 4, 9, 3,
81893 };
81894 static const unsigned short int aOffset[117] = {
81895 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
@@ -81911,11 +81966,11 @@
81911 TK_EXCEPT, TK_TRANSACTION,TK_ON, TK_JOIN_KW, TK_ALTER,
81912 TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, TK_INTERSECT,
81913 TK_TRIGGER, TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_ATTACH,
81914 TK_HAVING, TK_GROUP, TK_UPDATE, TK_TEMP, TK_TEMP,
81915 TK_OR, TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN,
81916 TK_NOT, TK_NOTNULL, TK_NULL, TK_LIKE_KW, TK_CASCADE,
81917 TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
81918 TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
81919 TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
81920 TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN, TK_WHERE,
81921 TK_REPLACE, TK_AFTER, TK_RESTRICT, TK_AND, TK_DEFAULT,
@@ -82690,11 +82745,11 @@
82690 ** Main file for the SQLite library. The routines in this file
82691 ** implement the programmer interface to the library. Routines in
82692 ** other files are for internal use by SQLite and should not be
82693 ** accessed by users of the library.
82694 **
82695 ** $Id: main.c,v 1.509 2008/10/30 15:03:16 drh Exp $
82696 */
82697
82698 #ifdef SQLITE_ENABLE_FTS3
82699 /************** Include fts3.h in the middle of main.c ***********************/
82700 /************** Begin file fts3.h ********************************************/
@@ -83176,10 +83231,17 @@
83176 db->lookaside.pEnd = 0;
83177 db->lookaside.bEnabled = 0;
83178 }
83179 return SQLITE_OK;
83180 }
 
 
 
 
 
 
 
83181
83182 /*
83183 ** Configuration settings for an individual database connection
83184 */
83185 SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
83186
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -9,17 +9,17 @@
9 **
10 ** This file is all you need to compile SQLite. To use SQLite in other
11 ** programs, you need this file and the "sqlite3.h" header file that defines
12 ** the programming interface to the SQLite library. (If you do not have
13 ** the "sqlite3.h" header file at hand, you will find a copy in the first
14 ** 6569 lines past this header comment.) Additional code files may be
15 ** needed if you want a wrapper to interface SQLite with your choice of
16 ** programming language. The code for the "sqlite3" command-line shell
17 ** is also in a separate file. This file contains only code for the core
18 ** SQLite library.
19 **
20 ** This amalgamation was generated on 2008-11-10 00:14:36 UTC.
21 */
22 #define SQLITE_CORE 1
23 #define SQLITE_AMALGAMATION 1
24 #ifndef SQLITE_PRIVATE
25 # define SQLITE_PRIVATE static
@@ -39,11 +39,11 @@
39 ** May you share freely, never taking more than you give.
40 **
41 *************************************************************************
42 ** Internal interface definitions for SQLite.
43 **
44 ** @(#) $Id: sqliteInt.h,v 1.788 2008/11/05 16:37:35 drh Exp $
45 */
46 #ifndef _SQLITEINT_H_
47 #define _SQLITEINT_H_
48
49 /*
@@ -485,11 +485,11 @@
485 ** The name of this file under configuration management is "sqlite.h.in".
486 ** The makefile makes some minor changes to this file (such as inserting
487 ** the version number) and changes its name to "sqlite3.h" as
488 ** part of the build process.
489 **
490 ** @(#) $Id: sqlite.h.in,v 1.409 2008/11/07 00:06:18 drh Exp $
491 */
492 #ifndef _SQLITE3_H_
493 #define _SQLITE3_H_
494 #include <stdarg.h> /* Needed for the definition of va_list */
495
@@ -1137,10 +1137,16 @@
1137 ** that when data is appended to a file, the data is appended
1138 ** first then the size of the file is extended, never the other
1139 ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
1140 ** information is written to disk in the same order as calls
1141 ** to xWrite().
1142 **
1143 ** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
1144 ** in the unread portions of the buffer with zeros. A VFS that
1145 ** fails to zero-fill short reads might seem to work. However,
1146 ** failure to zero-fill short reads will eventually lead to
1147 ** database corruption.
1148 */
1149 typedef struct sqlite3_io_methods sqlite3_io_methods;
1150 struct sqlite3_io_methods {
1151 int iVersion;
1152 int (*xClose)(sqlite3_file*);
@@ -3126,10 +3132,20 @@
3132 ** text that describes the error, as either UTF-8 or UTF-16 respectively.
3133 ** Memory to hold the error message string is managed internally.
3134 ** The application does not need to worry about freeing the result.
3135 ** However, the error string might be overwritten or deallocated by
3136 ** subsequent calls to other SQLite interface functions.
3137 **
3138 ** When the serialized [threading mode] is in use, it might be the
3139 ** case that a second error occurs on a separate thread in between
3140 ** the time of the first error and the call to these interfaces.
3141 ** When that happens, the second error will be reported since these
3142 ** interfaces always report the most recent result. To avoid
3143 ** this, each thread can obtain exclusive use of the [database connection] D
3144 ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
3145 ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
3146 ** all calls to the interfaces listed here are completed.
3147 **
3148 ** If an interface fails with SQLITE_MISUSE, that means the interface
3149 ** was invoked incorrectly by the application. In that case, the
3150 ** error code and message may or may not be set.
3151 **
@@ -6714,10 +6730,21 @@
6730 #define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
6731 #define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
6732 #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
6733 #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
6734
6735 /*
6736 ** CAPI3REF: Retrieve the mutex for a database connection {H17002} <H17000>
6737 **
6738 ** This interface returns a pointer the [sqlite3_mutex] object that
6739 ** serializes access to the [database connection] given in the argument
6740 ** when the [threading mode] is Serialized.
6741 ** If the [threading mode] is Single-thread or Multi-thread then this
6742 ** routine returns a NULL pointer.
6743 */
6744 SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6745
6746 /*
6747 ** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
6748 **
6749 ** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
6750 ** xFileControl method for the [sqlite3_io_methods] object associated
@@ -7909,145 +7936,145 @@
7936 */
7937 /************** Include opcodes.h in the middle of vdbe.h ********************/
7938 /************** Begin file opcodes.h *****************************************/
7939 /* Automatically generated. Do not edit */
7940 /* See the mkopcodeh.awk script for details */
7941 #define OP_VNext 1
7942 #define OP_Affinity 2
7943 #define OP_Column 3
7944 #define OP_SetCookie 4
7945 #define OP_Real 126 /* same as TK_FLOAT */
7946 #define OP_Sequence 5
7947 #define OP_MoveGt 6
7948 #define OP_Ge 72 /* same as TK_GE */
7949 #define OP_RowKey 7
7950 #define OP_SCopy 8
7951 #define OP_Eq 68 /* same as TK_EQ */
7952 #define OP_OpenWrite 9
7953 #define OP_NotNull 66 /* same as TK_NOTNULL */
7954 #define OP_If 10
 
 
 
 
 
 
 
 
 
7955 #define OP_ToInt 142 /* same as TK_TO_INT */
7956 #define OP_String8 88 /* same as TK_STRING */
7957 #define OP_VRowid 11
7958 #define OP_CollSeq 12
7959 #define OP_OpenRead 13
7960 #define OP_Expire 14
7961 #define OP_AutoCommit 15
7962 #define OP_Gt 69 /* same as TK_GT */
7963 #define OP_Pagecount 17
7964 #define OP_IntegrityCk 18
7965 #define OP_Sort 19
7966 #define OP_Copy 20
7967 #define OP_Trace 21
7968 #define OP_Function 22
7969 #define OP_IfNeg 23
7970 #define OP_And 61 /* same as TK_AND */
7971 #define OP_Subtract 79 /* same as TK_MINUS */
7972 #define OP_Noop 24
7973 #define OP_Return 25
7974 #define OP_Remainder 82 /* same as TK_REM */
7975 #define OP_NewRowid 26
7976 #define OP_Multiply 80 /* same as TK_STAR */
7977 #define OP_Variable 27
7978 #define OP_String 28
7979 #define OP_RealAffinity 29
7980 #define OP_VRename 30
7981 #define OP_ParseSchema 31
7982 #define OP_VOpen 32
7983 #define OP_Close 33
7984 #define OP_CreateIndex 34
7985 #define OP_IsUnique 35
7986 #define OP_NotFound 36
7987 #define OP_Int64 37
7988 #define OP_MustBeInt 38
7989 #define OP_Halt 39
7990 #define OP_Rowid 40
7991 #define OP_IdxLT 41
7992 #define OP_AddImm 42
7993 #define OP_Statement 43
7994 #define OP_RowData 44
7995 #define OP_MemMax 45
7996 #define OP_Or 60 /* same as TK_OR */
7997 #define OP_NotExists 46
7998 #define OP_Gosub 47
7999 #define OP_Divide 81 /* same as TK_SLASH */
8000 #define OP_Integer 48
8001 #define OP_ToNumeric 141 /* same as TK_TO_NUMERIC*/
8002 #define OP_Prev 49
8003 #define OP_Concat 83 /* same as TK_CONCAT */
 
 
 
 
 
 
8004 #define OP_BitAnd 74 /* same as TK_BITAND */
8005 #define OP_VColumn 50
8006 #define OP_CreateTable 51
8007 #define OP_Last 52
8008 #define OP_IsNull 65 /* same as TK_ISNULL */
8009 #define OP_IncrVacuum 53
8010 #define OP_IdxRowid 54
8011 #define OP_ShiftRight 77 /* same as TK_RSHIFT */
8012 #define OP_ResetCount 55
8013 #define OP_FifoWrite 56
8014 #define OP_ContextPush 57
8015 #define OP_Yield 58
8016 #define OP_DropTrigger 59
8017 #define OP_DropIndex 62
8018 #define OP_IdxGE 63
8019 #define OP_IdxDelete 64
8020 #define OP_Vacuum 73
8021 #define OP_MoveLe 84
8022 #define OP_IfNot 85
8023 #define OP_DropTable 86
8024 #define OP_MakeRecord 89
8025 #define OP_ToBlob 140 /* same as TK_TO_BLOB */
8026 #define OP_ResultRow 90
8027 #define OP_Delete 91
8028 #define OP_AggFinal 92
8029 #define OP_Compare 93
8030 #define OP_ShiftLeft 76 /* same as TK_LSHIFT */
8031 #define OP_Goto 94
8032 #define OP_TableLock 95
8033 #define OP_FifoRead 96
8034 #define OP_Clear 97
8035 #define OP_MoveLt 98
8036 #define OP_Le 70 /* same as TK_LE */
8037 #define OP_VerifyCookie 99
8038 #define OP_AggStep 100
8039 #define OP_ToText 139 /* same as TK_TO_TEXT */
8040 #define OP_Not 16 /* same as TK_NOT */
8041 #define OP_ToReal 143 /* same as TK_TO_REAL */
8042 #define OP_SetNumColumns 101
8043 #define OP_Transaction 102
8044 #define OP_VFilter 103
8045 #define OP_Ne 67 /* same as TK_NE */
8046 #define OP_VDestroy 104
8047 #define OP_ContextPop 105
8048 #define OP_BitOr 75 /* same as TK_BITOR */
8049 #define OP_Next 106
8050 #define OP_IdxInsert 107
8051 #define OP_Lt 71 /* same as TK_LT */
8052 #define OP_Insert 108
8053 #define OP_Destroy 109
8054 #define OP_ReadCookie 110
8055 #define OP_ForceInt 111
8056 #define OP_LoadAnalysis 112
8057 #define OP_Explain 113
8058 #define OP_OpenPseudo 114
8059 #define OP_OpenEphemeral 115
8060 #define OP_Null 116
8061 #define OP_Move 117
8062 #define OP_Blob 118
8063 #define OP_Add 78 /* same as TK_PLUS */
8064 #define OP_Rewind 119
8065 #define OP_MoveGe 120
8066 #define OP_VBegin 121
8067 #define OP_VUpdate 122
8068 #define OP_IfZero 123
8069 #define OP_BitNot 87 /* same as TK_BITNOT */
8070 #define OP_VCreate 124
8071 #define OP_Found 125
8072 #define OP_IfPos 127
8073 #define OP_NullRow 128
8074 #define OP_Jump 129
8075 #define OP_Permutation 130
 
8076
8077 /* The following opcode values are never used */
8078 #define OP_NotUsed_131 131
8079 #define OP_NotUsed_132 132
8080 #define OP_NotUsed_133 133
@@ -8067,27 +8094,27 @@
8094 #define OPFLG_IN1 0x0004 /* in1: P1 is an input */
8095 #define OPFLG_IN2 0x0008 /* in2: P2 is an input */
8096 #define OPFLG_IN3 0x0010 /* in3: P3 is an input */
8097 #define OPFLG_OUT3 0x0020 /* out3: P3 is an output */
8098 #define OPFLG_INITIALIZER {\
8099 /* 0 */ 0x00, 0x01, 0x00, 0x00, 0x10, 0x02, 0x11, 0x00,\
8100 /* 8 */ 0x00, 0x00, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00,\
8101 /* 16 */ 0x04, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05,\
8102 /* 24 */ 0x00, 0x04, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00,\
8103 /* 32 */ 0x00, 0x00, 0x02, 0x11, 0x11, 0x02, 0x05, 0x00,\
8104 /* 40 */ 0x02, 0x11, 0x04, 0x00, 0x00, 0x0c, 0x11, 0x01,\
8105 /* 48 */ 0x02, 0x01, 0x00, 0x02, 0x01, 0x01, 0x02, 0x00,\
8106 /* 56 */ 0x04, 0x00, 0x00, 0x00, 0x2c, 0x2c, 0x00, 0x11,\
8107 /* 64 */ 0x00, 0x05, 0x05, 0x15, 0x15, 0x15, 0x15, 0x15,\
8108 /* 72 */ 0x15, 0x00, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,\
8109 /* 80 */ 0x2c, 0x2c, 0x2c, 0x2c, 0x11, 0x05, 0x00, 0x04,\
8110 /* 88 */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,\
8111 /* 96 */ 0x01, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x01,\
8112 /* 104 */ 0x00, 0x00, 0x01, 0x08, 0x00, 0x02, 0x02, 0x05,\
8113 /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01,\
8114 /* 120 */ 0x11, 0x00, 0x00, 0x05, 0x00, 0x11, 0x02, 0x05,\
8115 /* 128 */ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
8116 /* 136 */ 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04,\
8117 }
8118
8119 /************** End of opcodes.h *********************************************/
8120 /************** Continuing where we left off in vdbe.h ***********************/
@@ -9004,10 +9031,11 @@
9031 } init;
9032 int nExtension; /* Number of loaded extensions */
9033 void **aExtension; /* Array of shared libraray handles */
9034 struct Vdbe *pVdbe; /* List of active virtual machines */
9035 int activeVdbeCnt; /* Number of vdbes currently executing */
9036 int writeVdbeCnt; /* Number of active VDBEs that are writing */
9037 void (*xTrace)(void*,const char*); /* Trace function */
9038 void *pTraceArg; /* Argument to the trace function */
9039 void (*xProfile)(void*,const char*,u64); /* Profiling function */
9040 void *pProfileArg; /* Argument to profile function */
9041 void *pCommitArg; /* Argument to xCommitCallback() */
@@ -17401,11 +17429,11 @@
17429 **
17430 *************************************************************************
17431 ** This file contains routines used to translate between UTF-8,
17432 ** UTF-16, UTF-16BE, and UTF-16LE.
17433 **
17434 ** $Id: utf.c,v 1.66 2008/11/07 03:29:34 drh Exp $
17435 **
17436 ** Notes on UTF-8:
17437 **
17438 ** Byte-0 Byte-1 Byte-2 Byte-3 Value
17439 ** 0xxxxxxx 00000000 00000000 0xxxxxxx
@@ -17443,11 +17471,11 @@
17471 ** VDBE. This information used to all be at the top of the single
17472 ** source code file "vdbe.c". When that file became too big (over
17473 ** 6000 lines long) it was split up into several smaller files and
17474 ** this header information was factored out.
17475 **
17476 ** $Id: vdbeInt.h,v 1.157 2008/11/05 16:37:35 drh Exp $
17477 */
17478 #ifndef _VDBEINT_H_
17479 #define _VDBEINT_H_
17480
17481 /*
@@ -17478,16 +17506,16 @@
17506 ** is currently pointing to.
17507 **
17508 ** Every cursor that the virtual machine has open is represented by an
17509 ** instance of the following structure.
17510 **
17511 ** If the VdbeCursor.isTriggerRow flag is set it means that this cursor is
17512 ** really a single row that represents the NEW or OLD pseudo-table of
17513 ** a row trigger. The data for the row is stored in VdbeCursor.pData and
17514 ** the rowid is in VdbeCursor.iKey.
17515 */
17516 struct VdbeCursor {
17517 BtCursor *pCursor; /* The cursor structure of the backend */
17518 int iDb; /* Index of cursor database in db->aDb[] (or -1) */
17519 i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
17520 i64 nextRowid; /* Next rowid returned by OP_NewRowid */
17521 Bool zeroed; /* True if zeroed out and ready for reuse */
@@ -17521,14 +17549,14 @@
17549 int payloadSize; /* Total number of bytes in the record */
17550 u32 *aType; /* Type values for all entries in the record */
17551 u32 *aOffset; /* Cached offsets to the start of each columns data */
17552 u8 *aRow; /* Data for the current row, if all on one page */
17553 };
17554 typedef struct VdbeCursor VdbeCursor;
17555
17556 /*
17557 ** A value for VdbeCursor.cacheValid that means the cache is always invalid.
17558 */
17559 #define CACHE_STALE 0
17560
17561 /*
17562 ** Internally, the vdbe manipulates nearly all SQL values as Mem
@@ -17719,20 +17747,20 @@
17747 int nLabelAlloc; /* Number of slots allocated in aLabel[] */
17748 int *aLabel; /* Space to hold the labels */
17749 Mem **apArg; /* Arguments to currently executing user function */
17750 Mem *aColName; /* Column names to return */
17751 int nCursor; /* Number of slots in apCsr[] */
17752 VdbeCursor **apCsr; /* One element of this array for each open cursor */
17753 int nVar; /* Number of entries in aVar[] */
17754 Mem *aVar; /* Values for the OP_Variable opcode. */
17755 char **azVar; /* Name of variables */
17756 int okVar; /* True if azVar[] has been initialized */
17757 int magic; /* Magic number for sanity checking */
17758 int nMem; /* Number of memory locations currently allocated */
17759 Mem *aMem; /* The memory locations */
17760 int nCallback; /* Number of callbacks invoked so far */
17761 int cacheCtr; /* VdbeCursor row cache generation counter */
17762 Fifo sFifo; /* A list of ROWIDs */
17763 int contextStackTop; /* Index of top element in the context stack */
17764 int contextStackDepth; /* The size of the "context" stack */
17765 Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/
17766 int pc; /* The program counter */
@@ -17747,10 +17775,12 @@
17775 u8 explain; /* True if EXPLAIN present on SQL command */
17776 u8 changeCntOn; /* True to update the change-counter */
17777 u8 expired; /* True if the VM needs to be recompiled */
17778 u8 minWriteFileFormat; /* Minimum file format for writable database files */
17779 u8 inVtabMethod; /* See comments above */
17780 u8 usesStmtJournal; /* True if uses a statement journal */
17781 u8 readOnly; /* True for read-only statements */
17782 int nChange; /* Number of db changes made since last reset */
17783 i64 startTime; /* Time when query started - used for profiling */
17784 int btreeMask; /* Bitmask of db->aDb[] entries referenced */
17785 BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */
17786 int aCounter[2]; /* Counters used by sqlite3_stmt_status() */
@@ -17779,13 +17809,13 @@
17809 #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
17810
17811 /*
17812 ** Function prototypes
17813 */
17814 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*);
17815 void sqliteVdbePopStack(Vdbe*,int);
17816 SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor*);
17817 #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
17818 SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, Op*);
17819 #endif
17820 SQLITE_PRIVATE int sqlite3VdbeSerialTypeLen(u32);
17821 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
@@ -17792,11 +17822,11 @@
17822 SQLITE_PRIVATE int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
17823 SQLITE_PRIVATE int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
17824 SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
17825
17826 int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
17827 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*);
17828 SQLITE_PRIVATE int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
17829 SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
17830 SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
17831 SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
17832 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
@@ -18040,11 +18070,11 @@
18070 if( rc!=SQLITE_OK ){
18071 assert( rc==SQLITE_NOMEM );
18072 return SQLITE_NOMEM;
18073 }
18074 zIn = (u8*)pMem->z;
18075 zTerm = &zIn[pMem->n&~1];
18076 while( zIn<zTerm ){
18077 temp = *zIn;
18078 *zIn = *(zIn+1);
18079 zIn++;
18080 *zIn++ = temp;
@@ -18058,10 +18088,11 @@
18088 /* When converting from UTF-16, the maximum growth results from
18089 ** translating a 2-byte character to a 4-byte UTF-8 character.
18090 ** A single byte is required for the output string
18091 ** nul-terminator.
18092 */
18093 pMem->n &= ~1;
18094 len = pMem->n * 2 + 1;
18095 }else{
18096 /* When converting from UTF-8 to UTF-16 the maximum growth is caused
18097 ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
18098 ** character. Two bytes are required in the output buffer for the
@@ -19606,83 +19637,83 @@
19637 /* Automatically generated. Do not edit */
19638 /* See the mkopcodec.awk script for details. */
19639 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
19640 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
19641 static const char *const azName[] = { "?",
19642 /* 1 */ "VNext",
19643 /* 2 */ "Affinity",
19644 /* 3 */ "Column",
19645 /* 4 */ "SetCookie",
19646 /* 5 */ "Sequence",
19647 /* 6 */ "MoveGt",
19648 /* 7 */ "RowKey",
19649 /* 8 */ "SCopy",
19650 /* 9 */ "OpenWrite",
19651 /* 10 */ "If",
19652 /* 11 */ "VRowid",
19653 /* 12 */ "CollSeq",
19654 /* 13 */ "OpenRead",
19655 /* 14 */ "Expire",
19656 /* 15 */ "AutoCommit",
19657 /* 16 */ "Not",
19658 /* 17 */ "Pagecount",
19659 /* 18 */ "IntegrityCk",
19660 /* 19 */ "Sort",
19661 /* 20 */ "Copy",
19662 /* 21 */ "Trace",
19663 /* 22 */ "Function",
19664 /* 23 */ "IfNeg",
19665 /* 24 */ "Noop",
19666 /* 25 */ "Return",
19667 /* 26 */ "NewRowid",
19668 /* 27 */ "Variable",
19669 /* 28 */ "String",
19670 /* 29 */ "RealAffinity",
19671 /* 30 */ "VRename",
19672 /* 31 */ "ParseSchema",
19673 /* 32 */ "VOpen",
19674 /* 33 */ "Close",
19675 /* 34 */ "CreateIndex",
19676 /* 35 */ "IsUnique",
19677 /* 36 */ "NotFound",
19678 /* 37 */ "Int64",
19679 /* 38 */ "MustBeInt",
19680 /* 39 */ "Halt",
19681 /* 40 */ "Rowid",
19682 /* 41 */ "IdxLT",
19683 /* 42 */ "AddImm",
19684 /* 43 */ "Statement",
19685 /* 44 */ "RowData",
19686 /* 45 */ "MemMax",
19687 /* 46 */ "NotExists",
19688 /* 47 */ "Gosub",
19689 /* 48 */ "Integer",
19690 /* 49 */ "Prev",
19691 /* 50 */ "VColumn",
19692 /* 51 */ "CreateTable",
19693 /* 52 */ "Last",
19694 /* 53 */ "IncrVacuum",
19695 /* 54 */ "IdxRowid",
19696 /* 55 */ "ResetCount",
19697 /* 56 */ "FifoWrite",
19698 /* 57 */ "ContextPush",
19699 /* 58 */ "Yield",
19700 /* 59 */ "DropTrigger",
19701 /* 60 */ "Or",
19702 /* 61 */ "And",
19703 /* 62 */ "DropIndex",
19704 /* 63 */ "IdxGE",
19705 /* 64 */ "IdxDelete",
19706 /* 65 */ "IsNull",
19707 /* 66 */ "NotNull",
19708 /* 67 */ "Ne",
19709 /* 68 */ "Eq",
19710 /* 69 */ "Gt",
19711 /* 70 */ "Le",
19712 /* 71 */ "Lt",
19713 /* 72 */ "Ge",
19714 /* 73 */ "Vacuum",
19715 /* 74 */ "BitAnd",
19716 /* 75 */ "BitOr",
19717 /* 76 */ "ShiftLeft",
19718 /* 77 */ "ShiftRight",
19719 /* 78 */ "Add",
@@ -19689,57 +19720,57 @@
19720 /* 79 */ "Subtract",
19721 /* 80 */ "Multiply",
19722 /* 81 */ "Divide",
19723 /* 82 */ "Remainder",
19724 /* 83 */ "Concat",
19725 /* 84 */ "MoveLe",
19726 /* 85 */ "IfNot",
19727 /* 86 */ "DropTable",
19728 /* 87 */ "BitNot",
19729 /* 88 */ "String8",
19730 /* 89 */ "MakeRecord",
19731 /* 90 */ "ResultRow",
19732 /* 91 */ "Delete",
19733 /* 92 */ "AggFinal",
19734 /* 93 */ "Compare",
19735 /* 94 */ "Goto",
19736 /* 95 */ "TableLock",
19737 /* 96 */ "FifoRead",
19738 /* 97 */ "Clear",
19739 /* 98 */ "MoveLt",
19740 /* 99 */ "VerifyCookie",
19741 /* 100 */ "AggStep",
19742 /* 101 */ "SetNumColumns",
19743 /* 102 */ "Transaction",
19744 /* 103 */ "VFilter",
19745 /* 104 */ "VDestroy",
19746 /* 105 */ "ContextPop",
19747 /* 106 */ "Next",
19748 /* 107 */ "IdxInsert",
19749 /* 108 */ "Insert",
19750 /* 109 */ "Destroy",
19751 /* 110 */ "ReadCookie",
19752 /* 111 */ "ForceInt",
19753 /* 112 */ "LoadAnalysis",
19754 /* 113 */ "Explain",
19755 /* 114 */ "OpenPseudo",
19756 /* 115 */ "OpenEphemeral",
19757 /* 116 */ "Null",
19758 /* 117 */ "Move",
19759 /* 118 */ "Blob",
19760 /* 119 */ "Rewind",
19761 /* 120 */ "MoveGe",
19762 /* 121 */ "VBegin",
19763 /* 122 */ "VUpdate",
19764 /* 123 */ "IfZero",
19765 /* 124 */ "VCreate",
19766 /* 125 */ "Found",
19767 /* 126 */ "Real",
19768 /* 127 */ "IfPos",
19769 /* 128 */ "NullRow",
19770 /* 129 */ "Jump",
19771 /* 130 */ "Permutation",
19772 /* 131 */ "NotUsed_131",
19773 /* 132 */ "NotUsed_132",
19774 /* 133 */ "NotUsed_133",
19775 /* 134 */ "NotUsed_134",
19776 /* 135 */ "NotUsed_135",
@@ -19770,11 +19801,11 @@
19801 **
19802 ******************************************************************************
19803 **
19804 ** This file contains code that is specific to OS/2.
19805 **
19806 ** $Id: os_os2.c,v 1.58 2008/11/07 00:06:18 drh Exp $
19807 */
19808
19809
19810 #if SQLITE_OS_OS2
19811
@@ -20113,10 +20144,11 @@
20144 return SQLITE_IOERR_READ;
20145 }
20146 if( got == (ULONG)amt )
20147 return SQLITE_OK;
20148 else {
20149 /* Unread portions of the input buffer must be zero-filled */
20150 memset(&((char*)pBuf)[got], 0, amt-got);
20151 return SQLITE_IOERR_SHORT_READ;
20152 }
20153 }
20154
@@ -21117,11 +21149,11 @@
21149 **
21150 ******************************************************************************
21151 **
21152 ** This file contains code that is specific to Unix systems.
21153 **
21154 ** $Id: os_unix.c,v 1.208 2008/11/07 00:06:18 drh Exp $
21155 */
21156 #if SQLITE_OS_UNIX /* This file is used on unix only */
21157
21158 /*
21159 ** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several
@@ -22231,10 +22263,11 @@
22263 if( got==amt ){
22264 return SQLITE_OK;
22265 }else if( got<0 ){
22266 return SQLITE_IOERR_READ;
22267 }else{
22268 /* Unread parts of the buffer must be zero-filled */
22269 memset(&((char*)pBuf)[got], 0, amt-got);
22270 return SQLITE_IOERR_SHORT_READ;
22271 }
22272 }
22273
@@ -24340,11 +24373,11 @@
24373 **
24374 ******************************************************************************
24375 **
24376 ** This file contains code that is specific to windows.
24377 **
24378 ** $Id: os_win.c,v 1.137 2008/11/07 00:06:18 drh Exp $
24379 */
24380 #if SQLITE_OS_WIN /* This file is used for windows only */
24381
24382
24383 /*
@@ -25224,10 +25257,11 @@
25257 return SQLITE_IOERR_READ;
25258 }
25259 if( got==(DWORD)amt ){
25260 return SQLITE_OK;
25261 }else{
25262 /* Unread parts of the buffer must be zero-filled */
25263 memset(&((char*)pBuf)[got], 0, amt-got);
25264 return SQLITE_IOERR_SHORT_READ;
25265 }
25266 }
25267
@@ -26260,16 +26294,18 @@
26294 **
26295 *************************************************************************
26296 ** This file implements an object that represents a fixed-length
26297 ** bitmap. Bits are numbered starting with 1.
26298 **
26299 ** A bitmap is used to record which pages of a database file have been
26300 ** journalled during a transaction, or which pages have the "dont-write"
26301 ** property. Usually only a few pages are meet either condition.
26302 ** So the bitmap is usually sparse and has low cardinality.
26303 ** But sometimes (for example when during a DROP of a large table) most
26304 ** or all of the pages in a database can get journalled. In those cases,
26305 ** the bitmap becomes dense with high cardinality. The algorithm needs
26306 ** to handle both cases well.
26307 **
26308 ** The size of the bitmap is fixed when the object is created.
26309 **
26310 ** All bits are clear when the bitmap is created. Individual bits
26311 ** may be set or cleared one at a time.
@@ -26280,11 +26316,11 @@
26316 ** sometimes grow into tens of thousands or larger. The size of the
26317 ** Bitvec object is the number of pages in the database file at the
26318 ** start of a transaction, and is thus usually less than a few thousand,
26319 ** but can be as large as 2 billion for a really big database.
26320 **
26321 ** @(#) $Id: bitvec.c,v 1.7 2008/11/03 20:55:07 drh Exp $
26322 */
26323
26324 #define BITVEC_SZ 512
26325 /* Round the union size down to the nearest pointer boundary, since that's how
26326 ** it will be aligned within the Bitvec struct. */
@@ -26372,10 +26408,18 @@
26408 }
26409
26410 /*
26411 ** Set the i-th bit. Return 0 on success and an error code if
26412 ** anything goes wrong.
26413 **
26414 ** This routine might cause sub-bitmaps to be allocated. Failing
26415 ** to get the memory needed to hold the sub-bitmap is the only
26416 ** that can go wrong with an insert, assuming p and i are valid.
26417 **
26418 ** The calling function must ensure that p is a valid Bitvec object
26419 ** and that the value for "i" is within range of the Bitvec object.
26420 ** Otherwise the behavior is undefined.
26421 */
26422 SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec *p, u32 i){
26423 u32 h;
26424 assert( p!=0 );
26425 assert( i>0 );
@@ -27804,11 +27848,11 @@
27848 ** is separate from the database file. The pager also implements file
27849 ** locking to prevent two processes from writing the same database
27850 ** file simultaneously, or one process from reading the database while
27851 ** another is writing.
27852 **
27853 ** @(#) $Id: pager.c,v 1.502 2008/11/07 00:24:54 drh Exp $
27854 */
27855 #ifndef SQLITE_OMIT_DISKIO
27856
27857 /*
27858 ** Macros for troubleshooting. Normally turned off
@@ -27988,11 +28032,11 @@
28032 i64 journalOff; /* Current byte offset in the journal file */
28033 i64 journalHdr; /* Byte offset to previous journal header */
28034 i64 stmtHdrOff; /* First journal header written this statement */
28035 i64 stmtCksum; /* cksumInit when statement was started */
28036 i64 stmtJSize; /* Size of journal at stmt_begin() */
28037 u32 sectorSize; /* Assumed sector size during rollback */
28038 #ifdef SQLITE_TEST
28039 int nHit, nMiss; /* Cache hits and missing */
28040 int nRead, nWrite; /* Database pages read/written */
28041 #endif
28042 void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */
@@ -28541,12 +28585,16 @@
28585 ** the process that created this journal. If this journal was
28586 ** created by a process other than this one, then this routine
28587 ** is being called from within pager_playback(). The local value
28588 ** of Pager.sectorSize is restored at the end of that routine.
28589 */
28590 rc = read32bits(pPager->jfd, jrnlOff+12, &pPager->sectorSize);
28591 if( rc ) return rc;
28592 if( (pPager->sectorSize & (pPager->sectorSize-1))!=0
28593 || pPager->sectorSize>0x1000000 ){
28594 return SQLITE_DONE;
28595 }
28596
28597 pPager->journalOff += JOURNAL_HDR_SZ(pPager);
28598 return SQLITE_OK;
28599 }
28600
@@ -31186,11 +31234,13 @@
31234 #endif
31235
31236 /*
31237 ** A call to this routine tells the pager that it is not necessary to
31238 ** write the information on page pPg back to the disk, even though
31239 ** that page might be marked as dirty. This happens, for example, when
31240 ** the page has been added as a leaf of the freelist and so its
31241 ** content no longer matters.
31242 **
31243 ** The overlying software layer calls this routine when all of the data
31244 ** on the given page is unused. The pager marks the page as clean so
31245 ** that it does not get written to disk.
31246 **
@@ -32978,11 +33028,11 @@
33028 ** May you do good and not evil.
33029 ** May you find forgiveness for yourself and forgive others.
33030 ** May you share freely, never taking more than you give.
33031 **
33032 *************************************************************************
33033 ** $Id: btree.c,v 1.527 2008/11/03 20:55:07 drh Exp $
33034 **
33035 ** This file implements a external (disk-based) database using BTrees.
33036 ** See the header comment on "btreeInt.h" for additional information.
33037 ** Including a description of file format and an overview of operation.
33038 */
@@ -33374,11 +33424,11 @@
33424 sqlite3BtreeRestoreCursorPosition(p) : \
33425 SQLITE_OK)
33426
33427 /*
33428 ** Determine whether or not a cursor has moved from the position it
33429 ** was last placed at. Cursors can move when the row they are pointing
33430 ** at is deleted out from under them.
33431 **
33432 ** This routine returns an error code if something goes wrong. The
33433 ** integer *pHasMoved is set to one if the cursor has moved and 0 if not.
33434 */
@@ -40501,11 +40551,11 @@
40551 ** This file contains code use to manipulate "Mem" structure. A "Mem"
40552 ** stores a single value in the VDBE. Mem is an opaque structure visible
40553 ** only within the VDBE. Interface routines refer to a Mem using the
40554 ** name sqlite_value
40555 **
40556 ** $Id: vdbemem.c,v 1.125 2008/11/05 17:41:19 drh Exp $
40557 */
40558
40559 /*
40560 ** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
40561 ** P if required.
@@ -41089,13 +41139,10 @@
41139 }else{
41140 for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
41141 }
41142 flags |= MEM_Term;
41143 }
 
 
 
41144
41145 /* The following block sets the new values of Mem.z and Mem.xDel. It
41146 ** also sets a flag in local variable "flags" to indicate the memory
41147 ** management (one of MEM_Dyn or MEM_Static).
41148 */
@@ -41102,10 +41149,13 @@
41149 if( xDel==SQLITE_TRANSIENT ){
41150 int nAlloc = nByte;
41151 if( flags&MEM_Term ){
41152 nAlloc += (enc==SQLITE_UTF8?1:2);
41153 }
41154 if( nByte>iLimit ){
41155 return SQLITE_TOOBIG;
41156 }
41157 if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
41158 return SQLITE_NOMEM;
41159 }
41160 memcpy(pMem->z, z, nAlloc);
41161 }else if( xDel==SQLITE_DYNAMIC ){
@@ -41116,10 +41166,13 @@
41166 sqlite3VdbeMemRelease(pMem);
41167 pMem->z = (char *)z;
41168 pMem->xDel = xDel;
41169 flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
41170 }
41171 if( nByte>iLimit ){
41172 return SQLITE_TOOBIG;
41173 }
41174
41175 pMem->n = nByte;
41176 pMem->flags = flags;
41177 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
41178 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
@@ -41543,11 +41596,11 @@
41596 ** This file contains code used for creating, destroying, and populating
41597 ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
41598 ** to version 2.8.7, all this code was combined into the vdbe.c source file.
41599 ** But that file was getting too big so this subroutines were split out.
41600 **
41601 ** $Id: vdbeaux.c,v 1.418 2008/11/05 17:41:19 drh Exp $
41602 */
41603
41604
41605
41606 /*
@@ -41793,10 +41846,12 @@
41846 int nMaxArgs = 0;
41847 Op *pOp;
41848 int *aLabel = p->aLabel;
41849 int doesStatementRollback = 0;
41850 int hasStatementBegin = 0;
41851 p->readOnly = 1;
41852 p->usesStmtJournal = 0;
41853 for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
41854 u8 opcode = pOp->opcode;
41855
41856 if( opcode==OP_Function || opcode==OP_AggStep ){
41857 if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5;
@@ -41809,12 +41864,15 @@
41864 if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){
41865 doesStatementRollback = 1;
41866 }
41867 }else if( opcode==OP_Statement ){
41868 hasStatementBegin = 1;
41869 p->usesStmtJournal = 1;
41870 }else if( opcode==OP_Destroy ){
41871 doesStatementRollback = 1;
41872 }else if( opcode==OP_Transaction && pOp->p2!=0 ){
41873 p->readOnly = 0;
41874 #ifndef SQLITE_OMIT_VIRTUALTABLE
41875 }else if( opcode==OP_VUpdate || opcode==OP_VRename ){
41876 doesStatementRollback = 1;
41877 }else if( opcode==OP_VFilter ){
41878 int n;
@@ -41839,10 +41897,11 @@
41897 ** transactions are not needed. So change every OP_Statement
41898 ** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive()
41899 ** which can be expensive on some platforms.
41900 */
41901 if( hasStatementBegin && !doesStatementRollback ){
41902 p->usesStmtJournal = 0;
41903 for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
41904 if( pOp->opcode==OP_Statement ){
41905 pOp->opcode = OP_Noop;
41906 }
41907 }
@@ -42547,11 +42606,11 @@
42606 p->magic = VDBE_MAGIC_RUN;
42607
42608 /* For each cursor required, also allocate a memory cell. Memory
42609 ** cells (nMem+1-nCursor)..nMem, inclusive, will never be used by
42610 ** the vdbe program. Instead they are used to allocate space for
42611 ** VdbeCursor/BtCursor structures. The blob of memory associated with
42612 ** cursor 0 is stored in memory cell nMem. Memory cell (nMem-1)
42613 ** stores the blob of memory associated with cursor 1, etc.
42614 **
42615 ** See also: allocateCursor().
42616 */
@@ -42564,28 +42623,28 @@
42623 int nArg; /* Maximum number of args passed to a user function. */
42624 resolveP2Values(p, &nArg);
42625 /*resizeOpArray(p, p->nOp);*/
42626 assert( nVar>=0 );
42627 if( isExplain && nMem<10 ){
42628 nMem = 10;
42629 }
42630 p->aMem = sqlite3DbMallocZero(db,
42631 nMem*sizeof(Mem) /* aMem */
42632 + nVar*sizeof(Mem) /* aVar */
42633 + nArg*sizeof(Mem*) /* apArg */
42634 + nVar*sizeof(char*) /* azVar */
42635 + nCursor*sizeof(VdbeCursor*)+1 /* apCsr */
42636 );
42637 if( !db->mallocFailed ){
42638 p->aMem--; /* aMem[] goes from 1..nMem */
42639 p->nMem = nMem; /* not from 0..nMem-1 */
42640 p->aVar = &p->aMem[nMem+1];
42641 p->nVar = nVar;
42642 p->okVar = 0;
42643 p->apArg = (Mem**)&p->aVar[nVar];
42644 p->azVar = (char**)&p->apArg[nArg];
42645 p->apCsr = (VdbeCursor**)&p->azVar[nVar];
42646 p->nCursor = nCursor;
42647 for(n=0; n<nVar; n++){
42648 p->aVar[n].flags = MEM_Null;
42649 p->aVar[n].db = db;
42650 }
@@ -42624,11 +42683,11 @@
42683
42684 /*
42685 ** Close a VDBE cursor and release all the resources that cursor
42686 ** happens to hold.
42687 */
42688 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
42689 if( pCx==0 ){
42690 return;
42691 }
42692 if( pCx->pBt ){
42693 sqlite3BtreeClose(pCx->pBt);
@@ -42659,11 +42718,11 @@
42718 */
42719 static void closeAllCursorsExceptActiveVtabs(Vdbe *p){
42720 int i;
42721 if( p->apCsr==0 ) return;
42722 for(i=0; i<p->nCursor; i++){
42723 VdbeCursor *pC = p->apCsr[i];
42724 if( pC && (!p->inVtabMethod || !pC->pVtabCursor) ){
42725 sqlite3VdbeFreeCursor(p, pC);
42726 p->apCsr[i] = 0;
42727 }
42728 }
@@ -42749,11 +42808,11 @@
42808 return SQLITE_NOMEM;
42809 }
42810 assert( p->aColName!=0 );
42811 pColName = &(p->aColName[idx+var*p->nResColumn]);
42812 rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, xDel);
42813 assert( rc!=0 || !zName || (pColName->flags&MEM_Term)!=0 );
42814 return rc;
42815 }
42816
42817 /*
42818 ** A read or write transaction may or may not be active on database handle
@@ -42980,18 +43039,21 @@
43039 */
43040 #ifndef NDEBUG
43041 static void checkActiveVdbeCnt(sqlite3 *db){
43042 Vdbe *p;
43043 int cnt = 0;
43044 int nWrite = 0;
43045 p = db->pVdbe;
43046 while( p ){
43047 if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){
43048 cnt++;
43049 if( p->readOnly==0 ) nWrite++;
43050 }
43051 p = p->pNext;
43052 }
43053 assert( cnt==db->activeVdbeCnt );
43054 assert( nWrite==db->writeVdbeCnt );
43055 }
43056 #else
43057 #define checkActiveVdbeCnt(x)
43058 #endif
43059
@@ -43075,46 +43137,19 @@
43137 /* Check for one of the special errors */
43138 mrc = p->rc & 0xff;
43139 isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR
43140 || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL;
43141 if( isSpecialError ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43142 /* If the query was read-only, we need do no rollback at all. Otherwise,
43143 ** proceed with the special handling.
43144 */
43145 if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){
43146 if( p->rc==SQLITE_IOERR_BLOCKED && p->usesStmtJournal ){
43147 xFunc = sqlite3BtreeRollbackStmt;
43148 p->rc = SQLITE_BUSY;
43149 }else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL)
43150 && p->usesStmtJournal ){
43151 xFunc = sqlite3BtreeRollbackStmt;
43152 }else{
43153 /* We are forced to roll back the active transaction. Before doing
43154 ** so, abort any other statements this handle currently has active.
43155 */
@@ -43127,13 +43162,13 @@
43162
43163 /* If the auto-commit flag is set and this is the only active vdbe, then
43164 ** we do either a commit or rollback of the current transaction.
43165 **
43166 ** Note: This block also runs if one of the special errors handled
43167 ** above has occurred.
43168 */
43169 if( db->autoCommit && db->writeVdbeCnt==(p->readOnly==0) ){
43170 if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
43171 /* The auto-commit flag is true, and the vdbe program was
43172 ** successful or hit an 'OR FAIL' constraint. This means a commit
43173 ** is required.
43174 */
@@ -43209,10 +43244,14 @@
43244 }
43245
43246 /* We have successfully halted and closed the VM. Record this fact. */
43247 if( p->pc>=0 ){
43248 db->activeVdbeCnt--;
43249 if( !p->readOnly ){
43250 db->writeVdbeCnt--;
43251 }
43252 assert( db->activeVdbeCnt>=db->writeVdbeCnt );
43253 }
43254 p->magic = VDBE_MAGIC_HALT;
43255 checkActiveVdbeCnt(db);
43256 if( p->db->mallocFailed ){
43257 p->rc = SQLITE_NOMEM;
@@ -43392,11 +43431,11 @@
43431 /*
43432 ** If a MoveTo operation is pending on the given cursor, then do that
43433 ** MoveTo now. Return an error code. If no MoveTo is pending, this
43434 ** routine does nothing and returns SQLITE_OK.
43435 */
43436 SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){
43437 if( p->deferredMoveto ){
43438 int res, rc;
43439 #ifdef SQLITE_TEST
43440 extern int sqlite3_search_count;
43441 #endif
@@ -43495,11 +43534,11 @@
43534 return 6;
43535 }
43536 if( flags&MEM_Real ){
43537 return 7;
43538 }
43539 assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
43540 n = pMem->n;
43541 if( flags & MEM_Zero ){
43542 n += pMem->u.i;
43543 }
43544 assert( n>=0 );
@@ -43959,11 +43998,11 @@
43998 **
43999 ** pUnpacked may be an unpacked version of pKey,nKey. If pUnpacked is
44000 ** supplied it is used in place of pKey,nKey.
44001 */
44002 SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(
44003 VdbeCursor *pC, /* The cursor to compare against */
44004 UnpackedRecord *pUnpacked, /* Unpacked version of pKey and nKey */
44005 int *res /* Write the comparison result here */
44006 ){
44007 i64 nCellKey = 0;
44008 int rc;
@@ -44045,11 +44084,11 @@
44084 *************************************************************************
44085 **
44086 ** This file contains code use to implement APIs that are part of the
44087 ** VDBE.
44088 **
44089 ** $Id: vdbeapi.c,v 1.148 2008/11/05 16:37:35 drh Exp $
44090 */
44091
44092 #if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
44093 /*
44094 ** The following structure contains pointers to the end points of a
@@ -44498,10 +44537,11 @@
44537 p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0;
44538 }
44539 #endif
44540
44541 db->activeVdbeCnt++;
44542 if( p->readOnly==0 ) db->writeVdbeCnt++;
44543 p->pc = 0;
44544 stmtLruRemove(p);
44545 }
44546 #ifndef SQLITE_OMIT_EXPLAIN
44547 if( p->explain ){
@@ -45383,11 +45423,11 @@
45423 ** documentation, headers files, or other derived files. The formatting
45424 ** of the code in this file is, therefore, important. See other comments
45425 ** in this file for details. If in doubt, do not deviate from existing
45426 ** commenting and indentation practices when changing or adding code.
45427 **
45428 ** $Id: vdbe.c,v 1.786 2008/11/05 16:37:35 drh Exp $
45429 */
45430
45431 /*
45432 ** The following global variable is incremented every time a cursor
45433 ** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test
@@ -45519,24 +45559,24 @@
45559 assert( opcode>0 && opcode<sizeof(opcodeProperty) );
45560 return (opcodeProperty[opcode]&mask)!=0;
45561 }
45562
45563 /*
45564 ** Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL
45565 ** if we run out of memory.
45566 */
45567 static VdbeCursor *allocateCursor(
45568 Vdbe *p, /* The virtual machine */
45569 int iCur, /* Index of the new VdbeCursor */
45570 Op *pOp, /* */
45571 int iDb, /* */
45572 int isBtreeCursor /* */
45573 ){
45574 /* Find the memory cell that will be used to store the blob of memory
45575 ** required for this VdbeCursor structure. It is convenient to use a
45576 ** vdbe memory cell to manage the memory allocation required for a
45577 ** VdbeCursor structure for the following reasons:
45578 **
45579 ** * Sometimes cursor numbers are used for a couple of different
45580 ** purposes in a vdbe program. The different uses might require
45581 ** different sized allocations. Memory cells provide growable
45582 ** allocations.
@@ -45550,40 +45590,41 @@
45590 ** cursor 1 is managed by memory cell (p->nMem-1), etc.
45591 */
45592 Mem *pMem = &p->aMem[p->nMem-iCur];
45593
45594 int nByte;
45595 VdbeCursor *pCx = 0;
45596 /* If the opcode of pOp is OP_SetNumColumns, then pOp->p2 contains
45597 ** the number of fields in the records contained in the table or
45598 ** index being opened. Use this to reserve space for the
45599 ** VdbeCursor.aType[] array.
45600 */
45601 int nField = 0;
45602 if( pOp->opcode==OP_SetNumColumns || pOp->opcode==OP_OpenEphemeral ){
45603 nField = pOp->p2;
45604 }
45605 nByte =
45606 sizeof(VdbeCursor) +
45607 (isBtreeCursor?sqlite3BtreeCursorSize():0) +
45608 2*nField*sizeof(u32);
45609
45610 assert( iCur<p->nCursor );
45611 if( p->apCsr[iCur] ){
45612 sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
45613 p->apCsr[iCur] = 0;
45614 }
45615 if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
45616 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
45617 memset(pMem->z, 0, nByte);
45618 pCx->iDb = iDb;
45619 pCx->nField = nField;
45620 if( nField ){
45621 pCx->aType = (u32 *)&pMem->z[sizeof(VdbeCursor)];
45622 }
45623 if( isBtreeCursor ){
45624 pCx->pCursor = (BtCursor*)
45625 &pMem->z[sizeof(VdbeCursor)+2*nField*sizeof(u32)];
45626 }
45627 }
45628 return pCx;
45629 }
45630
@@ -47386,22 +47427,19 @@
47427 ** from this record. If there are less that (P2+1)
47428 ** values in the record, extract a NULL.
47429 **
47430 ** The value extracted is stored in register P3.
47431 **
 
 
 
47432 ** If the column contains fewer than P2 fields, then extract a NULL. Or,
47433 ** if the P4 argument is a P4_MEM use the value of the P4 argument as
47434 ** the result.
47435 */
47436 case OP_Column: {
47437 u32 payloadSize; /* Number of bytes in the record */
47438 int p1 = pOp->p1; /* P1 value of the opcode */
47439 int p2 = pOp->p2; /* column number to retrieve */
47440 VdbeCursor *pC = 0;/* The VDBE cursor */
47441 char *zRec; /* Pointer to complete record-data */
47442 BtCursor *pCrsr; /* The BTree cursor */
47443 u32 *aType; /* aType[i] holds the numeric type of the i-th column */
47444 u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */
47445 u32 nField; /* number of fields in the record */
@@ -47427,11 +47465,11 @@
47465 ** If the record is stored in a cursor, the complete record text
47466 ** might be available in the pC->aRow cache. Or it might not be.
47467 ** If the data is unavailable, zRec is set to NULL.
47468 **
47469 ** We also compute the number of columns in the record. For cursors,
47470 ** the number of columns is stored in the VdbeCursor.nField element.
47471 */
47472 pC = p->apCsr[p1];
47473 assert( pC!=0 );
47474 #ifndef SQLITE_OMIT_VIRTUALTABLE
47475 assert( pC->pVtabCursor==0 );
@@ -47823,37 +47861,44 @@
47861 ** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails.
47862 **
47863 ** This instruction causes the VM to halt.
47864 */
47865 case OP_AutoCommit: {
47866 int desiredAutoCommit = pOp->p1;
47867 int rollback = pOp->p2;
47868 int turnOnAC = desiredAutoCommit && !db->autoCommit;
47869
47870 assert( desiredAutoCommit==1 || desiredAutoCommit==0 );
47871 assert( desiredAutoCommit==1 || rollback==0 );
47872
47873 assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */
47874
47875 if( turnOnAC && rollback && db->activeVdbeCnt>1 ){
47876 /* If this instruction implements a ROLLBACK and other VMs are
47877 ** still running, and a transaction is active, return an error indicating
47878 ** that the other VMs must complete first.
47879 */
47880 sqlite3SetString(&p->zErrMsg, db, "cannot rollback transaction - "
47881 "SQL statements in progress");
47882 rc = SQLITE_BUSY;
47883 }else if( turnOnAC && !rollback && db->writeVdbeCnt>1 ){
47884 /* If this instruction implements a COMMIT and other VMs are writing
47885 ** return an error indicating that the other VMs must complete first.
47886 */
47887 sqlite3SetString(&p->zErrMsg, db, "cannot commit transaction - "
47888 "SQL statements in progress");
47889 rc = SQLITE_BUSY;
47890 }else if( desiredAutoCommit!=db->autoCommit ){
47891 if( pOp->p2 ){
47892 assert( desiredAutoCommit==1 );
47893 sqlite3RollbackAll(db);
47894 db->autoCommit = 1;
47895 }else{
47896 db->autoCommit = desiredAutoCommit;
47897 if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
47898 p->pc = pc;
47899 db->autoCommit = 1-desiredAutoCommit;
47900 p->rc = rc = SQLITE_BUSY;
47901 goto vdbe_return;
47902 }
47903 }
47904 if( p->rc==SQLITE_OK ){
@@ -47862,11 +47907,11 @@
47907 rc = SQLITE_ERROR;
47908 }
47909 goto vdbe_return;
47910 }else{
47911 sqlite3SetString(&p->zErrMsg, db,
47912 (!desiredAutoCommit)?"cannot start a transaction within a transaction":(
47913 (rollback)?"cannot rollback - no transaction is active":
47914 "cannot commit - no transaction is active"));
47915
47916 rc = SQLITE_ERROR;
47917 }
@@ -48099,11 +48144,11 @@
48144 int i = pOp->p1;
48145 int p2 = pOp->p2;
48146 int iDb = pOp->p3;
48147 int wrFlag;
48148 Btree *pX;
48149 VdbeCursor *pCur;
48150 Db *pDb;
48151
48152 assert( iDb>=0 && iDb<db->nDb );
48153 assert( (p->btreeMask & (1<<iDb))!=0 );
48154 pDb = &db->aDb[iDb];
@@ -48199,11 +48244,11 @@
48244 ** this opcode. Then this opcode was call OpenVirtual. But
48245 ** that created confusion with the whole virtual-table idea.
48246 */
48247 case OP_OpenEphemeral: {
48248 int i = pOp->p1;
48249 VdbeCursor *pCx;
48250 static const int openFlags =
48251 SQLITE_OPEN_READWRITE |
48252 SQLITE_OPEN_CREATE |
48253 SQLITE_OPEN_EXCLUSIVE |
48254 SQLITE_OPEN_DELETEONCLOSE |
@@ -48265,11 +48310,11 @@
48310 ** memory cell containing the row data is not overwritten until the
48311 ** pseudo table is closed (or a new row is inserted into it).
48312 */
48313 case OP_OpenPseudo: {
48314 int i = pOp->p1;
48315 VdbeCursor *pCx;
48316 assert( i>=0 );
48317 pCx = allocateCursor(p, i, &pOp[-1], -1, 0);
48318 if( pCx==0 ) goto no_mem;
48319 pCx->nullRow = 1;
48320 pCx->pseudoTable = 1;
@@ -48354,11 +48399,11 @@
48399 case OP_MoveLt: /* jump, in3 */
48400 case OP_MoveLe: /* jump, in3 */
48401 case OP_MoveGe: /* jump, in3 */
48402 case OP_MoveGt: { /* jump, in3 */
48403 int i = pOp->p1;
48404 VdbeCursor *pC;
48405
48406 assert( i>=0 && i<p->nCursor );
48407 pC = p->apCsr[i];
48408 assert( pC!=0 );
48409 if( pC->pCursor!=0 ){
@@ -48471,11 +48516,11 @@
48516 */
48517 case OP_NotFound: /* jump, in3 */
48518 case OP_Found: { /* jump, in3 */
48519 int i = pOp->p1;
48520 int alreadyExists = 0;
48521 VdbeCursor *pC;
48522 assert( i>=0 && i<p->nCursor );
48523 assert( p->apCsr[i]!=0 );
48524 if( (pC = p->apCsr[i])->pCursor!=0 ){
48525 int res;
48526 UnpackedRecord *pIdxKey;
@@ -48527,11 +48572,11 @@
48572 **
48573 ** See also: NotFound, NotExists, Found
48574 */
48575 case OP_IsUnique: { /* jump, in3 */
48576 int i = pOp->p1;
48577 VdbeCursor *pCx;
48578 BtCursor *pCrsr;
48579 Mem *pK;
48580 i64 R;
48581
48582 /* Pop the value R off the top of the stack
@@ -48624,11 +48669,11 @@
48669 **
48670 ** See also: Found, NotFound, IsUnique
48671 */
48672 case OP_NotExists: { /* jump, in3 */
48673 int i = pOp->p1;
48674 VdbeCursor *pC;
48675 BtCursor *pCrsr;
48676 assert( i>=0 && i<p->nCursor );
48677 assert( p->apCsr[i]!=0 );
48678 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
48679 int res;
@@ -48693,11 +48738,11 @@
48738 ** AUTOINCREMENT feature.
48739 */
48740 case OP_NewRowid: { /* out2-prerelease */
48741 int i = pOp->p1;
48742 i64 v = 0;
48743 VdbeCursor *pC;
48744 assert( i>=0 && i<p->nCursor );
48745 assert( p->apCsr[i]!=0 );
48746 if( (pC = p->apCsr[i])->pCursor==0 ){
48747 /* The zero initialization above is all that is needed */
48748 }else{
@@ -48861,11 +48906,11 @@
48906 Mem *pData = &p->aMem[pOp->p2];
48907 Mem *pKey = &p->aMem[pOp->p3];
48908
48909 i64 iKey; /* The integer ROWID or key for the record to be inserted */
48910 int i = pOp->p1;
48911 VdbeCursor *pC;
48912 assert( i>=0 && i<p->nCursor );
48913 pC = p->apCsr[i];
48914 assert( pC!=0 );
48915 assert( pC->pCursor!=0 || pC->pseudoTable );
48916 assert( pKey->flags & MEM_Int );
@@ -48955,11 +49000,11 @@
49000 ** using OP_NotFound prior to invoking this opcode.
49001 */
49002 case OP_Delete: {
49003 int i = pOp->p1;
49004 i64 iKey;
49005 VdbeCursor *pC;
49006
49007 assert( i>=0 && i<p->nCursor );
49008 pC = p->apCsr[i];
49009 assert( pC!=0 );
49010 assert( pC->pCursor!=0 ); /* Only valid for real tables, no pseudotables */
@@ -49026,11 +49071,11 @@
49071 ** of a real table, not a pseudo-table.
49072 */
49073 case OP_RowKey:
49074 case OP_RowData: {
49075 int i = pOp->p1;
49076 VdbeCursor *pC;
49077 BtCursor *pCrsr;
49078 u32 n;
49079
49080 pOut = &p->aMem[pOp->p2];
49081
@@ -49080,11 +49125,11 @@
49125 ** Store in register P2 an integer which is the key of the table entry that
49126 ** P1 is currently point to.
49127 */
49128 case OP_Rowid: { /* out2-prerelease */
49129 int i = pOp->p1;
49130 VdbeCursor *pC;
49131 i64 v;
49132
49133 assert( i>=0 && i<p->nCursor );
49134 pC = p->apCsr[i];
49135 assert( pC!=0 );
@@ -49113,11 +49158,11 @@
49158 ** that occur while the cursor is on the null row will always
49159 ** write a NULL.
49160 */
49161 case OP_NullRow: {
49162 int i = pOp->p1;
49163 VdbeCursor *pC;
49164
49165 assert( i>=0 && i<p->nCursor );
49166 pC = p->apCsr[i];
49167 assert( pC!=0 );
49168 pC->nullRow = 1;
@@ -49136,11 +49181,11 @@
49181 ** If P2 is 0 or if the table or index is not empty, fall through
49182 ** to the following instruction.
49183 */
49184 case OP_Last: { /* jump */
49185 int i = pOp->p1;
49186 VdbeCursor *pC;
49187 BtCursor *pCrsr;
49188 int res;
49189
49190 assert( i>=0 && i<p->nCursor );
49191 pC = p->apCsr[i];
@@ -49186,11 +49231,11 @@
49231 ** If P2 is 0 or if the table or index is not empty, fall through
49232 ** to the following instruction.
49233 */
49234 case OP_Rewind: { /* jump */
49235 int i = pOp->p1;
49236 VdbeCursor *pC;
49237 BtCursor *pCrsr;
49238 int res;
49239
49240 assert( i>=0 && i<p->nCursor );
49241 pC = p->apCsr[i];
@@ -49231,11 +49276,11 @@
49276 **
49277 ** The P1 cursor must be for a real table, not a pseudo-table.
49278 */
49279 case OP_Prev: /* jump */
49280 case OP_Next: { /* jump */
49281 VdbeCursor *pC;
49282 BtCursor *pCrsr;
49283 int res;
49284
49285 CHECK_FOR_INTERRUPT;
49286 assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -49274,11 +49319,11 @@
49319 ** This instruction only works for indices. The equivalent instruction
49320 ** for tables is OP_Insert.
49321 */
49322 case OP_IdxInsert: { /* in2 */
49323 int i = pOp->p1;
49324 VdbeCursor *pC;
49325 BtCursor *pCrsr;
49326 assert( i>=0 && i<p->nCursor );
49327 assert( p->apCsr[i]!=0 );
49328 assert( pIn2->flags & MEM_Blob );
49329 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
@@ -49301,11 +49346,11 @@
49346 ** an unpacked index key. This opcode removes that entry from the
49347 ** index opened by cursor P1.
49348 */
49349 case OP_IdxDelete: {
49350 int i = pOp->p1;
49351 VdbeCursor *pC;
49352 BtCursor *pCrsr;
49353 assert( pOp->p3>0 );
49354 assert( pOp->p2>0 && pOp->p2+pOp->p3<=p->nMem );
49355 assert( i>=0 && i<p->nCursor );
49356 assert( p->apCsr[i]!=0 );
@@ -49335,11 +49380,11 @@
49380 ** See also: Rowid, MakeIdxRec.
49381 */
49382 case OP_IdxRowid: { /* out2-prerelease */
49383 int i = pOp->p1;
49384 BtCursor *pCrsr;
49385 VdbeCursor *pC;
49386
49387 assert( i>=0 && i<p->nCursor );
49388 assert( p->apCsr[i]!=0 );
49389 if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
49390 i64 rowid;
@@ -49385,11 +49430,11 @@
49430 ** to the comparison. This makes the opcode work like IdxLE.
49431 */
49432 case OP_IdxLT: /* jump, in3 */
49433 case OP_IdxGE: { /* jump, in3 */
49434 int i= pOp->p1;
49435 VdbeCursor *pC;
49436
49437 assert( i>=0 && i<p->nCursor );
49438 assert( p->apCsr[i]!=0 );
49439 if( (pC = p->apCsr[i])->pCursor!=0 ){
49440 int res;
@@ -50068,11 +50113,11 @@
50113 ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
50114 ** P1 is a cursor number. This opcode opens a cursor to the virtual
50115 ** table and stores that cursor in P1.
50116 */
50117 case OP_VOpen: {
50118 VdbeCursor *pCur = 0;
50119 sqlite3_vtab_cursor *pVtabCursor = 0;
50120
50121 sqlite3_vtab *pVtab = pOp->p4.pVtab;
50122 sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule;
50123
@@ -50127,11 +50172,11 @@
50172 Mem *pQuery = &p->aMem[pOp->p3];
50173 Mem *pArgc = &pQuery[1];
50174 sqlite3_vtab_cursor *pVtabCursor;
50175 sqlite3_vtab *pVtab;
50176
50177 VdbeCursor *pCur = p->apCsr[pOp->p1];
50178
50179 REGISTER_TRACE(pOp->p3, pQuery);
50180 assert( pCur->pVtabCursor );
50181 pVtabCursor = pCur->pVtabCursor;
50182 pVtab = pVtabCursor->pVtab;
@@ -50184,11 +50229,11 @@
50229 */
50230 case OP_VRowid: { /* out2-prerelease */
50231 sqlite3_vtab *pVtab;
50232 const sqlite3_module *pModule;
50233 sqlite_int64 iRow;
50234 VdbeCursor *pCur = p->apCsr[pOp->p1];
50235
50236 assert( pCur->pVtabCursor );
50237 if( pCur->nullRow ){
50238 break;
50239 }
@@ -50218,11 +50263,11 @@
50263 sqlite3_vtab *pVtab;
50264 const sqlite3_module *pModule;
50265 Mem *pDest;
50266 sqlite3_context sContext;
50267
50268 VdbeCursor *pCur = p->apCsr[pOp->p1];
50269 assert( pCur->pVtabCursor );
50270 assert( pOp->p3>0 && pOp->p3<=p->nMem );
50271 pDest = &p->aMem[pOp->p3];
50272 if( pCur->nullRow ){
50273 sqlite3VdbeMemSetNull(pDest);
@@ -50276,11 +50321,11 @@
50321 case OP_VNext: { /* jump */
50322 sqlite3_vtab *pVtab;
50323 const sqlite3_module *pModule;
50324 int res = 0;
50325
50326 VdbeCursor *pCur = p->apCsr[pOp->p1];
50327 assert( pCur->pVtabCursor );
50328 if( pCur->nullRow ){
50329 break;
50330 }
50331 pVtab = pCur->pVtabCursor->pVtab;
@@ -51153,15 +51198,11 @@
51198 #endif
51199
51200 /************** End of journal.c *********************************************/
51201 /************** Begin file memjournal.c **************************************/
51202 /*
 
 
 
51203 ** 2008 October 7
 
51204 **
51205 ** The author disclaims copyright to this source code. In place of
51206 ** a legal notice, here is a blessing:
51207 **
51208 ** May you do good and not evil.
@@ -52715,11 +52756,11 @@
52756 **
52757 *************************************************************************
52758 ** This file contains routines used for analyzing expressions and
52759 ** for generating VDBE code that evaluates expressions in SQLite.
52760 **
52761 ** $Id: expr.c,v 1.401 2008/11/06 15:33:04 drh Exp $
52762 */
52763
52764 /*
52765 ** Return the 'affinity' of the expression pExpr if any.
52766 **
@@ -54565,10 +54606,14 @@
54606 testcase( to_op==OP_ToText );
54607 testcase( to_op==OP_ToBlob );
54608 testcase( to_op==OP_ToNumeric );
54609 testcase( to_op==OP_ToInt );
54610 testcase( to_op==OP_ToReal );
54611 if( inReg!=target ){
54612 sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target);
54613 inReg = target;
54614 }
54615 sqlite3VdbeAddOp1(v, to_op, inReg);
54616 testcase( usedAsColumnCache(pParse, inReg, inReg) );
54617 sqlite3ExprCacheAffinityChange(pParse, inReg, 1);
54618 break;
54619 }
@@ -56430,11 +56475,11 @@
56475 ** May you share freely, never taking more than you give.
56476 **
56477 *************************************************************************
56478 ** This file contains code associated with the ANALYZE command.
56479 **
56480 ** @(#) $Id: analyze.c,v 1.44 2008/11/03 20:55:07 drh Exp $
56481 */
56482 #ifndef SQLITE_OMIT_ANALYZE
56483
56484 /*
56485 ** This routine generates code that opens the sqlite_stat1 table on cursor
@@ -56504,15 +56549,15 @@
56549 ** a single table.
56550 */
56551 static void analyzeOneTable(
56552 Parse *pParse, /* Parser context */
56553 Table *pTab, /* Table whose indices are to be analyzed */
56554 int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */
56555 int iMem /* Available memory locations begin here */
56556 ){
56557 Index *pIdx; /* An index to being analyzed */
56558 int iIdxCur; /* Index of VdbeCursor for index being analyzed */
56559 int nCol; /* Number of columns in the index */
56560 Vdbe *v; /* The virtual machine being built up */
56561 int i; /* Loop counter */
56562 int topOfLoop; /* The top of the loop */
56563 int endOfLoop; /* The end of the loop */
@@ -57640,11 +57685,11 @@
57685 ** creating ID lists
57686 ** BEGIN TRANSACTION
57687 ** COMMIT
57688 ** ROLLBACK
57689 **
57690 ** $Id: build.c,v 1.500 2008/11/03 20:55:07 drh Exp $
57691 */
57692
57693 /*
57694 ** This routine is called when a new SQL statement is beginning to
57695 ** be parsed. Initialize the pParse structure as needed.
@@ -60673,11 +60718,11 @@
60718 pList->nSrc++;
60719 return pList;
60720 }
60721
60722 /*
60723 ** Assign VdbeCursor index numbers to all tables in a SrcList
60724 */
60725 SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){
60726 int i;
60727 struct SrcList_item *pItem;
60728 assert(pList || pParse->db->mallocFailed );
@@ -63616,11 +63661,11 @@
63661 **
63662 *************************************************************************
63663 ** This file contains C code routines that are called by the parser
63664 ** to handle INSERT statements in SQLite.
63665 **
63666 ** $Id: insert.c,v 1.251 2008/11/03 20:55:07 drh Exp $
63667 */
63668
63669 /*
63670 ** Set P4 of the most recently inserted opcode to a column affinity
63671 ** string for index pIdx. A column affinity string has one character
@@ -64988,11 +65033,11 @@
65033 ** Return the number of indices on the table.
65034 */
65035 SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
65036 Parse *pParse, /* Parsing context */
65037 Table *pTab, /* Table to be opened */
65038 int baseCur, /* Cursor number assigned to the table */
65039 int op /* OP_OpenRead or OP_OpenWrite */
65040 ){
65041 int i;
65042 int iDb;
65043 Index *pIdx;
@@ -75667,11 +75712,11 @@
75712 ** generating the code that loops through a table looking for applicable
75713 ** rows. Indices are selected and used to speed the search when doing
75714 ** so is applicable. Because this module is responsible for selecting
75715 ** indices, you might also think of this module as the "query optimizer".
75716 **
75717 ** $Id: where.c,v 1.328 2008/11/03 09:06:06 danielk1977 Exp $
75718 */
75719
75720 /*
75721 ** The number of bits in a Bitmask. "BMS" means "BitMask Size".
75722 */
@@ -78122,20 +78167,30 @@
78167 pStart = pEnd;
78168 pEnd = pTerm;
78169 }
78170 if( pStart ){
78171 Expr *pX;
78172 int r1;
78173 pX = pStart->pExpr;
78174 assert( pX!=0 );
78175 assert( pStart->leftCursor==iCur );
78176
78177 /* The ForceInt instruction may modify the register that it operates
78178 ** on. For example it may replace a real value with an integer one,
78179 ** or if p3 is true it may increment the register value. For this
78180 ** reason we need to make sure that register r1 is really a newly
78181 ** allocated temporary register, and not part of the column-cache.
78182 ** For this reason we cannot use sqlite3ExprCodeTemp() here.
78183 */
78184 r1 = sqlite3GetTempReg(pParse);
78185 sqlite3ExprCode(pParse, pX->pRight, r1);
78186
78187 sqlite3VdbeAddOp3(v, OP_ForceInt, r1, brk,
78188 pX->op==TK_LE || pX->op==TK_GT);
78189 sqlite3VdbeAddOp3(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk, r1);
78190 VdbeComment((v, "pk"));
78191 sqlite3ReleaseTempReg(pParse, r1);
78192 disableTerm(pLevel, pStart);
78193 }else{
78194 sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, brk);
78195 }
78196 if( pEnd ){
@@ -78764,424 +78819,424 @@
78819 ** yy_reduce_ofst[] For each state, the offset into yy_action for
78820 ** shifting non-terminals after a reduce.
78821 ** yy_default[] Default action for each state.
78822 */
78823 static const YYACTIONTYPE yy_action[] = {
78824 /* 0 */ 296, 914, 120, 597, 2, 172, 425, 425, 62, 62,
78825 /* 10 */ 62, 62, 210, 64, 64, 64, 64, 65, 65, 66,
78826 /* 20 */ 66, 66, 67, 212, 398, 395, 432, 438, 69, 64,
78827 /* 30 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78828 /* 40 */ 458, 456, 327, 168, 61, 60, 301, 442, 443, 439,
78829 /* 50 */ 439, 63, 63, 62, 62, 62, 62, 256, 64, 64,
78830 /* 60 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296,
78831 /* 70 */ 498, 425, 425, 212, 427, 83, 68, 469, 70, 154,
78832 /* 80 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78833 /* 90 */ 212, 68, 307, 70, 154, 432, 438, 454, 214, 59,
78834 /* 100 */ 65, 65, 66, 66, 66, 67, 212, 429, 429, 429,
78835 /* 110 */ 497, 583, 296, 61, 60, 301, 442, 443, 439, 439,
78836 /* 120 */ 63, 63, 62, 62, 62, 62, 321, 64, 64, 64,
78837 /* 130 */ 64, 65, 65, 66, 66, 66, 67, 212, 432, 438,
78838 /* 140 */ 95, 66, 66, 66, 67, 212, 403, 256, 421, 35,
78839 /* 150 */ 57, 67, 212, 175, 417, 499, 61, 60, 301, 442,
78840 /* 160 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 19,
78841 /* 170 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78842 /* 180 */ 212, 296, 225, 532, 299, 581, 109, 422, 242, 458,
78843 /* 190 */ 416, 335, 414, 21, 502, 503, 346, 403, 527, 176,
78844 /* 200 */ 160, 454, 214, 580, 579, 344, 500, 432, 438, 149,
78845 /* 210 */ 150, 404, 405, 539, 514, 418, 151, 541, 8, 498,
78846 /* 220 */ 538, 577, 578, 427, 296, 61, 60, 301, 442, 443,
78847 /* 230 */ 439, 439, 63, 63, 62, 62, 62, 62, 196, 64,
78848 /* 240 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78849 /* 250 */ 432, 438, 454, 598, 398, 395, 429, 429, 429, 369,
78850 /* 260 */ 558, 481, 404, 405, 372, 576, 213, 296, 61, 60,
78851 /* 270 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62,
78852 /* 280 */ 62, 321, 64, 64, 64, 64, 65, 65, 66, 66,
78853 /* 290 */ 66, 67, 212, 432, 438, 555, 503, 304, 557, 532,
78854 /* 300 */ 218, 557, 552, 421, 36, 234, 397, 2, 542, 21,
78855 /* 310 */ 540, 61, 60, 301, 442, 443, 439, 439, 63, 63,
78856 /* 320 */ 62, 62, 62, 62, 388, 64, 64, 64, 64, 65,
78857 /* 330 */ 65, 66, 66, 66, 67, 212, 415, 530, 85, 381,
78858 /* 340 */ 78, 323, 296, 210, 304, 527, 493, 492, 379, 274,
78859 /* 350 */ 273, 379, 274, 273, 347, 463, 241, 387, 268, 210,
78860 /* 360 */ 533, 581, 210, 403, 20, 224, 144, 464, 432, 438,
78861 /* 370 */ 485, 164, 114, 248, 349, 253, 350, 177, 554, 580,
78862 /* 380 */ 465, 420, 331, 81, 257, 419, 61, 60, 301, 442,
78863 /* 390 */ 443, 439, 439, 63, 63, 62, 62, 62, 62, 391,
78864 /* 400 */ 64, 64, 64, 64, 65, 65, 66, 66, 66, 67,
78865 /* 410 */ 212, 296, 224, 203, 249, 496, 403, 440, 837, 114,
78866 /* 420 */ 248, 349, 253, 350, 177, 250, 321, 152, 404, 405,
78867 /* 430 */ 321, 257, 303, 324, 155, 445, 445, 432, 438, 317,
78868 /* 440 */ 400, 389, 213, 68, 209, 70, 154, 422, 421, 35,
78869 /* 450 */ 393, 202, 421, 42, 481, 61, 60, 301, 442, 443,
78870 /* 460 */ 439, 439, 63, 63, 62, 62, 62, 62, 422, 64,
78871 /* 470 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78872 /* 480 */ 296, 404, 405, 183, 513, 422, 351, 354, 355, 403,
78873 /* 490 */ 77, 335, 79, 489, 216, 183, 334, 356, 351, 354,
78874 /* 500 */ 355, 433, 434, 406, 407, 408, 432, 438, 235, 356,
78875 /* 510 */ 386, 68, 291, 70, 154, 456, 531, 168, 198, 302,
78876 /* 520 */ 449, 450, 436, 437, 61, 60, 301, 442, 443, 439,
78877 /* 530 */ 439, 63, 63, 62, 62, 62, 62, 394, 64, 64,
78878 /* 540 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 296,
78879 /* 550 */ 321, 435, 422, 260, 404, 405, 321, 183, 153, 321,
78880 /* 560 */ 351, 354, 355, 446, 332, 321, 595, 905, 321, 905,
78881 /* 570 */ 1, 356, 421, 28, 403, 432, 438, 376, 421, 42,
78882 /* 580 */ 477, 421, 35, 213, 548, 366, 548, 421, 50, 159,
78883 /* 590 */ 421, 50, 422, 61, 60, 301, 442, 443, 439, 439,
78884 /* 600 */ 63, 63, 62, 62, 62, 62, 592, 64, 64, 64,
78885 /* 610 */ 64, 65, 65, 66, 66, 66, 67, 212, 296, 337,
78886 /* 620 */ 217, 463, 256, 94, 339, 326, 449, 450, 172, 340,
78887 /* 630 */ 425, 345, 532, 464, 312, 595, 904, 313, 904, 404,
78888 /* 640 */ 405, 588, 21, 226, 432, 438, 465, 243, 504, 324,
78889 /* 650 */ 322, 445, 445, 421, 3, 459, 230, 308, 505, 194,
78890 /* 660 */ 278, 296, 61, 60, 301, 442, 443, 439, 439, 63,
78891 /* 670 */ 63, 62, 62, 62, 62, 592, 64, 64, 64, 64,
78892 /* 680 */ 65, 65, 66, 66, 66, 67, 212, 432, 438, 213,
78893 /* 690 */ 179, 180, 181, 422, 324, 425, 445, 445, 281, 262,
78894 /* 700 */ 279, 402, 194, 481, 296, 61, 60, 301, 442, 443,
78895 /* 710 */ 439, 439, 63, 63, 62, 62, 62, 62, 377, 64,
78896 /* 720 */ 64, 64, 64, 65, 65, 66, 66, 66, 67, 212,
78897 /* 730 */ 432, 438, 591, 295, 115, 268, 422, 266, 211, 264,
78898 /* 740 */ 373, 324, 246, 445, 445, 56, 256, 296, 61, 71,
78899 /* 750 */ 301, 442, 443, 439, 439, 63, 63, 62, 62, 62,
78900 /* 760 */ 62, 377, 64, 64, 64, 64, 65, 65, 66, 66,
78901 /* 770 */ 66, 67, 212, 432, 438, 550, 269, 474, 18, 549,
78902 /* 780 */ 280, 309, 343, 380, 171, 160, 256, 268, 5, 268,
78903 /* 790 */ 296, 368, 60, 301, 442, 443, 439, 439, 63, 63,
78904 /* 800 */ 62, 62, 62, 62, 321, 64, 64, 64, 64, 65,
78905 /* 810 */ 65, 66, 66, 66, 67, 212, 432, 438, 403, 10,
78906 /* 820 */ 403, 310, 268, 403, 268, 485, 421, 29, 566, 22,
78907 /* 830 */ 568, 420, 428, 425, 376, 419, 301, 442, 443, 439,
78908 /* 840 */ 439, 63, 63, 62, 62, 62, 62, 321, 64, 64,
78909 /* 850 */ 64, 64, 65, 65, 66, 66, 66, 67, 212, 73,
78910 /* 860 */ 328, 485, 4, 569, 268, 570, 300, 268, 147, 421,
78911 /* 870 */ 24, 321, 359, 321, 325, 73, 328, 491, 4, 455,
78912 /* 880 */ 321, 342, 300, 404, 405, 404, 405, 367, 404, 405,
78913 /* 890 */ 325, 330, 321, 421, 33, 421, 54, 321, 425, 178,
78914 /* 900 */ 229, 458, 421, 53, 321, 227, 321, 330, 228, 478,
78915 /* 910 */ 165, 321, 315, 119, 421, 99, 333, 458, 321, 421,
78916 /* 920 */ 97, 76, 75, 311, 268, 519, 421, 102, 421, 103,
78917 /* 930 */ 74, 319, 320, 421, 108, 427, 467, 76, 75, 490,
78918 /* 940 */ 421, 110, 452, 452, 321, 520, 74, 319, 320, 73,
78919 /* 950 */ 328, 427, 4, 210, 298, 321, 300, 321, 156, 257,
78920 /* 960 */ 321, 210, 185, 182, 325, 284, 421, 17, 429, 429,
78921 /* 970 */ 429, 430, 431, 12, 593, 378, 188, 421, 100, 421,
78922 /* 980 */ 34, 330, 421, 98, 429, 429, 429, 430, 431, 12,
78923 /* 990 */ 475, 458, 422, 162, 480, 321, 422, 306, 231, 232,
78924 /* 1000 */ 233, 105, 484, 632, 476, 321, 486, 447, 321, 23,
78925 /* 1010 */ 422, 76, 75, 594, 207, 178, 286, 421, 25, 254,
78926 /* 1020 */ 74, 319, 320, 287, 321, 427, 321, 421, 55, 321,
78927 /* 1030 */ 421, 111, 321, 471, 321, 205, 515, 557, 511, 363,
78928 /* 1040 */ 472, 204, 321, 516, 206, 321, 421, 112, 421, 113,
78929 /* 1050 */ 321, 421, 26, 321, 421, 37, 421, 38, 429, 429,
78930 /* 1060 */ 429, 430, 431, 12, 421, 27, 521, 421, 39, 321,
78931 /* 1070 */ 298, 158, 421, 40, 255, 421, 41, 321, 483, 321,
78932 /* 1080 */ 173, 523, 321, 182, 321, 522, 321, 384, 283, 273,
78933 /* 1090 */ 321, 421, 43, 297, 534, 321, 476, 321, 210, 421,
78934 /* 1100 */ 44, 421, 45, 321, 421, 30, 421, 31, 421, 46,
78935 /* 1110 */ 508, 509, 421, 47, 259, 321, 182, 421, 48, 421,
78936 /* 1120 */ 49, 321, 358, 390, 182, 421, 32, 321, 261, 518,
78937 /* 1130 */ 517, 553, 561, 182, 173, 412, 191, 421, 11, 562,
78938 /* 1140 */ 573, 92, 92, 421, 51, 590, 263, 294, 265, 421,
78939 /* 1150 */ 52, 267, 272, 371, 146, 374, 375, 275, 276, 277,
78940 /* 1160 */ 565, 575, 285, 288, 289, 587, 470, 451, 236, 453,
78941 /* 1170 */ 329, 244, 473, 514, 251, 524, 560, 163, 401, 572,
78942 /* 1180 */ 426, 525, 282, 528, 409, 7, 410, 411, 385, 318,
78943 /* 1190 */ 85, 237, 338, 526, 84, 336, 353, 58, 80, 215,
78944 /* 1200 */ 170, 468, 121, 86, 341, 348, 305, 501, 506, 124,
78945 /* 1210 */ 511, 222, 360, 423, 252, 186, 512, 510, 221, 223,
78946 /* 1220 */ 238, 507, 239, 535, 240, 292, 424, 529, 536, 537,
78947 /* 1230 */ 293, 543, 187, 189, 245, 362, 482, 488, 247, 190,
78948 /* 1240 */ 364, 89, 545, 192, 117, 370, 132, 556, 563, 195,
78949 /* 1250 */ 382, 383, 314, 133, 134, 571, 138, 135, 136, 584,
78950 /* 1260 */ 589, 585, 142, 399, 101, 413, 220, 586, 270, 104,
78951 /* 1270 */ 141, 633, 634, 166, 167, 441, 444, 72, 460, 448,
78952 /* 1280 */ 457, 546, 143, 157, 6, 461, 14, 479, 169, 462,
78953 /* 1290 */ 93, 466, 82, 122, 13, 174, 487, 96, 123, 161,
78954 /* 1300 */ 494, 495, 87, 125, 126, 116, 258, 88, 127, 184,
78955 /* 1310 */ 250, 361, 219, 107, 544, 145, 128, 193, 365, 118,
78956 /* 1320 */ 352, 357, 173, 271, 130, 9, 316, 559, 197, 90,
78957 /* 1330 */ 547, 131, 129, 15, 199, 551, 564, 200, 567, 201,
78958 /* 1340 */ 139, 137, 582, 91, 16, 106, 140, 208, 574, 392,
78959 /* 1350 */ 396, 290, 148, 596,
78960 };
78961 static const YYCODETYPE yy_lookahead[] = {
78962 /* 0 */ 16, 140, 141, 142, 143, 21, 23, 23, 69, 70,
78963 /* 10 */ 71, 72, 110, 74, 75, 76, 77, 78, 79, 80,
78964 /* 20 */ 81, 82, 83, 84, 1, 2, 42, 43, 73, 74,
78965 /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78966 /* 40 */ 58, 162, 163, 164, 60, 61, 62, 63, 64, 65,
78967 /* 50 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75,
78968 /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
78969 /* 70 */ 88, 88, 88, 84, 92, 22, 219, 220, 221, 222,
78970 /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78971 /* 90 */ 84, 219, 183, 221, 222, 42, 43, 78, 79, 46,
78972 /* 100 */ 78, 79, 80, 81, 82, 83, 84, 125, 126, 127,
78973 /* 110 */ 170, 239, 16, 60, 61, 62, 63, 64, 65, 66,
78974 /* 120 */ 67, 68, 69, 70, 71, 72, 148, 74, 75, 76,
78975 /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
78976 /* 140 */ 44, 80, 81, 82, 83, 84, 23, 148, 170, 171,
78977 /* 150 */ 19, 83, 84, 156, 23, 170, 60, 61, 62, 63,
78978 /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 19,
78979 /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
78980 /* 180 */ 84, 16, 183, 148, 151, 148, 21, 190, 148, 58,
78981 /* 190 */ 169, 213, 157, 158, 186, 187, 218, 23, 177, 202,
78982 /* 200 */ 203, 78, 79, 166, 167, 208, 161, 42, 43, 78,
78983 /* 210 */ 79, 88, 89, 177, 178, 170, 181, 182, 68, 88,
78984 /* 220 */ 184, 98, 99, 92, 16, 60, 61, 62, 63, 64,
78985 /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 22, 74,
78986 /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
78987 /* 250 */ 42, 43, 78, 0, 1, 2, 125, 126, 127, 226,
78988 /* 260 */ 11, 162, 88, 89, 231, 228, 229, 16, 60, 61,
78989 /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
78990 /* 280 */ 72, 148, 74, 75, 76, 77, 78, 79, 80, 81,
78991 /* 290 */ 82, 83, 84, 42, 43, 186, 187, 16, 49, 148,
78992 /* 300 */ 201, 49, 18, 170, 171, 154, 142, 143, 157, 158,
78993 /* 310 */ 182, 60, 61, 62, 63, 64, 65, 66, 67, 68,
78994 /* 320 */ 69, 70, 71, 72, 91, 74, 75, 76, 77, 78,
78995 /* 330 */ 79, 80, 81, 82, 83, 84, 168, 169, 122, 55,
78996 /* 340 */ 132, 16, 16, 110, 16, 177, 20, 20, 99, 100,
78997 /* 350 */ 101, 99, 100, 101, 80, 12, 223, 124, 148, 110,
78998 /* 360 */ 182, 148, 110, 23, 19, 84, 21, 24, 42, 43,
78999 /* 370 */ 148, 90, 91, 92, 93, 94, 95, 96, 94, 166,
79000 /* 380 */ 37, 107, 39, 132, 103, 111, 60, 61, 62, 63,
79001 /* 390 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 189,
79002 /* 400 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
79003 /* 410 */ 84, 16, 84, 156, 92, 20, 23, 92, 134, 91,
79004 /* 420 */ 92, 93, 94, 95, 96, 103, 148, 22, 88, 89,
79005 /* 430 */ 148, 103, 210, 106, 156, 108, 109, 42, 43, 144,
79006 /* 440 */ 145, 228, 229, 219, 149, 221, 222, 190, 170, 171,
79007 /* 450 */ 240, 156, 170, 171, 162, 60, 61, 62, 63, 64,
79008 /* 460 */ 65, 66, 67, 68, 69, 70, 71, 72, 190, 74,
79009 /* 470 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
79010 /* 480 */ 16, 88, 89, 90, 20, 190, 93, 94, 95, 23,
79011 /* 490 */ 131, 213, 133, 201, 212, 90, 218, 104, 93, 94,
79012 /* 500 */ 95, 42, 43, 7, 8, 9, 42, 43, 191, 104,
79013 /* 510 */ 215, 219, 159, 221, 222, 162, 163, 164, 156, 165,
79014 /* 520 */ 166, 167, 63, 64, 60, 61, 62, 63, 64, 65,
79015 /* 530 */ 66, 67, 68, 69, 70, 71, 72, 242, 74, 75,
79016 /* 540 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
79017 /* 550 */ 148, 92, 190, 20, 88, 89, 148, 90, 156, 148,
79018 /* 560 */ 93, 94, 95, 20, 187, 148, 19, 20, 148, 22,
79019 /* 570 */ 19, 104, 170, 171, 23, 42, 43, 148, 170, 171,
79020 /* 580 */ 114, 170, 171, 229, 99, 100, 101, 170, 171, 148,
79021 /* 590 */ 170, 171, 190, 60, 61, 62, 63, 64, 65, 66,
79022 /* 600 */ 67, 68, 69, 70, 71, 72, 59, 74, 75, 76,
79023 /* 610 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 211,
79024 /* 620 */ 212, 12, 148, 21, 213, 165, 166, 167, 21, 148,
79025 /* 630 */ 23, 148, 148, 24, 217, 19, 20, 217, 22, 88,
79026 /* 640 */ 89, 157, 158, 214, 42, 43, 37, 148, 39, 106,
79027 /* 650 */ 148, 108, 109, 170, 171, 20, 146, 183, 49, 156,
79028 /* 660 */ 14, 16, 60, 61, 62, 63, 64, 65, 66, 67,
79029 /* 670 */ 68, 69, 70, 71, 72, 59, 74, 75, 76, 77,
79030 /* 680 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 229,
79031 /* 690 */ 99, 100, 101, 190, 106, 88, 108, 109, 52, 14,
79032 /* 700 */ 54, 148, 156, 162, 16, 60, 61, 62, 63, 64,
79033 /* 710 */ 65, 66, 67, 68, 69, 70, 71, 72, 215, 74,
79034 /* 720 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
79035 /* 730 */ 42, 43, 245, 246, 148, 148, 190, 52, 193, 54,
79036 /* 740 */ 237, 106, 201, 108, 109, 200, 148, 16, 60, 61,
79037 /* 750 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
79038 /* 760 */ 72, 215, 74, 75, 76, 77, 78, 79, 80, 81,
79039 /* 770 */ 82, 83, 84, 42, 43, 25, 189, 22, 232, 29,
79040 /* 780 */ 134, 183, 16, 237, 202, 203, 148, 148, 192, 148,
79041 /* 790 */ 16, 41, 61, 62, 63, 64, 65, 66, 67, 68,
79042 /* 800 */ 69, 70, 71, 72, 148, 74, 75, 76, 77, 78,
79043 /* 810 */ 79, 80, 81, 82, 83, 84, 42, 43, 23, 19,
79044 /* 820 */ 23, 183, 148, 23, 148, 148, 170, 171, 189, 19,
79045 /* 830 */ 189, 107, 148, 23, 148, 111, 62, 63, 64, 65,
79046 /* 840 */ 66, 67, 68, 69, 70, 71, 72, 148, 74, 75,
79047 /* 850 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
79048 /* 860 */ 17, 148, 19, 189, 148, 189, 23, 148, 113, 170,
79049 /* 870 */ 171, 148, 16, 148, 31, 16, 17, 80, 19, 162,
79050 /* 880 */ 148, 115, 23, 88, 89, 88, 89, 210, 88, 89,
79051 /* 890 */ 31, 48, 148, 170, 171, 170, 171, 148, 88, 43,
79052 /* 900 */ 214, 58, 170, 171, 148, 189, 148, 48, 189, 114,
79053 /* 910 */ 19, 148, 243, 244, 170, 171, 148, 58, 148, 170,
79054 /* 920 */ 171, 78, 79, 210, 148, 30, 170, 171, 170, 171,
79055 /* 930 */ 87, 88, 89, 170, 171, 92, 148, 78, 79, 80,
79056 /* 940 */ 170, 171, 125, 126, 148, 50, 87, 88, 89, 16,
79057 /* 950 */ 17, 92, 19, 110, 98, 148, 23, 148, 156, 103,
79058 /* 960 */ 148, 110, 156, 22, 31, 189, 170, 171, 125, 126,
79059 /* 970 */ 127, 128, 129, 130, 20, 124, 156, 170, 171, 170,
79060 /* 980 */ 171, 48, 170, 171, 125, 126, 127, 128, 129, 130,
79061 /* 990 */ 204, 58, 190, 5, 148, 148, 190, 102, 10, 11,
79062 /* 1000 */ 12, 13, 148, 112, 22, 148, 148, 20, 148, 22,
79063 /* 1010 */ 190, 78, 79, 59, 26, 43, 28, 170, 171, 148,
79064 /* 1020 */ 87, 88, 89, 35, 148, 92, 148, 170, 171, 148,
79065 /* 1030 */ 170, 171, 148, 27, 148, 47, 148, 49, 97, 234,
79066 /* 1040 */ 34, 53, 148, 179, 56, 148, 170, 171, 170, 171,
79067 /* 1050 */ 148, 170, 171, 148, 170, 171, 170, 171, 125, 126,
79068 /* 1060 */ 127, 128, 129, 130, 170, 171, 179, 170, 171, 148,
79069 /* 1070 */ 98, 89, 170, 171, 148, 170, 171, 148, 20, 148,
79070 /* 1080 */ 22, 20, 148, 22, 148, 179, 148, 99, 100, 101,
79071 /* 1090 */ 148, 170, 171, 105, 148, 148, 114, 148, 110, 170,
79072 /* 1100 */ 171, 170, 171, 148, 170, 171, 170, 171, 170, 171,
79073 /* 1110 */ 7, 8, 170, 171, 20, 148, 22, 170, 171, 170,
79074 /* 1120 */ 171, 148, 20, 135, 22, 170, 171, 148, 148, 91,
79075 /* 1130 */ 92, 20, 20, 22, 22, 150, 233, 170, 171, 20,
79076 /* 1140 */ 20, 22, 22, 170, 171, 20, 148, 22, 148, 170,
79077 /* 1150 */ 171, 148, 148, 148, 192, 148, 148, 148, 148, 148,
79078 /* 1160 */ 148, 148, 148, 148, 148, 148, 173, 230, 194, 230,
79079 /* 1170 */ 225, 205, 173, 178, 173, 173, 195, 6, 147, 195,
79080 /* 1180 */ 162, 162, 205, 162, 147, 22, 147, 147, 205, 155,
79081 /* 1190 */ 122, 195, 119, 173, 120, 118, 174, 121, 131, 224,
79082 /* 1200 */ 112, 153, 153, 98, 117, 98, 40, 172, 172, 19,
79083 /* 1210 */ 97, 84, 15, 190, 172, 152, 172, 174, 227, 227,
79084 /* 1220 */ 196, 180, 197, 172, 198, 175, 199, 180, 172, 172,
79085 /* 1230 */ 175, 153, 152, 152, 206, 153, 207, 207, 206, 153,
79086 /* 1240 */ 38, 131, 153, 152, 60, 153, 19, 185, 195, 185,
79087 /* 1250 */ 153, 15, 153, 188, 188, 195, 185, 188, 188, 33,
79088 /* 1260 */ 138, 153, 216, 1, 160, 20, 176, 153, 235, 176,
79089 /* 1270 */ 216, 112, 112, 112, 112, 92, 107, 19, 11, 20,
79090 /* 1280 */ 20, 236, 19, 19, 116, 20, 116, 114, 22, 20,
79091 /* 1290 */ 238, 20, 22, 19, 22, 116, 115, 238, 20, 112,
79092 /* 1300 */ 20, 20, 19, 19, 19, 32, 20, 19, 19, 96,
79093 /* 1310 */ 103, 16, 44, 241, 17, 21, 98, 98, 36, 244,
79094 /* 1320 */ 44, 44, 22, 134, 19, 5, 247, 1, 123, 68,
79095 /* 1330 */ 51, 102, 45, 19, 113, 45, 1, 14, 17, 117,
79096 /* 1340 */ 102, 113, 20, 68, 19, 14, 123, 136, 124, 57,
79097 /* 1350 */ 3, 137, 19, 4,
79098 };
79099 #define YY_SHIFT_USE_DFLT (-99)
79100 #define YY_SHIFT_MAX 396
79101 static const short yy_shift_ofst[] = {
79102 /* 0 */ 23, 843, 988, -16, 843, 933, 933, 393, 123, 252,
79103 /* 10 */ -98, 96, 933, 933, 933, 933, 933, -45, 249, 174,
79104 /* 20 */ 340, -17, 19, 19, 53, 165, 208, 251, 326, 395,
79105 /* 30 */ 464, 533, 602, 645, 688, 645, 645, 645, 645, 645,
79106 /* 40 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
79107 /* 50 */ 645, 645, 645, 731, 774, 774, 859, 933, 933, 933,
79108 /* 60 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79109 /* 70 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79110 /* 80 */ 933, 933, 933, 933, 933, 933, 933, 933, 933, 933,
79111 /* 90 */ 933, 933, 933, 933, 933, 933, 933, -61, -61, 6,
79112 /* 100 */ 6, 281, 22, 61, 856, 284, 340, 340, 68, -17,
79113 /* 110 */ -11, -99, -99, -99, 131, 328, 609, 609, 547, 616,
79114 /* 120 */ 253, 607, 340, 607, 340, 340, 340, 340, 340, 340,
79115 /* 130 */ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
79116 /* 140 */ 340, 233, 851, -98, -98, -98, -99, -99, -99, -18,
79117 /* 150 */ -18, 405, 467, 327, 551, 543, 635, 343, 466, 795,
79118 /* 160 */ 800, 797, 496, 340, 340, 274, 340, 340, 810, 340,
79119 /* 170 */ 340, 982, 340, 340, 340, 588, 982, 340, 340, 895,
79120 /* 180 */ 895, 895, 340, 340, 340, 588, 340, 340, 588, 340,
79121 /* 190 */ 750, 485, 340, 340, 588, 340, 340, 340, 588, 340,
79122 /* 200 */ 340, 340, 588, 588, 340, 340, 340, 340, 340, 345,
79123 /* 210 */ 724, 755, -17, 817, 817, 359, 1006, 1006, 766, 1006,
79124 /* 220 */ 972, 1006, -17, 1006, -17, 941, 216, 766, 766, 216,
79125 /* 230 */ 1171, 1171, 1171, 1171, 1163, -98, 1068, 1073, 1074, 1077,
79126 /* 240 */ 1076, 1067, 1088, 1088, 1105, 1087, 1105, 1087, 1107, 1107,
79127 /* 250 */ 1166, 1107, 1113, 1107, 1190, 1127, 1127, 1166, 1107, 1107,
79128 /* 260 */ 1107, 1190, 1197, 1088, 1197, 1088, 1197, 1088, 1088, 1202,
79129 /* 270 */ 1110, 1197, 1088, 1184, 1184, 1227, 1068, 1088, 1236, 1236,
79130 /* 280 */ 1236, 1236, 1068, 1184, 1227, 1088, 1226, 1226, 1088, 1088,
79131 /* 290 */ 1122, -99, -99, -99, -99, -99, 459, 646, 591, 685,
79132 /* 300 */ 891, 325, 987, 1058, 322, 1103, 1038, 1061, 1094, 1102,
79133 /* 310 */ 1111, 1112, 1119, 1120, 150, 1125, 954, 1262, 1245, 1159,
79134 /* 320 */ 1160, 1161, 1162, 1183, 1169, 1258, 1259, 1260, 1263, 1267,
79135 /* 330 */ 1264, 1265, 1266, 1269, 1271, 1270, 1168, 1272, 1170, 1270,
79136 /* 340 */ 1173, 1274, 1179, 1181, 1278, 1187, 1280, 1281, 1273, 1268,
79137 /* 350 */ 1283, 1276, 1284, 1286, 1285, 1288, 1277, 1289, 1213, 1207,
79138 /* 360 */ 1295, 1297, 1294, 1218, 1282, 1279, 1287, 1300, 1290, 1189,
79139 /* 370 */ 1219, 1305, 1320, 1326, 1229, 1261, 1275, 1205, 1314, 1221,
79140 /* 380 */ 1335, 1323, 1222, 1321, 1228, 1238, 1223, 1325, 1224, 1322,
79141 /* 390 */ 1331, 1292, 1211, 1214, 1333, 1347, 1349,
79142 };
79143 #define YY_REDUCE_USE_DFLT (-144)
79144 #define YY_REDUCE_MAX 295
79145 static const short yy_reduce_ofst[] = {
79146 /* 0 */ -139, 278, 295, 292, 402, -22, 408, 35, 37, 546,
79147 /* 10 */ -3, -128, 133, 282, 411, 417, 420, -143, 503, 213,
79148 /* 20 */ 151, 353, 354, 460, 224, 224, 224, 224, 224, 224,
79149 /* 30 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
79150 /* 40 */ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224,
79151 /* 50 */ 224, 224, 224, 224, 224, 224, 483, 656, 699, 723,
79152 /* 60 */ 725, 732, 744, 749, 756, 758, 763, 770, 796, 807,
79153 /* 70 */ 809, 812, 847, 857, 860, 876, 878, 881, 884, 886,
79154 /* 80 */ 894, 897, 902, 905, 921, 929, 931, 934, 936, 938,
79155 /* 90 */ 942, 947, 949, 955, 967, 973, 979, 224, 224, 224,
79156 /* 100 */ 224, 168, 224, 224, 36, 33, 210, 484, 224, -121,
79157 /* 110 */ 224, 224, 224, 224, 45, 21, 8, 109, 487, 487,
79158 /* 120 */ 164, 99, 222, 541, -91, -1, 474, 598, 587, 677,
79159 /* 130 */ 638, 429, 713, 639, 641, 674, 676, 716, 719, 686,
79160 /* 140 */ 776, 257, 362, 802, 806, 820, 545, 582, 669, -60,
79161 /* 150 */ -15, 128, 178, 317, 40, 317, 317, 377, 441, 481,
79162 /* 160 */ 499, 502, 510, 553, 586, 596, 502, 684, 717, 768,
79163 /* 170 */ 788, 786, 846, 854, 858, 317, 786, 871, 888, 864,
79164 /* 180 */ 887, 906, 926, 946, 980, 317, 998, 1000, 317, 1003,
79165 /* 190 */ 903, 805, 1004, 1005, 317, 1007, 1008, 1009, 317, 1010,
79166 /* 200 */ 1011, 1012, 317, 317, 1013, 1014, 1015, 1016, 1017, 985,
79167 /* 210 */ 962, 974, 1018, 937, 939, 945, 993, 999, 966, 1001,
79168 /* 220 */ 995, 1002, 1019, 1020, 1021, 1022, 981, 977, 983, 984,
79169 /* 230 */ 1031, 1037, 1039, 1040, 1034, 1023, 996, 1024, 1025, 1026,
79170 /* 240 */ 1027, 975, 1048, 1049, 1028, 1029, 1032, 1030, 1035, 1036,
79171 /* 250 */ 1041, 1042, 1043, 1044, 1050, 991, 992, 1047, 1051, 1056,
79172 /* 260 */ 1057, 1055, 1063, 1078, 1080, 1082, 1081, 1086, 1089, 1033,
79173 /* 270 */ 1045, 1091, 1092, 1062, 1064, 1046, 1053, 1097, 1065, 1066,
79174 /* 280 */ 1069, 1070, 1060, 1071, 1054, 1099, 1052, 1059, 1108, 1114,
79175 /* 290 */ 1072, 1104, 1090, 1093, 1075, 1079,
79176 };
79177 static const YYACTIONTYPE yy_default[] = {
79178 /* 0 */ 603, 832, 913, 719, 913, 832, 913, 913, 859, 913,
79179 /* 10 */ 723, 888, 830, 913, 913, 913, 913, 804, 913, 859,
79180 /* 20 */ 913, 635, 859, 859, 755, 913, 913, 913, 913, 913,
79181 /* 30 */ 913, 913, 913, 756, 913, 834, 829, 825, 827, 826,
79182 /* 40 */ 833, 757, 746, 753, 760, 735, 872, 762, 763, 769,
79183 /* 50 */ 770, 889, 887, 792, 791, 810, 913, 913, 913, 913,
79184 /* 60 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79185 /* 70 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79186 /* 80 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79187 /* 90 */ 913, 913, 913, 913, 913, 913, 913, 794, 816, 793,
79188 /* 100 */ 803, 628, 795, 796, 688, 623, 913, 913, 797, 913,
79189 /* 110 */ 798, 811, 812, 813, 913, 913, 913, 913, 913, 913,
79190 /* 120 */ 603, 719, 913, 719, 913, 913, 913, 913, 913, 913,
79191 /* 130 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79192 /* 140 */ 913, 913, 913, 913, 913, 913, 713, 723, 906, 913,
79193 /* 150 */ 913, 679, 913, 913, 913, 913, 913, 913, 913, 913,
79194 /* 160 */ 913, 913, 611, 609, 913, 711, 913, 913, 637, 913,
79195 /* 170 */ 913, 721, 913, 913, 913, 726, 727, 913, 913, 913,
79196 /* 180 */ 913, 913, 913, 913, 913, 625, 913, 913, 700, 913,
79197 /* 190 */ 865, 913, 913, 913, 879, 913, 913, 913, 877, 913,
79198 /* 200 */ 913, 913, 702, 765, 845, 913, 892, 894, 913, 913,
79199 /* 210 */ 711, 720, 913, 913, 913, 828, 749, 749, 737, 749,
79200 /* 220 */ 658, 749, 913, 749, 913, 661, 759, 737, 737, 759,
79201 /* 230 */ 608, 608, 608, 608, 678, 913, 759, 750, 752, 742,
79202 /* 240 */ 754, 913, 728, 728, 736, 741, 736, 741, 690, 690,
79203 /* 250 */ 675, 690, 661, 690, 838, 842, 842, 675, 690, 690,
79204 /* 260 */ 690, 838, 620, 728, 620, 728, 620, 728, 728, 869,
79205 /* 270 */ 871, 620, 728, 692, 692, 771, 759, 728, 699, 699,
79206 /* 280 */ 699, 699, 759, 692, 771, 728, 891, 891, 728, 728,
79207 /* 290 */ 899, 645, 663, 663, 906, 911, 913, 913, 913, 913,
79208 /* 300 */ 778, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79209 /* 310 */ 913, 913, 913, 913, 852, 913, 913, 913, 913, 783,
79210 /* 320 */ 779, 913, 780, 913, 705, 913, 913, 913, 913, 913,
79211 /* 330 */ 913, 913, 913, 913, 913, 831, 913, 743, 913, 751,
79212 /* 340 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79213 /* 350 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79214 /* 360 */ 913, 913, 913, 913, 913, 913, 867, 868, 913, 913,
79215 /* 370 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79216 /* 380 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913,
79217 /* 390 */ 913, 898, 913, 913, 901, 604, 913, 599, 601, 602,
79218 /* 400 */ 606, 607, 610, 632, 633, 634, 612, 613, 614, 615,
79219 /* 410 */ 616, 617, 618, 624, 626, 644, 646, 630, 648, 709,
79220 /* 420 */ 710, 775, 703, 704, 708, 631, 786, 777, 781, 782,
79221 /* 430 */ 784, 785, 799, 800, 802, 808, 815, 818, 801, 806,
79222 /* 440 */ 807, 809, 814, 817, 706, 707, 821, 638, 639, 642,
79223 /* 450 */ 643, 855, 857, 856, 858, 641, 640, 787, 790, 823,
79224 /* 460 */ 824, 880, 881, 882, 883, 884, 819, 729, 822, 805,
79225 /* 470 */ 744, 747, 748, 745, 712, 722, 731, 732, 733, 734,
79226 /* 480 */ 717, 718, 724, 740, 773, 774, 738, 739, 725, 714,
79227 /* 490 */ 715, 716, 820, 776, 788, 789, 649, 650, 783, 651,
79228 /* 500 */ 652, 653, 691, 694, 695, 696, 654, 673, 676, 677,
79229 /* 510 */ 655, 662, 656, 657, 664, 665, 666, 669, 670, 671,
79230 /* 520 */ 672, 667, 668, 839, 840, 843, 841, 659, 660, 674,
79231 /* 530 */ 647, 636, 629, 680, 683, 684, 685, 686, 687, 689,
79232 /* 540 */ 681, 682, 627, 619, 621, 730, 861, 870, 866, 862,
79233 /* 550 */ 863, 864, 622, 835, 836, 693, 767, 768, 860, 873,
79234 /* 560 */ 875, 772, 876, 878, 874, 903, 697, 698, 701, 844,
79235 /* 570 */ 885, 758, 761, 764, 766, 846, 847, 848, 849, 850,
79236 /* 580 */ 853, 854, 851, 886, 890, 893, 895, 896, 897, 900,
79237 /* 590 */ 902, 907, 908, 909, 912, 910, 605, 600,
79238 };
79239 #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
79240
79241 /* The next table maps tokens into fallback tokens. If a construct
79242 ** like the following:
@@ -81856,40 +81911,40 @@
81911 "WHENWHEREPLACEAFTERESTRICTANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMIT"
81912 "CONFLICTCROSSCURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAILFROM"
81913 "FULLGLOBYIFINTOFFSETISNULLORDERIGHTOUTEROLLBACKROWUNIONUSINGVACUUM"
81914 "VIEWINITIALLY";
81915 static const unsigned char aHash[127] = {
81916 65, 94, 110, 63, 0, 44, 0, 0, 71, 0, 66, 0, 0,
81917 104, 12, 67, 15, 0, 108, 74, 105, 101, 0, 19, 0, 0,
81918 114, 0, 112, 78, 0, 22, 82, 0, 9, 0, 0, 59, 60,
81919 0, 58, 6, 0, 39, 79, 91, 0, 111, 90, 0, 0, 45,
81920 0, 92, 24, 0, 17, 0, 115, 40, 23, 0, 5, 99, 25,
81921 85, 0, 0, 117, 95, 50, 116, 47, 7, 42, 0, 80, 0,
81922 89, 26, 0, 88, 0, 0, 0, 84, 81, 86, 77, 98, 14,
81923 34, 97, 0, 70, 0, 18, 76, 100, 31, 0, 113, 69, 106,
81924 52, 46, 73, 0, 0, 83, 102, 0, 109, 0, 35, 0, 0,
81925 28, 0, 75, 48, 53, 0, 20, 51, 0, 43,
81926 };
81927 static const unsigned char aNext[117] = {
81928 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
81929 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
81930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81931 0, 0, 3, 38, 0, 32, 21, 0, 0, 0, 0, 29, 0,
81932 0, 37, 0, 0, 0, 1, 55, 0, 0, 56, 0, 0, 0,
81933 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 30, 0,
81934 16, 33, 10, 0, 0, 0, 0, 0, 0, 0, 11, 61, 68,
81935 0, 8, 0, 93, 87, 0, 96, 0, 49, 0, 0, 64, 0,
81936 41, 103, 0, 27, 107, 36, 62, 72, 0, 0, 57, 0, 0,
81937 };
81938 static const unsigned char aLen[117] = {
81939 7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
81940 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6,
81941 11, 2, 7, 5, 5, 9, 6, 10, 9, 7, 10, 6, 5,
81942 6, 6, 5, 6, 4, 9, 2, 5, 5, 6, 7, 7, 3,
81943 4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6,
81944 5, 4, 7, 6, 5, 6, 7, 5, 4, 5, 7, 5, 8,
81945 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7,
81946 8, 8, 2, 4, 4, 4, 4, 4, 2, 2, 4, 6, 2,
81947 3, 6, 5, 5, 5, 8, 3, 5, 5, 6, 4, 9, 3,
81948 };
81949 static const unsigned short int aOffset[117] = {
81950 0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
@@ -81911,11 +81966,11 @@
81966 TK_EXCEPT, TK_TRANSACTION,TK_ON, TK_JOIN_KW, TK_ALTER,
81967 TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, TK_INTERSECT,
81968 TK_TRIGGER, TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_ATTACH,
81969 TK_HAVING, TK_GROUP, TK_UPDATE, TK_TEMP, TK_TEMP,
81970 TK_OR, TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN,
81971 TK_NOTNULL, TK_NOT, TK_NULL, TK_LIKE_KW, TK_CASCADE,
81972 TK_ASC, TK_DELETE, TK_CASE, TK_COLLATE, TK_CREATE,
81973 TK_CTIME_KW, TK_DETACH, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
81974 TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT,
81975 TK_VALUES, TK_VIRTUAL, TK_LIMIT, TK_WHEN, TK_WHERE,
81976 TK_REPLACE, TK_AFTER, TK_RESTRICT, TK_AND, TK_DEFAULT,
@@ -82690,11 +82745,11 @@
82745 ** Main file for the SQLite library. The routines in this file
82746 ** implement the programmer interface to the library. Routines in
82747 ** other files are for internal use by SQLite and should not be
82748 ** accessed by users of the library.
82749 **
82750 ** $Id: main.c,v 1.510 2008/11/04 13:46:28 drh Exp $
82751 */
82752
82753 #ifdef SQLITE_ENABLE_FTS3
82754 /************** Include fts3.h in the middle of main.c ***********************/
82755 /************** Begin file fts3.h ********************************************/
@@ -83176,10 +83231,17 @@
83231 db->lookaside.pEnd = 0;
83232 db->lookaside.bEnabled = 0;
83233 }
83234 return SQLITE_OK;
83235 }
83236
83237 /*
83238 ** Return the mutex associated with a database connection.
83239 */
83240 SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
83241 return db->mutex;
83242 }
83243
83244 /*
83245 ** Configuration settings for an individual database connection
83246 */
83247 SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
83248
+28 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -28,11 +28,11 @@
2828
** The name of this file under configuration management is "sqlite.h.in".
2929
** The makefile makes some minor changes to this file (such as inserting
3030
** the version number) and changes its name to "sqlite3.h" as
3131
** part of the build process.
3232
**
33
-** @(#) $Id: sqlite.h.in,v 1.406 2008/10/30 15:03:16 drh Exp $
33
+** @(#) $Id: sqlite.h.in,v 1.409 2008/11/07 00:06:18 drh Exp $
3434
*/
3535
#ifndef _SQLITE3_H_
3636
#define _SQLITE3_H_
3737
#include <stdarg.h> /* Needed for the definition of va_list */
3838
@@ -680,10 +680,16 @@
680680
** that when data is appended to a file, the data is appended
681681
** first then the size of the file is extended, never the other
682682
** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
683683
** information is written to disk in the same order as calls
684684
** to xWrite().
685
+**
686
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
687
+** in the unread portions of the buffer with zeros. A VFS that
688
+** fails to zero-fill short reads might seem to work. However,
689
+** failure to zero-fill short reads will eventually lead to
690
+** database corruption.
685691
*/
686692
typedef struct sqlite3_io_methods sqlite3_io_methods;
687693
struct sqlite3_io_methods {
688694
int iVersion;
689695
int (*xClose)(sqlite3_file*);
@@ -2669,10 +2675,20 @@
26692675
** text that describes the error, as either UTF-8 or UTF-16 respectively.
26702676
** Memory to hold the error message string is managed internally.
26712677
** The application does not need to worry about freeing the result.
26722678
** However, the error string might be overwritten or deallocated by
26732679
** subsequent calls to other SQLite interface functions.
2680
+**
2681
+** When the serialized [threading mode] is in use, it might be the
2682
+** case that a second error occurs on a separate thread in between
2683
+** the time of the first error and the call to these interfaces.
2684
+** When that happens, the second error will be reported since these
2685
+** interfaces always report the most recent result. To avoid
2686
+** this, each thread can obtain exclusive use of the [database connection] D
2687
+** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
2688
+** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
2689
+** all calls to the interfaces listed here are completed.
26742690
**
26752691
** If an interface fails with SQLITE_MISUSE, that means the interface
26762692
** was invoked incorrectly by the application. In that case, the
26772693
** error code and message may or may not be set.
26782694
**
@@ -6257,10 +6273,21 @@
62576273
#define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
62586274
#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
62596275
#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
62606276
#define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
62616277
6278
+/*
6279
+** CAPI3REF: Retrieve the mutex for a database connection {H17002} <H17000>
6280
+**
6281
+** This interface returns a pointer the [sqlite3_mutex] object that
6282
+** serializes access to the [database connection] given in the argument
6283
+** when the [threading mode] is Serialized.
6284
+** If the [threading mode] is Single-thread or Multi-thread then this
6285
+** routine returns a NULL pointer.
6286
+*/
6287
+sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6288
+
62626289
/*
62636290
** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
62646291
**
62656292
** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
62666293
** xFileControl method for the [sqlite3_io_methods] object associated
62676294
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -28,11 +28,11 @@
28 ** The name of this file under configuration management is "sqlite.h.in".
29 ** The makefile makes some minor changes to this file (such as inserting
30 ** the version number) and changes its name to "sqlite3.h" as
31 ** part of the build process.
32 **
33 ** @(#) $Id: sqlite.h.in,v 1.406 2008/10/30 15:03:16 drh Exp $
34 */
35 #ifndef _SQLITE3_H_
36 #define _SQLITE3_H_
37 #include <stdarg.h> /* Needed for the definition of va_list */
38
@@ -680,10 +680,16 @@
680 ** that when data is appended to a file, the data is appended
681 ** first then the size of the file is extended, never the other
682 ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
683 ** information is written to disk in the same order as calls
684 ** to xWrite().
 
 
 
 
 
 
685 */
686 typedef struct sqlite3_io_methods sqlite3_io_methods;
687 struct sqlite3_io_methods {
688 int iVersion;
689 int (*xClose)(sqlite3_file*);
@@ -2669,10 +2675,20 @@
2669 ** text that describes the error, as either UTF-8 or UTF-16 respectively.
2670 ** Memory to hold the error message string is managed internally.
2671 ** The application does not need to worry about freeing the result.
2672 ** However, the error string might be overwritten or deallocated by
2673 ** subsequent calls to other SQLite interface functions.
 
 
 
 
 
 
 
 
 
 
2674 **
2675 ** If an interface fails with SQLITE_MISUSE, that means the interface
2676 ** was invoked incorrectly by the application. In that case, the
2677 ** error code and message may or may not be set.
2678 **
@@ -6257,10 +6273,21 @@
6257 #define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
6258 #define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
6259 #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
6260 #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
6261
 
 
 
 
 
 
 
 
 
 
 
6262 /*
6263 ** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
6264 **
6265 ** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
6266 ** xFileControl method for the [sqlite3_io_methods] object associated
6267
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -28,11 +28,11 @@
28 ** The name of this file under configuration management is "sqlite.h.in".
29 ** The makefile makes some minor changes to this file (such as inserting
30 ** the version number) and changes its name to "sqlite3.h" as
31 ** part of the build process.
32 **
33 ** @(#) $Id: sqlite.h.in,v 1.409 2008/11/07 00:06:18 drh Exp $
34 */
35 #ifndef _SQLITE3_H_
36 #define _SQLITE3_H_
37 #include <stdarg.h> /* Needed for the definition of va_list */
38
@@ -680,10 +680,16 @@
680 ** that when data is appended to a file, the data is appended
681 ** first then the size of the file is extended, never the other
682 ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
683 ** information is written to disk in the same order as calls
684 ** to xWrite().
685 **
686 ** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
687 ** in the unread portions of the buffer with zeros. A VFS that
688 ** fails to zero-fill short reads might seem to work. However,
689 ** failure to zero-fill short reads will eventually lead to
690 ** database corruption.
691 */
692 typedef struct sqlite3_io_methods sqlite3_io_methods;
693 struct sqlite3_io_methods {
694 int iVersion;
695 int (*xClose)(sqlite3_file*);
@@ -2669,10 +2675,20 @@
2675 ** text that describes the error, as either UTF-8 or UTF-16 respectively.
2676 ** Memory to hold the error message string is managed internally.
2677 ** The application does not need to worry about freeing the result.
2678 ** However, the error string might be overwritten or deallocated by
2679 ** subsequent calls to other SQLite interface functions.
2680 **
2681 ** When the serialized [threading mode] is in use, it might be the
2682 ** case that a second error occurs on a separate thread in between
2683 ** the time of the first error and the call to these interfaces.
2684 ** When that happens, the second error will be reported since these
2685 ** interfaces always report the most recent result. To avoid
2686 ** this, each thread can obtain exclusive use of the [database connection] D
2687 ** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
2688 ** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
2689 ** all calls to the interfaces listed here are completed.
2690 **
2691 ** If an interface fails with SQLITE_MISUSE, that means the interface
2692 ** was invoked incorrectly by the application. In that case, the
2693 ** error code and message may or may not be set.
2694 **
@@ -6257,10 +6273,21 @@
6273 #define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */
6274 #define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */
6275 #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
6276 #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */
6277
6278 /*
6279 ** CAPI3REF: Retrieve the mutex for a database connection {H17002} <H17000>
6280 **
6281 ** This interface returns a pointer the [sqlite3_mutex] object that
6282 ** serializes access to the [database connection] given in the argument
6283 ** when the [threading mode] is Serialized.
6284 ** If the [threading mode] is Single-thread or Multi-thread then this
6285 ** routine returns a NULL pointer.
6286 */
6287 sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
6288
6289 /*
6290 ** CAPI3REF: Low-Level Control Of Database Files {H11300} <S30800>
6291 **
6292 ** {H11301} The [sqlite3_file_control()] interface makes a direct call to the
6293 ** xFileControl method for the [sqlite3_io_methods] object associated
6294

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button