diff options
author | Joerg Bruehe <joerg.bruehe@oracle.com> | 2012-05-07 22:20:42 +0200 |
---|---|---|
committer | Joerg Bruehe <joerg.bruehe@oracle.com> | 2012-05-07 22:20:42 +0200 |
commit | ad1e123f478e170cdbed5fd0e6a58277e61326ad (patch) | |
tree | fd4bc4e87a0385cd676cd34fe9ba93dd57358f2e /sql/field.cc | |
parent | 066dc9a281ee8932827f7e6180dd0fa1bfe5d922 (diff) | |
parent | 582b7283472a43af5d7fb51386df055ea9d44a96 (diff) | |
download | mariadb-git-ad1e123f478e170cdbed5fd0e6a58277e61326ad.tar.gz |
Merge 5.5.24 back into main 5.5.
This is a weave merge, but without any conflicts.
In 14 source files, the copyright year needed to be updated to 2012.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 59eb83da5fa..4fcf5b33dc1 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -8257,7 +8257,19 @@ String *Field_set::val_str(String *val_buffer, ulonglong tmp=(ulonglong) Field_enum::val_int(); uint bitnr=0; - val_buffer->set("", 0, field_charset); + if (tmp == 0) + { + /* + Some callers expect *val_buffer to contain the result, + so we assign to it, rather than doing 'return &empty_set_string. + */ + *val_buffer= empty_set_string; + return val_buffer; + } + + val_buffer->set_charset(field_charset); + val_buffer->length(0); + while (tmp && bitnr < (uint) typelib->count) { if (tmp & 1) |