Commit Graph

82 Commits

Author SHA1 Message Date
Michael Cahill
439f1213d6 Switch the Python API to not allocate objects explicitly, and instead leave that to SWIG typemaps.
This avoids making calls into Python's C API from our methods.  The problem with that is that in SWIG "thread" mode, we are not holding the Python interpreter lock, and some Python functions (including allocation functions) expect to be single-threaded.

While in the area, prefer generic SWIG macros to Python-specific ones and avoid int returns that are used purely for error checking.

closes #374
2012-10-24 14:33:39 +11:00
Michael Cahill
ca6c9037fa Cache cursor key/value formats in Python, to save a native call from every get_key/value. 2012-10-24 14:33:39 +11:00
Michael Cahill
033834a443 Turn on SWIG optimizations and warnings.
This doesn't appear to have any significant effect at the moment, but we may as well take advantage of them.
2012-10-24 14:33:39 +11:00
Michael Cahill
899d510f98 warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' 2012-10-03 18:18:43 +10:00
Michael Cahill
9803c4736a lang/python/wiredtiger_wrap.c:5726:3: warning: expression result unused
; should this cast be to 'void'? [-Wunused-value]
2012-09-12 15:04:39 +10:00
Keith Bostic
0c60365433 Replace cursor.equals with cursor.compare (#314) 2012-09-07 17:41:26 +00:00
Michael Cahill
06e48b3b0b Move dist/RELEASE to the top level of the tree.
Bump the version to 1.2.3 to check that it is updated everywhere.

--HG--
rename : dist/RELEASE => RELEASE
2012-08-02 14:23:03 +10:00
Michael Cahill
e4a08ad7f6 whitespace 2012-07-30 17:08:51 +10:00
Michael Cahill
b7c593b39b Fix warnings in SWIG code on OS X 10.8. 2012-07-30 16:32:42 +10:00
Michael Cahill
b608c27425 Fix methods that return integer parameters from Python.
This includes cursor.equals and cursor.search_near.
closes #276
2012-07-30 16:05:15 +10:00
Keith Bostic
71442cc95f Change cursor.equals to return a standard error value and store the cursor
equality result in a separate argument: close #274.

Add connection.is_new to the list of methods in the SWIG file that don't
require error handling, add a connection.is_new smoke test to the test
suite.

Add a connection.get_home smoke test to the test suite.
2012-07-28 11:56:53 +00:00
Michael Cahill
fd3a1bcc34 Determine statically in SWIG how to handle errors.
(This change requires SWIG 2.0.x for a bug fix involving interaction between
thread mode and exceptions in SWIG).
2012-07-11 13:53:51 +10:00
Michael Cahill
c4cf6417f6 Revert change to use SWIG exception in the Python API.
That relied on a bug fix in swig 2.0 (SWIG bug ID 2818499),
and we don't have SWIG 2.0 available everywhere.
reverts 2fb179afbd
2012-07-10 12:28:21 +10:00
Michael Cahill
2fb179afbd Decide statically what error handling is required. 2012-07-10 11:12:53 +10:00
Keith Bostic
80c1c05662 Change SWIG mapping to treat cursor.equals as a boolean return.
Change SWIG mapping to only support WT_NOTFOUND return from cursor methods
that search for keys.
2012-07-09 14:05:26 +00:00
Michael Cahill
8e0bafa05e Add a cast to the Python API when setting a record number.
(Found in transaction testing, refs #183).
2012-05-23 21:45:14 +10:00
Michael Cahill
410e800b1e retab the SWIG input file: whitespace was inconsistent. 2012-05-14 10:22:33 +10:00
Michael Cahill
8f941fa757 Handle errors in Python cursor._set_recno. 2012-05-14 10:02:36 +10:00
Keith Bostic
ff12749de3 The wiredtiger_struct_size() call can fail, it has to return an error
status, not a size.
2012-05-11 10:56:09 +00:00
Keith Bostic
5a06143447 Change wiredtiger_struct_{size,pack,unpack} to take a WT_SESSION as their
first argument, they're calling underlying functions that need to handle
errors in appropriate ways.

Fix some related documentation problems.

__log_record_size was calling the wrong function, fix that while I'm in
the area.

ref #209.
2012-05-11 10:36:20 +00:00
Michael Cahill
362714a228 Move the python "check" into lang/python: that simplifies things and avoids tracking the dependency. 2012-05-04 10:39:46 +10:00
Michael Cahill
4e7a2cd095 Add an interface for "data source" extensions.
--HG--
rename : docs/src/cursors.dox => docs/src/data_sources.dox
2012-03-11 10:46:07 +11:00
Keith Bostic
4b77de7959 Update copyright notice. 2012-03-12 12:09:20 -04:00
Keith Bostic
003688a168 SWIG 2.0.4 no longer mentions a LICENSE file, so there's reason we need to
have one, as far as I can tell.
2012-02-06 19:47:17 +00:00
Keith Bostic
8347925459 Retain copyright on the Python API, add the SWIG license to the local
directory.
2012-02-02 20:18:52 +00:00
Keith Bostic
8345e010cf The Python code is in the public domain. 2012-02-02 11:25:36 +00:00
Michael Cahill
734f5a7974 Update copyright notices for the BDB stubs and the Python API tests.
--HG--
extra : rebase_source : c270e923e1df304e8190062413a5028ad3da78d4
2012-02-02 10:03:18 +11:00
Keith Bostic
ce8d2c2558 Update the copyright notices. 2012-02-01 19:09:17 +00:00
Keith Bostic
4879e63e5b More copyright cleanup. 2012-02-01 15:32:36 +00:00
Michael Cahill
3fa04a7148 Add WT_CURSOR::uri containing the cursor source URI, primarily in support of WT_CURSOR::equals.
closes #153
2012-01-31 00:50:04 +11:00
Michael Cahill
246589707a Replace WT_CURSOR::first,last} with WT_CURSOR::reset. 2012-01-25 14:24:15 +11:00
Don Anderson
d5af0d22b0 Use new stat defines to look up values by key, rather than matching strings. 2012-01-24 11:39:54 +11:00
Michael Cahill
18d4ae91c3 Use underscores in public struct names to avoid namespace pollution. 2012-01-18 11:55:01 +11:00
Michael Cahill
86c3f25313 Add documentation to the Python API. 2011-11-02 10:34:30 +11:00
Don Anderson
d182472964 Added a test for 'wt dump'. Fixed python interface so that
wiredtiger_version() returns all its int values.
refs #16

--HG--
extra : rebase_source : 04afdc038a7201bb30cbc6bc384dcc3300533f46
2011-10-22 11:26:33 -04:00
Don Anderson
4fe07a6658 Fix output arg for search_near in python API. refs #31
Added more tests for cursor.search() and cursor.search_near().  refs #16

--HG--
extra : rebase_source : 5a6ec0aac1d61ae475e9ef355f6a051cf72ce6d5
2011-10-09 15:59:35 -04:00
Don Anderson
fd85797033 Added support to pack type 't', needed for 'fix' tables.
Added a simple test for fix tables.
refs #31
refs #16

--HG--
extra : rebase_source : 26f08d2b3715df318a0965e9c0d0f8b437cd8240
2011-10-06 07:06:08 -04:00
Michael Cahill
a5b0fd47de Don't require SWIG to build the Python API from a release. 2011-09-16 16:38:39 +10:00
Michael Cahill
dd5bee8486 Handle record numbers in raw cursors. 2011-09-15 21:41:17 +10:00
Michael Cahill
0c9c1d263b Some minor test fixes. 2011-09-15 15:13:05 +10:00
Don Anderson
4e36b6987d Added some workarounds to allow recnos to start to work:
- disable WT_CURSTD_RAW cursor flag for the duration of the call to get/set_key
- added typemaps so that Python long are compatible with 64 bit int
refs #31

--HG--
extra : rebase_source : bb25c23fcd649330e5729fe78d846ef81afb7a09
2011-09-14 16:30:25 -04:00
Michael Cahill
27a1bd8606 Use the swig "-thread" command line flag, it wraps our extension functions correctly as well. 2011-09-08 18:26:44 +10:00
Don Anderson
e7bdd917b0 Use an adaptor class for iterable, so we don't have to rename 'wt_cursor.next'.
refs #31

--HG--
extra : rebase_source : 0dcc43912afc6a15566f18551faf64c6369fabb9
2011-09-06 06:44:21 -04:00
Michael Cahill
b12f6c5458 Fix up various build issues:
* make test programs link statically by default
* depende on libwiredtiger.la so tests are relinked when the library changes
* don't bother with helper targets for test/insert
2011-09-06 07:09:39 +10:00
Michael Cahill
c545f4fc29 Split out the Python and examples from the top level Makefile. 2011-09-02 21:53:51 +10:00
Michael Cahill
9018517cb6 Add a cursor.reset operation to the Python API so that tests can use a cursor for inserts, then loop through the whole table in a natural way. 2011-09-02 21:53:51 +10:00
Michael Cahill
45c9f74209 Add some missing error checking to extension functions in the Python API. 2011-08-29 15:46:55 +10:00
Michael Cahill
574d7b43cf Add libtool to the build.
While in the area, add a pkg-config file.
* * *
[mq]: build-fixes
2011-08-26 15:28:43 +10:00
Don Anderson
5806941282 Release the Global Interpreter Lock during all WT calls.
Otherwise there will be no real multithreading for WT.
refs #31

--HG--
extra : rebase_source : 3c162bf4e42d21aebe4a3421d5d90feb2ae48ef4
2011-08-19 09:44:07 -04:00
Michael Cahill
d1ac7e8e57 Replace wiredtiger_recno_t with uint64_t.
closes #71
2011-07-22 09:40:58 +10:00