'Out of memory' error

Bug #341115 reported by Nidhi Shrotriya on 2009-03-11
2
Affects Status Importance Assigned to Milestone
PBXT
Undecided
Vladimir Kolesnikov

Bug Description

CREATE TABLE t2(c1 INT SIGNED NOT NULL, c2 INT UNSIGNED NULL, c3 INT, KEY(c1), KEY(c2));

Got 'Out of memory' error on the query
SELECT c1 FROM t2;

after a set of commands.

Please try to run the attached test case file to reproduce with PBXT.

/home/nidhi/mysql-builds/mysql-6.0.8-alpha-pbxt/bin/mysqltest: Out of memory (Needed 3608488 bytes)
mysqltest: At line 37: query 'SELECT c1 FROM t2' failed: 2008: MySQL client ran out of memory

-"Only happens with PBXT. All other engines MyISAM, Innodb, Falcon, Maria works fine."
-"Reproducible directly from the mysql client with the same set of commands (as in test case file) .

Related branches

In the same test, queries like
SELECT * FROM t2 WHERE c1 <> -2147483648 ORDER BY c1,c2;
SELECT * FROM t2 WHERE c1 > -2147483648 ORDER BY c1,c2;
timeout.

nidhi@nidhi-laptop:~/mysql-builds/mysql-6.0.8-alpha-pbxt/mysql-test$ tail -f var/log/master.log
      1 Query SELECT * FROM t2 WHERE c2 IN(8,9) ORDER BY c2 DESC
      1 Query UPDATE t2 SET c1=-2147483648 WHERE c2 IS NULL ORDER BY c2 LIMIT 2
      1 Query SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c2
      1 Query UPDATE t2 SET c1=-2147483648 WHERE c2>= 6 AND c2 < 9 ORDER BY c2 LIMIT 2
      1 Query SELECT * FROM t2 WHERE c2>= 6 AND c2 < 9 ORDER BY c2
      1 Query UPDATE t2 SET c1=-2147483648 WHERE c1=-12 OR c2=1
      1 Query SELECT * FROM t2
      1 Query SELECT * FROM t2 WHERE c1=-2147483648
      1 Query SELECT * FROM t2 WHERE c1 <> -2147483648 ORDER BY c1,c2
mysql> show processlist
    -> ;
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
| 1 | root | localhost | test | Query | 240 | Sorting result | SELECT * FROM t2 WHERE c1 <> -2147483648 ORDER BY c1,c2 |
| 2 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
2 rows in set (0.00 sec)
--
mysql> show processlist;
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
| 1 | root | localhost | test | Query | 849 | Sorting result | SELECT * FROM t2 WHERE c1 <> -2147483648 ORDER BY c1,c2 |
| 2 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+----+------+-----------+------+---------+------+----------------+---------------------------------------------------------+
2 rows in set (0.00 sec)

Hi Nidhi,

Thanks for the report. I can confirm that in some cases index scans cause loops over index which lead to endless resultset. This causes timeouts. I guess this also causes OOM errors on client.

Changed in pbxt:
assignee: nobody → vkolesnikov
status: New → Confirmed
Changed in pbxt:
status: Confirmed → Fix Committed
Changed in pbxt:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments