Commit Graph

12955 Commits

Author SHA1 Message Date
drh
11a6eee8e1 Tighten the conditions under which applyNumericAffinity() be called and add
assert() statements to prove that it is never called otherwise.

FossilOrigin-Name: e996ca32cb643c558b616c0dd872f3351b6aa3ef
2014-09-19 22:01:54 +00:00
drh
4583c37ca0 Fix the affinity on inserts into the ANALYZE tables. Change the affinity
characters to be upper case, to make the P5 parameter of comparison operators
easier to read.

FossilOrigin-Name: 3f3ca76aea38d566a574f4403b375bdac32854ed
2014-09-19 20:13:25 +00:00
drh
d74a90eab8 Do not attempt to extend the temp file if VFS version 3 is not supported and
hence memory mapped I/O is unavailable.

FossilOrigin-Name: 3ab20ba14f0204efeec62c7dbb87cb3f60e2497f
2014-09-19 19:43:20 +00:00
drh
142341cd23 Make the "nolock" VFS on unix a version-3 VFS so that the sorter can
use memory-mapped I/O.

FossilOrigin-Name: 3db78d6100a1ecf58c18eec3abefa7d1250c649c
2014-09-19 19:00:48 +00:00
drh
0c8f760ab3 Remove a local variable from the OP_Column implementation, resulting in a
modest size reduction and a performance increase.

FossilOrigin-Name: 6199760d1340858d97c845177986b783da915d9e
2014-09-19 16:56:45 +00:00
drh
069c23c947 Small size reduction and performance increase for releaseMemArray().
FossilOrigin-Name: 24cd32d681df58f687b2afbe4b13d579e3efdd4b
2014-09-19 16:13:12 +00:00
drh
7abda85607 Updates to comments. No code changes.
FossilOrigin-Name: 9b42c3da6b2593a10b8fe4b2fcc3d650132625c1
2014-09-19 16:02:06 +00:00
drh
7b5ebcaf26 The OP_Column opcode runs faster and is smaller by manually in-lining the
code that persists string values in the output register.

FossilOrigin-Name: 36b613ccf0ddb764af90841994da91b7fcaa8f00
2014-09-19 15:28:33 +00:00
drh
a5476e9254 Add the sqlite3VdbeMemClearAndResize() function. Fix a sorting-index
prefilter problem.

FossilOrigin-Name: 987a7a211913b3949da20e43423af376f72a28ba
2014-09-19 04:42:38 +00:00
drh
137fd4fda2 Make sure that the sorting-index pre-filter recognizes that a rowid reference
might be sortable.  This fixes a performance regression.

FossilOrigin-Name: 72727b68cd07969165f1f0943cc7e1a265436653
2014-09-19 02:01:37 +00:00
drh
322f2852f2 Add the sqlite3VdbeMemClearAndResize() interface to be used in place of
sqlite3VdbeMemGrow().

FossilOrigin-Name: 5b9b8987797abf7c68d2c3154f6657be9b8b1c8f
2014-09-19 00:43:39 +00:00
drh
17bcb10299 Add the Mem.szMalloc element to the Mem object and use it to keep track of
the size of the Mem.zMalloc allocation.

FossilOrigin-Name: 9c09ac353df6041808cace41880f4729ee73f5e1
2014-09-18 21:25:33 +00:00
mistachkin
26c79a060b Correct typos in comments. No changes to code.
FossilOrigin-Name: 55879932116d373c95a5f32ec44b53a9c3f4db24
2014-09-18 18:55:47 +00:00
drh
74eaba4de2 Merge the Mem.r value into the MemValue union as Mem.u.r. Hence, a Mem can
now store an integer or a real but not both at the same time.  Strings are
still stored in a separate element Mem.z, for now.

FossilOrigin-Name: 4c8c89d7e62aecfe2eb735f7bb114aed6b452847
2014-09-18 17:52:15 +00:00
drh
24a096297e Performance improvement for affinity transformations on comparison operators.
FossilOrigin-Name: d7afdcbac24350b73a30c06c45cf0f2122820e4f
2014-09-18 16:28:59 +00:00
drh
7ea31ccb01 Since numeric affinity is the most common case, check it first. Interchange
the NONE and TEXT affinity codes for easier checking of no affinity.

