1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug#15409: Columns with 64-element SET may not be updated with integers.

SET column storing procedure has been modified to be 64bit-clean.
This commit is contained in:
gshchepa/uchum@host.loc
2008-02-08 16:04:01 +04:00
parent 83bb97b495
commit 2e9f2b678c
3 changed files with 31 additions and 3 deletions

View File

@ -7871,10 +7871,10 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
int Field_set::store(longlong nr, bool unsigned_val)
{
int error= 0;
if ((ulonglong) nr > (ulonglong) (((longlong) 1 << typelib->count) -
(longlong) 1))
ulonglong max_nr= set_bits(ulonglong, typelib->count);
if ((ulonglong) nr > max_nr)
{
nr&= (longlong) (((longlong) 1 << typelib->count) - (longlong) 1);
nr&= max_nr;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
error=1;
}