Backport into build-200906240007-5.1.34sp1
Backport into build-200906240007-5.1.34sp1

> ------------------------------------------------------------
> revno: 2871.4.1
> revision-id: vvaintroub@mysql.com-20090429115110-1ye4700m8it5tyc5
> parent: staale.smedseng@sun.com-20090428161955-3vnku1igwt0knpfu
> committer: Vladislav Vaintroub <vvaintroub@mysql.com>
> branch nick: mysql-5.1-bugteam
> timestamp: Wed 2009-04-29 13:51:10 +0200
> message:
>   Bug#43932 myisam index corruption with large index and large 
>   key_buffer_size.
>   
>   The cause of corruption was number overflow when multiplying 
>   two ulong values, number of used keycache blocks with size
>   of a single block. The result of multiplication exceeded ulong 
>   range (4G) and this lead to incorrectly calculated  buffer offset
>   in the key cache.
>   
>   The fix is to use size_t for multiplication result.
>   
>   This patch also fixes pointless cast in safemalloc 
>   (size of allocated block to uint), that creates lot of false
>   alarm warnings when using big keycache (> 4GB) in debug mode.

natsys/mariadb_10.2,flynn1973/mariadb-aix,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,davidl-zend/zenddbi,ollie314/server,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,ollie314/server,davidl-zend/zenddbi,ollie314/server,ollie314/server,natsys/mariadb_10.2,slanterns/server,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,flynn1973/mariadb-aix,ollie314/server,davidl-zend/zenddbi,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi