LAST_INSERT_ID and CRC32

2009-05-03 Thread thun...@isfahan.at
Hello, I have a questions and I hope, that is possible in MySQL. I have the following short Table. CREATE TABLE IF NOT EXISTS `testtable` ( `id` bigint(20) unsigned NOT NULL auto_increment, `id-crc` bigint(20) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id-crc` (`id-crc`) )

Re: LAST_INSERT_ID and CRC32

2009-05-03 Thread Johnny Withers
I don't think its possible to do what you want in a single statement. Since LAST_INSERT_ID() is set to the last insert id of the connection... and the row you are inserting doesn't exist.. well.. until you create it, it will always either be zero or the record BEFORE your next insert, ie: INSERT

Re: Question regards mysqldump and replication

2009-05-03 Thread Shawn Green
Dominik Klein wrote: Hi. I have a question regarding mysql replication and mysqldump. I have a master (A). All my clients insert/update/delete only to this master. Then I have a Slave (B). This slave only replicates the master. There are no other processes changing/inserting data into the

Re: LAST_INSERT_ID and CRC32

2009-05-03 Thread thun...@isfahan.at
Hi Johnny, I need the CRC32 for a unique URL-ID... I think it isn't to slow when I make a SELECT later in this form: Rows in Table: 825,984 Search for id: 2532552 (CRC32: 46316330) SELECT id FROM `testtable` WHERE id = 2532552 0.0005 sec. SELECT id FROM `testtable` WHERE CRC32(id) =

Re: LAST_INSERT_ID and CRC32

2009-05-03 Thread thun...@isfahan.at
I'm so sorry for the mistake... I mean: I think it is to slow when I make a SELECT later in this form: I don't think its possible to do what you want in a single statement. Since LAST_INSERT_ID() is set to the last insert id of the connection... and the row you are inserting doesn't exist..

Re: Where the hell did 5.4 come from?

2009-05-03 Thread Shawn Green
Andy Shellam wrote: My thoughts exactly! This article might help: http://dev.mysql.com/tech-resources/articles/mysql-54.html It worries me though that 5.1 went through a large number of alpha releases, then a set of beta releases before the GA release came out. It looks like they've

Re: Is there a MySQL 5.4 Speed advantage for MyISAM tables?

2009-05-03 Thread mos
At 09:40 AM 4/30/2009, you wrote: I see MySQL 5.4 is out. http://www.mysql.com/news-and-events/generate-article.php?id=1602 Sun claims there are speed improvements for Innodb and ClusterDb tables, but is there any reason to upgrade if I'm only using MyISAM tables? Also I didn't see a

Re: Log querys from stored procedure

2009-05-03 Thread Shawn Green
Hello Mauricio, Mauricio Tellez wrote: Hi, I'm trying to debug a stored procedure. This SP has a few queries and also call another SP. I'm starting mysql with the --log=my_queries.log but I found that mysql only log the call my_sp(param1, param2) but don't log any query inside my_sp neither log

Re: LAST_INSERT_ID and CRC32

2009-05-03 Thread Johnny Withers
Well, I think an update after insert is the only way. Other than perpopulating another table with possibe crc values then usinga join: Select id from testtable Inner join crctable on testtable.id=crctable.id Where crctable.crcval='xxx' Just be sure to index the crcval column. On Sunday,

expired mysql connection ?

2009-05-03 Thread Randomcoder
Hi, I run a Perl program on a test run of about 4 hours and my database connection expired/broke down. Here is the error I got : DBI connect('project','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at

mysqlcheck: Got error 202: Can't connect to local MySQL server through socket '/home/qsys/mysql-5.1.32/temp/mysql.sock'

2009-05-03 Thread michel
I am trying to set up MySQL on a GNU/Linux box with this script:cd /home/qsys gzip -cd /home/qsys/mysql-5.1.32.tar.gz | tar xf - mv /home/qsys/mysql-5.1.32 /home/qsys/mysql-5.1.32.source cd /home/qsys/mysql-5.1.32.source ./configure --prefix=/home/qsys/mysql-5.1.32 \

Fw: mysqlcheck: Got error 202: Can't connect to local MySQL server through socket '/home/qsys/mysql-5.1.32/temp/mysql.sock'

2009-05-03 Thread michel
Sorry for the bad end of lines in the first message! I am trying to set up MySQL on a GNU/Linux box with this script:cd /home/qsys gzip -cd /home/qsys/mysql-5.1.32.tar.gz | tar xf - mv /home/qsys/mysql-5.1.32 /home/qsys/mysql-5.1.32.source cd /home/qsys/mysql-5.1.32.source ./configure