1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00
Commit Graph

494 Commits

Author SHA1 Message Date
mistachkin
98ab33a82f Add test cases for tointeger() and toreal() functions. Fixes for several tests.
FossilOrigin-Name: 5e1e9fd5e4f189836442baa42244be00de13ff0f
2013-08-20 09:26:38 +00:00
drh
db1c12b79f Fix compiler warnings and boundary cases for the tointeger() and toreal()
functions.

FossilOrigin-Name: 4438b9865826446721b7aa09295fe335bf2fafb7
2013-08-20 02:07:50 +00:00
dan
0106e378f1 Re-enable reading from the sqlite_stat3 table (as well as sqlite_stat4).
FossilOrigin-Name: 6d45078e621526fc2bac0eaefbb0f9602b9a8ec5
2013-08-12 16:34:32 +00:00
drh
0057a74675 Merge in the latest changes from trunk. Simplify the implementation of the
tointeger() and toreal() functions.  Fix test cases and put unambiguous
labels on all testcase names.

FossilOrigin-Name: 9b837b0508fbfb395f0a0d8e4bd127730c80ffc5
2013-06-21 19:29:33 +00:00
mistachkin
f5fe3ae9e6 Merge updates from trunk.
FossilOrigin-Name: fa2a91e6c631864846484d13cffdc51856953cd1
2013-06-21 18:32:11 +00:00
drh
f7b5496e8e Many small harmless comment changes. Removal of obsolete comments and
fixing misspelled words.  No changes to code.

FossilOrigin-Name: a0d5cc9315dc6e9ef7dee4c3dfabf4e562d64376
2013-05-28 12:11:54 +00:00
mistachkin
1654256ac8 Merge updates from trunk.
FossilOrigin-Name: 6fbad957259eb8c15eaf7e5657240ae24aaf343e
2013-05-15 08:00:44 +00:00
drh
56282a5bc7 Add the sqlite3_strglob() interface.
FossilOrigin-Name: 41d6ff32a6dd1311dc3aabe5156335a64a886919
2013-04-10 16:13:38 +00:00
mistachkin
bc3ec28b88 Rename the experimental todouble() function to toreal(), update comments.
FossilOrigin-Name: 12c318ef1b674d1ef347458ce149398885f5ba10
2013-03-13 06:48:05 +00:00
mistachkin
ee1c64ed25 Increase strictness of the new experimental functions and add more tests.
FossilOrigin-Name: 05c4463ec5f36dde50f6eb116624dc40142f2c8c
2013-03-12 09:07:25 +00:00
mistachkin
69f3d04810 Add experimental tointeger() and todouble() SQL functions.
FossilOrigin-Name: 465fd853d3e3544cb06b15ffa32ce25774d816c7
2013-03-11 01:23:37 +00:00
drh
fe7a5d11b6 Fix the char() function so that it works even if SQLITE_OMIT_UTF16 is defined.
FossilOrigin-Name: af542c82e8e7f0415530b639fa397429c5f377f6
2013-03-07 14:00:04 +00:00
mistachkin
ef593f293e Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined.
FossilOrigin-Name: 10ace06be7fbe9a76a201c418b2af453c7a69043
2013-03-07 06:42:53 +00:00
drh
1d59d036de Complete the initialization of the loadable extension thunk table. Also
fix other (harmless) compiler warnings.

FossilOrigin-Name: 780d06c5e54590f677f993fa9c313989c2eab8c7
2013-03-01 23:40:26 +00:00
drh
de97724827 Fix the handling of UTF16 surrogate pairs in the char() function.
FossilOrigin-Name: ff67d87894eeb0036374235c5723e267536909f9
2013-03-01 15:02:52 +00:00
mistachkin
c9545442f9 Remove extra use of the sqlite3_value_int64() function.
FossilOrigin-Name: 6d7973524a7d3bf3158fdac58975945da7f51740
2013-02-26 05:42:30 +00:00
drh
d495d8c9a3 Two new SQL functions: unicode() and char().
FossilOrigin-Name: 209b21085b9767f10f6ffb7c7cac756fcb74ded5
2013-02-22 19:34:25 +00:00
drh
68c804b9ab Fix a harmless compiler warning.
FossilOrigin-Name: 12693deba9b8a47ad02ca4e32d5fba6006b0401c
2012-12-04 11:03:11 +00:00
drh
d55e07296b Implementation of the INSTR() SQL function, as found in SQL Server, MySQL,
and Oracle.

