smaller type conversion bugs on 32 bit

Bug #1087202 reported by Vladislav Vaintroub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Laurynas Biveinis
5.1
Fix Released
Medium
Laurynas Biveinis
5.5
Fix Released
Medium
Laurynas Biveinis
5.6
Invalid
Undecided
Unassigned

Bug Description

There are couple of bugs about conversion of ib_uint64_t types (like LSNs) to size_t-big types. On 32 bit, for big enough values it would mean truncating valuable bits off the value. I used Visual Studio compiler to find the bugs, gcc by default is lax on type conversions, even ones that might result in loss of information.

Also, I found that ut_max inline function was sometimes incorrectly used on 64 bit values - it is defined for ulint values, which is != ib_uint64_t on 32 bit

Finally, there is a warning about truncation of ib_uint64_t to double, in I_S handling (because Field::store(double) was used instead of Field::store(longlong,bool)). I'll attach the patch shortly.

Tags: contribution

Related branches

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

Notes:
The warnings are found in XtraDB inside MariaDB, here is the listing

http://buildbot.askmonty.org/buildbot/builders/win32-packages/builds/733/steps/build_zip/logs/warnings%20%2834%29 .

Revision history for this message
Vladislav Vaintroub (wlad-montyprogram) wrote :

The patch is against xtradb in MariaDB 5.1.66. I hope it applies to PerconaServer, too

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Thanks Vladislav.

All of the truncation_warnings.patch is in the new log tracking feature (not tested on Windows...)

tags: added: contribution
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1285

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.