GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

COMPRESS/UNCOMPRESS bug??

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • COMPRESS/UNCOMPRESS bug??

    I have following problem:

    Create Table is:
    CREATE TABLE `search_keyword` (
    `id` int(11) NOT NULL COMMENT 'ID',
    `keyword` varchar(60) NOT NULL,
    `search_result` text,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8

    In field "search_result" I have compressed a lot of data with:
    update search_keyword set search_result = COMPRESS(search_result)

    ...and now, when I try to access this data with

    select UNCOMPRESS(search_result) from search_keyword where keyword = ....

    I get NULL as result. Why???


    In the documentation I saw a remark, that only binary fields are recommended

    "(However, use of nonbinary string data types such as CHAR or VARCHAR to store compressed strings is not recommended anyway because character set conversion may occur. Use a VARBINARY or BLOB binary string column instead.) "

    In this case I had not binary field. Is this a reason for this problem? Is there a way to get data back?

  • #2
    http://dev.mysql.com/doc/refman/4.1/en/encryption-functions. html#function_uncompress

    As long as you use the same collation everywhere, text should not pose a problem.

    Comment

    Working...
    X