MySQL 4.1.12 has been released

2005-05-15 Thread Matt Wagner
Hi, A new version of MySQL Community Edition 4.1.12 Open Source database management system has been released. It is now available in source and binary form for a number of platforms from our download pages at http://dev.mysql.com/downloads/ and mirror sites. Note that not all mirror sites may be

Re: Single vs Multiple primary keys

2005-05-15 Thread Dan Bolser
On Sun, 15 May 2005, Martijn Tonies wrote: >Bob, > >> I have a table, see below, that contains a single primary key >(SubTestCaseKey ) and a number of foreign keys >> >> * plantriggers_ID_FK , >> * testcase_root_ID_FK >> * testcasesuffix_name_FK >> >> What I want to ensure is that there are no dup

Re: amPiguous!

2005-05-15 Thread Dan Bolser
On Sat, 7 May 2005, Jochem van Dieten wrote: >On 5/7/05, Dan Bolser wrote: >> On Sat, 7 May 2005, Jochem van Dieten wrote: >>>On 5/7/05, Dan Bolser wrote: >>> select pk from a inner join b using (pk); ERROR 1052 (23000): Column 'pk' in field list is ambiguous!!! Is this

Re: utf8, 4.1, and character length truncation in mysql system tables

2005-05-15 Thread Pengz9
Hi! Normally, people will choose "lazy" method, define default charset as 'utf8'. But based on the information of mysql, one might be able to define at table level as 'utf-8' instead of whole database charset. In normal case, only certain table or certain "col" might store 'utf-8' data. Hence

Re: if no lock at all for update

2005-05-15 Thread mfatene
Hi, What will happen is that the rdbms will lock the row for you, updates it and unlock it. This is transparent for the user. there will be a wait (not a problem) if another user want to update the same row. When the first transaction is committed, the second can hold a lock for update. There is

if no lock at all for update

2005-05-15 Thread Pengz9
Hi! If there is no any lock at all while one update a row, what it is going to happen to my SQL database? In which cases, it might cause problems? Anyone know? Thanks __ Switch to Netscape Internet Service. As low as $9.95 a mont

QUERY (TOP)

2005-05-15 Thread Seena Blace
hi, here is table description report1 +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-

Re: Behavior of ON DUPLICATE KEY

2005-05-15 Thread Taisuke Yamada
Thanks for the verification. After some experiments, I came up with an alternative using "REPLACE INTO foo (...) SELECT ... UNION ..." to accomplish the same task, so will use it for now. INSERT INTO foo (id, value) SELECT id, value FROM bar ON DUPLICATE KEY UPDATE value = value + VALUES(valu

Re: Behavior of ON DUPLICATE KEY

2005-05-15 Thread Sergei Golubchik
Hi! On May 15, Taisuke Yamada wrote: > Hi. I found behavior of "ON DUPLICATE KEY" bit odd, and would > like to know if it's a bug or feature. > > I'm trying to "insert" or "add" (not "replace") data of one > table to another table and came up with following statement: > > CREATE TABLE foo (id

Re: What's wrong with this code?

2005-05-15 Thread Michael Stassen
Robb Kerr wrote: I have the following lines in my PHP doc. mysql_select_db($database_TBAJobLink, $TBAJobLink); $updateSQL = sprintf("UPDATE JL_Resumes SET DateEdited=%s, Status=%s WHERE ResumeID=%s", $dateEdited, $status, $resumeID); mysql_query($updateSQL, $TBAJobLink) or die(mysql

Re: Efficiently finding a random record

2005-05-15 Thread Michael Stassen
Eric Bergen wrote: in() can take millions of arguments. Up to max packet size. Try it :) True, but several past threads have suggested that performance drops dramatically when the size of the IN list gets too large. As IN is equivalent to an equality check for each value in the list, separated b

Re: Efficiently finding a random record

2005-05-15 Thread Michael Stassen
You are both missing something fundamental: functions are evaluated for each and every row. Your query, SELECT * FROM history WHERE id = CAST(RAND() * 2355008 AS UNSIGNED); gets a random number for *each row*, and returns the row if that row's random number is the same as its id. You are rol

Re: What's wrong with this code?

2005-05-15 Thread Taisuke Yamada
What are the types of each column? You need to quote parameter if it's a string type. But anyway, you'd better use placeholder '?' and pass parameters as argument to query method instead of embedding into SQL statement using sprintf. $updateSQL = sprintf("UPDATE JL_Resumes SET DateEdited=%s, Status

Re: What's wrong with this code?

2005-05-15 Thread Peter Brawley
Robb, If DateEdited is a datetime col, try "...DateEdited='%s'...", ditto for Status if it is not numeric. PB - Robb Kerr wrote: I have the following lines in my PHP doc. The three variables - $dateEdited, $status and $resumeID - are defined in the top of the page. I'm g

Re: Single vs Multiple primary keys

2005-05-15 Thread Martijn Tonies
Bob, > I have a table, see below, that contains a single primary key (SubTestCaseKey ) and a number of foreign keys > > * plantriggers_ID_FK , > * testcase_root_ID_FK > * testcasesuffix_name_FK > > What I want to ensure is that there are no duplicate records when considering the three foreign keys

Single vs Multiple primary keys

2005-05-15 Thread Bartis, Robert M (Bob)
I have a table, see below, that contains a single primary key (SubTestCaseKey ) and a number of foreign keys * plantriggers_ID_FK , * testcase_root_ID_FK * testcasesuffix_name_FK What I want to ensure is that there are no duplicate records when considering the three forei

What's wrong with this code?

2005-05-15 Thread Robb Kerr
I have the following lines in my PHP doc. The three variables - $dateEdited, $status and $resumeID - are defined in the top of the page. I'm getting a return of. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right synta

What's wrong with this code?

2005-05-15 Thread Robb Kerr
I have the following lines in my PHP doc. The three variables - $dateEdited, $status and $resumeID - are defined in the top of the page. I'm getting a return of. You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right synta

Re: Efficiently finding a random record

2005-05-15 Thread Gary Huntress
There's definitely more going on here that I don't understand. Consider this simple query and result: mysql> select * from history where id = CAST( rand() * 2355008 as unsigned); +-+++---++ | id | symbol | thedate| close | volume | +-+---

Behavior of ON DUPLICATE KEY

2005-05-15 Thread Taisuke Yamada
Hi. I found behavior of "ON DUPLICATE KEY" bit odd, and would like to know if it's a bug or feature. I'm trying to "insert" or "add" (not "replace") data of one table to another table and came up with following statement: CREATE TABLE foo (id INT NOT NULL PRIMARY KEY, value IN

Re: Efficiently finding a random record

2005-05-15 Thread mfatene
Hi, i did the test and agree with you. even with Select ID from history where id = 1+CAST( rand() * 19 as UNSIGNED) limit 1; when testing : select CAST( rand() * 19 as UNSIGNED) this always returns a unique value. So you don't need limit 1. The workaround i found is : Select ID from hist