From ce2b64b439b2ee0afdeae044f216286306bcbd2e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 18:06:02 +0200 Subject: Corrections to test "sp", stored procedure "fib" (see entry 9937 in the bug DB). mysql-test/r/sp.result: Correct the result file for the changed test. mysql-test/t/sp.test: 1) Correct the "fib" stored procedure and its initial data to be mathematical correct: fib(0) = 0 2) Do a small run of "fib" first, that is not likely to hit a memory limit (see entry 9937 in the bug DB). BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/sp.result | 16 ++++++++++++---- mysql-test/t/sp.test | 18 +++++++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index c75f6010605..01726f15985 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -115,6 +115,7 @@ jcole@sarvik.tfr.cafe.ee jcole@tetra.spaceapes.com jimw@mysql.com joerg@mysql.com +joerg@trift-lap.fambruehe jon@gigan. jonas@mysql.com joreland@bk-internal.mysql.com diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 815683172f6..0cc16448625 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1404,11 +1404,10 @@ show procedure status like '%p%'| Db Name Type Definer Modified Created Security_type Comment drop table if exists fib| create table fib ( f bigint unsigned not null )| -insert into fib values (1), (1)| drop procedure if exists fib| create procedure fib(n int unsigned) begin -if n > 0 then +if n > 1 then begin declare x, y bigint unsigned; declare c cursor for select f from fib order by f desc limit 2; @@ -1421,9 +1420,20 @@ call fib(n-1); end; end if; end| +insert into fib values (0), (1)| +call fib(3)| +select * from fib order by f asc| +f +0 +1 +1 +2 +delete from fib| +insert into fib values (0), (1)| call fib(20)| select * from fib order by f asc| f +0 1 1 2 @@ -1444,8 +1454,6 @@ f 2584 4181 6765 -10946 -17711 drop table fib| drop procedure fib| drop procedure if exists bar| diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 77fe5ab7601..b4066df1666 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1634,8 +1634,6 @@ drop table if exists fib| --enable_warnings create table fib ( f bigint unsigned not null )| -insert into fib values (1), (1)| - # We deliberately do it the awkward way, fetching the last two # values from the table, in order to exercise various statements # and table accesses at each turn. @@ -1644,7 +1642,7 @@ drop procedure if exists fib| --enable_warnings create procedure fib(n int unsigned) begin - if n > 0 then + if n > 1 then begin declare x, y bigint unsigned; declare c cursor for select f from fib order by f desc limit 2; @@ -1659,6 +1657,20 @@ begin end if; end| +# Minimum test: recursion of 3 levels + +insert into fib values (0), (1)| + +call fib(3)| + +select * from fib order by f asc| + +delete from fib| + +# Original test: 20 levels (may run into memory limits!) + +insert into fib values (0), (1)| + call fib(20)| select * from fib order by f asc| -- cgit v1.2.1