drop stored procedures in prepare statment

2007-03-06 Thread xian liu
hi guys, I'm searching stored procedures with prepare statment in mysql-5.0. It seems that can not use 'drop procedure xxx' in prepare statment , like this: mysql> create procedure drpsp() -> begin -> prepare aa from 'drop procedure ct_tb'; -> execute aa; -> end

Pointers about replication

2007-03-06 Thread Cabbar Duzayak
Hi All, Would it be possible to provide some advanced pointers (articles/books/tutorials/sites) for learning more about replication? I am particularly interested in master-to-master replication (not even sure if this is possible with mysql) and/or real-world usage scenarios/examples as to how mu

Re: Best Practice: Timezones and web development

2007-03-06 Thread Chris McKeever
Wanted to thank everyone for the insights for some of this date/time issues! Pretty much what I was looking at, just wanted a little confirmation! I will also need to research that PHP function - Thanks - Chris On 3/6/07, Marcus Bointon <[EMAIL PROTECTED]> wrote: On 6 Mar 2007, at 17:12, David

Ability to escape varbinary data when sent to the console?

2007-03-06 Thread Kevin Burton
We need to store binary data form time to time in mysql. To date I've just base64 encoded the data to avoid having it corrupt the console on SELECT * Is there any way to have the mysql command line client automatically do this for me? Is there any work around? base64 is about 30% data bloat

/etc/my.cnf in 5.0.27 RHEL4 RPMS is broken!

2007-03-06 Thread Aaron Scamehorn
>Description: The /etc/my.cnf that is included with RHEL4 5.0.27 RPMS is incompatibel with the /etc/init.d/mysql start scripts! [EMAIL PROTECTED] rhel4]$ sudo rpm -Uveh MySQL*.rpm Password: warning: MySQL-client-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Prepa

RE: Best Practice: Timezones and web development

2007-03-06 Thread Jerry Schwartz
Remember that if you supply an argument to UNIX_TIMESTAMP(), the argument is interpreted according to the time zone of the connection, not the time zone of the server. I wonder if some combination of JavaScript's getTimezoneOffset() method, a hidden form field, and using the returned value to set t

RE: Best Practice: Timezones and web development

2007-03-06 Thread Dana Diederich
I think the best way is to always store an unsigned integer epoch time. Cheers, -Dana -Original Message- From: David T. Ashley [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 11:12 AM To: Chris McKeever Cc: mysql@lists.mysql.com Subject: Re: Best Practice: Timezones and web deve

Re: Best Practice: Timezones and web development

2007-03-06 Thread William R. Mussatto
On Tue, March 6, 2007 9:40, Marcus Bointon said: > On 6 Mar 2007, at 17:12, David T. Ashley wrote: > >> Best practice is that all times maintained in a database (or >> anywhere on the >> server) are UTC, and are only converted to local timezone and/or >> adjusted to >> daylight savings time as requ

Re: Elimination Query

2007-03-06 Thread Jay Pipes
Miles Thompson wrote: That looks a lot more professional - thanks. No problem! test it out first, though! ;) Where can I get information on writing better SQL? There's lots of good books on it. Joe Celko's SQL for Smarties books are great for that stuff. (Also, shameless plug: my own bo

Re: Best Practice: Timezones and web development

2007-03-06 Thread Marcus Bointon
On 6 Mar 2007, at 17:12, David T. Ashley wrote: Best practice is that all times maintained in a database (or anywhere on the server) are UTC, and are only converted to local timezone and/or adjusted to daylight savings time as required to display data for a specific user. Exactly right.

Re: Best Practice: Timezones and web development

2007-03-06 Thread David T. Ashley
On 2/28/07, Chris McKeever <[EMAIL PROTECTED]> wrote: Does anyone have any resources, guides, insight into the best practice for storing date/time information when developing a custom web app? I am mainly concerned with how the TZ should be stored? Should it go in as UTC and the code accounts

Re: Elimination Query

2007-03-06 Thread Miles Thompson
Jay, That looks a lot more professional - thanks. Where can I get information on writing better SQL? Regards - Miles Thompson From: Jay Pipes <[EMAIL PROTECTED]> DELETE bm_KW FROM bm_KW INNER JOIN ( SELECT kw2.KeywordID FROM bmjn_KW kw1 INNER JOIN bmjn_KW kw2 ON kw1.KeywordID = kw2.KeywordI

Re: Elimination Query

2007-03-06 Thread Jay Pipes
DELETE bm_KW FROM bm_KW INNER JOIN ( SELECT kw2.KeywordID FROM bmjn_KW kw1 INNER JOIN bmjn_KW kw2 ON kw1.KeywordID = kw2.KeywordID AND kw2.ItemID != '1016' WHERE kw1.ItemID = '1016' ) AS keywords ON bm_KW.KeywordID = keywords.KeywordID; Miles Thompson wrote: This query works but is there any way

Re: help me optimize this sql

2007-03-06 Thread Jay Pipes
SELECT * FROM table_one t1 INNER JOIN table_two t2 ON t1.column_one = t2.column_one LEFT JOIN table_three t3 ON t3.column_two = t1.column_three AND t3.column_four = t1.column_five WHERE column_six LIKE '%dsc%' AND column_seven LIKE '%aaa%'; There is no need for a derived table. Also, using LIKE '

Problems with migration from 4.0.24 to 5.0.32 with unique varchar

2007-03-06 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm having trouble with the following: In the MySQL 4 database I had the following values in an unique varchar and there was no problem: Gross Groß (the latter has the german sharp "s" character) Now whenever I import this into the MySQL5 data

Elimination Query

2007-03-06 Thread Miles Thompson
This query works but is there any way of making it more elegant or speeding it up? DELETE from bm_KW USING bm_KW, bmjn_KW WHERE bm_KW.KeywordID IN (SELECT bmjn_KW.KeywordID FROM bmjn_KW WHERE bmjn_KW.ItemID = '1016' ) AND bm_KW.KeywordID NOT IN (SELECT bmjn_KW.Key

Re: Google like search string to be implemented

2007-03-06 Thread abhishek jain
On 3/6/07, Nils Meyer <[EMAIL PROTECTED]> wrote: Hi, abhishek jain wrote: > I am having a database with varchar(255) columns named title, > extra_info1,extra_info2,extra_info3 . > I want to search all these columns with a search string given to me via a > form ,I am using PERL, the string will

help me optimize this sql

2007-03-06 Thread wangxu
sql: select * from table_one inner join table_two on table_two.column_one = table_one.column_one left join (SELECT * from table_three) table_four on table_four.column_two = table_one.column_three and table_fo

Re: Google like search string to be implemented

2007-03-06 Thread Nils Meyer
Hi, abhishek jain wrote: I am having a database with varchar(255) columns named title, extra_info1,extra_info2,extra_info3 . I want to search all these columns with a search string given to me via a form ,I am using PERL, the string will be like +abhishek jain -abcd "this should be exact" I t

Re: *.MYI was corrupted with OS crash when lots of rows were inserting

2007-03-06 Thread Duncan Hill
On Tuesday 06 March 2007 01:51:38 xian liu wrote: > Hi all, > > when I insert many records into a myisam type table, at the same time, > unplugged the power cable, the os crash, I found several *.MYI file was > corrupted, but can use "repair" or "myisamchk" to repair those table. > > Is there any w