diff options
author | unknown <guilhem@mysql.com> | 2005-11-07 16:18:46 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2005-11-07 16:18:46 +0100 |
commit | dba800c4777631ecdef7110985c7275df3ff0f4b (patch) | |
tree | 7b70cea20c3b819b996a804ba53efafcba9e279a /sql/field.cc | |
parent | f6903ed0c34c2e8a383b3ae30c5d63b9aa323e64 (diff) | |
download | mariadb-git-dba800c4777631ecdef7110985c7275df3ff0f4b.tar.gz |
Fix for BUG#14703 "Valgrind error when inserting 0 into a BIT column (like in type_bit.test)":
test "length" first (otherwise when "length" is 0, the *from invalid access still triggers a Valgrind warning).
I wrote to the Valgrind authors in case this is something fixable in Valgrind (normally the
decision to issue a warning is based on the simulated CPU condition code, which should not be undefined here).
BUILD/compile-pentium64-valgrind-max:
putting this script in sync with compile-pentium-valgrind-max, otherwise we didn't have the federated engine compiled in.
mysql-test/r/read_only.result:
result update
sql/field.cc:
To avoid a Valgrind warning running the type_bit test: test "length" first (otherwise when "length" is 0, the *from invalid access still triggers a Valgrind warning).
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 03d20b4bfe2..18ef77230f2 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7931,7 +7931,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) { int delta; - for (; !*from && length; from++, length--); // skip left 0's + for (; length && !*from; from++, length--); // skip left 0's delta= field_length - length; if (delta < -1 || @@ -8151,7 +8151,7 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) int delta; uchar bits= create_length & 7; - for (; !*from && length; from++, length--); // skip left 0's + for (; length && !*from; from++, length--); // skip left 0's delta= field_length - length; if (delta < 0 || |