AD

sqlite source code analysis (2)

Disclaimer: The SQLite source code analysis series Xing (**deepfuture.javaeye**/) original, without author authorization, any human institution can not be reproduced

/ *

** The maximum number of opcodes in a VDBE program.

** Not currently enforced.

* /

/ / VDBE procedure code maximum number of operations

# Ifndef SQLITE_MAX_VDBE_OP

# Define SQLITE_MAX_VDBE_OP 25000

# Endif

/ *

** The maximum number of arguments to an SQL function.

* /

/ / SQL function, the maximum number of parameters

# Ifndef SQLITE_MAX_FUNCTION_ARG

# Define SQLITE_MAX_FUNCTION_ARG 127

# Endif

/ *

** The maximum number of in-memory pages to use for the main database

** Table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE

* /

/ / Main database tables and the maximum memory size of the temporary table

# Ifndef SQLITE_DEFAULT_CACHE_SIZE

# Define SQLITE_DEFAULT_CACHE_SIZE 2000

# Endif

# Ifndef SQLITE_DEFAULT_TEMP_CACHE_SIZE

# Define SQLITE_DEFAULT_TEMP_CACHE_SIZE 500

# Endif

/ *

** The maximum number of attached databases. This must be between 0

** And 30. The upper bound on 30 is because a 32-bit integer bitmap

** Is used internally to track attached databases.

* /

/ / Add the number of databases

# Ifndef SQLITE_MAX_ATTACHED

# Define SQLITE_MAX_ATTACHED 10

# Endif

/ *

** The maximum value of a? Nnn wildcard that the parser will accept.

* /

/ / Parser to accept the maximum parameters of the matching symbol

# Ifndef SQLITE_MAX_VARIABLE_NUMBER

# Define SQLITE_MAX_VARIABLE_NUMBER 999

# Endif

/ * Maximum page size. The upper bound on this value is 32768. This a limit

** Imposed by the necessity of storing the value in a 2-byte unsigned integer

** And the fact that the page size must be a power of 2.

**

** If this limit is changed, then the compiled library is technically

** Incompatible with an SQLite library compiled with a different limit. If

** A process operating on a database with a page-size of 65536 bytes

** Crashes, then an instance of SQLite compiled with the default page-size

** Limit will not be able to rollback the aborted transaction. This could

** Lead to database corruption.

* /

/ / Largest page size

# Ifndef SQLITE_MAX_PAGE_SIZE

# Define SQLITE_MAX_PAGE_SIZE 32768

# Endif

/ *

** The default size of a database page.

* /

/ / Default database page size

# Ifndef SQLITE_DEFAULT_PAGE_SIZE

# Define SQLITE_DEFAULT_PAGE_SIZE 1024

# Endif

# If SQLITE_DEFAULT_PAGE_SIZE> SQLITE_MAX_PAGE_SIZE

# Undef SQLITE_DEFAULT_PAGE_SIZE

# Define SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE

# Endif

/ *

** Ordinarily, if no value is explicitly provided, SQLite creates databases

** With page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain

** Device characteristics (sector-size and atomic write () support),

** SQLite may choose a larger value. This constant is the maximum value

** SQLite will choose on its own.

* /

/ / Default database page size of the largest

# Ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE

# Define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192

# Endif

# If SQLITE_MAX_DEFAULT_PAGE_SIZE> SQLITE_MAX_PAGE_SIZE

# Undef SQLITE_MAX_DEFAULT_PAGE_SIZE

# Define SQLITE_MAX_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE

# Endif

/ *

** Maximum number of pages in one database file.

**

** This is really just the default value for the max_page_count pragma.

** This value can be lowered (or raised) at run-time using that the

** Max_page_count macro.

* /

/ / Maximum number of pages a single database file number

# Ifndef SQLITE_MAX_PAGE_COUNT

# Define SQLITE_MAX_PAGE_COUNT 1073741823

# Endif

/ *

** Maximum length (in bytes) of the pattern in a LIKE or GLOB

