Skip to content

Commit

Permalink
SQL: respect signed in set_max(), is_max()
Browse files Browse the repository at this point in the history
  • Loading branch information
midenok committed May 5, 2017
1 parent a722593 commit 78c5d1d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sql/field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4359,16 +4359,22 @@ void Field_longlong::sql_type(String &res) const
bool Field_longlong::set_max()
{
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
int8store(ptr, ULONGLONG_MAX);
int8store(ptr, unsigned_flag ? ULONGLONG_MAX : LONGLONG_MAX);
return FALSE;
}

bool Field_longlong::is_max()
{
ASSERT_COLUMN_MARKED_FOR_READ;
ulonglong j;
j = sint8korr(ptr);
return j == ULONGLONG_MAX;
if (unsigned_flag)
{
ulonglong j;
j= uint8korr(ptr);
return j == ULONGLONG_MAX;
}
longlong j;
j= sint8korr(ptr);
return j == LONGLONG_MAX;
}

/*
Expand Down

0 comments on commit 78c5d1d

Please sign in to comment.