Commit Graph

13142 Commits

Author SHA1 Message Date
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
drh
32c6a48b5e Add support for the extra parameter on the sqlite3_set_authorizer() callback
and support for failing an ATTACH with an authentication-required database
using bad credentials.  The extension is now feature complete, but much
testing and bug-fixing remains.

FossilOrigin-Name: 596e728b0eb19a34c888e33d4d37978ca2bf1e00
2014-09-11 13:44:52 +00:00
drh
d39c40ff5e Reorder parameters on the sqlite3_user_*() interfaces for consistency.
Add the first TCL test cases.

FossilOrigin-Name: 2f6d8f32eef526b5912f42ab467e3c7812480d8b
2014-09-11 00:27:53 +00:00
drh
09e60541ae Complete the implementation of the various APIs. Fix several problems.
This is another incremental check-in that does not completely work.

FossilOrigin-Name: 4eaaa7fa87aa912d24f8b35440ab60310dc08310
2014-09-10 22:46:46 +00:00
drh
f442e33e3a Add the ".user" shell command and implement the sqlite3_user_add()
routine.  Incremental check-in.  The code compiles but does not work.

FossilOrigin-Name: a0455f9deb603bf91684158d911269622720fc1a
2014-09-10 19:01:14 +00:00
drh
e933b83f02 Further ideas on user authentication. Not yet working code.
FossilOrigin-Name: c8171ecd0d6f097c9e95d5f6643bae8d67f44750
2014-09-10 17:34:28 +00:00
drh
bbf483f855 Change the name of the _texte64() interfaces to just _test64(), without the "e".
FossilOrigin-Name: 6ab76c5fedfe568b0f0f34a600f9135bf6558148
2014-09-09 20:30:24 +00:00
drh
0807cc2c29 Add new interfaces to the loadable extension mechanism.
FossilOrigin-Name: 18d80cbc590165913d82056aa69ddaeea07b76ec
2014-09-09 18:41:32 +00:00
drh
da4ca9d19c Add new APIs that take 64-bit length parameters:
sqlite3_malloc64(),
sqlite3_realloc64(),
sqlite3_bind_blob64(),
sqlite3_bind_texte64(),
sqlite3_result_blob64(),
and sqlite3_result_texte64().
Internal memory allocation routines also now use 64-bit unsigned length
parameters for safety.
Also add the sqlite3_msize() interface.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid a
integer overflow problem.

FossilOrigin-Name: 94954850cf2e1ec0b7f590c7f46cdc54c72558ce
2014-09-09 17:27:35 +00:00
drh
d45309796b Non-working preliminary implementation attempts on user authentication.
FossilOrigin-Name: 8440f093bac19a41d44ee352744354eab897fe4e
2014-09-09 14:47:53 +00:00
dan
524a733d89 Fixes to os_unix.c to support database (and other) files larger than 2GiB on Android.
FossilOrigin-Name: ad7063aa1a0db32cdbe71815545b2edca57d3bcc
2014-09-06 17:06:13 +00:00
dan
3fdf46a16e Merge latest trunk changes with this branch.
FossilOrigin-Name: 9dca7ce55797b3eb617859f6189c1a2ec6f66566
2014-09-06 16:52:18 +00:00
dan
2ee5341288 Fixes to os_unix.c to support database (and other) files larger than 2GiB.
FossilOrigin-Name: e7fae33c0754488336ce093189a83dfe1b818d89
2014-09-06 16:49:40 +00:00
peter.d.reid
60ec914c74 Fix typos in comments. No code changes.
FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69
2014-09-06 16:39:46 +00:00