Skip to content

return a known error code when max rows is exceeded#3159

Merged
sougou merged 1 commit intovitessio:masterfrom
HubSpot:max_rows_error
Sep 11, 2017
Merged

return a known error code when max rows is exceeded#3159
sougou merged 1 commit intovitessio:masterfrom
HubSpot:max_rows_error

Conversation

@bbeaudreault
Copy link
Copy Markdown
Contributor

I chose negative numbers for the vitess error codes so they dont conflict with mysql, but could be easily swayed to choose something else if preferred. There are no pre-existing mysql error codes that really make sense for this.

We could also add another field to SQLError, if that would be preferred.

@sougou
Copy link
Copy Markdown
Contributor

sougou commented Sep 11, 2017

We should find out what error code mysql returns for the max rows setting and mimic that.

@bbeaudreault
Copy link
Copy Markdown
Contributor Author

@sougou I scanned https://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html and I didn't see any error codes that made sense. I don't think mysql sets a limit on this?

There is an ER_TOO_MANY_ROWS, but that is specifically for the case of select * from foo where a = (select b from bar), when the inner query returns more than 1 row.

@sougou
Copy link
Copy Markdown
Contributor

sougou commented Sep 11, 2017

LGTM
I think this is ok for now. But we have to keep an eye on it. It could become a problem later if some third party tools get confused by the error code.

Approved with PullApprove

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

Successfully merging this pull request may close these issues.

3 participants