summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-07-26 18:08:49 -0700
committerunknown <jimw@mysql.com>2005-07-26 18:08:49 -0700
commiteb25e83ee4a2b960a387778a19440b6db4a01fd7 (patch)
tree0b255fa282c6caf7c049b919090d9116dcc699b6 /mysql-test
parent51308e23273537037a651c005659c4a8b8db96a4 (diff)
downloadmariadb-git-eb25e83ee4a2b960a387778a19440b6db4a01fd7.tar.gz
Increase allowed size of stored procedure bodies to 4GB, and
produce a sensible error when that limit is exceeded. (Bug #11602) client/mysqltest.c: Increase query buffer size, and explain why mysql-test/r/system_mysql_db.result: Update results scripts/mysql_create_system_tables.sh: Increase size of proc.body scripts/mysql_fix_privilege_tables.sql: Increase size of proc.body sql/share/errmsg.txt: Add error for SP routines that are too long sql/sp.cc: Raise an error when the SP body is too long. sql/sp.h: Add error for SP body being too long. sql/sql_parse.cc: Handle SP_BODY_TOO_LONG error. mysql-test/r/sp-big.result: New BitKeeper file ``mysql-test/r/sp-big.result'' mysql-test/t/sp-big.test: New BitKeeper file ``mysql-test/t/sp-big.test''
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp-big.result15
-rw-r--r--mysql-test/r/system_mysql_db.result2
-rw-r--r--mysql-test/t/sp-big.test33
3 files changed, 49 insertions, 1 deletions
diff --git a/mysql-test/r/sp-big.result b/mysql-test/r/sp-big.result
new file mode 100644
index 00000000000..004ff586aab
--- /dev/null
+++ b/mysql-test/r/sp-big.result
@@ -0,0 +1,15 @@
+drop procedure if exists test.longprocedure;
+drop table if exists t1;
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+length
+107520
+select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
+length(routine_definition)
+107530
+call test.longprocedure(@value);
+select @value;
+@value
+3
+drop procedure test.longprocedure;
+drop table t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 277115733d4..d2872878cb9 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -172,7 +172,7 @@ proc CREATE TABLE `proc` (
`security_type` enum('INVOKER','DEFINER') NOT NULL default 'DEFINER',
`param_list` blob NOT NULL,
`returns` char(64) NOT NULL default '',
- `body` blob NOT NULL,
+ `body` longblob NOT NULL,
`definer` char(77) character set utf8 collate utf8_bin NOT NULL default '',
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
diff --git a/mysql-test/t/sp-big.test b/mysql-test/t/sp-big.test
new file mode 100644
index 00000000000..769d77dbef9
--- /dev/null
+++ b/mysql-test/t/sp-big.test
@@ -0,0 +1,33 @@
+#
+# Bug #11602: SP with very large body not handled well
+#
+
+--disable_warnings
+drop procedure if exists test.longprocedure;
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+
+let $body=`select repeat('select count(*) into out1 from t1;\n', 3072)`;
+
+delimiter //;
+--disable_query_log
+eval select length('$body') as length//
+eval create procedure test.longprocedure (out out1 int) deterministic
+begin
+ $body
+end//
+--enable_query_log
+
+delimiter ;//
+
+# this is larger than the length above, because it includes the 'begin' and
+# 'end' bits and some whitespace
+select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
+
+call test.longprocedure(@value); select @value;
+
+drop procedure test.longprocedure;
+drop table t1;