Commit Graph

77 Commits

Author SHA1 Message Date
Jeffrey A. Clark
166821f22c
PYTHON-5205 Replace http with https in doc links (#2204) 2025-03-14 21:37:11 -04:00
Shane Harvey
8f26f43911
PYTHON-4450 Support free-threaded Python 3.13t with no-GIL (#1906) 2024-10-10 09:01:27 -07:00
Jeffrey A. Clark
7380097dbc
PYTHON-3959 - NULL Initialize PyObjects (#1859) 2024-10-03 13:39:04 -04:00
Shane Harvey
ec4cb3ee55
PYTHON-4285 More consistent PyModule_GetState checks (#1560) 2024-03-25 13:48:45 -07:00
Shane Harvey
a8b8dab04a
PYTHON-3745 Add support for multiphase initialization (#1499)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
2024-02-16 10:44:13 -08:00
Iris
0b5bdccf3a
PYTHON-3729 use PyObject_GetAddr instead of PyObject_GetAddrString (#1281) 2023-07-03 09:15:04 -07:00
thalassemia
1ba4c0bcbd
PYTHON-3718 Faster INT2STRING (#1221) 2023-06-05 18:35:39 -05:00
thalassemia
4c0196d340
PYTHON-3717 Speed up _type_marker check in BSON (#1219) 2023-05-26 09:40:32 -05:00
Ben Warner
be3008aa11
PYTHON-2110 Refactored some C to avoid symbol conflicts (#968)
* Refactored to avoid symbol conflicts

* Forgot a replacement

* Found a symbol

* Undid symbol replacement for PyInit__cmessage

* Changed cbson too

Co-authored-by: Ben Warner <ben.warner@mongodb.com>
2022-06-13 11:42:41 -07:00
Shane Harvey
797197e73b
PYTHON-2763 Remove outdated check_keys and $clusterTime logic (#817) 2021-12-10 10:22:49 -08:00
Shane Harvey
11752ed594
PYTHON-2899 Remove code for MongoDB <= 3.4 (#729)
Remove unneeded memoryview to bytes conversion.
2021-09-16 16:53:50 -07:00
Shane Harvey
a28b05bf24 PYTHON-1410 Remove "safe" legacy messages 2021-08-04 11:29:16 -07:00
Bernie Hackett
96b75808d1 PYTHON-2133 Remove py2 support from extensions 2021-01-26 14:26:03 -08:00
Shane Harvey
3463f060e9 PYTHON-2191 Fix buffer leak added in 021adc53e8 2020-04-09 12:56:58 -07:00
Shane Harvey
643e64880e PYTHON-2188 Raise ValueError instead of MemoryError when encoding exceeds 2GiB 2020-04-08 15:07:41 -07:00
Shane Harvey
a3556c4447 PYTHON-2012 Update FLE to support commands larger than 6MiB
Bulk write command are batched at 2MiB when auto encryption is enabled.
2019-11-12 15:24:09 -08:00
Shane Harvey
9cf0fbd785
PYTHON-2001 Fix warnings emitted by Python 3.8 (#428)
Fix DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
Fix DeprecationWarning: isAlive() is deprecated, use is_alive() instead
Fix SyntaxWarning: invalid escape sequence
Test Python 3.8 on Travis
2019-11-08 11:48:15 -08:00
Shane Harvey
55c8bdd346 PYTHON-1939 Add prose tests for BSON size limits and batch splitting 2019-08-13 13:35:55 -07:00
Shane Harvey
cd787dbb2c PYTHON-1791 Fix reference counting leaks
Fix batched op_msg/op_query reference leak of overflow doc.
Fix theoretically possible (but practically impossible) reference leak of
$clusterTime in op_query.
Optimization: Don't encode document past the batch size in batched op_query.
2019-03-27 13:04:02 -07:00
Shane Harvey
d571ac022c PYTHON-1647 Fix memory leak in OP_MSG C extensions 2018-10-09 13:24:13 -07:00
Shane Harvey
b57e6e281f PYTHON-1599 Fix unchecked return value in cmessagemodule 2018-06-26 13:59:02 -04:00
Shane Harvey
05c7c65470 PYTHON-1329 OP_MSG with unacknowledged writes
Replace OP_INSERT/OP_UPDATE/OP_DELETE usage with OP_MSG with moreToCome
flag when the server is 3.6 or greater.
Unack'ed OP_MSG supports bypass_document_validation.
getLastError updatedExisting is always false on mongos after an OP_MSG
unack'ed update.
2018-06-23 11:46:50 -04:00
Bernie Hackett
4a9c65eb22 PYTHON-1329 - OP_MSG unacknowledged bulk writes 2018-06-22 22:00:07 -07:00
Bernie Hackett
4d786fd0cd PYTHON-1329 - OP_MSG bulk writes 2018-06-21 16:03:20 -07:00
Shane Harvey
ea8cb6c209 PYTHON-1329 Send/receive commands as OP_MSG
Don't use $query with OP_MSG.
Support compression with OP_MSG.
2018-06-21 15:46:48 -07:00
Bernie Hackett
3e075b0a58 PYTHON-1278 - Fix Windows builds 2018-05-22 15:35:39 -07:00
Bernie Hackett
335cb97a34 PYTHON-1278, PYTHON-1553 - Support OP_COMPRESSED 2018-05-22 11:44:21 -07:00
Shane Harvey
1a784e1afb PYTHON-1466 Silence minor complaints from Coverity
Remove useless NULL check as GETSTATE cannot return NULL after
successful initialization.
2018-02-12 11:31:48 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
de801be529 Silence various complaints from Coverity 2017-11-30 15:02:20 -08:00
Shane Harvey
280efd2d72 PYTHON-1339 Generate a single message in _do_batched_write_command.
Ordered op_insert should check for errors on the last insert.
Use _Bulk API for Collection.insert.
Avoid sending acknowledged inserts as much as possible.
max_cmd_size already accounts for trailing null bytes.
2017-10-31 16:59:26 -04:00
Shane Harvey
6721e0157b Revert "PYTHON-1299 Remove "safe" legacy messages."
This reverts commit da8fabc49a.
2017-10-12 12:14:33 -07:00
A. Jesse Jiryu Davis
df018e88e2 PYTHON-1332 - Gossip $clusterTime 2017-10-12 09:08:38 -04:00
Shane Harvey
da8fabc49a PYTHON-1299 Remove "safe" legacy messages. 2017-09-29 12:09:24 -07:00
Bernie Hackett
c4e8d22544 PYTHON-1025 - C extensions big endian support 2016-06-24 17:54:24 -07:00
Bernie Hackett
c327913cbf Fix issues found in coverity scan 2015-09-29 17:29:59 -07:00
Bernie Hackett
b80fa6d632 PYTHON-952 - Bulk write operations monitoring
This change adds monitoring of bulk write operations (i.e.
Collection.bulk_write, Collection.insert_many, Collection.insert with multiple
documents, Bulk.execute, etc.). It also fixes bugs in conversion of legacy
write results to write command result format and conversion of legacy queries
to find command documents. Finally, it adds an operation_id attribute to the
published events to tie related events together.
2015-09-10 09:10:19 -07:00
Bernie Hackett
0e4f79c7c3 PYTHON-952 - Non-bulk write operation monitoring 2015-08-21 12:47:08 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
27874fc2ec PYTHON-857 - Update C version of batch writes.
As with the Python functions, the C implementations of _do_batched_insert and
_do_batched_write command must now take a SocketInfo, not a MongoClient, to
ensure they send the OP_INSERT or write command over the same socket used to
determine the server's wire protocol version.
2015-03-21 16:36:43 -04:00
A. Jesse Jiryu Davis
9da835ab3d PYTHON-825 BSON API changes and internal options handling.
This change resolves four issues:

PYTHON-826 The new codec_options submodule is moved from pymongo to bson.

PYTHON-827 Use codec_options in BSON APIs.

Functions and methods of the bson module that accepted the options as_class,
tz_aware, and uuid_subtype now accept a codec_options parameter instead.

For example, the function definition for bson.decode_all changes from this:

def decode_all(data, as_class=dict, tz_aware=True,
               uuid_subtype=OLD_UUID_SUBTYPE)

to:

def decode_all(data, codec_options=CodecOptions())

The following functions are changed:

- decode_all
- decode_iter
- decode_file_iter

The following methods are changed:

- BSON.encode
- BSON.decode

This is a breaking change for any application that uses the BSON API directly
and changes any of the named parameter defaults. No changes are required for
applications that use the default values for these options. The behavior
remains the same.

PYTHON-828 Internal BSON module changes to support CodecOptions

The pure Python BSON module passes around a CodecOptions instance instead of
as_class, tz_aware, and uuid_subtype. C extensions pass these values around in
a struct.

PYTHON-801 Rename uuid_subtype to uuid_representation.
2015-02-05 23:09:23 -06:00
A. Jesse Jiryu Davis
28cf3102a6 Undeprecate message.insert().
In PyMongo 2.6, message.insert was replaced with _do_batched insert. It was
deprecated but not removed in case third-party libraries might rely on it. In
PyMongo 2.7 we implemented the Bulk API (PYTHON-630) and message.insert found a
new use.
2014-11-17 20:30:11 -05:00
Bernie Hackett
b94298b202 PYTHON-685 - Fix rare resource leak in _cmessage 2014-04-29 13:30:26 -07:00
A. Jesse Jiryu Davis
6d5f658c2a Use maxWriteBatchSize for write command batch splitting, PYTHON-642. 2014-02-21 14:05:40 -05:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
cdaa711b26 Remove unused variable. 2014-01-29 13:13:55 -08:00
Bernie Hackett
ee9ecd05ee Introduce DocumentTooLarge exception PYTHON-630
The idea here is to unify the handling of oversize documents when using
the bulk API in MongoDB 2.6 and previous versions. This also means that
using bulk Collection.insert against legacy servers will attempt to insert
all documents previous to the oversize document before raising.
2014-01-29 12:55:49 -08:00
Bernie Hackett
6e35b8af84 Update write commands support PYTHON-554
This change brings write commands support up to
date with the current spec and gets tests passing
with the latest nightly builds of MongoDB 2.5.x.
2014-01-14 09:37:23 -08:00
Bernie Hackett
681205ab5a Clean up write commands support PYTHON-554
A few changes:

- Eliminate the ordered parameter - no reason this needs to be a
separate param.
- Use integers to represent the operation instead of strings - this
will make part of the bulk API implementation a bit cleaner and
avoid a bunch of string comparisons.
- Clean up namespace and collection name handling in collection.py - No
need to create a bunch of new strings or do unnecessary string copies.
- Pass client.disconnect to _check_command_response to deal with
"not master".
2013-12-01 08:59:07 -05:00
Bernie Hackett
b2d1034989 Use commands for write operations PYTHON-554 2013-11-25 18:21:04 -08:00