mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
SQL providers: make sure we don't exceed the allowed placeholders
Fixes #1415 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -592,7 +592,7 @@ func TestDataTransferExceeded(t *testing.T) {
|
||||
|
||||
func TestGetUsersForQuotaCheck(t *testing.T) {
|
||||
usersToFetch := make(map[string]bool)
|
||||
for i := 0; i < 50; i++ {
|
||||
for i := 0; i < 70; i++ {
|
||||
usersToFetch[fmt.Sprintf("user%v", i)] = i%2 == 0
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ func TestGetUsersForQuotaCheck(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, users, 0)
|
||||
|
||||
for i := 0; i < 40; i++ {
|
||||
for i := 0; i < 60; i++ {
|
||||
user := dataprovider.User{
|
||||
BaseUser: sdk.BaseUser{
|
||||
Username: fmt.Sprintf("user%v", i),
|
||||
@@ -631,7 +631,7 @@ func TestGetUsersForQuotaCheck(t *testing.T) {
|
||||
|
||||
users, err = dataprovider.GetUsersForQuotaCheck(usersToFetch)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, users, 40)
|
||||
assert.Len(t, users, 60)
|
||||
|
||||
for _, user := range users {
|
||||
userIdxStr := strings.Replace(user.Username, "user", "", 1)
|
||||
@@ -655,7 +655,7 @@ func TestGetUsersForQuotaCheck(t *testing.T) {
|
||||
assert.Equal(t, int64(0), total)
|
||||
}
|
||||
|
||||
for i := 0; i < 40; i++ {
|
||||
for i := 0; i < 60; i++ {
|
||||
err = dataprovider.DeleteUser(fmt.Sprintf("user%v", i), "", "", "")
|
||||
assert.NoError(t, err)
|
||||
err = dataprovider.DeleteFolder(fmt.Sprintf("f%v", i), "", "", "")
|
||||
|
||||
Reference in New Issue
Block a user