** Operator.

* /

/ / LIKE or GLOB pattern of maximum length (bytes)

# Ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH

# Define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000

# Endif

/ *

** Maximum depth of recursion for triggers.

**

** A value of 1 means that a trigger program will not be able to itself

** Fire any triggers. A value of 0 means that no trigger programs at all

** May be executed.

* /

/ / Trigger the depth of recursion process

# Ifndef SQLITE_MAX_TRIGGER_DEPTH

# Define SQLITE_MAX_TRIGGER_DEPTH 1000

# Endif

/ / SQLITE restricted definition of parameters is completed

/************** End of sqliteLimit.h ****************************** ***********/

/************** Continuing where we left off in sqliteInt.h ******************/

/ / Ban annoying Borland compiler warnings

/ * Disable nuisance warnings on Borland compilers * /

# If defined (__BORLANDC__)

# Pragma warn-rch / * unreachable code * /

# Pragma warn-ccc / * Condition is always true or false * /

# Pragma warn-aus / * Assigned value is never used * /

# Pragma warn-csu / * Comparing signed and unsigned * /

# Pragma warn-spa / * Suspicious pointer arithmetic * /

# Endif

/ / Is defined as the GNU source

/ * Needed for various definitions ... * /

# Ifndef _GNU_SOURCE

# Define _GNU_SOURCE

# Endif

/ *

** Include standard header files as necessary

* /

/ / Contains the necessary header files

# Ifdef HAVE_STDINT_H

# Include <stdint.h>

# Endif

# Ifdef HAVE_INTTYPES_H

# Include <inttypes.h>

# Endif

/ *

** The number of samples of an index that SQLite takes in order to

** Construct a histogram of the table content when running ANALYZE

** And with SQLITE_ENABLE_STAT2

* /

/ / Index number of samples

# Define SQLITE_INDEX_SAMPLES 10

/ *

** The following macros are used to cast pointers to integers and

** Integers to pointers. The way you do this varies from one compiler

** To the next, so we have developed the following set of # if statements

** To generate appropriate macros for a wide range of compilers.

**

** The correct "ANSI" way to do this is to use the intptr_t type.

** Unfortunately, that typedef is not available on all compilers, or

** If it is available, it requires an # include of specific headers

** That very from one machine to the next.

**

** Ticket # 3860: The llvm-gcc-4.2 compiler from Apple chokes on

** The ((void *)&(( char *) 0) [X]) construct. But MSVC chokes on ((void *) (X)).

** So we have to define the macros in different ways depending on the

** Compiler.

* /

/ / The following macros to complete switch to integer and integer pointer pointer transfer

# If defined (__PTRDIFF_TYPE__) / * This case should work for GCC * /

# Define SQLITE_INT_TO_PTR (X) ((void *)(__ PTRDIFF_TYPE__) (X))

# Define SQLITE_PTR_TO_INT (X) ((int) (__PTRDIFF_TYPE__) (X))

# Elif! Defined (__GNUC__) / * Works for compilers other than LLVM * /

# Define SQLITE_INT_TO_PTR (X) ((void *)&(( char *) 0) [X])

# Define SQLITE_PTR_TO_INT (X) ((int) (((char *) X) - (char *) 0))

# Elif defined (HAVE_STDINT_H) / * Use this case if we have ANSI headers * /

# Define SQLITE_INT_TO_PTR (X) ((void *) (intptr_t) (X))

# Define SQLITE_PTR_TO_INT (X) ((int) (intptr_t) (X))

# Else / * Generates a warning - but it always works * /

# Define SQLITE_INT_TO_PTR (X) ((void *) (X))

# Define SQLITE_PTR_TO_INT (X) ((int) (X))

# Endif

/ *

** The SQLITE_THREADSAFE macro must be defined as either 0 or 1.

** Older versions of SQLite used an optional THREADSAFE macro.

** We support that for legacy

* /

/ / SQLITE_THREADSAFE thread unsafe macros defined as 0 or 1,

