Fossil SCM
Update SQLite the latest 3.8.0 beta, hopefully fixing an alignment problem on sparc.
Commit
01196ad38c480884ea80fafc8916d5284278f353
Parent
6593c1560afb393…
2 files changed
+26
-16
+24
-15
+26
-16
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -670,11 +670,11 @@ | ||
| 670 | 670 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 671 | 671 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 672 | 672 | */ |
| 673 | 673 | #define SQLITE_VERSION "3.8.0" |
| 674 | 674 | #define SQLITE_VERSION_NUMBER 3008000 |
| 675 | -#define SQLITE_SOURCE_ID "2013-07-17 11:54:47 64bf8148b84e0ebb45c12b629f49bc9b316aceba" | |
| 675 | +#define SQLITE_SOURCE_ID "2013-07-18 14:50:56 5dcffa671f592ae9355628afa439ae9a2d26f0cd" | |
| 676 | 676 | |
| 677 | 677 | /* |
| 678 | 678 | ** CAPI3REF: Run-Time Library Version Numbers |
| 679 | 679 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 680 | 680 | ** |
| @@ -4745,12 +4745,12 @@ | ||
| 4745 | 4745 | ** CAPI3REF: Function Auxiliary Data |
| 4746 | 4746 | ** |
| 4747 | 4747 | ** The following two functions may be used by scalar SQL functions to |
| 4748 | 4748 | ** associate metadata with argument values. If the same value is passed to |
| 4749 | 4749 | ** multiple invocations of the same SQL function during query execution, under |
| 4750 | -** some circumstances the associated metadata may be preserved. This may | |
| 4751 | -** be used, for example, to add a regular-expression matching scalar | |
| 4750 | +** some circumstances the associated metadata may be preserved. This might | |
| 4751 | +** be used, for example, in a regular-expression matching | |
| 4752 | 4752 | ** function. The compiled version of the regular expression is stored as |
| 4753 | 4753 | ** metadata associated with the SQL value passed as the regular expression |
| 4754 | 4754 | ** pattern. The compiled regular expression can be reused on multiple |
| 4755 | 4755 | ** invocations of the same function so that the original pattern string |
| 4756 | 4756 | ** does not need to be recompiled on each invocation. |
| @@ -4760,27 +4760,36 @@ | ||
| 4760 | 4760 | ** value to the application-defined function. ^If no metadata has been ever |
| 4761 | 4761 | ** been set for the Nth argument of the function, or if the corresponding |
| 4762 | 4762 | ** function parameter has changed since the meta-data was set, |
| 4763 | 4763 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4764 | 4764 | ** |
| 4765 | -** ^The sqlite3_set_auxdata() interface saves the metadata | |
| 4766 | -** pointed to by its 3rd parameter as the metadata for the N-th | |
| 4767 | -** argument of the application-defined function. Subsequent | |
| 4768 | -** calls to sqlite3_get_auxdata() might return this data, if it has | |
| 4769 | -** not been destroyed. | |
| 4770 | -** ^If it is not NULL, SQLite will invoke the destructor | |
| 4771 | -** function given by the 4th parameter to sqlite3_set_auxdata() on | |
| 4772 | -** the metadata when the corresponding function parameter changes | |
| 4773 | -** or when the SQL statement completes, whichever comes first. | |
| 4765 | +** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th | |
| 4766 | +** argument of the application-defined function. ^Subsequent | |
| 4767 | +** calls to sqlite3_get_auxdata(C,N) return P from the most recent | |
| 4768 | +** sqlite3_set_auxdata(C,N,P,X) call if the data has not been dropped, or | |
| 4769 | +** NULL if the data has been dropped. | |
| 4770 | +** ^(If it is not NULL, SQLite will invoke the destructor | |
| 4771 | +** function X passed to sqlite3_set_auxdata(C,N,P,X) when <ul> | |
| 4772 | +** <li> the corresponding function parameter changes, | |
| 4773 | +** <li> [sqlite3_reset()] or [sqlite3_finalize()] is called for the | |
| 4774 | +** SQL statement, | |
| 4775 | +** <li> sqlite3_set_auxdata() is invoked again on the same parameter, or | |
| 4776 | +** <li> a memory allocation error occurs. </ul>)^ | |
| 4774 | 4777 | ** |
| 4775 | 4778 | ** SQLite is free to call the destructor and drop metadata on any |
| 4776 | 4779 | ** parameter of any function at any time. ^The only guarantee is that |
| 4777 | -** the destructor will be called before the metadata is dropped. | |
| 4780 | +** the destructor will be called when the [prepared statement] is destroyed. | |
| 4781 | +** Note in particular that the destructor X in the call to | |
| 4782 | +** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before | |
| 4783 | +** the sqlite3_set_auxdata() call even returns. Hence sqlite3_set_auxdata() | |
| 4784 | +** should be called near the end of the function implementation and the | |
| 4785 | +** implementation should not make any use of P after sqlite3_set_auxdata() | |
| 4786 | +** has been called. | |
| 4778 | 4787 | ** |
| 4779 | 4788 | ** ^(In practice, metadata is preserved between function calls for |
| 4780 | -** expressions that are constant at compile time. This includes literal | |
| 4781 | -** values and [parameters].)^ | |
| 4789 | +** function parameters that are compile-time constants, including literal | |
| 4790 | +** values and [parameters] and expressions composed from the same.)^ | |
| 4782 | 4791 | ** |
| 4783 | 4792 | ** These routines must be called from the same thread in which |
| 4784 | 4793 | ** the SQL function is running. |
| 4785 | 4794 | */ |
| 4786 | 4795 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| @@ -110176,11 +110185,12 @@ | ||
| 110176 | 110185 | pWInfo->wctrlFlags = wctrlFlags; |
| 110177 | 110186 | pWInfo->savedNQueryLoop = pParse->nQueryLoop; |
| 110178 | 110187 | pMaskSet = &pWInfo->sMaskSet; |
| 110179 | 110188 | sWLB.pWInfo = pWInfo; |
| 110180 | 110189 | sWLB.pWC = &pWInfo->sWC; |
| 110181 | - sWLB.pNew = (WhereLoop*)&pWInfo->a[nTabList]; | |
| 110190 | + sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo); | |
| 110191 | + assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) ); | |
| 110182 | 110192 | whereLoopInit(sWLB.pNew); |
| 110183 | 110193 | #ifdef SQLITE_DEBUG |
| 110184 | 110194 | sWLB.pNew->cId = '*'; |
| 110185 | 110195 | #endif |
| 110186 | 110196 | |
| 110187 | 110197 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -670,11 +670,11 @@ | |
| 670 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 671 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 672 | */ |
| 673 | #define SQLITE_VERSION "3.8.0" |
| 674 | #define SQLITE_VERSION_NUMBER 3008000 |
| 675 | #define SQLITE_SOURCE_ID "2013-07-17 11:54:47 64bf8148b84e0ebb45c12b629f49bc9b316aceba" |
| 676 | |
| 677 | /* |
| 678 | ** CAPI3REF: Run-Time Library Version Numbers |
| 679 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 680 | ** |
| @@ -4745,12 +4745,12 @@ | |
| 4745 | ** CAPI3REF: Function Auxiliary Data |
| 4746 | ** |
| 4747 | ** The following two functions may be used by scalar SQL functions to |
| 4748 | ** associate metadata with argument values. If the same value is passed to |
| 4749 | ** multiple invocations of the same SQL function during query execution, under |
| 4750 | ** some circumstances the associated metadata may be preserved. This may |
| 4751 | ** be used, for example, to add a regular-expression matching scalar |
| 4752 | ** function. The compiled version of the regular expression is stored as |
| 4753 | ** metadata associated with the SQL value passed as the regular expression |
| 4754 | ** pattern. The compiled regular expression can be reused on multiple |
| 4755 | ** invocations of the same function so that the original pattern string |
| 4756 | ** does not need to be recompiled on each invocation. |
| @@ -4760,27 +4760,36 @@ | |
| 4760 | ** value to the application-defined function. ^If no metadata has been ever |
| 4761 | ** been set for the Nth argument of the function, or if the corresponding |
| 4762 | ** function parameter has changed since the meta-data was set, |
| 4763 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4764 | ** |
| 4765 | ** ^The sqlite3_set_auxdata() interface saves the metadata |
| 4766 | ** pointed to by its 3rd parameter as the metadata for the N-th |
| 4767 | ** argument of the application-defined function. Subsequent |
| 4768 | ** calls to sqlite3_get_auxdata() might return this data, if it has |
| 4769 | ** not been destroyed. |
| 4770 | ** ^If it is not NULL, SQLite will invoke the destructor |
| 4771 | ** function given by the 4th parameter to sqlite3_set_auxdata() on |
| 4772 | ** the metadata when the corresponding function parameter changes |
| 4773 | ** or when the SQL statement completes, whichever comes first. |
| 4774 | ** |
| 4775 | ** SQLite is free to call the destructor and drop metadata on any |
| 4776 | ** parameter of any function at any time. ^The only guarantee is that |
| 4777 | ** the destructor will be called before the metadata is dropped. |
| 4778 | ** |
| 4779 | ** ^(In practice, metadata is preserved between function calls for |
| 4780 | ** expressions that are constant at compile time. This includes literal |
| 4781 | ** values and [parameters].)^ |
| 4782 | ** |
| 4783 | ** These routines must be called from the same thread in which |
| 4784 | ** the SQL function is running. |
| 4785 | */ |
| 4786 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| @@ -110176,11 +110185,12 @@ | |
| 110176 | pWInfo->wctrlFlags = wctrlFlags; |
| 110177 | pWInfo->savedNQueryLoop = pParse->nQueryLoop; |
| 110178 | pMaskSet = &pWInfo->sMaskSet; |
| 110179 | sWLB.pWInfo = pWInfo; |
| 110180 | sWLB.pWC = &pWInfo->sWC; |
| 110181 | sWLB.pNew = (WhereLoop*)&pWInfo->a[nTabList]; |
| 110182 | whereLoopInit(sWLB.pNew); |
| 110183 | #ifdef SQLITE_DEBUG |
| 110184 | sWLB.pNew->cId = '*'; |
| 110185 | #endif |
| 110186 | |
| 110187 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -670,11 +670,11 @@ | |
| 670 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 671 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 672 | */ |
| 673 | #define SQLITE_VERSION "3.8.0" |
| 674 | #define SQLITE_VERSION_NUMBER 3008000 |
| 675 | #define SQLITE_SOURCE_ID "2013-07-18 14:50:56 5dcffa671f592ae9355628afa439ae9a2d26f0cd" |
| 676 | |
| 677 | /* |
| 678 | ** CAPI3REF: Run-Time Library Version Numbers |
| 679 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 680 | ** |
| @@ -4745,12 +4745,12 @@ | |
| 4745 | ** CAPI3REF: Function Auxiliary Data |
| 4746 | ** |
| 4747 | ** The following two functions may be used by scalar SQL functions to |
| 4748 | ** associate metadata with argument values. If the same value is passed to |
| 4749 | ** multiple invocations of the same SQL function during query execution, under |
| 4750 | ** some circumstances the associated metadata may be preserved. This might |
| 4751 | ** be used, for example, in a regular-expression matching |
| 4752 | ** function. The compiled version of the regular expression is stored as |
| 4753 | ** metadata associated with the SQL value passed as the regular expression |
| 4754 | ** pattern. The compiled regular expression can be reused on multiple |
| 4755 | ** invocations of the same function so that the original pattern string |
| 4756 | ** does not need to be recompiled on each invocation. |
| @@ -4760,27 +4760,36 @@ | |
| 4760 | ** value to the application-defined function. ^If no metadata has been ever |
| 4761 | ** been set for the Nth argument of the function, or if the corresponding |
| 4762 | ** function parameter has changed since the meta-data was set, |
| 4763 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4764 | ** |
| 4765 | ** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th |
| 4766 | ** argument of the application-defined function. ^Subsequent |
| 4767 | ** calls to sqlite3_get_auxdata(C,N) return P from the most recent |
| 4768 | ** sqlite3_set_auxdata(C,N,P,X) call if the data has not been dropped, or |
| 4769 | ** NULL if the data has been dropped. |
| 4770 | ** ^(If it is not NULL, SQLite will invoke the destructor |
| 4771 | ** function X passed to sqlite3_set_auxdata(C,N,P,X) when <ul> |
| 4772 | ** <li> the corresponding function parameter changes, |
| 4773 | ** <li> [sqlite3_reset()] or [sqlite3_finalize()] is called for the |
| 4774 | ** SQL statement, |
| 4775 | ** <li> sqlite3_set_auxdata() is invoked again on the same parameter, or |
| 4776 | ** <li> a memory allocation error occurs. </ul>)^ |
| 4777 | ** |
| 4778 | ** SQLite is free to call the destructor and drop metadata on any |
| 4779 | ** parameter of any function at any time. ^The only guarantee is that |
| 4780 | ** the destructor will be called when the [prepared statement] is destroyed. |
| 4781 | ** Note in particular that the destructor X in the call to |
| 4782 | ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before |
| 4783 | ** the sqlite3_set_auxdata() call even returns. Hence sqlite3_set_auxdata() |
| 4784 | ** should be called near the end of the function implementation and the |
| 4785 | ** implementation should not make any use of P after sqlite3_set_auxdata() |
| 4786 | ** has been called. |
| 4787 | ** |
| 4788 | ** ^(In practice, metadata is preserved between function calls for |
| 4789 | ** function parameters that are compile-time constants, including literal |
| 4790 | ** values and [parameters] and expressions composed from the same.)^ |
| 4791 | ** |
| 4792 | ** These routines must be called from the same thread in which |
| 4793 | ** the SQL function is running. |
| 4794 | */ |
| 4795 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| @@ -110176,11 +110185,12 @@ | |
| 110185 | pWInfo->wctrlFlags = wctrlFlags; |
| 110186 | pWInfo->savedNQueryLoop = pParse->nQueryLoop; |
| 110187 | pMaskSet = &pWInfo->sMaskSet; |
| 110188 | sWLB.pWInfo = pWInfo; |
| 110189 | sWLB.pWC = &pWInfo->sWC; |
| 110190 | sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo); |
| 110191 | assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) ); |
| 110192 | whereLoopInit(sWLB.pNew); |
| 110193 | #ifdef SQLITE_DEBUG |
| 110194 | sWLB.pNew->cId = '*'; |
| 110195 | #endif |
| 110196 | |
| 110197 |
+24
-15
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.8.0" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3008000 |
| 112 | -#define SQLITE_SOURCE_ID "2013-07-17 11:54:47 64bf8148b84e0ebb45c12b629f49bc9b316aceba" | |
| 112 | +#define SQLITE_SOURCE_ID "2013-07-18 14:50:56 5dcffa671f592ae9355628afa439ae9a2d26f0cd" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| @@ -4182,12 +4182,12 @@ | ||
| 4182 | 4182 | ** CAPI3REF: Function Auxiliary Data |
| 4183 | 4183 | ** |
| 4184 | 4184 | ** The following two functions may be used by scalar SQL functions to |
| 4185 | 4185 | ** associate metadata with argument values. If the same value is passed to |
| 4186 | 4186 | ** multiple invocations of the same SQL function during query execution, under |
| 4187 | -** some circumstances the associated metadata may be preserved. This may | |
| 4188 | -** be used, for example, to add a regular-expression matching scalar | |
| 4187 | +** some circumstances the associated metadata may be preserved. This might | |
| 4188 | +** be used, for example, in a regular-expression matching | |
| 4189 | 4189 | ** function. The compiled version of the regular expression is stored as |
| 4190 | 4190 | ** metadata associated with the SQL value passed as the regular expression |
| 4191 | 4191 | ** pattern. The compiled regular expression can be reused on multiple |
| 4192 | 4192 | ** invocations of the same function so that the original pattern string |
| 4193 | 4193 | ** does not need to be recompiled on each invocation. |
| @@ -4197,27 +4197,36 @@ | ||
| 4197 | 4197 | ** value to the application-defined function. ^If no metadata has been ever |
| 4198 | 4198 | ** been set for the Nth argument of the function, or if the corresponding |
| 4199 | 4199 | ** function parameter has changed since the meta-data was set, |
| 4200 | 4200 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4201 | 4201 | ** |
| 4202 | -** ^The sqlite3_set_auxdata() interface saves the metadata | |
| 4203 | -** pointed to by its 3rd parameter as the metadata for the N-th | |
| 4204 | -** argument of the application-defined function. Subsequent | |
| 4205 | -** calls to sqlite3_get_auxdata() might return this data, if it has | |
| 4206 | -** not been destroyed. | |
| 4207 | -** ^If it is not NULL, SQLite will invoke the destructor | |
| 4208 | -** function given by the 4th parameter to sqlite3_set_auxdata() on | |
| 4209 | -** the metadata when the corresponding function parameter changes | |
| 4210 | -** or when the SQL statement completes, whichever comes first. | |
| 4202 | +** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th | |
| 4203 | +** argument of the application-defined function. ^Subsequent | |
| 4204 | +** calls to sqlite3_get_auxdata(C,N) return P from the most recent | |
| 4205 | +** sqlite3_set_auxdata(C,N,P,X) call if the data has not been dropped, or | |
| 4206 | +** NULL if the data has been dropped. | |
| 4207 | +** ^(If it is not NULL, SQLite will invoke the destructor | |
| 4208 | +** function X passed to sqlite3_set_auxdata(C,N,P,X) when <ul> | |
| 4209 | +** <li> the corresponding function parameter changes, | |
| 4210 | +** <li> [sqlite3_reset()] or [sqlite3_finalize()] is called for the | |
| 4211 | +** SQL statement, | |
| 4212 | +** <li> sqlite3_set_auxdata() is invoked again on the same parameter, or | |
| 4213 | +** <li> a memory allocation error occurs. </ul>)^ | |
| 4211 | 4214 | ** |
| 4212 | 4215 | ** SQLite is free to call the destructor and drop metadata on any |
| 4213 | 4216 | ** parameter of any function at any time. ^The only guarantee is that |
| 4214 | -** the destructor will be called before the metadata is dropped. | |
| 4217 | +** the destructor will be called when the [prepared statement] is destroyed. | |
| 4218 | +** Note in particular that the destructor X in the call to | |
| 4219 | +** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before | |
| 4220 | +** the sqlite3_set_auxdata() call even returns. Hence sqlite3_set_auxdata() | |
| 4221 | +** should be called near the end of the function implementation and the | |
| 4222 | +** implementation should not make any use of P after sqlite3_set_auxdata() | |
| 4223 | +** has been called. | |
| 4215 | 4224 | ** |
| 4216 | 4225 | ** ^(In practice, metadata is preserved between function calls for |
| 4217 | -** expressions that are constant at compile time. This includes literal | |
| 4218 | -** values and [parameters].)^ | |
| 4226 | +** function parameters that are compile-time constants, including literal | |
| 4227 | +** values and [parameters] and expressions composed from the same.)^ | |
| 4219 | 4228 | ** |
| 4220 | 4229 | ** These routines must be called from the same thread in which |
| 4221 | 4230 | ** the SQL function is running. |
| 4222 | 4231 | */ |
| 4223 | 4232 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4224 | 4233 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.0" |
| 111 | #define SQLITE_VERSION_NUMBER 3008000 |
| 112 | #define SQLITE_SOURCE_ID "2013-07-17 11:54:47 64bf8148b84e0ebb45c12b629f49bc9b316aceba" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -4182,12 +4182,12 @@ | |
| 4182 | ** CAPI3REF: Function Auxiliary Data |
| 4183 | ** |
| 4184 | ** The following two functions may be used by scalar SQL functions to |
| 4185 | ** associate metadata with argument values. If the same value is passed to |
| 4186 | ** multiple invocations of the same SQL function during query execution, under |
| 4187 | ** some circumstances the associated metadata may be preserved. This may |
| 4188 | ** be used, for example, to add a regular-expression matching scalar |
| 4189 | ** function. The compiled version of the regular expression is stored as |
| 4190 | ** metadata associated with the SQL value passed as the regular expression |
| 4191 | ** pattern. The compiled regular expression can be reused on multiple |
| 4192 | ** invocations of the same function so that the original pattern string |
| 4193 | ** does not need to be recompiled on each invocation. |
| @@ -4197,27 +4197,36 @@ | |
| 4197 | ** value to the application-defined function. ^If no metadata has been ever |
| 4198 | ** been set for the Nth argument of the function, or if the corresponding |
| 4199 | ** function parameter has changed since the meta-data was set, |
| 4200 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4201 | ** |
| 4202 | ** ^The sqlite3_set_auxdata() interface saves the metadata |
| 4203 | ** pointed to by its 3rd parameter as the metadata for the N-th |
| 4204 | ** argument of the application-defined function. Subsequent |
| 4205 | ** calls to sqlite3_get_auxdata() might return this data, if it has |
| 4206 | ** not been destroyed. |
| 4207 | ** ^If it is not NULL, SQLite will invoke the destructor |
| 4208 | ** function given by the 4th parameter to sqlite3_set_auxdata() on |
| 4209 | ** the metadata when the corresponding function parameter changes |
| 4210 | ** or when the SQL statement completes, whichever comes first. |
| 4211 | ** |
| 4212 | ** SQLite is free to call the destructor and drop metadata on any |
| 4213 | ** parameter of any function at any time. ^The only guarantee is that |
| 4214 | ** the destructor will be called before the metadata is dropped. |
| 4215 | ** |
| 4216 | ** ^(In practice, metadata is preserved between function calls for |
| 4217 | ** expressions that are constant at compile time. This includes literal |
| 4218 | ** values and [parameters].)^ |
| 4219 | ** |
| 4220 | ** These routines must be called from the same thread in which |
| 4221 | ** the SQL function is running. |
| 4222 | */ |
| 4223 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4224 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.0" |
| 111 | #define SQLITE_VERSION_NUMBER 3008000 |
| 112 | #define SQLITE_SOURCE_ID "2013-07-18 14:50:56 5dcffa671f592ae9355628afa439ae9a2d26f0cd" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -4182,12 +4182,12 @@ | |
| 4182 | ** CAPI3REF: Function Auxiliary Data |
| 4183 | ** |
| 4184 | ** The following two functions may be used by scalar SQL functions to |
| 4185 | ** associate metadata with argument values. If the same value is passed to |
| 4186 | ** multiple invocations of the same SQL function during query execution, under |
| 4187 | ** some circumstances the associated metadata may be preserved. This might |
| 4188 | ** be used, for example, in a regular-expression matching |
| 4189 | ** function. The compiled version of the regular expression is stored as |
| 4190 | ** metadata associated with the SQL value passed as the regular expression |
| 4191 | ** pattern. The compiled regular expression can be reused on multiple |
| 4192 | ** invocations of the same function so that the original pattern string |
| 4193 | ** does not need to be recompiled on each invocation. |
| @@ -4197,27 +4197,36 @@ | |
| 4197 | ** value to the application-defined function. ^If no metadata has been ever |
| 4198 | ** been set for the Nth argument of the function, or if the corresponding |
| 4199 | ** function parameter has changed since the meta-data was set, |
| 4200 | ** then sqlite3_get_auxdata() returns a NULL pointer. |
| 4201 | ** |
| 4202 | ** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th |
| 4203 | ** argument of the application-defined function. ^Subsequent |
| 4204 | ** calls to sqlite3_get_auxdata(C,N) return P from the most recent |
| 4205 | ** sqlite3_set_auxdata(C,N,P,X) call if the data has not been dropped, or |
| 4206 | ** NULL if the data has been dropped. |
| 4207 | ** ^(If it is not NULL, SQLite will invoke the destructor |
| 4208 | ** function X passed to sqlite3_set_auxdata(C,N,P,X) when <ul> |
| 4209 | ** <li> the corresponding function parameter changes, |
| 4210 | ** <li> [sqlite3_reset()] or [sqlite3_finalize()] is called for the |
| 4211 | ** SQL statement, |
| 4212 | ** <li> sqlite3_set_auxdata() is invoked again on the same parameter, or |
| 4213 | ** <li> a memory allocation error occurs. </ul>)^ |
| 4214 | ** |
| 4215 | ** SQLite is free to call the destructor and drop metadata on any |
| 4216 | ** parameter of any function at any time. ^The only guarantee is that |
| 4217 | ** the destructor will be called when the [prepared statement] is destroyed. |
| 4218 | ** Note in particular that the destructor X in the call to |
| 4219 | ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before |
| 4220 | ** the sqlite3_set_auxdata() call even returns. Hence sqlite3_set_auxdata() |
| 4221 | ** should be called near the end of the function implementation and the |
| 4222 | ** implementation should not make any use of P after sqlite3_set_auxdata() |
| 4223 | ** has been called. |
| 4224 | ** |
| 4225 | ** ^(In practice, metadata is preserved between function calls for |
| 4226 | ** function parameters that are compile-time constants, including literal |
| 4227 | ** values and [parameters] and expressions composed from the same.)^ |
| 4228 | ** |
| 4229 | ** These routines must be called from the same thread in which |
| 4230 | ** the SQL function is running. |
| 4231 | */ |
| 4232 | SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4233 |