vieten / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

Loss of Data - Editing BLOB fields truncated stored data to 255 characters #1196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a field with type BLOB or LONGBLOG add more then 255 characters of 
data to a new record and save the record
2. Double click on the field to Edit it then click Cancel and/or OK
3. Double click on the field again and the data has been truncated to 255 
characters

What is the expected output? What do you see instead?
Data should not get truncated, data should be intact, there is data lost.

What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?
SP 0.9.9.1 (but I saw this in an earlier version), MySQL (5.x and others)

Please provide any additional information below.
I have not tested this on any other field types other then BLOB and LONGBLOB at 
this point.

Original issue reported on code.google.com by livingzo...@yahoo.com on 18 Sep 2011 at 7:16

GoogleCodeExporter commented 9 years ago
Hi there,

I haven't been able to replicate this with a few quick tests (both with 0.9.9.1 
and with the latest nightlies), so it seems that there must be some other 
factor coming into play here.

There is some code which truncates BLOB-type values for display in the table, 
which does truncate long fields to 255 characters, so that sounds like the 
suspect once we track down the circumstances causing this.

When you click Cancel or OK after editing, presumably the sheet editor closes, 
and the field you've just edited remains highlighted (and editable) within the 
table view.  What do you do then?  Do you click outside the row, or hit return, 
to commit the changes - or do you trigger editing somehow again?

If you look at the query console (View menu > Show Console), is the data 
getting truncated before save, or is it the re-editing which is triggering it 
somehow?

Original comment by rowanb@gmail.com on 18 Sep 2011 at 8:19

GoogleCodeExporter commented 9 years ago
I initially assumed you were talking about the Content view, but based on the 
double-click behaviour you describe in your ticket, are you talking about 
results in the Custom Query view?  (I still can't reproduce it there)

If so, what kind of query are you running - a SELECT * FROM foo, or with fewer 
fields or more restrictions?

Original comment by rowanb@gmail.com on 18 Sep 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Thanks for the quick reply. I am viewing the rows in the Content view. In this 
view I double click on a blog field to view and edit it. From there if I click 
either Cancel or Ok it closed the edit sheet. The text in the field is 
highlighted in the Content row as you mentioned. Then if I click on another row 
or tab to another field I see it does a update to that row. II have attached 
some screenshots and here is a snippet from the log.  You can see the UPDATE 
after I click off the row or TAB to the next field. Let me know how else I can 
help with this.

/* 3:17:58 PM  5o9ds01 */ INSERT INTO `test` (`id`, `test`) VALUES ('NULL', 
'texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttext');
/* 3:17:58 PM  5o9ds01 */ SELECT * FROM `test` LIMIT 0,100;
/* 3:18:13 PM  5o9ds01 */ UPDATE `test` SET `test` = 
'texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttex
ttexttexttexttex' WHERE `id` = '2';
/* 3:18:13 PM  5o9ds01 */ SELECT * FROM `test` LIMIT 0,100;

Original comment by livingzo...@yahoo.com on 18 Sep 2011 at 9:24

Attachments:

GoogleCodeExporter commented 9 years ago
It seems to be that having the text highlighted after closing the edit sheet is 
probably the culprit. As soon as we click out it updates that field for that 
row. I recall from older versions of SP this type of field acted differently 
where you could only select, edit or view this data was in an edit sheet.

I just tried turning on the check box "Don't load blob and text fields until 
needed" but it still acts the same way.

Original comment by livingzo...@yahoo.com on 18 Sep 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Sorry, I can't reproduce this either with the steps given.
What is your OS X version?
32/64 Bit?
PPC/Intel?

Can you make a video?

Original comment by schlabbe...@gmail.com on 18 Sep 2011 at 10:01

GoogleCodeExporter commented 9 years ago
I am on a PowerPC G5 running OX 10.5.8

I just tried this on my laptop which is a MacBook running 10.6.8 and it seems 
to not exhibit this behavior that I am seeing on my G5. 

Is this something you think will end up being addressed for PPC or 10.5.8 (not 
sure which is the cause here)?

Thank for your help.

Original comment by livingzo...@yahoo.com on 19 Sep 2011 at 1:29

GoogleCodeExporter commented 9 years ago
Thanks for the extra info.  I would wager that 10.5.8 is the cause here - we 
have seen PPC issues, but they tend to be rather more specific, whereas this is 
definitely an issue with table logic.  Something has probably changed and we're 
relying on the new behaviour.

I don't have a 10.5.8 box readily available but I'll see what I can do.

Original comment by rowanb@gmail.com on 19 Sep 2011 at 10:19

GoogleCodeExporter commented 9 years ago

Original comment by rowanb@gmail.com on 19 Sep 2011 at 10:19

GoogleCodeExporter commented 9 years ago
Thanks for the note. I am happy to help in testing if needed. Thanks again.

Original comment by livingzo...@yahoo.com on 19 Sep 2011 at 4:24

GoogleCodeExporter commented 9 years ago
This was quite a bit harder than I thought it might be, but r3438 should fix 
this issue - and has based on my testing in a 10.5.8 environment.

We make development builds available for testing at 
http://nightly.sequelpro.com/ - if you'd like to confirm the fix, please 
download the most recent build from there, although as with all development 
code we don't recommend its use against production systems, just in case a bug 
like this one creeps in!

Thank you very much for the report - the code should be a bit more robust now.  
(If you run into any further issues with this, I will of course reopen it)

Original comment by rowanb@gmail.com on 5 Oct 2011 at 12:48

GoogleCodeExporter commented 9 years ago
So far r3438 seems to be working fine. I will let you know if I run in to any 
issues. Thank you!

Original comment by ams...@gmail.com on 12 Oct 2011 at 4:20