Re: how to create unique key for long varchar?

2013-11-05 Thread Li Li
king. > but the problem is that if I define md5 as unique key and there exists > 2 different urls with the same md5. I can't insert the second url > anymore > > On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson wrote: >> In the last episode (Nov 05), Li Li said: >>&g

Re: how to create unique key for long varchar?

2013-11-05 Thread Michael Dykman
I prefer your solution in that it's something like Optimistic Locking. > but the problem is that if I define md5 as unique key and there exists > 2 different urls with the same md5. I can't insert the second url > anymore > > On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson &g

Re: how to create unique key for long varchar?

2013-11-05 Thread Li Li
I prefer your solution in that it's something like Optimistic Locking. but the problem is that if I define md5 as unique key and there exists 2 different urls with the same md5. I can't insert the second url anymore On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson wrote: > In the last ep

RE: how to create unique key for long varchar?

2013-11-05 Thread Rick James
. > -Original Message- > From: Dan Nelson [mailto:dnel...@allantgroup.com] > Sent: Tuesday, November 05, 2013 7:56 AM > To: Li Li > Cc: mysql@lists.mysql.com > Subject: Re: how to create unique key for long varchar? > > In the last episode (Nov 05), Li Li said: > >

Re: how to create unique key for long varchar?

2013-11-05 Thread Dan Nelson
In the last episode (Nov 05), Li Li said: > I want to create a table with a long varchar column, maybe it's the url. > according to dns spec, the url's max length is fixed. but I have > to deal with url having long params such as > a.html?q=&fl=bb

how to create unique key for long varchar?

2013-11-04 Thread Li Li
hi all I want to create a table with a long varchar column, maybe it's the url. according to dns spec, the url's max length is fixed. but I have to deal with url having long params such as a.html?q=&fl= I want the url is unique whe

Re: best way to have a unique key

2011-01-21 Thread Michael Satterwhite
who cares? If it's a life sustaining mission critical problem where an atomic war starts if the transaction fails ... you might want to at least think about another key. Personally, I wouldn't lose sleep over it. Another reasonable - and faster - source of a unique key would be to have a

RE: best way to have a unique key

2011-01-21 Thread Jerry Schwartz
>-Original Message- >From: Michael Dykman [mailto:mdyk...@gmail.com] >Sent: Friday, January 21, 2011 11:35 AM >To: Johan De Meersman >Cc: Anthony Pace; mysql. >Subject: Re: best way to have a unique key > >One of the components of the UUID is drawn form the ma

Re: best way to have a unique key

2011-01-21 Thread Michael Dykman
rimary key >>> that is not unique. >>> >>>  - michael dykman >>> >>> On Thu, Jan 20, 2011 at 1:32 PM, Anthony Pace >>>  wrote: >>> >>>> Due to certain reasons, the company I am doing business with has decided >>>&g

RE: best way to have a unique key

2011-01-21 Thread Jerry Schwartz
>-Original Message- >From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De >Meersman >Sent: Friday, January 21, 2011 1:22 AM >To: Anthony Pace >Cc: Michael Dykman; mysql. >Subject: Re: best way to have a unique key > >I have to say, som

Re: best way to have a unique key

2011-01-20 Thread Johan De Meersman
or any other RDBMS will allow you to establish a primary key >> that is not unique. >> >> - michael dykman >> >> On Thu, Jan 20, 2011 at 1:32 PM, Anthony Pace >> wrote: >> >>> Due to certain reasons, the company I am doing business with has decide

RE: best way to have a unique key

2011-01-20 Thread Daevid Vincent
http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/ > -Original Message- > From: Krishna Chandra Prajapati [mailto:prajapat...@gmail.com] > Sent: Thursday, January 20, 2011 10:45 AM > To: Anthony Pace > Cc: mysql. > Subject: Re: best way to have a un

Re: best way to have a unique key

2011-01-20 Thread Michael Dykman
;>>> >>>> Due to certain reasons, the company I am doing business with has decided >>>> that the primary key, for an orders table, be a unique key; however, I >>>> don't >>>> like the possibility of it conflicting if moved to another mach

