Backport into build-200911241145-5.1.40sp1
Backport into build-200911241145-5.1.40sp1

> ------------------------------------------------------------
> revno: 1810.3961.12
> revision-id: li-bing.song@sun.com-20091103090041-zj7nedx6ok5jgges
> parent: davi.arnaut@sun.com-20091102201021-1brn7cjb1kvqg9gr
> committer: <Li-Bing.Song@sun.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Tue 2009-11-03 17:00:41 +0800
> message:
>   BUG#48216 Replication fails on all slaves after upgrade to 5.0.86 on master
>   
>   When a sessione is closed, all temporary tables of the session are automatically 
>   dropped and are binlogged. But it will be binlogged with wrong database names when
>   the length of the temporary tables' database names are greater than the 
>   length of the current database name or the current database is not set.
>   
>   Query_log_event's db_len is forgot to set when Query_log_event's db is set.
>   This patch wrote code to set db_len immediately after db has set.

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