FossilOrigin-Name: 4ef4c9a7c8510203bce0941dda2f76ded8da1de2
2014-09-18 14:36:00 +00:00
dan
9675d5dabc Modify an assert() within sqlite3PagerWalFramesize(), a function only ever used by zipvfs, to account for recent zipvfs changes.
FossilOrigin-Name: 3bd7c1b2faa2d4cc95b255633204006849bfd5e0
2014-09-18 09:59:28 +00:00
drh
20f3df046a Fix harmless warnings on 32-bit MSVC builds.
FossilOrigin-Name: 5192f964b2a85459553f1cea741b9791606ccc4e
2014-09-18 02:20:54 +00:00
drh
760b15984b Make sure of the strchrnul() library function on platforms where it is
available.

FossilOrigin-Name: ef1aa10b7f54912cba71cd0a98c5055d501de54f
2014-09-18 01:50:09 +00:00
drh
9031494af2 Merge micro-optimizations into trunk after fixing the build on MSVC.
Performance now shows 7.58% faster than the 3.8.6 release on x64 with
gcc 4.8.1 and -Os.

FossilOrigin-Name: 1de558bcb13edc4e9a42a0b05e4b0ed6b14286a4
2014-09-18 01:29:11 +00:00
drh
3329a63ac5 Fix compiler warnings and change the nullMem structure initializer into a
format that MSVC can understand.

FossilOrigin-Name: 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
2014-09-18 01:21:43 +00:00
drh
ca5506bdc4 Performance improvement and slight size reduction to the comparison operators
in the VDBE.

FossilOrigin-Name: 14052a7d088bed8196d90a3361ce717a5193bdc8
2014-09-17 23:37:38 +00:00
drh
d3b74200a8 In the Mem object, stop requiring that Mem.xDel be NULL when the MEM_Dyn
bit is clear.  Also reduce the amount of initialization of Mem objects.
All for a small size reduction and performance increase.

FossilOrigin-Name: fdddb477c89dabb9f7bf2d5ccb32534868df3a03
2014-09-17 16:41:15 +00:00
drh
0725cabe3a Improved interface to the Mem object handling. Small size reduction and
performance increase.

FossilOrigin-Name: 4e437844322cc20eef92928b53fa6b37eded586e
2014-09-17 14:52:46 +00:00
drh
6b478bcd9e Continuing cleanup of memory register memory allocation handling.
FossilOrigin-Name: 2598aedc5dd2bac67e2e518a31f2803e469c2ba6
2014-09-16 21:54:11 +00:00
drh
8740a60016 Make sure registers are cleared properly prior to being used to store
the result of an OP_Column operator.

FossilOrigin-Name: 78fb8838d80b229418c347c63579989432e1af7d
2014-09-16 20:05:21 +00:00
drh
2a2a696cd7 Simplification of the OP_Column logic for the case of rows with overflow.
FossilOrigin-Name: f73678038d8fc399c1ca55230ae45962007c909c
2014-09-16 18:22:44 +00:00
drh
897a2d50f2 Remove an unused parameter from sqlite3VdbeIdxRowid(). This is cosmetic
only as the C-compiler optimizers were already omitting this parameter on
amalgamation builds.

FossilOrigin-Name: a10a6bba4963761b490b7243b388dcc920c4cfed
2014-09-16 14:55:08 +00:00
drh
75179ded97 Reduce the number of arguments to RecordCompare functions from 4 to 3,
resulting in a small performance increase.

FossilOrigin-Name: 8239c35aedd583af79505378bb7dbb78346a3f45
2014-09-16 14:37:35 +00:00
drh
035e563bf6 Reorder the elements of the Mem object for a small size reduction and
performance improvement.

FossilOrigin-Name: 0be3019ed794c10de67dfd645ceea7d45815bc4b
2014-09-16 14:16:31 +00:00
drh
7f4b19f170 Changes to sqlite3VdbeRecordUnpack() to make it slightly smaller and faster.
FossilOrigin-Name: 8fb90da77ce0e662c1ef1ae0d854e5164494b7af
2014-09-16 13:30:05 +00:00
drh
982ff72f0f Performance improvement to the sqlite3MemCompare() routine by factoring out
sqlite3BlobCompare().

FossilOrigin-Name: 20ed2321b09ba076e50f9fc2f42c135b25746d72
2014-09-16 03:24:43 +00:00
dan
b6dea49f3d Fix tool/showwal.c so that it handles WAL files that contain 64KiB pages.
FossilOrigin-Name: 4060efb646c873c4abde7ab9ddf330489a44f274
2014-09-15 16:53:23 +00:00
dan
ed7bcba798 Avoid attempting to call the xFetch() method of an sqlite3_io_methods object with a version number less than 3.
FossilOrigin-Name: dedaa6fb3d2e6e697d4a48649af5f42d9a11c333
2014-09-15 16:50:34 +00:00
drh
907214c8e8 Remove the EXPENSIVE_ASSERTS in pcache.c having to do with the pSynced field
of the Pcache object, as they are incorrect, as revealed by recent pcache
enhancements.

FossilOrigin-Name: 69a64560777f85b47349b4b2aab01dc99298592e
2014-09-15 14:59:12 +00:00
drh
9588ad95c1 Do not flatten aggregate subqueries that contain min() or max() functions
so that if the min()/max() are discarded by the outer query, they still
function and cause non-aggregate expression to be evaluated on the minimal
or maximal row.

FossilOrigin-Name: 0bdf1a086b3946722f4d4b328e25917f61c14713
2014-09-15 14:46:02 +00:00
drh
6092d2bcfe Adjust comments to show that subquery flattening restriction (10) was
removed from the code back in 2005.  This is a comment change only.

FossilOrigin-Name: 4ff0eb96bc364baed2d8005c69291ca9240b99dd
2014-09-15 11:14:50 +00:00
drh
36ce91913c Small performance improvement to the dirty list handling in the pager.
FossilOrigin-Name: b332a84d5154f70f3197537df4af243eaebbb011
2014-09-12 20:30:59 +00:00
drh
236241aeb0 Simplify the way the column cache is managed around OP_Move instructions.
FossilOrigin-Name: 320556233e19cdd9d590a09655c3465754700d39
2014-09-12 17:41:30 +00:00
drh
fb046e7653 Fix a problem with parser memory allocation on 32-bit systems.
FossilOrigin-Name: 2f69a1fa6adc9377149ae7faa586a5d30b6a631b
2014-09-12 04:28:33 +00:00
drh
fc59a954cb Fix an issue with sqlite3_bind_text64() with the SQLITE_UTF16 encoding
parameter.  Remove some unreachable code from the text64() and blob64()
implementation.

FossilOrigin-Name: 34292b084ef48cd6e9ca5704f6b072a29733b4c2
2014-09-11 23:34:55 +00:00
drh
46c831bf2a Add new APIs that take 64-bit length parameters: sqlite3_malloc64(),
sqlite3_realloc64(), sqlite3_bind_blob64(), sqlite3_bind_text64(),
sqlite3_result_blob64(), and sqlite3_result_text64().
Add the sqlite3_msize() interface.
Internal memory allocation routines now use 64-bit unsigned
length parameters for safety.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid
a integer overflow problem.

FossilOrigin-Name: 7e4978c003867d1b532b69221013dda75ca61953
2014-09-11 18:44:04 +00:00
drh
3586f9837d Add the SQLITE_USER_AUTHENTICATION extension to the trunk. This extension
is disabled by default.  Special compilation procedures are need to enable
it.

FossilOrigin-Name: 65884d4f81a4705b0356b6cb8ec4909945ff5c19
2014-09-11 17:27:54 +00:00
drh
c891c6c7ad Clean up some #includes in the extension API implementation.
FossilOrigin-Name: b149ef5c639e6bcff7bd1c7866353e7f7f468070
2014-09-11 17:14:54 +00:00
drh
3a3a03f29e Suppress the potential schema error that occurs when a non-user-auth
SQLite library tries to parse the sqlite_user table definition in a
user-auth database.

FossilOrigin-Name: cda33c1ef35416a155af602c0b4e9d42ccf8633f
2014-09-11 16:36:43 +00:00
drh
7883ecfcd4 Enhance the sqlite3_user_add() interface to initialize the user
authentication logic.  Add test cases for the extra argument on the
end of the authorizer callback.

FossilOrigin-Name: 842c6da8f1a62bd13a1b4089a98b0835a46a2285
2014-09-11 16:19:31 +00:00
drh
a000ca681a All interfaces working and tested.
FossilOrigin-Name: 96ea5c0b3cd1dec81d490f2f958ebd2e47a24921
2014-09-11 15:25:02 +00:00
drh
9d5b0df132 Get the sqlite3_user_delete() interface working.
FossilOrigin-Name: 974a9c65583f7ab438d5673dc00c347ab8322855
2014-09-11 14:56:45 +00:00
drh
570f187f78 Fix the sqlite3_user_change() interface so that it does allow a
non-admin user to change their own password.

FossilOrigin-Name: 52d440c7e1b07fc03f14ed5fa4cc4c89a75cd430
2014-09-11 14:40:27 +00:00
drh
b2445d5ee8 Move user authentication blocking from sqlite3_prepare() over to the
table lock generator, thus allowing SQL statements (like 
"PRAGMA locking_mode") that do not touch database content to run
prior to authentication.

FossilOrigin-Name: 70121e7cf868b7d6d19bf98794ddc3809a901456
2014-09-11 14:01:41 +00:00