Re: best way to have a unique key

2011-01-20 Thread Luciano Furtado
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What conflicts are you expecting? according to the documentation: A UUID is designed as a number that is globally unique in space and time. Two calls to UUID() are expected to generate two different values, even if these calls are performed on two sep

Re: best way to have a unique key

2011-01-20 Thread Anthony Pace
Thu, Jan 20, 2011 at 1:32 PM, Anthony Pace wrote: Due to certain reasons, the company I am doing business with has decided that the primary key, for an orders table, be a unique key; however, I don't like the possibility of it conflicting if moved to another machine. What are some pitfal

Re: best way to have a unique key

2011-01-20 Thread Anthony Pace
I know of uuid() my problem is that there can be conflicts when copying the DB to a different machine, or working with sections of the db on different machines for load balancing. On 1/20/2011 1:44 PM, Krishna Chandra Prajapati wrote: > Please keep in mind this variable will also be displayed

Re: best way to have a unique key

2011-01-20 Thread Anthony Pace
orders table, be a unique key; however, I don't like the possibility of it conflicting if moved to another machine. What are some pitfalls of using a unique key, that is generated by a server side script, rather than by mysql? What are the best ways to do this? Please keep in mind this variable

Re: best way to have a unique key

2011-01-20 Thread Krishna Chandra Prajapati
uuid() Krishna On Fri, Jan 21, 2011 at 12:02 AM, Anthony Pace wrote: > Due to certain reasons, the company I am doing business with has decided > that the primary key, for an orders table, be a unique key; however, I don't > like the possibility of it conflicting if moved to a

best way to have a unique key

2011-01-20 Thread Anthony Pace
Due to certain reasons, the company I am doing business with has decided that the primary key, for an orders table, be a unique key; however, I don't like the possibility of it conflicting if moved to another machine. What are some pitfalls of using a unique key, that is generated by a s

Which unique key is hit with my insert?

2009-11-27 Thread Jan Fabry
RIMARY" AND Seq_in_index = '2'; But this is an extra query - is there a way to know it from the first query? I also posted this question on Stack Overflow [ http://stackoverflow.com/questions/1486068/which-unique-key-is-hit-with-my-insert ], but I want to check whether this

Re: UNIQUE KEY vs UNIQUE INDEX

2009-07-30 Thread b
On 07/30/2009 02:23 PM, Joerg Bruehe wrote: Hi ! mos wrote: At 09:13 AM 7/30/2009, b wrote: Are UNIQUE KEY& UNIQUE INDEX two ways of specifying the same thing? If not, what are the differences? Feel free to tell me to RTFM but please post manual chapters. I've been looking but hav

Re: UNIQUE KEY vs UNIQUE INDEX

2009-07-30 Thread Joerg Bruehe
Hi ! mos wrote: > At 09:13 AM 7/30/2009, b wrote: >> Are UNIQUE KEY & UNIQUE INDEX two ways of specifying the same thing? >> If not, what are the differences? >> >> Feel free to tell me to RTFM but please post manual chapters. I've >> been looking but hav

Re: UNIQUE KEY vs UNIQUE INDEX

2009-07-30 Thread mos
At 09:13 AM 7/30/2009, b wrote: Are UNIQUE KEY & UNIQUE INDEX two ways of specifying the same thing? If not, what are the differences? Feel free to tell me to RTFM but please post manual chapters. I've been looking but haven't been able to find anything. They are the same

UNIQUE KEY vs UNIQUE INDEX

2009-07-30 Thread b
Are UNIQUE KEY & UNIQUE INDEX two ways of specifying the same thing? If not, what are the differences? Feel free to tell me to RTFM but please post manual chapters. I've been looking but haven't been able to find anything. -- MySQL General Mailing List For list

RE: UNIQUE KEY vs NULLs