# If! Defined (SQLITE_THREADSAFE)

# If defined (THREADSAFE)

# Define SQLITE_THREADSAFE THREADSAFE

# Else

# Define SQLITE_THREADSAFE 1

# Endif

# Endif

/ *

** The SQLITE_DEFAULT_MEMSTATUS macro must be defined as either 0 or 1.

** It determines whether or not the features related to

** SQLITE_CONFIG_MEMSTATUS are available by default or not. This value can

** Be overridden at runtime using the sqlite3_config () API.

* /

/ / SQLITE_DEFAULT_MEMSTATUS macro is defined as 0 or 1, at run time can

/ / Use sqlite3_config () API to modify the value

# If! Defined (SQLITE_DEFAULT_MEMSTATUS)

# Define SQLITE_DEFAULT_MEMSTATUS 1

# Endif
标签: database table, databases, database tables, parser, source code analysis, maximum number, cache size, maximum value, sql function, variable number, wildcard, bitmap, max function, unsigned integer, memory pages, upper bound, human institution, maximum parameters, opcodes, maximum memory size
分类: Database
时间: 2010-07-22

相关文章

  1. SQLite source code analysis (1)

    Disclaimer: The SQLite source code analysis series Xing ( http://deepfuture.javaeye.com/) original, without au ...
  2. SQLite source code analysis (6)

    / * ** Add the ability to override 'extern' * / / / Extern macro definitions can be used to complete the exter ...
  3. sqlite source code analysis (18)

    Disclaimer: The SQLite source code analysis series LIU Xing (http://deepfuture.javaeye.com/) original, without ...
  4. SQLite source code download

    Disclaimer: This SQLITE Source Analysis series Xing (http://deepfuture.javaeye.com/) original, without author ...
  5. Struts2 source code analysis - Request Processing

    Struts2 source code analysis - Request Processing http://www.javaeye.com/topic/450979
  6. TOMCAT source code analysis (Message Processing)

    TOMCAT source code analysis (Message Processing) http://yuleihome.javaeye.com/blog/562244
  7. openjdk source code analysis --- the loading of class analysis

    openjdk source code analysis --- the loading of class analysis (* env) -> FindClass implementation, to find ...
  8. ThreadLocal Source Code Analysis

    Had previously been associated ThreadLocal reproduced the article, but it has been in a confused state, when t ...
  9. Spring source code analysis (4): Spring MVC

    The following Spring MVC framework of the code we analyzed, for webApplicationContext correlation analysis can ...
  10. Spring source code analysis (6): Spring declarative transaction processing

    We take a look at Spring's transaction code, the use of Spring Management Services are two kinds of declarativ ...
  11. Spring source code analysis (8): Spring-driven implementation of Hibernate

    O / R tool came to simplify the complex information of many persistent development. Spring application develop ...
  12. Tomcat 5.5.26 source code analysis - start the process (2)

    init method Catalina_Home and Catalina_Base Initialize the system class loader Tomcat's class loader system in ...
  13. jQuery 1.2.6 source code analysis (pdf)

    jQuery source code analysis.
  14. Chrome source code analysis of sequence

    Chrome source code analysis of sequence Open source is a good thing mouth, it makes a lot of industrial waste ...
  15. Mysql source code analysis series

    Mysql source code analysis series (2): the source code structure Mysql source code include the client code, se ...
  16. Heritrix source code analysis (9) Heritrix secondary to Heritrix crawl crawl and how to capture the URL you do not want

    I said before Heritrix crawl in a basis (here assumed to be A) to crawl, because Heritrix on each URL will hav ...
  17. Qt source code analysis: starting from QObject

    Originally intended to "Qt way of learning" as something of a similar tutorial, so do not intend to ...
  18. Android IPC communication mechanism for source code analysis

    Android IPC communication mechanism for source code analysis Binder Communications Description: Linux system, ...
  19. iBATIS source code analysis framework

    iBATIS source code analysis framework Basic Information Of: any steel Publisher: Electronic Industry Press ISB ...