Bug #19552 group_concat returns incorrect value (binary data)
| Submitted: | 4 May 2006 23:07 | Modified: | 10 Jun 2006 23:50 |
|---|---|---|---|
| Reporter: | David vonThenen | Email Updates: | |
| Status: | No Feedback | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.0.21 | OS: | Windows (WinXP) |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
[4 May 2006 23:07]
David vonThenen
[8 May 2006 23:51]
MySQL Verification Team
Thank you for the bug report. According the Manual; http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html GROUP_CONCAT(expr) This function returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values. The full syntax is as follows: <cut> Beginning with MySQL 5.0.19, the type returned by GROUP_CONCAT() is always VARCHAR unless group_concat_max_len is greater than 512, in which case, it returns a BLOB. (Previously, it returned a BLOB with group_concat_max_len greater than 512 only if the query included an ORDER BY clause.) Then group_concat is returning truncated values from a longtext since it is converted to blob: C:\mysql\bin>mysqladmin -uroot create dbt C:\mysql\bin>mysql -uroot dbt Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> CREATE TABLE file ( -> id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, -> data LONGTEXT, -> datab BLOB, -> PRIMARY KEY (id) ); Query OK, 0 rows affected (0.17 sec) mysql> INSERT INTO file (data,datab) values ( -> LOAD_FILE("C:/mysql/lib/opt/libmysql.dll"), -> LOAD_FILE("C:/mysql/lib/opt/libmysql.dll")); Query OK, 1 row affected, 1 warning (0.11 sec) mysql> show warnings; +---------+------+--------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------+ | Warning | 1265 | Data truncated for column 'datab' at row 1 | +---------+------+--------------------------------------------+ 1 row in set (0.00 sec) Do you agree? Thanks in advance.
[10 May 2006 22:57]
David vonThenen
I agree to that. I was under the impression that by increasing group_concat_max_len to a value larger than BLOB, it would accommodate the size required otherwise there is almost no point to having this parameter to set (just always return a BLOB). Are there any plans or a pending feature request to make it return the value no matter what the length is? The reason why I ask is because if you have data that exceeds a BLOB the only way you can stuff the data into the database as one record is by the CONCAT function. If you have ever done a CONCAT on a 300 Meg file in 1-10Meg chuncks, it is just plain slow (like a high end 4-way server takes nearly 2-4 minutes). By the example thought, you can see why you might want to have a LONGTEXT value from a GROUP_CONCAT so you dont have to store the file in an "unchuncked" form. Thanks for your help.
[10 May 2006 23:50]
MySQL Verification Team
Thank you for the feedback. I am not aware if there is a plan or feature request regarding this issue. However you can change this bug report as feature request, making a more suitable Synopsis and then I can edit as verified. Thanks in advance.
[11 Jun 2006 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.