List:GUI Tools« Previous MessageNext Message »
From:Stephen Gray Date:May 29 2007 5:52am
Subject:Re: Query Browser bug
View as plain text  
Hi Daniel,

Thanks for the response. I see what you mean re SQL statements. I did a 
quick test on updating a no primary key table with the previous 
incarnation of query browser (Mysql Control Center) which does allow 
updating of these tables, and what it seems to do is include every field 
in the table in the where clause and add LIMIT 1 at the end, eg

UPDATE `table`
SET `datasetname`='hello2'
WHERE `datasetID`='test' AND `datasetname`='hello1'
LIMIT 1

It is possible that this could cause a minor problem if there are two 
records whose values are identical in every field, in which case only 
the first record would be updated, however this situation is unlikely 
and only updating the first wouldn't be a big problem if it did occur.

Regards,
Steve

Daniel Kasak wrote:
> On Tue, 2007-05-29 at 14:21 +1000, Stephen Gray wrote:
>
>   
>> Hi everyone,
>>
>> Just a request. There is a bug in Query Browser which means Edit button 
>> is greyed out for tables which have no primary key, so you can't 
>> add/edit records. I've seen a number of posts discussing this bug but it 
>> seems not to have been fixed in the latest version. Could this be fixed?
>>     
>
> I think the standard answer here will be that this is not a bug; it's a
> feature. If you don't have a primary key, how does Query Browser ( or
> anything else ) know which row to update? The secret here is that it
> *doesn't*, as it has no unique identifier to say, for example:
>
> update _table_ set field = 'blah' where _unique_id = 'xxx';
>
> You see, without the unique id bit, you'll update everything in the
> table:
>
> update _table_ set field = 'blah'
>
> --
> Daniel Kasak
> IT Developer
> NUS Consulting Group
> Level 5, 77 Pacific Highway
> North Sydney, NSW, Australia 2060
> T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
> email: dkasak@stripped
> website: http://www.nusconsulting.com.au
>
>
>   


-- 
Stephen Gray
Archive IT Officer
Australian Social Science Data Archive
18 Balmain Crescent (Building #66)
The Australian National University
Canberra ACT 0200

Phone +61 2 6125 2185
Fax +61 2 6125 0627
Web http://assda.anu.edu.au/

Thread
Query Browser bugStephen Gray29 May
  • Re: Query Browser bugDaniel Kasak29 May
    • Re: Query Browser bugStephen Gray29 May