FossilOrigin-Name: 49ccae964f3a8ae5aab87f56503121e09424545f
2012-10-25 03:07:29 +00:00
drh
4261096124 Remove an unnecessary parameter from sqlite3Utf8Read() resulting in a slight
performance increase.

FossilOrigin-Name: 8b962c94a2f829f71efdd0ca770469b02feea3e1
2012-09-17 18:56:32 +00:00
drh
0fdbdbea03 Remove the stale implementation of the ifnull and coalesce functions - code
that has been commented out for ages.  No functional changes.

FossilOrigin-Name: c2ad691174b8af2e8b158d8840cfc93f75d7db71
2012-09-10 15:02:32 +00:00
mistachkin
2b434a7ec0 Move variable declaration to fix compilation with MSVC.
FossilOrigin-Name: d45f7a013f05fe7603d5e6d02df0e6bab2c7ffd8
2012-06-19 04:36:48 +00:00
drh
72b3fbc7b5 Improved accuracy on text-to-real and real-to-text conversions. Most
conversions now round-trip correctly.  Still need to fix some corner
cases.

FossilOrigin-Name: 8ecffca900cd6a8922001fd458a266ce8c83fb66
2012-06-19 03:11:25 +00:00
drh
a748fdcc43 Evaluate typeof(X) and length(Y) where X is any column and Y is a blob column
without actually loading X and Y from disk.

FossilOrigin-Name: b899dbeb60752843287e2c6ad3577e1d00f0d587
2012-03-28 01:34:47 +00:00
drh
af8001bfb3 Another attempt to fix warnings in the randomFunc() function.
FossilOrigin-Name: 768df4e11670ac704d96e3b601d009aaa2fd793a
2012-02-11 19:53:24 +00:00
drh
96d7b510e9 Fix a warning coming from the Solaris Studio compiler.
FossilOrigin-Name: 33294bbd1724665832464b33f865a29dc82b90f6
2012-02-10 20:43:05 +00:00
drh
94a6d998f6 Fix a problem with NULL handling in aggregate min/max when returning
values from the row containing the min or max.

FossilOrigin-Name: f27c7b4fb193126548e6a620ac89664d1efa3856
2012-02-02 18:42:09 +00:00
drh
7a95789c0c For queries of the form "SELECT p, max(q) FROM t1", the value of column p
returned is the one on the same row that holds the maximum value of q.

FossilOrigin-Name: adb29232b659c5332b6841776372407fcc350b08
2012-02-02 17:35:43 +00:00
drh
df901d34e5 Simplifications to the upper() and lower() SQL functions.
Updates to documentation on sqlite3_bind_text() and sqlite3_result_text()
to make it clear that users should not try to create strings with
embedded NULs and that if they do the result of expression on those strings
is undefined.  Ticket [57c971fc74524a]

FossilOrigin-Name: 9984cc20ca70b7fb39c0b99580a1317a7b0c9c85
2011-10-13 18:00:11 +00:00
drh
1aa4f3e529 Fix a couple of compiler warnings.
FossilOrigin-Name: 3899f3b95ed50773a72d907b39b451fefce69c9e
2011-06-15 12:43:36 +00:00
drh
0a32fa6d81 Use only unsigned values in the implementatin of LIKE and GLOB so that
values won't overflow to negative when dealing with malformed UTF8.

FossilOrigin-Name: 77f01578bb565d1bc884b374b68bae10ce34a084
2011-06-13 12:19:21 +00:00
drh
840561f2a4 Change the name of an internal function to avoid conflicts with the math
library.

FossilOrigin-Name: 1bd1484cd7e09709d87aa84b82e87597d00a4162
2011-04-27 18:08:42 +00:00
drh
3ca84ef623 Add the (deliberately undocumented) sqlite_log() SQL function as a built-in.
FossilOrigin-Name: f7806e03995b314771aa72a08ce55d56d60096cf
2011-04-25 18:03:10 +00:00
drh
158b9cb965 Fix all known instances of signed-integer overflow. Within SQL expressions,
integer overflow now forces coercion to floating point.  The shift operators
work with any integer right-hand operand with negative values reversing
the direction of the shift.

