Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tarantool 2.11.x fixes #76

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions anon_slave_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func TestAnonSlaveSubscribeExpectedReplicaSetUUIDFail(t *testing.T) {

ver, err := tntBoxVersion(box)
require.NoError(err)
if ver >= version2_8_0 && ver < version2_9_0 {
t.Skip("Tarantool 2.8 returns an empty replicaset UUID, skip check")
if ver >= version2_8_0 && ver < version2_9_0 || ver >= version2_11_0 {
t.Skip("Tarantool 2.8/2.11 returns an empty replicaset UUID, skip check")
}

s, _ := NewAnonSlave(box.Listen, Options{
Expand Down
16 changes: 14 additions & 2 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,29 @@ func TestAuth(t *testing.T) {
User: "user_not_found",
Password: "qwerty",
})
ver, _ := tntBoxVersion(box)

if assert.Error(err) && assert.Nil(conn) {
assert.Contains(err.Error(), "is not found")
if ver >= version2_11_0 {
assert.Exactly(err.Error(), "User not found or supplied credentials are invalid")
} else {
assert.Contains(err.Error(), "is not found")
}
}

// bad password
conn, err = box.Connect(&Options{
User: "tester",
Password: "qwerty",
})
ver, _ = tntBoxVersion(box)

if assert.Error(err) && assert.Nil(conn) {
assert.Contains(err.Error(), "Incorrect password supplied for user")
if ver >= version2_11_0 {
assert.Exactly(err.Error(), "User not found or supplied credentials are invalid")
} else {
assert.Contains(err.Error(), "Incorrect password supplied for user")
}
}

// ok user password
Expand Down
10 changes: 6 additions & 4 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
KeyLSN = uint(0x03)
KeyTimestamp = uint(0x04)
KeySchemaID = uint(0x05)
KeyVersionID = uint(0x06)
KeySpaceNo = uint(0x10)
KeyIndexNo = uint(0x11)
KeyLimit = uint(0x12)
Expand Down Expand Up @@ -135,7 +136,7 @@ const (
ErrDropUser = uint(0x2c) // Failed to drop user '%s': %s
ErrNoSuchUser = uint(0x2d) // User '%s' is not found
ErrUserExists = uint(0x2e) // User '%s' already exists
ErrPasswordMismatch = uint(0x2f) // Incorrect password supplied for user '%s'
ErrCredsMismatch = uint(0x2f) // User not found or supplied credentials are invalid
ErrUnknownRequestType = uint(0x30) // Unknown request type %u
ErrUnknownSchemaObject = uint(0x31) // Unknown object type '%s'
ErrCreateFunction = uint(0x32) // Failed to create function '%s': %s
Expand Down Expand Up @@ -378,7 +379,8 @@ const (
// 2.3.1 is min version for anonymous replication
version2_3_1 = uint32(131841) // VersionID(2, 3, 1)
// Add box.info.replication_anon
version2_5_1 = uint32(132353) // VersionID(2, 5, 1)
version2_8_0 = uint32(133120) // VersionID(2, 8, 0)
version2_9_0 = uint32(133376) // VersionID(2, 9, 0)
version2_5_1 = uint32(132353) // VersionID(2, 5, 1)
version2_8_0 = uint32(133120) // VersionID(2, 8, 0)
version2_9_0 = uint32(133376) // VersionID(2, 9, 0)
version2_11_0 = uint32(133888) // VersionID(2, 11, 0)
)
5 changes: 5 additions & 0 deletions fetch_snapshot.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package tarantool

import "github.com/tinylib/msgp/msgp"

// FetchSnapshot is the FETCH_SNAPSHOT command
type FetchSnapshot struct{}

Expand All @@ -12,6 +14,9 @@ func (q *FetchSnapshot) GetCommandID() uint {
// MarshalMsg implements msgp.Marshaler
func (q *FetchSnapshot) MarshalMsg(b []byte) (o []byte, err error) {
o = b
o = msgp.AppendMapHeader(o, 1)
o = msgp.AppendUint(o, KeyVersionID)
o = msgp.AppendUint(o, uint(version2_9_0))
return o, nil
}

Expand Down
Loading