From: drh Date: Thu, 25 Apr 2002 00:21:50 +0000 (+0000) Subject: Fix for ticket #26: Document the fact that CREATE TABLE might not be X-Git-Tag: version-3.6.10~5531 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7caf776079d409682a5006c0af2e71478d848073;p=thirdparty%2Fsqlite.git Fix for ticket #26: Document the fact that CREATE TABLE might not be immediately visible to other processes that are holding the database open. (CVS 544) FossilOrigin-Name: 18b31b7ab90ab330e271e0ed5d316f63846845be --- diff --git a/manifest b/manifest index 063284a5f5..a47c417579 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sfor\sticket\s#22:\sIn\sthe\scode\sgenerator\sfor\scompound\sSELECT\sstatements,\stake\ncare\snot\sto\sgenerate\scolumn\sname\sheaders\sif\sthe\soutput\sis\san\sintermediate\stable.\nOtherwise\sthe\scolumn\sheaders\sare\snot\sgenerated\scorrectly\sif\sa\scompound\sSELECT\nstatement\sappears\sas\san\sexpression\sin\spart\sof\sthe\sWHERE\sclause.\s(CVS\s543) -D 2002-04-23T17:10:18 +C Fix\sfor\sticket\s#26:\sDocument\sthe\sfact\sthat\sCREATE\sTABLE\smight\snot\sbe\nimmediately\svisible\sto\sother\sprocesses\sthat\sare\sholding\sthe\sdatabase\sopen.\s(CVS\s544) +D 2002-04-25T00:21:50 F Makefile.in 50f1b3351df109b5774771350d8c1b8d3640130d F Makefile.template 89e373b2dad0321df00400fa968dc14b61a03296 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 @@ -121,7 +121,7 @@ F www/conflict.tcl 81dd21f9a679e60aae049e9dd8ab53d59570cda2 F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060 F www/download.tcl 29aa6679ca29621d10613f60ebbbda18f4b91c49 F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c -F www/faq.tcl fb1e92e2f604546694f83a36d969492f52fb685d +F www/faq.tcl 45bdb18b75ac3aa1befec42985fb892413aac0bb F www/formatchng.tcl 2ce21ff30663fad6618198fe747ce675df577590 F www/index.tcl d0c52fbf031d0a3ee6d9d77aa669d5a4b24b6130 F www/lang.tcl 2d4654255ad1ec7f58d02dc41b59528c0ee6ea44 @@ -131,7 +131,7 @@ F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 -P 0691720a4b94141635734ab0a8c4072cab189a33 -R 5e23c695d2d82aae9921a85b5156d273 +P a06d9acdd5af0dc69b3a4d024de082631254aead +R cfeb54c57cf6f9ec54bd35534c55c306 U drh -Z 57e5aab64c05733c095af92c508e335d +Z d14450a4a0ba6fe1648be69426d0ab18 diff --git a/manifest.uuid b/manifest.uuid index 5c4ba8a45d..ffa096e990 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a06d9acdd5af0dc69b3a4d024de082631254aead \ No newline at end of file +18b31b7ab90ab330e271e0ed5d316f63846845be \ No newline at end of file diff --git a/www/faq.tcl b/www/faq.tcl index 9626ab8b67..98024bfe98 100644 --- a/www/faq.tcl +++ b/www/faq.tcl @@ -1,7 +1,7 @@ # # Run this script to generated a faq.html output file # -set rcsid {$Id: faq.tcl,v 1.9 2002/03/23 00:31:29 drh Exp $} +set rcsid {$Id: faq.tcl,v 1.10 2002/04/25 00:21:50 drh Exp $} puts { @@ -67,6 +67,20 @@ INSERT INTO t1 VALUES((SELECT max(a) FROM t1)+1,123); details.

} +faq { + What datatypes does SQLite support? +} { +

SQLite is typeless. All data is stored as null-terminated strings. + The datatype information that follows the column name in CREATE TABLE + statements is ignored (mostly). You can put any type of data you want + into any column, without regard to the declared datatype of that column. +

+ +

An exception to this rule is a column of type INTEGER PRIMARY KEY. + Such columns must hold an integer. An attempt to put a non-integer + value into an INTEGER PRIMARY KEY column will generate an error.

+} + faq { SQLite lets me insert a string into a database column of type integer! } { @@ -189,6 +203,12 @@ faq { adjust this behavior from C code using the sqlite_busy_handler() or sqlite_busy_timeout() API functions. See the API documentation for details.

+ +

If two or more processes have the same database open and one + process creates a new table or index, the other processes might + not be able to see the new table right away. You might have to + get the other processes to close and reopen their connection to + the database before they will be able to see the new table.

} faq { @@ -205,6 +225,12 @@ faq { returned from separate calls to sqlite_open(). It is never safe to use the same sqlite structure pointer simultaneously in two or more threads.

+ +

Note that if two or more threads have the same database open and one + thread creates a new table or index, the other threads might + not be able to see the new table right away. You might have to + get the other threads to close and reopen their connection to + the database before they will be able to see the new table.

} faq { @@ -255,7 +281,7 @@ ORDER BY name; } faq { - Are there any known size limits to SQLite databases. + Are there any known size limits to SQLite databases? } {

Internally, SQLite can handle databases up to 2^40 bytes (1 terabyte) in size. But the backend interface to POSIX and Win32 limits files to @@ -278,6 +304,36 @@ faq { number of columns, etc. Indices are similarly unconstrained.

} +faq { + What is the maximum size of a VARCHAR in SQLite? +} { +

Remember, SQLite is typeless. A VARCHAR column can hold as much + data as any other column. The total amount of data in a single row + of the database is limited to 1 megabyte. You can increase this limit + to 16 megabytes, if you need to, by adjusting a single #define in the + source tree and recompiling.

+ +

For maximum speed and space efficiency, you should try to keep the + amount of data in a single row below about 230 bytes.

+} + +faq { + Does SQLite support a BLOB type? +} { +

You can declare a table column to be of type "BLOB" but it will still + only store null-terminated strings. This is because the only way to + insert information into an SQLite database is using an INSERT SQL statement, + and you can not include binary data in the middle of the ASCII text string + of an INSERT statement.

+ +

SQLite is 8-bit clean with regard to the data is stores as long as + the data does not contain any NUL characters. If you want to store binary + data, consider encoding your data in such a way that it contains no NUL + characters and inserting it that way. You might use URL-style encoding: + encode NUL as "%00" and "%" as "%25". Or you might consider encoding your + binary data using base-64.

+} + faq { How do I add or delete columns from an existing table in SQLite. } {