2006-12-11 Thread imre
on here? How can I get rid of this error? Thx ImRe > > Dan > > > On 12/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have an InnoDB table similar to this: > > > > CREATE TABLE Target > > (IMSI VARCHAR(15) ASCII,

Re: UNIQUE KEY vs NULLs

2006-12-11 Thread Martijn Tonies
> I have an InnoDB table similar to this: > > CREATE TABLE Target > (IMSI VARCHAR(15) ASCII, > IMEI VARCHAR(15) ASCII, > UNIQUE KEY (IMSI, IMEI)); > > After playing a bit with it, I managed to add duplicate records, if one of

Re: UNIQUE KEY vs NULLs

2006-12-11 Thread Dan Buettner
12/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, I have an InnoDB table similar to this: CREATE TABLE Target (IMSI VARCHAR(15) ASCII, IMEI VARCHAR(15) ASCII, UNIQUE KEY (IMSI, IMEI)); After playing a bit with it, I managed to add duplicate records, if one of the fields was

RE: UNIQUE KEY vs NULLs

2006-12-11 Thread emierzwa
It is expected behavior, you can make the unique key a primary key instead. This should prevent this situation. Ed -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 11, 2006 7:42 AM To: mysql@lists.mysql.com Subject: UNIQUE KEY vs NULLs Hi, I

UNIQUE KEY vs NULLs

2006-12-11 Thread imre
Hi, I have an InnoDB table similar to this: CREATE TABLE Target (IMSI VARCHAR(15) ASCII, IMEI VARCHAR(15) ASCII, UNIQUE KEY (IMSI, IMEI)); After playing a bit with it, I managed to add duplicate records, if one of the fields was a NULL: +-+-+ | IMSI

Re: Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Martijn Tonies
rake Linux LE 2005 environments. > > For the sake of ease, I will just set up a small test table to assist me with > this question. > > > Create table test ( > x smallint not null, > y char(5) default null, > z char(10) not null default '', > Unique K

Re: Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Dan Buettner
o assist me with this question. > Create table test ( x smallint not null, y char(5) default null, z char(10) not null default '', Unique Key `s`(x, y) ) ENGINE=MyISAM test> Insert into test values (1, 'dan', 'yes'), (2, &#

Bug or No bug - Composite Unique Key using null values

2006-10-06 Thread Dan Julson
environments. For the sake of ease, I will just set up a small test table to assist me with this question. > Create table test ( x smallint not null, y char(5) default null, z char(10) not null default '', Unique Key `s`(x, y) ) ENGINE=MyISAM test

Design flaw for unique key

2006-09-27 Thread Rob Desbois
My application contains a table `event` which is essentially a historical log. Currently it contains a UNIQUE KEY on three fields - the location which generated the event `location_id`, the timestamp the event was generated `timestamp`, and the type of event `type`. I have discovered that this

Re: Specified key was too long; max key length is 1000 bytes (UNIQUE KEY on multiple columns)

2006-07-07 Thread Remo Tex
varchar(255) default NULL, `pid` smallint(5) unsigned NOT NULL default '0', UNIQUE KEY `uniq_phone_key` (`user_agent`,`http_x_wap_profile`,`pid`) ) TYPE=MyISAM; How-To-Repeat: server 1: mysql> SELECT VERSION(); ++ | VERSION() | ++ | 4.0.22-log | +---

Specified key was too long; max key length is 1000 bytes (UNIQUE KEY on multiple columns)

2006-07-07 Thread Lubomir Host 'rajo'
d` smallint(5) unsigned NOT NULL default '0', UNIQUE KEY `uniq_phone_key` (`user_agent`,`http_x_wap_profile`,`pid`) ) TYPE=MyISAM; >How-To-Repeat: server 1: mysql> SELECT VERSION(); ++ | VERSION() | ++ | 4.0.22-log | ++ 1 row in set (0

Re: Remove Unique Key

2005-07-20 Thread SGreen
Eric Jensen <[EMAIL PROTECTED]> wrote on 07/20/2005 02:00:26 PM: > I have a field that was set as a unique key when created via: > UNIQUE KEY `username` (`username`) > > I no longer want it unique, but can't see a way with ALTER TABLE to > remove it. It isn't th

Re: Remove Unique Key

2005-07-20 Thread Joseph
www.mysql.com/doc search drop index Eric Jensen wrote: I have a field that was set as a unique key when created via: UNIQUE KEY `username` (`username`) I no longer want it unique, but can't see a way with ALTER TABLE to remove it. It isn't the Primary Key or an index. The desc

Remove Unique Key

2005-07-20 Thread Eric Jensen
I have a field that was set as a unique key when created via: UNIQUE KEY `username` (`username`) I no longer want it unique, but can't see a way with ALTER TABLE to remove it. It isn't the Primary Key or an index. The describe looks

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Gustafson, Tim" <[EMAIL PROTECTED]> writes: > Martijn, > The problem is that I don't want more than one row in the table that has > a null value in the column. As you've pointed out in your e-mail, > there's a difference between NULL and BLANK. It's not that I do

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
Tim, > The table in question is used to store aliases to web sites. That is, > "meitech.com" is the main web site, and "www.meitech.com" is the alias. > So, the first column is the domain name in question, and the second on > is the host name part of the alias, in this example "www". > > Now, I a

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
> The problem is that I don't want more than one row in the table that has > a null value in the column. As you've pointed out in your e-mail, > there's a difference between NULL and BLANK. It's not that I don't want > NULL values, it's that I don't want MORE THAN ONE. I can easily continue arg

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
Gustafson, Tim; Paul DuBois; mysql@lists.mysql.com Subject: Re: UNIQUE Key Allowing Duplicate NULL Values Tim, > Oh well, thanks anyhow. > > If I could put in a feature suggestion, it would be a flag that I could > set to disallow duplicate nulls. :) What for? NULL is not equal to N

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Martijn Tonies
Tim, > Oh well, thanks anyhow. > > If I could put in a feature suggestion, it would be a flag that I could > set to disallow duplicate nulls. :) What for? NULL is not equal to NULL. Period. If you don't want NULLs, make the column "not null". The specification is correct. With regards, Mart

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
/ -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 8:14 AM To: Gustafson, Tim; mysql@lists.mysql.com Subject: RE: UNIQUE Key Allowing Duplicate NULL Values At 8:10 -0500 2/23/05, Gustafson, Tim wrote: >Is there any flag I can set on

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Paul DuBois
x27;d have to use a BDB table, because only BDB allows a single NULL per UNIQUE index. -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 3:13 PM To: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: UNIQUE Key Allowing Duplicate NULL Values At

RE: UNIQUE Key Allowing Duplicate NULL Values

2005-02-23 Thread Gustafson, Tim
:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 3:13 PM To: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: UNIQUE Key Allowing Duplicate NULL Values At 15:00 -0500 2/22/05, Gustafson, Tim wrote: >Hi there! > >I have a table, defined as follows: > >CREATE TABLE `Web

Re: UNIQUE Key Allowing Duplicate NULL Values

2005-02-22 Thread Paul DuBois
x27;, `Alias` char(16) default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `DomainName` (`DomainName`,`Alias`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1 The way I read this definition, it should be impossible for someone to put in two rows with the same DomainName and Alias, however, right now I have t

UNIQUE Key Allowing Duplicate NULL Values

2005-02-22 Thread Gustafson, Tim
PRIMARY KEY (`ID`), UNIQUE KEY `DomainName` (`DomainName`,`Alias`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1 The way I read this definition, it should be impossible for someone to put in two rows with the same DomainName and Alias, however, right now I have the followi

Re: non-unique key of multiple columns

2005-01-28 Thread Gleb Paharenko
put of EXPLAIN statement and the definitions of your tables which are used by query. Ginger Cheng <[EMAIL PROTECTED]> wrote: > Hello, MySQL gurus, > I have a non-unique key of 2 columns, the 1st is a varchar(15), > 2nd is a int(10) unsigned. But when I 'explain&

non-unique key of multiple columns

2005-01-27 Thread Ginger Cheng
Hello, MySQL gurus, I have a non-unique key of 2 columns, the 1st is a varchar(15), 2nd is a int(10) unsigned. But when I 'explain' a query that uses this key, the key_len is only 15 with the key name shown up in the 'key' column of this table correctly though. Acc

Re: unique key <-> primary key

2004-12-29 Thread Martijn Tonies
Hello, > RE: > > And columns in primary keys must be NOT NULL. Columns in unique > > keys can be NULL (if they are NOT NULL, then the unique key is > > functionally the same as a primary key). > > OK, thanks guys for the explanation. > > Then the result o

Re: unique key <-> primary key

2004-12-29 Thread Martijn Tonies
> >> I have two tables, seemigly very similar setup; the primary key is the > >> combination of two columns. With mysqldump, however, the table > >> definition of the two tables looks different. > >> > >> Mysqldump on table 1 says > >>

Re: unique key <-> primary key

2004-12-28 Thread Gaspar Bakos
Hi, RE: > And columns in primary keys must be NOT NULL. Columns in unique > keys can be NULL (if they are NOT NULL, then the unique key is > functionally the same as a primary key). OK, thanks guys for the explanation. Then the result of mysqldump table definition part: UNIQUE KE

Re: unique key <-> primary key

2004-12-28 Thread Paul DuBois
At 22:27 +0100 12/28/04, Martijn Tonies wrote: Hello, I have two tables, seemigly very similar setup; the primary key is the combination of two columns. With mysqldump, however, the table definition of the two tables looks different. Mysqldump on table 1 says ... UNIQUE KEY HONstid

Re: unique key <-> primary key

2004-12-28 Thread Martijn Tonies
Hello, > I have two tables, seemigly very similar setup; the primary key is the > combination of two columns. With mysqldump, however, the table > definition of the two tables looks different. > > Mysqldump on table 1 says > ... > UNIQUE KEY HONstid (HONstid,HONname)

unique key <-> primary key

2004-12-28 Thread Gaspar Bakos
Hi, I have two tables, seemigly very similar setup; the primary key is the combination of two columns. With mysqldump, however, the table definition of the two tables looks different. Mysqldump on table 1 says ... UNIQUE KEY HONstid (HONstid,HONname) whereas on table 2 it says

Unique key violations

2004-10-14 Thread Matt Parlane
Hi all... I am having a problem with unique key violations in one of my tables. This is the table structure: CREATE TABLE `optionaldata` ( `ForeignID` int(10) unsigned NOT NULL default '0', `FieldID` int(10) unsigned NOT NULL default '0', `Value` char(200) defaul

Unique Key

2004-08-05 Thread Paul McNeil
Thanks to all for helping me sort this out. I am setting the field to tinyblob vs tinytext. Thanks again. God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web technologies. Microneil research Sniffer Anti Spam Sortmonster Research GOD BLESS AMERICA! To God Be The Gl

Unique Key question

2004-08-05 Thread Paul McNeil
ry as - Select * from myTable where DATA = 'june' - I am returned both. If I query as Select * from myTable where cast(DATA as binary) = 'june' - I am returned only one. How can I set this table so that the unique key is based on the binary value of the field? Do I have to alter the

Re: Unique Key question

2004-08-05 Thread Michael Stassen
If I query as Select * from myTable where cast(DATA as binary) = 'june' - I am returned only one. How can I set this table so that the unique key is based on the binary value of the field? Do I have to alter the field type or is there a better way? Thank you. God Bless Paul C. McN

Re: Unique Key Violation - How to determine which key

2003-09-18 Thread Jeremy Zawodny
On Thu, Sep 18, 2003 at 08:20:00AM -0700, Scot Campbell wrote: > O.K., I understand. And I have always coded in this manner. > > Throw the data at the system and see if it sticks. In most cases it will. > > However, when it does fail, it would be nice to determine the error w/o > issuing more

Re: Unique Key Violation - How to determine which key

2003-09-18 Thread Scot Campbell
lated, issue selects for each of the unique contrained columns to determine which one was violated"? Thanks From: Jeremy Zawodny <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Scot Campbell <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: Unique Key Violation - How

Re: Unique Key Violation - How to determine which key

2003-09-17 Thread Jeremy Zawodny
On Wed, Sep 17, 2003 at 03:07:41PM -0700, Scot Campbell wrote: > These will be random atomic Inserts originating from a Web page. > > I'm not sure I catch your drift. The inserts are not in a batch. > > I need to notify the user on the page which field was in error. I'd like to > refer to the

Re: Unique Key Violation - How to determine which key

2003-09-17 Thread Scot Campbell
ns the non-duplicate data (i.e., error message on the email address vs. error message on the userid field). From: Jeremy Zawodny <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Scot Campbell <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: Unique Key Violation - How to de

Re: Unique Key Violation - How to determine which key

2003-09-17 Thread Jeremy Zawodny
On Wed, Sep 17, 2003 at 08:01:07AM -0700, Scot Campbell wrote: > Let me rephrase. I insert a row and recieve a 1062 error (Key violation). > How do I determine, at run-time, which of the 3 possible columns has the > error. I guess I could parse the mysql_error message string. But, that > see

Re: Unique Key Violation - How to determine which key

2003-09-17 Thread Scot Campbell
uniqueness via individual selects before I issue the insert. Thanks From: Jeremy Zawodny <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Scot Campbell <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: Unique Key Violation - How to determine which key Date: Tue, 16 Sep 2003 20

Re: Unique Key Violation - How to determine which key

2003-09-16 Thread Jeremy Zawodny
can retrieve a message w/ mysql_error() which returns "Duplicate entry > '[EMAIL PROTECTED]' for key 3" > > I'd rather get the name of the unique key, in this case I named it > `IDX_EMAILADDR`. > > Any ideas? Thanks Look at SHOW KEYS or SHOW CREATE TABLE a

Unique Key Violation - How to determine which key

2003-09-16 Thread Scot Campbell
for key 3" I'd rather get the name of the unique key, in this case I named it `IDX_EMAILADDR`. Any ideas? Thanks _ Send and receive larger attachments with Hotmail Extra Storage. http://join.msn.com/?PAGE=features/es

Re: Dropping primary key/unique key

2003-08-14 Thread Sergei Golubchik
; | id| int(11) | | | 0 | | > | name | char(30) | YES | | NULL| | > | tel | char(20) | | PRI | | | > +---+--+--+-+-+---+ > 3 rows in set (0.00 sec) > > Unique key was dropped. Why not Primary key, why no error message??? Confirmed. Fixed in 4

Re: Dropping primary key/unique key

2003-08-14 Thread Nils Valentin
Hi Victoria, Victoria Reznichenko wrote: "Nils Valentin" <[EMAIL PROTECTED]> wrote: I have a problem understanding why MySQL is deleting a unique key instead of a primary key. from Documentation: DROP PRIMARY KEY drops the primary index. If no such index exists, it drops

Re: Dropping primary key/unique key

2003-08-14 Thread Nils Valentin
| int(11) | | | 0 | | | name | char(30) | YES | | NULL| | | tel | char(20) | | PRI | | | +---+--+--+-+-+---+ 3 rows in set (0.00 sec) Unique key was dropped. Why not Primary key, why no error message???

Re: Dropping primary key/unique key

2003-08-14 Thread Victoria Reznichenko
"Nils Valentin" <[EMAIL PROTECTED]> wrote: > > I have a problem understanding why MySQL is deleting a unique key instead of > a primary key. > > from Documentation: DROP PRIMARY KEY drops the primary index. If no such index > exists, it drops the first UNIQU

Re: Dropping primary key/unique key

2003-08-11 Thread Victoria Reznichenko
"Nils Valentin" <[EMAIL PROTECTED]> wrote: > Hi Victoria, > > Victoria Reznichenko wrote: > >>"Nils Valentin" <[EMAIL PROTECTED]> wrote: >> >> >>>I have a problem understanding why MySQL is deleting a unique key instead o

Re: Dropping primary key/unique key

2003-08-07 Thread Nils Valentin
t; > +---+--+--+-+-+---+ > > | id| int(11) | | | 0 | | > | name | char(30) | YES | | NULL | | > | tel | char(20) | | PRI | | | > > +---+--+--+-+-+---+ > 3

Re: Dropping primary key/unique key

2003-08-06 Thread Cybot
I have a problem understanding why MySQL is deleting a unique key instead of a primary key. from Documentation: DROP PRIMARY KEY drops the primary index. If no such index exists, it drops the first UNIQUE index in the table. When I do it then I get this: mysql> desc uksamp

Dropping primary key/unique key

2003-08-02 Thread Nils Valentin
Hi Mysql fans ;-); I have a problem understanding why MySQL is deleting a unique key instead of a primary key. from Documentation: DROP PRIMARY KEY drops the primary index. If no such index exists, it drops the first UNIQUE index in the table. When I do it then I get this: mysql> d

Re: How to drop unique key

2003-06-30 Thread Joseph Bueno
fault NULL,\ `asset_duration` bigint(20) default NULL,\ `asset_status` varchar(10) default NULL,\ `asset_channel` varchar(20) default NULL,\ PRIMARY KEY (`ano`),\ UNIQUE KEY `asset_name_2` (`asset_name`),\ KEY `p_asset_name_idx01` (`asset_name`)\ ) TYPE=InnoDB According to the manual,there is no '

How to drop unique key

2003-06-30 Thread MaFai
bigint(20) default NULL,\ `asset_status` varchar(10) default NULL,\ `asset_channel` varchar(20) default NULL,\ PRIMARY KEY (`ano`),\ UNIQUE KEY `asset_name_2` (`asset_name`),\ KEY `p_asset_name_idx01` (`asset_name`)\ ) TYPE=InnoDB According to the manual,there is no 'drop uniqu

Re: Bug report: UNIQUE KEY and DESCRIBE TABLE

2002-12-29 Thread Heikki Tuuri
. DESCRIBE TABLE does not contain all information. Regards, Heikki - Original Message - From: "Matt Solnit" <[EMAIL PROTECTED]> To: "Heikki Tuuri" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: "Henry Bequet" <[EMAIL PROTECTED]> Sent: Saturda

Re: Bug report: UNIQUE KEY and DESCRIBE TABLE

2002-12-27 Thread Paul DuBois
mysql>CREATE TABLE mytable (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (a), UNIQUE KEY (b, c)); mysql>DESCRIBE TABLE mytable; -- Results: -- +---+-+--+-+-+---+ | Field | Type| Null | Ke

Bug report: UNIQUE KEY and DESCRIBE TABLE

2002-12-27 Thread Matt Solnit
YSQL_FIELD structure returned by mysql_fetch_field(), the MULTIPLE_KEY_FLAG will only be present in the first column. - Test script: - mysql>USE test mysql>CREATE TABLE mytable (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (a), UNIQUE KE

re: Output of "DESCRIBE tbl_name" wrong for unique key on NULL column

2002-09-18 Thread Victoria Reznichenko
jwakely, Wednesday, September 18, 2002, 5:46:19 PM, you wrote: jamdc> The output of DESCRIBE tbl_name shows unique keys to be "MUL" for columns jamdc> defined as NULL. jamdc> The SQL shown is a minimal test case that creates a new database and two jamdc> tables, both wi

Output of "DESCRIBE tbl_name" wrong for unique key on NULL column

2002-09-18 Thread jwakely
>Description: The output of DESCRIBE tbl_name shows unique keys to be "MUL" for columns defined as NULL. The SQL shown is a minimal test case that creates a new database and two tables, both with a unique key on the column "uni" The first table is fine. The second tabl

Re: Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Paul DuBois
uot;Andy Sy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >>Sent: Friday, June 14, 2002 2:45 AM >>Subject: Re: Why does Key==Mul in DESCRIBE TABLE for unique key? >> >>>At 2:03 +0800 6/14/02, Andy Sy wrote: >

Re: Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Paul DuBois
At 3:35 +0800 6/14/02, Andy Sy wrote: >- Original Message - >From: "Paul DuBois" <[EMAIL PROTECTED]> >To: "Andy Sy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Friday, June 14, 2002 2:45 AM >Subject: Re: Why does Key==Mul in DESCRIB

Re: Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Gerald Clark
lt;[EMAIL PROTECTED]> >Sent: Friday, June 14, 2002 2:45 AM >Subject: Re: Why does Key==Mul in DESCRIBE TABLE for unique key? > > >>At 2:03 +0800 6/14/02, Andy Sy wrote: >> >>>mysql> CREATE TABLE X (FLD1 INT UNIQUE); >>>Query OK, 0 rows affected (0.05 sec

Re: Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Andy Sy
- Original Message - From: "Paul DuBois" <[EMAIL PROTECTED]> To: "Andy Sy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 2:45 AM Subject: Re: Why does Key==Mul in DESCRIBE TABLE for unique key? > At 2:03 +0800 6/14/02

Re: Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Paul DuBois
At 2:03 +0800 6/14/02, Andy Sy wrote: >mysql> CREATE TABLE X (FLD1 INT UNIQUE); >Query OK, 0 rows affected (0.05 sec) > >mysql> DESCRIBE X; >+---+-+--+-+-+---+ >| Field | Type| Null | Key | Default | Extra | >+---+-+--+-+-+---+ >|

Why does Key==Mul in DESCRIBE TABLE for unique key?

2002-06-13 Thread Andy Sy
mysql> CREATE TABLE X (FLD1 INT UNIQUE); Query OK, 0 rows affected (0.05 sec) mysql> DESCRIBE X; +---+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-+---+ | FLD1 | int(11) | YES | MUL | NULL|

Bug with UNIQUE Key on multi-row containing NULL values

2001-07-28 Thread Martin Friebe
escription: first thing i am not sure, if this is a bug or I am missunderstanding something. It is possible to insert multiple records in a database, having the same unique key, if the unique key or one of its fields contain NULL. I know that NULL compares to itself as not equal, but I dont know

Dropping a Unique Key?

2001-05-15 Thread Jason Lam
How do I drop a Unique key from a table in my database? I know I should Alter table, however there doesn't seems to have an option to drop just the Unique key but not the primary key. Change and modify does seems to do it either.. Jaso

Re: Cannot DELETE all records with NULL entries in UNIQUE KEY fields

2001-04-10 Thread René Tegel
se an index for the time being? gl - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 09, 2001 6:43 PM Subject: BUG: Cannot DELETE all records with NULL entries in UNIQUE KEY fields > >Description: > > Attempting to

PATCH: Cannot DELETE all records with NULL entries in UNIQUE KEY fields

2001-04-09 Thread Michael Widenius
Hi! >>>>> "loschert" == loschert <[EMAIL PROTECTED]> writes: >> Description: loschert> Attempting to delete all records in a table containing NULL values in a loschert> UNIQUE KEY field does not work as expected. Only a single record is deleted, los

Re: BUG: Cannot DELETE all records with NULL entries in UNIQUE KEY fields

2001-04-09 Thread Benjamin Pflugmann
Hello. On Mon, Apr 09, 2001 at 01:05:01PM -0400, [EMAIL PROTECTED] wrote: > On 9 Apr 2001 [EMAIL PROTECTED] wrote: > > > >Description: > > > > Attempting to delete all records in a table containing NULL values in a > > UNIQUE KEY field does not work as e

Re: BUG: Cannot DELETE all records with NULL entries in UNIQUE KEY fields

2001-04-09 Thread Sinisa Milivojevic
[EMAIL PROTECTED] writes: > >Description: > > Attempting to delete all records in a table containing NULL values in a > UNIQUE KEY field does not work as expected. Only a single record is deleted, > presumably because the server thinks that the table will only have on

BUG: Cannot DELETE all records with NULL entries in UNIQUE KEY fields

2001-04-09 Thread loschert
>Description: Attempting to delete all records in a table containing NULL values in a UNIQUE KEY field does not work as expected. Only a single record is deleted, presumably because the server thinks that the table will only have one record with a NULL value in it (as it is in a UNIQUE fi