FossilOrigin-Name: abf21394124a0af46f072793718964cee2ce55d0
2011-03-05 20:59:46 +00:00
drh
cfd654bf2a Fix an instance of signed arithmetic overflow and an one bit-shift overflow.
Mark six other signed arithmetic overflow locations that need fixing.

FossilOrigin-Name: 04abab71ecd52f6070b9f84781a3df3d6dba7722
2011-03-05 13:54:15 +00:00
drh
901e994b8b When registering the built-in LIKE and GLOB functions, make sure that they
are tagged with SQLITE_UTF8 so that if other application-defined LIKE and
GLOB implementations are provided for UTF16, then the appropriate function
will be selected.

FossilOrigin-Name: e1660764f20fed3fe92156d2b7f06075ff6ac145
2010-12-15 18:54:37 +00:00
drh
9339da1f22 Rework the text to numeric conversion routines so that they work with either
UTF8 or UTF16 and do not require a NULL terminator.  This allowed text to
numeric conversion without reallocating the string.

FossilOrigin-Name: 14eed3a0e0a45c6f2904a3a134aa27c159916f7b
2010-09-30 00:50:49 +00:00
drh
6ac78a0d9f Fix several harmless compiler warnings.
FossilOrigin-Name: 7be03ecc04235420e54fed8a88742243278de160
2010-09-28 14:26:36 +00:00
dan
d2199f0f8d Add the sqlite3_create_function_v2() API, a version of create_function that allows a destructor to be specified.
FossilOrigin-Name: 9a724dfbe822c77e76721abe3443c9cb018bb2e2
2010-08-27 17:48:52 +00:00
drh
a3e414cd48 Fix disabled implementation-mark comments in func.c.
FossilOrigin-Name: 57c0960038b8ce97f9d6665f15e7f6ec310c681f
2010-08-03 18:06:25 +00:00
drh
b975598ea0 Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and
all memory from sqlite3_malloc() is freed by sqlite3_free().

FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
2010-07-24 16:34:37 +00:00
drh
a4741840f6 Remove an unreachable branch from the function initialization logic.
FossilOrigin-Name: 064d3ddd6199b7b049b1706974e4295f78fb5ab9
2010-04-25 20:58:37 +00:00
drh
545f587fc8 When commands such as ALTER TABLE and VACUUM use SQL internally, make sure
they use only the built-in functions and not application-defined overrides
for those functions.

FossilOrigin-Name: 0291ed974d5bf1e344e2c38422530cc961b897da
2010-04-24 14:02:59 +00:00
drh
8bb76d39a0 Rename the sqlite_compile_option_*() SQL functions to sqlite_compileoption_*()
for consistency with the C/C++ interface.

FossilOrigin-Name: dd4962aa34c4dd118d2cb15465384636eacc64d5
2010-02-26 16:37:47 +00:00
drh
264a2d4de1 Minor simplifications to the compile-time option reporting functions and
pragmas to facilitate coverage testing.

FossilOrigin-Name: 633d874783a94f923ff8240f9153764033d37a89
2010-02-25 15:28:41 +00:00
drh
380083ce18 Merge the compile-time option introspection interfaces into the trunk.
FossilOrigin-Name: 9f429434c0404f03a3e5c6741b769afe98a5c6c9
2010-02-23 20:32:15 +00:00
shaneh
dc97a8cdc1 Refactored compile time option diagnostic support to use strings identifiers instead of bitmask.
FossilOrigin-Name: 76a0294ab4208a0858a13bab0858e1bc1448b651
2010-02-23 20:08:35 +00:00
shaneh
bdea6d1368 Test new api to report which options (defines) were used to compile SQLite.
FossilOrigin-Name: 84c9756993caf82710a0905ed1987d144bc764fd
2010-02-23 04:19:54 +00:00
shaneh
147e176aff Avoid using the internal printf routine for round(x,y) in the common case where y==0.
FossilOrigin-Name: d76ad8b3c494ffb4e670da0e92a1f8dbf7f48daf
2010-02-17 04:19:27 +00:00
drh
ab2f1f9560 Add a few documentation evidence comments to the built-in function
implementations.

FossilOrigin-Name: 8bd0f8147dbf75367243b3eecfb705da6e794ab7
2010-01-11 18:26:42 +00:00