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

Broken pipe error on large statements #24

Open
JustPixelz opened this issue May 22, 2017 · 0 comments
Open

Broken pipe error on large statements #24

JustPixelz opened this issue May 22, 2017 · 0 comments

Comments

@JustPixelz
Copy link

If SQL statement character count exceeds 0xffffff - 5, EXEC fails with "Broken pipe" error. MySQL specification says large statements should be split into multiple packets. I did not test large/multi-packet response.

TEST code manufactures large string then truncates to 0xfffff8 then attempts exec operation

print("large packet test")
var largeString = "abcd1234"
while largeString.characters.count < 0xfffff0		{ largeString += largeString }
let index = largeString.index(largeString.startIndex, offsetBy: 0xfffff8)
largeString = largeString.substring(to: index)
print(largeString.characters.count)
try con.exec("select '\(largeString)'")
print("END large packet test END")

STDOUT...

Hello, World!
large packet test
16777208
writeFailed("Broken pipe")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant