Skip to content

make oursql compile against mariadb and mysql 5.6 / 5.7 #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions oursqlx/_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,10 @@ enum _oursqlx_exception_type _oursqlx_exc_from_errno(int err) {
return _oursqlx_PermissionsError;

default:
#if MYSQL_VERSION_ID >= 50700
for(unsigned int i = 0; i < sizeof(errmsg_section_start)/sizeof(int); ++i) {
#if MYSQL_VERSION_ID >= 50700 && !defined(ER_ERROR_FIRST)
{
unsigned int i;
for(i = 0; i < sizeof(errmsg_section_start)/sizeof(int); ++i) {
int min = errmsg_section_start[i];
int max = errmsg_section_start[i] + errmsg_section_size[i] - 1;
if ( err >= min && err <= max ) {
Expand All @@ -628,6 +630,7 @@ enum _oursqlx_exception_type _oursqlx_exc_from_errno(int err) {
if ( err > CR_MIN_ERROR && err < CR_MAX_ERROR) {
return _oursqlx_InterfaceError;
}
}
#else
if (err >= ER_ERROR_FIRST && err <= ER_ERROR_LAST)
return _oursqlx_ProgrammingError;
Expand Down