June 18, 2013

Post: Statement based replication with Stored Functions, Triggers and Events

… not the Event itself. Example: mysql> create event year ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT INTO t VALUES(YEAR(CURDATE… SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT INTO t VALUES(YEAR(CURDATE())) After one hour the event gets executed. The insert is…

Post: Timezone and pt-table-checksum

…of CURRENT_TIMESTAMP.  From the manual, here is how MySQL handles timezone locality with timestamp fields: Values for TIMESTAMP columns are converted from the current …in EDT time.  Now, lets insert some rows into a table with timestamp field configured to use CURRENT_TIMESTAMP as the default and …

Post: INSERT ON DUPLICATE KEY UPDATE and summary counters.

INSERT … ON DUPLICATE KEY UPDATE is very powerful but often forgotten MySQL feature. It was introduced in MySQL 4.1 but I still… takes advantage of is TIMESTAMP field. By default first TIMESTAMP column will have its value automatically updated to current timestamp on insert and update. We…

Post: Edge-case behavior of INSERT...ODKU

…host_id TINYINT UNSIGNED NOT NULL, last_modified TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY(id), UNIQUE KEY…currently set to 2. If we do an INSERT … ODKU on this table, we see the following: (root@localhost) [test]> insert… as being defined first. So, MySQL checks our INSERT, sees that the next auto-…

Post: Ultimate MySQL variable and status reference list

…the amazing MySQL manual, especially the option and variable ….commanual delayed_insert_limitblogpercona.commanual Delayed_insert_threadsblogpercona.commanual delayed_insert_timeoutblogpercona.commanual …_timeoutblogpercona.commanual Innodb_row_lock_current_waitsblogpercona.commanual Innodb_row_lock_…

Post: Recovery after DROP & CREATE

…VARCHAR(45) NOT NULL, ->   last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, ->   PRIMARY KEY  (actor_id),… sec) # ./page_parser -f /var/lib/mysql/ibdata1 # ./bin/constraints_parser.SYS_TABLES … is lost when new record is inserted. But the actual old values remain…

Comment: How to find wrong indexing with glance view

inserts, updates and deletes but not so much in 2010. MySQL surprisingly supports declarative integrity constraints. But wait being MySQL… order_date datetime not null, last_updated timestamp not null default current_timestamp on update current_timestamp, foreign key(item_type_id) references…

Post: Long PRIMARY KEY for Innodb tables

… NULL default ’0′, `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`url`,`thumb_width`,`thumb…/repairing large MyISAM tables in case of MySQL/System crash is painful and great to… many images from one domain/album are inserted at about same time which makes …

Post: Statistics of InnoDB tables and indexes available in xtrabackup

…(20) unsigned NOT NULL, `message_published` timestamp NOT NULL default CURRENT_TIMESTAMP, `kind` enum(‘link’,'img’) NOT … –stats –tables=art.link* –datadir=/mnt/data/mysql/ which will show something like this: table…it will grow with further inserts, and I also suspect random INSERTS into so dense …

Post: Infinite Replication Loop

… the timestamp included in the last executed sql statement. As some of them are looping, the timestamp of… looping statement were first inserted. Another way to see it is by monitoring your MySQL server with cacti,… in case the replication of events with the current server_id didn’t fetch up. There is…