1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6473 - main.statistics fails on PPC64

mysql.column_stats wasn't stored/restored properly on big-endian
with histogram_type=DOUBLE_PREC_HB.

Store histogram values using int2store()/uint2korr().

Note that this patch invalidates previously calculated histogram
values on big-endian.
This commit is contained in:
Sergey Vojtovich
2014-07-23 12:55:26 +04:00
parent a1e41e3258
commit d466ed90fd
2 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ private:
case SINGLE_PREC_HB:
return (uint) (((uint8 *) values)[i]);
case DOUBLE_PREC_HB:
return (uint) (((uint16 *) values)[i]);
return (uint) uint2korr(values + i * 2);
}
return 0;
}
@ -214,7 +214,7 @@ public:
((uint8 *) values)[i]= (uint8) (val * prec_factor());
return;
case DOUBLE_PREC_HB:
((uint16 *) values)[i]= (uint16) (val * prec_factor());
int2store(values + i * 2, val * prec_factor());
return;
}
}
@ -226,7 +226,7 @@ public:
((uint8 *) values)[i]= ((uint8 *) values)[i-1];
return;
case DOUBLE_PREC_HB:
((uint16 *) values)[i]= ((uint16 *) values)[i-1];
int2store(values + i * 2, uint2korr(values + i * 2 - 2));
return;
}
}