summaryrefslogtreecommitdiff
path: root/src/cursor/cur_dump.c
Commit message (Collapse)AuthorAgeFilesLines
* WT-2693 Check open_cursor error paths for consistent handling (#2859)Keith Bostic2016-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WT-2693 Check open_cursor error paths for consistent handling There's a problem with cursor functions which don't call their typed close functions, relying instead on a simple free of the base cursor type because the __wt_cursor_init() function is the last function called before successful return. The problem is __wt_cursor_init() doesn't clean up after itself: for example, it allocates memory to hold the URI in WT_CURSOR.internal_uri, then has a number of subsequent potential error returns, and WT_CURSOR.internal_uri won't be free'd unless __wt_cursor_close() is called. In other words, we should always call the typed closed function (which in turn calls __wt_cursor_close()). Specific additional concerns: cursor/cur_backup.c: __wt_curbackup_open() doesn't turn off backups or clear the hot-backup flag if __wt_cursor_init() fails, which will hang the process. Remove the cleanup-on-error code from the __backup_start() function and rely instead on the backup cursor's close function to do the work. There's a problem if we fail the initial backup cursor test, in which case we don't want to do cleanup other than discarding the cursors themselves. Add the WT_CURBACKUP_LOCKER flag to the WT_CURSOR_BACKUP structure, which isn't set until we're holding the hot backup cursor flag, and use it to figure out how much cleanup needs to be done. cursor/cur_file.c: the change to call the __curfile_close() function has a problem with __wt_bulk_wrapup(), which assumes WT_CURSOR_BULK.reconcile has been initialized, change it to check for NULL. cursor/cur_file.c: the change to call the __curfile_close() function has a problem with incrementing the data-source's in-use counter. Instead of incrementing the counter in __wt_curfile_open() before calling __curfile_create(), increment it in __curfile_create() after the point where all failure paths close the cursor. cursor/cur_log.c: the change to call the __curlog_close() function means we may be required to clean up a cursor that has not yet acquired the log archive lock. Add the WT_CURLOG_ARCHIVE_LOCK flag to the WT_CURSOR_LOG structure so the close function knows if the log archive lock needs to be released. cursor/cur_log.c: remove the __curlog_reset() call from __curlog_close(), we're closing the cursor, resetting it doesn't do anything useful. cursor/cur_metadata.c: the change to call the __curmetadata_close() function is slightly tricky, be cautious about closing the underlying WT_CURSOR_METADATA.file_cursor field, it may not be set when we call __curmetadata_close(). * comment typo * fix a comment * Add explicit comment on the life-cycle of the WT_CURBACKUP_LOCKER flag. * Review comment, set a specific size on the flags field. Generally, the cursors all use uint8_t for flags, and I don't think it matters much what we use, use the same thing everywhere.
* WT-2691 Use wrappers for ctype functions to avoid sign extension errors (#2824)Keith Bostic2016-06-221-1/+1
| | | | | gcc 4.7, clang 3.4 and clang 3.8 all complain about different things; cast the arguments to our new wrapper functions, hopefully that makes all of the complaints go away.
* WT-2691 Use wrappers for ctype functions to avoid sign extension errors (#2818)Don Anderson2016-06-211-1/+1
| | | | | | | | | | | | | | * Cast arguments for ctype functions to avoid sign extension errors. Create __wt_* versions of all ctype functions, and use them whenever wt_internal.h is available. Add check to prevent direct use of ctype functions from core source. * Change wrappers to use u_char arguments, and return bool. Remove unused wrappers. * Use u_char in preference to unsigned char. * Examples do not have u_char defined on Windows.
* WT-2268 WT-2597 JSON load/dump Unicode fixes (#2749)Don Anderson2016-05-311-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | * WT-2268 Change dump representation so every byte represents a single 0x00-0xff Unicode character. Otherwise arbitrary binary data (that does not conform to Unicode) cannot be represented. Fix an off-by-one error in counting bytes on input. Added some better Unicode tests. * JSON Dump now uses a 'dump version' stamp, as well as showing WT version. Dump input that is too old, and input that is too new will be rejected. * In setting a key for dump, converting a JSON string must always occur first. * When loading JSON, treat binary data just like strings. Fixed an error in determining the string length of JSON in the presence of Unicode strings. * Add LSM tests to JSON dump/load testing. * Add more extensive testing for dump/reload of JSON binary data. * Byte arrays differ from strings for JSON input, they do not null terminate. Handle escapes like '\n', '\t', etc. on input. * Added tests of JSON dump/load of all byte codes. * whitespace
* WT-2410: Casting function pointers to different typesKeith Bostic2016-02-191-16/+16
| | | | | Don't cast function pointers to different types, it's undefined behavior. Fixes for the cursor layer.
* Upgrade copyright notices from 2015 to 2016.Keith Bostic2016-01-011-1/+1
|
* WT-1315. Added support for join cursors:Don Anderson2015-11-031-1/+1
| | | | | | | | | | | | - "join:" URI handling added to WT_SESSION::open_cursor, added WT_SESSION::join. - Added support for in-memory bloom filters. - Minor fix to cur_dump_close CURSOR_API_CALL. - Some refactoring in __wt_{curindex,curtable}_get_value() to allow them to be called internally. - Use new macro JOINABLE_CURSOR_API_CALL() instead of CURSOR_API_CALL() to trap illegal calls to joined cursor. - __wt_curtable_open now takes an owning cursor arg. - Added __wt_struct_unpack_size() and __wt_struct_repack()
* Boolean conversion pass over cursor.Keith Bostic2015-09-241-7/+8
|
* WT-2122 Convert more expressions to use bool. In particular, make F_ISSET a ↵Michael Cahill2015-09-221-6/+6
| | | | boolean expression and add F_MASK for applying a mask to flags.
* Push renaming down into `api_data.py`, replacing lower-case handleKeith Bostic2015-04-211-1/+1
| | | | naming with the standard public name.
* Merge branch 'develop' into cursor-equalMichael Cahill2015-01-171-0/+1
|\ | | | | | | | | | | | | Conflicts: src/cursor/cur_std.c src/cursor/cur_table.c src/include/extern.h
| * Merge branch 'develop' into cursor-reconfigureMichael Cahill2015-01-141-0/+1
| |\
| * \ Merge branch 'develop' into cursor-reconfigureKeith Bostic2014-12-151-2/+2
| |\ \ | | | | | | | | | | | | | | | | Conflicts: src/cursor/cur_metadata.c
| * | | Add support for a WT_CURSOR.reconfigure method, reference #1381.Keith Bostic2014-12-111-0/+1
| | | |
* | | | Rename WT_CURSOR compare_equal to be equals.Alex Gorrod2015-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While here, add a generic cursor equals stub in curstd, rather than redirecting via cursor function pointer lists. Implement the Java API wrapper.
* | | | Add support for the WT_CURSOR.compare_equal method.Keith Bostic2015-01-101-0/+1
| |_|/ |/| |
* | | Copyright notices: add MongoDB, update to 2015.Keith Bostic2015-01-041-0/+1
| |/ |/|
* | Most WiredTiger calloc calls are to allocate a single structure,Keith Bostic2014-12-151-2/+2
|/ | | | | create the macro __wt_calloc_one that doesn't take a count or a sizeof.
* Merge branch 'develop' into json-loadAlex Gorrod2014-10-151-1/+1
|\ | | | | | | | | | | | | Conflicts: dist/s_string.ok src/include/extern.h src/utilities/util_load.c
| * STATIC_ASSERT is outside of the claimed WiredTiger name space (andKeith Bostic2014-10-041-1/+1
| | | | | | | | | | | | far too likely to be seen in the field), prefix it with WT SIZE_CHECK is local to include/verify_build.h, make sure it stays there.
* | Merge branch 'develop' into json-loadDon Anderson2014-09-251-2/+2
|\ \ | |/
| * Ensure that the WT_CURSOR::uri field matches open_cursor URI.Alex Gorrod2014-09-181-2/+2
| | | | | | | | Since we document that is how it works.
* | Merge branch 'develop' into json-loadAlex Gorrod2014-09-191-1/+1
|\ \ | |/
| * __wt_cursor_init has a long list of tests for cursor methods that weKeith Bostic2014-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | don't need, except for get/set-key and get/set-value, almost all of the methods are explicitly set, it's simpler to set them all then to leave that code in place. Two real changes besides the semantic sugar: change the config cursor reset method from not-supported to a no-op, that's the default, delete the __cursor_search function (the default search method), no code needed it.
* | Add JSON loading to cursors and wt load utility. refs #740.Don Anderson2014-08-061-12/+13
|/ | | | | | | | | | | | | Allow set_key and set_value on JSON cursors. The argument is a string that is interpreted as JSON and must match the format created by a JSON dump cursor or the 'wt dump -j' command. Add -j option to 'wt load' utility to allow loading JSON. Small adjustment to Python interface so that JSON cursor key/values inputs are always treated as strings. Added doc and Python tests for JSON cursors and wt load -j.
* I can never remember which version of API_END has the return call andKeith Bostic2014-06-271-6/+3
| | | | | which doesn't; create API_END_RET and API_END_RET_NOTFOUND_MAP, leave API_END for functions without any return value.
* Check dump cursor for JSON flag early in the call stack #1031Susan LoVerso2014-05-271-0/+8
|
* Coverity errors 1215469 and 1215470: the jump to the error label couldKeith Bostic2014-05-231-6/+8
| | | | fail to call call va_end().
* KNFSusan LoVerso2014-05-221-1/+1
|
* Tighten args and change some function names.Susan LoVerso2014-05-211-6/+5
|
* Wrap json cursors as a type of dump cursor.Susan LoVerso2014-05-211-28/+74
|
* Last change was wrong -- ret was needed, we just weren't returning it.Keith Bostic2014-05-071-1/+2
|
* Remove unused variables.Keith Bostic2014-05-071-1/+0
|
* Merge branch 'develop' into metadata-cursorsMichael Cahill2014-04-231-5/+5
|\
| * Set the TXN_ERROR flag for errors in any transactional call, not just updates.Michael Cahill2014-04-231-5/+5
| | | | | | | | refs #969
* | Further implementation of metadata cursors.Alex Gorrod2014-03-171-1/+5
|/
* Update copyright notices for 2014.Keith Bostic2014-01-071-1/+1
| | | | Move lang/java and lang/python into the public domain.
* Create a Python pass for source code style checking (to eventually replace ↵Michael Cahill2013-11-051-0/+8
| | | | s_style).
* Create a WT_CURSOR_DATA_SOURCE structure so data-source cursors (almost)Keith Bostic2013-07-051-2/+2
| | | | follow the standard cursor patterns.
* More work on data-source configuration support.Keith Bostic2013-04-111-1/+1
| | | | | | | | | | | | | | | We can't stack a random set of entries into a cfg[] because we don't want to allocate memory in the API. Instead, whenever a method's arguments are reconfigured, re-build the base configuration string by appending the new configuration, and re-build the checks array, that way we always have a single base configuration string and a single checks array. Re-work how we're handling lists, we can't expect the application to crack them, they can be seriously messy. If it's a list, create an array of NULL-terminated refrences to nul-terminated strings (create an "argv" array, in other words). It's ugly, and the user has to free the memory, but I don't see an alternative.
* Support new configuration options added by the applications, using a newKeith Bostic2013-04-091-1/+1
| | | | | | | | method, WT_CONNECTION::configure_method. For some reason I can'quite figure out, this set of changes made lint run a bunch better on some sources, and showed up a few different uninitialized variables in error paths. Got me why, but they're real, and I fixed them.
* First cut at moving the configuration information into the WT_CONNECTION_IMPLKeith Bostic2013-04-091-1/+5
| | | | | | | | | | | | structure: create the array of WT_CONFIG_ENTRY structures that the connection references, and a set of #defines so we can easily reference any single slot. Replace API_CONF_DEFAULTS and explicit references to the old structures with WT_CONFIG_VALUE and WT_CONFIG_CHECKS. Some (hopefully) minor shuffling of the cfg array manipulation in various chunks of code. The test suite and various test programs run with this change.
* fix a commentKeith Bostic2013-04-011-1/+1
|
* Create a #define that initializes a static WT_CURSOR and use it.Keith Bostic2013-01-081-27/+15
|
* Update copyright notice to 2013.Keith Bostic2013-01-011-1/+1
|
* Add a __wt_panic function that shuts down all of the WiredTiger APIs.Keith Bostic2012-12-101-1/+1
|
* Stylistic change only: I'm about to put in panic checks, make the styleKeith Bostic2012-12-101-3/+1
| | | | | of API_END/return consistent, a blank line before the error label, API_END next to the return.
* Rename our strtouq to __wt_strtouq so we don't export anything outsideAlex Gorrod2012-12-031-1/+1
| | | | of our namespace.
* Implement auto-commit of transactions at the API.Michael Cahill2012-09-191-5/+5
| | | | | This simplifies code that tried to get the effect of auto-commit internally. closes #309, refs #310
* Replace cursor.equals with cursor.compare (#314)Keith Bostic2012-09-071-2/+1
|