Bug #5658 | displaying a varchar containing char(0) truncate rest of data | ||
---|---|---|---|
Submitted: | 20 Sep 2004 5:03 | Modified: | 1 Dec 2004 14:24 |
Reporter: | Sorin Florea | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Query Browser | Severity: | S2 (Serious) |
Version: | 1.0.7 beta | OS: | Windows (Windows 2000 Professional) |
Assigned to: | Michael G. Zinner | CPU Architecture: | Any |
[20 Sep 2004 5:03]
Sorin Florea
[20 Sep 2004 17:56]
Michael G. Zinner
This is problematic because a 0 terminates a string in C and we use C libraries. We have introduced a special handling for BLOB fields that ensures that "0" characters are treated correctly. Therefore we do not allow to displaying the text, you will have to use the Hex-viewer or the Image viewer to display the content. Would it be possible to use a TINYBLOB in your case?
[21 Sep 2004 19:03]
Sorin Florea
I haven't tried to see if I can deal with this type of data externally from mysql (with php). With tinyblob, it works fine in the mysql client. In QueryBrowser, nothing appears. i have set up a table test with 3 fields: password1 varchar(45), password2 varchar(45), password3 tinyblob in password, i put in cleartext strings in password2, i put in aes_encrypt(password) in password3, i do the same as above in the mysql client, i can see all fields with their content, but in query browser, only password and password 2 will show up. Password2 has the same problem as in my original post. as for password3 (the tinyblob), i can't see anything (with the viewer). i tried putting a problem string in the tiny blob filed: update test set password3=concat('G',char(0),'4'); and it does show up in the text viewer as 'G', nothing else, and for the binary viewer, nothing there. What is weird is that i checked to see why I can only see something in the text viewer (even if its not the right string) only with the 'G\04' string and not with anything else, so i checked to see if there are any other strings starting with a viewable character, and there are. I guess it's because they have undisplayable characters like «%Áø—\/³K?éµ²ûÈ.
[1 Dec 2004 14:24]
Michael G. Zinner
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html