()
| 18 | } |
| 19 | |
| 20 | func generateOneMBInsert() string { |
| 21 | letterList := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") |
| 22 | b := make([]byte, 1024*1024) |
| 23 | for i := range b { |
| 24 | // Use crypto/rand for secure random generation |
| 25 | randomIndex, err := rand.Int(rand.Reader, big.NewInt(int64(len(letterList)))) |
| 26 | if err != nil { |
| 27 | // Fallback to a simple pattern if crypto/rand fails |
| 28 | b[i] = letterList[i%26] |
| 29 | } else { |
| 30 | b[i] = letterList[randomIndex.Int64()] |
| 31 | } |
| 32 | } |
| 33 | return fmt.Sprintf("INSERT INTO t values('%s')", string(b)) |
| 34 | } |
| 35 | |
| 36 | func TestApplyMultiStatements(t *testing.T) { |
| 37 | type testData struct { |
no test coverage detected