This function is useful for control of master/slave
synchronization. It blocks until the slave has read and applied
all updates up to the specified position in the master log. The
return value is the number of log events the slave had to wait
for to advance to the specified position. The function returns
NULL if the slave SQL thread is not started, the slave's master
information is not initialized, the arguments are incorrect, or
an error occurs. It returns -1 if the timeout has been exceeded.
If the slave SQL thread stops while MASTER_POS_WAIT() is waiting,
the function returns NULL. If the slave is past the specified
position, the function returns immediately.
If a timeout value is specified, MASTER_POS_WAIT() stops waiting
when timeout seconds have elapsed. timeout must be greater than
0; a zero or negative timeout means no timeout.
This is great for applications which …
I've just released changes to two of the tools in MySQL Toolkit. MySQL Table Checksum got some convenient functionality to help you recursively check slaves for bad replicated checksum chunks. MySQL Archiver got statistics-gathering functionality to help you optimize your archiving and purging jobs, plus a few important bug fixes.
MySQL recently released 5.1.20 beta. I just ran into another gotcha, which prompted me to post this draft I’ve had for a while.
rbradford@newyork:/opt/mysql51$ scripts/mysql_install_db Installing MySQL system tables... 070709 23:24:08 [Note] Plugin 'InnoDB' disabled by command line option OK Filling help tables... 070709 23:24:08 [Note] Plugin 'InnoDB' disabled by command line option OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h newyork password 'new-password' See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd …[Read more]
I’m at some internal MySQL training today at our US HQ. In a room of 11 people we are all using our laptops for access to additional machines. The beauty of this is we have Linux (Ubuntu 5.10, 6.10, 7.04, Red Hat Fedora), Mac OS/X and Windows Operating Systems on various staff machines. It’s great to realize we are not locked into just one infrastructure, and we have the ability to all do our work effectively and MySQL works just as well across these technologies. I can’t however SSH from my iPhone yet, unlike my previous Nokia E62 PDA.
I’ve just released changes to two of the tools in MySQL Toolkit. MySQL Table Checksum got some convenient functionality to help you recursively check replicas for bad replicated checksum chunks. MySQL Archiver got statistics-gathering functionality to help you optimize your archiving and purging jobs, plus a few important bug fixes. Changes in MySQL Archiver: Made –time suffix optional. Added –statistics option to gather and print timing statistics. Added signal handling so mysql-archiver exits cleanly when it can.
Sadly, it’s not my bug, it’s a bug in the MySQL Documentation.
http://bugs.mysql.com/bug.php?id=29915
I’m actually quite surprised nobody has run into this before, and in fact many sources quote this stating that %I and %h are the same thing.
I can’t be the only person in the world that’s ever needed hours with stripped leading zeros before. The irony is that before the submitted bug I was 5 points away from being a Basic Quality Contributor, and it would be very funny to me if this is the bug that pushed me over to qualify for a free Basic license….particularly since my company JUST bought a few licenses a month ago.
Several MySQLers will be at Oscon next week in Portland. Speakers from MySQL include Kaj Arno, Jay Pipes, Marten Mickos and Brian Aker. We have a booth at the show and will be recruiting for some of our open jobs, which are listed at http://jobs.mysql.com . There's also a joint reception with Zend planned for Tuesday July 24 at 5:30 pm at the DoubleTree Cantina bar. I hope to see many Oscon regulars there!
[Read more]
If you have configured a large query_cache in your MySQL configuration file,
and your database freezes sporadically, take a look at the bugs
#21074 and #26460 in the MySQL bug tracking system. Under
heavy load with a large query cache, invalidating part of the
cache could cause the server to freeze (that is, to be unable to
service other operations until the invalidation was
complete).
The bugfix was pushed into the 5.1 branch a few days ago, so it
will be part of the next release 5.1.21-beta. Unfortunately it
wasn't pushed into the 5.0 branch yet, hence the only way to
workaround this problem in production environments is to reduce
the query cache.
This is always mentioned that InnoDB is slower in giving results for COUNT(*) as compared to MyISAM. But as Peter points out in his blog that this fact only applies to COUNT(*) queries without WHERE clause. This text is from Peter's blog only - "If you have query like SELECT COUNT(*) FROM IMAGE WHERE USER_ID=5 this query will be executed same way both for MyISAM and Innodb tables by performing index rage scan. This can be faster or slower both for MyISAM and Innodb depending on various conditions." Let's see what EXPLAIN has in store for us.
1: mysql> CREATE TABLE `test_index` (
2: `id` int(11) NOT NULL AUTO_INCREMENT,
3: `x` int(11) DEFAULT NULL,
4: `y` int(11) DEFAULT NULL,
5: `z` varchar(255) NOT NULL DEFAULT 'testing',
6: PRIMARY KEY (`id`),
7: …[Read more]