Question

I create view,Statement follows:

DELIMITER $$
USE `dada`$$
DROP VIEW IF EXISTS `view_product_new`$$
CREATE ALGORITHM=UNDEFINED DEFINER=`dada`@`%` SQL SECURITY DEFINER VIEW `view_product_new` AS 
SELECT product_id,FROM_UNIXTIME(`update_date`,'%Y%m%d') FROM web_product$$
DELIMITER ;

The view can be created successfully,but my binlog is destroyed. Statement follows:

mysqlbinlog mysql-bin.000167

ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 66129, event_type: 32

If i delete FROM_UNIXTIME(update_date,'%Y%m%d'),the above statement don't occured

My mysql version is 5.1.30

Was it helpful?

Solution

As I said in my comment, you're using a rather old version of MySQL, one that came out before 2009 in fact, according to wikipedia.

Old versions are bound to harbour bugs that have been fixed in newer versions, so without anything obviously wrong with your code it's possible that upgrading would fix an issue you're having.

Even if it doesn't, it's in your interest to upgrade anyway. The 5.1 branch is the oldest one Oracle currently supports. They also recently released MySQL 5.6, and they probably don't want to continue active maintenance of 3 branches...

5.6 is new so it's probably still got issues that need ironing out, but you should be pretty safe upgrading to 5.5 provided you back your database up first. If the worst comes to the worst and unresolvable problems crop up with a 5.5 install you can always use your backup to roll back to an older version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top