Bug #39332 Proxy crashes with large datasets
Submitted: 9 Sep 2008 3:43 Modified: 21 Jan 2009 12:19
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
Category:MySQL Proxy: Core Severity:S1 (Critical)
Version:0.7.0 r 511 OS:Any
Assigned to: MC Brown CPU Architecture:Any

[9 Sep 2008 3:43] Diego Medina
It is possible to crash the MySQL Proxy by generating a large dataset and have some LUA script to process the result.

This affects Data Warehouse application in particular.

How to repeat:
1- Install the proxy
2- Start the proxy and use the tutorial-query-time.lua script (or pretty much any other lua script) and send the proxy the correct arguments to connect to a backend database
3- Run these commands through the proxy:

create table t1 (
dt datetime not null,
primary key (dt)

create view v3 as select null union all select null union all select null;
create view v10 as select null from v3 a, v3 b union all select null;
create view v1000 as select null from v10 a, v10 b, v10 c;
set @n = 0;
insert into t1 select now()-interval @n:=@n+1 second from v1000 a,v1000 b;

4- The previous lines were to create  large dataset in a table, now to crash the proxy run:

select * from t1 , t1 AS a, t1 AS b;

5- Wait and sooner or later the proxy will crash.

On Mac OS 10.5 will crash pretty soon. (4GB RAM)
On Fedora 8 will swap a lot and eventually will crash (2GB RAM)
[9 Sep 2008 4:37] Diego Medina
Correction: This bug will affect *any* database that
has proxy use LUA and has a large query run.  It is very common for primarily OLTP apps to still have occasional reporting queries issued against them.  One might
also note that mysqldump causes the creation of large result set queries and would
be another example use case to try out.
[9 Sep 2008 4:38] Diego Medina
Priority: P1
Severity: Critical
[21 Jan 2009 12:19] MC Brown
A note has been added to the 0.7.0 changelog: 

Using mysql-proxy with very large return datasets from queries, with or without manipulate of the dataset within the Lua engine could cause a crash.