MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Harald Fuchs Date:August 15 2002 1:02pm
Subject:4.0.x bug with LONGTEXT?
View as plain text  
I think I've found a bug in the handling of large INSERTs/UPDATEs
(MySQL 4.0.2, Intel/Linux).

Consider the following:

  CREATE TABLE IF NOT EXISTS tbl1 (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    txt LONGTEXT NOT NULL,
    PRIMARY KEY (id)
  ) TYPE=Innodb;

  INSERT INTO tbl1 (txt) VALUES (LOAD_FILE("/var/tmp/out"));

Here /var/tmp/out is an arbitrary file of 8 MB.   max_allowed_packet
is set to 16M, the maximum for 3.23.x.  The query

  SELECT id, LENGTH(txt) AS len
  FROM tbl1
  ORDER BY id;

returns:

  +----+---------+
  | id | len     |
  +----+---------+
  |  1 | 8388608 |
  +----+---------+

as expected.

If I do

  UPDATE tbl1
  SET txt = CONCAT(txt, LOAD_FILE("/var/tmp/out"))
  WHERE id = 1;

(i.e. duplicating txt), SELECT returns

  +----+-----+
  | id | len |
  +----+-----+
  |  1 |   0 |
  +----+-----+

According to the manual, LOAD_FILE returns NULL if the file is too
large, but apparently this isn't the case here.

Even stranger: adding yet another UPDATE, SELECT returns 8M again.
Thread
4.0.x bug with LONGTEXT?Harald Fuchs15 Aug
  • Re: 4.0.x bug with LONGTEXT?Victoria Reznichenko16 Aug
Re: 4.0.x bug with LONGTEXT?Harald Fuchs16 Aug
  • Re: Re: 4.0.x bug with LONGTEXT?Victoria Reznichenko19 Aug
Re: 4.0.x bug with LONGTEXT?Harald Fuchs20 Aug
  • max_allowed_packet (was: Re: 4.0.x bug with LONGTEXT?)Roger Baklund20 Aug
RE: max_allowed_packet (was: Re: 4.0.x bug with LONGTEXT?)Luc Foisy20 Aug
  • Re: max_allowed_packet (was: Re: 4.0.x bug with LONGTEXT?)Roger Baklund20 Aug
    • Re: Re: max_allowed_packet (was: Re: 4.0.x bug with LONGTEXT?)Victoria Reznichenko21 Aug
      • Re: max_allowed_packet (was: Re: 4.0.x bug with LONGTEXT?)Roger Baklund21 Aug