-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump go.mongodb.org/mongo-driver from 1.13.0-prerelease.0.20230726045…
…955-5ee10b94cc66 to 1.13.0 (#34497) (#34998) * Bump go.mongodb.org/mongo-driver Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.13.0-prerelease.0.20230726045955-5ee10b94cc66 to 1.13.0. - [Release notes](https://github.com/mongodb/mongo-go-driver/releases) - [Commits](https://github.com/mongodb/mongo-go-driver/commits/v1.13.0) --- updated-dependencies: - dependency-name: go.mongodb.org/mongo-driver dependency-type: direct:production update-type: version-update:semver-patch ... * mongodb: Handle deprecated parsing logic Because we want to support older mongo DB versions we need to continue to support parsing these now deprecated message types. * Apply PR feedback and update to handle remaining deprecated fields * update MongoDB test server to expect OpMsg instead of OpQuery for MongoAtlas * deflake attempt 1 * bump test default max message size due to switch to OP_MSG --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: STeve Huang <xin.huang@goteleport.com>
- Loading branch information
1 parent
e55e7a8
commit 6668d40
Showing
8 changed files
with
108 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright 2023 Gravitational, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package protocol | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/x/bsonx/bsoncore" | ||
"go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage" | ||
) | ||
|
||
// This file contains logic which has been deprecated from MongoDB's client library, but needs to be supported for | ||
// our backwards compatibility needs. This deprecation started in MongoDB 1.13.0. | ||
|
||
// OpmsgWireVersion is the minimum wire version needed to use OP_MSG | ||
const OpmsgWireVersion = 6 | ||
|
||
// ReadQueryFlags reads OP_QUERY flags from src. | ||
func ReadQueryFlags(src []byte) (flags wiremessage.QueryFlag, rem []byte, ok bool) { | ||
i32, rem, ok := readInt32(src) | ||
return wiremessage.QueryFlag(i32), rem, ok | ||
} | ||
|
||
// ReadQueryFullCollectionName reads the full collection name from src. | ||
func ReadQueryFullCollectionName(src []byte) (collname string, rem []byte, ok bool) { | ||
return readCString(src) | ||
} | ||
|
||
// ReadQueryNumber is a replacement for ReadQueryNumberToSkip or ReadQueryNumberToSkip. This function reads a 32 bit | ||
// integer from src. | ||
func ReadQueryNumber(src []byte) (nts int32, rem []byte, ok bool) { | ||
return readInt32(src) | ||
} | ||
|
||
// ReadDocument is a replacement for ReadQueryQuery or ReadQueryReturnFieldsSelector. This function reads a bson | ||
// document from src. | ||
func ReadDocument(src []byte) (rfs bsoncore.Document, rem []byte, ok bool) { | ||
return bsoncore.ReadDocument(src) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters