summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0sel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index ee79bc94906..9cb4e0f6f20 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -4555,6 +4555,15 @@ row_search_autoinc_read_column(
ut_a(len != UNIV_SQL_NULL);
ut_a(len <= sizeof value);
+#ifdef WORDS_BIGENDIAN
+ /* Copy integer data and restore sign bit */
+
+ memcpy((ptr = dest), data, len);
+
+ if (!unsigned_type) {
+ dest[0] ^= 128;
+ }
+#else
/* Convert integer data from Innobase to a little-endian format,
sign bit restored to normal */
@@ -4566,6 +4575,7 @@ row_search_autoinc_read_column(
if (!unsigned_type) {
dest[len - 1] ^= 128;
}
+#endif
/* The assumption here is that the AUTOINC value can't be negative.*/
switch (len) {