From 6a0f352bcd8fbff0abc9a0f029d0f1e38541c648 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Jun 2004 18:50:03 +0200 Subject: [PATCH] Added test case for SELECT INTO with too many rows. --- mysql-test/r/sp-error.result | 9 +++++++++ mysql-test/t/sp-error.test | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 1231c6398ee..0542b32582b 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -5,6 +5,15 @@ create procedure syntaxerror(t int)| ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 create procedure syntaxerror(t int)| ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +drop table if exists t3| +create table t3 ( x int )| +insert into t3 values (2), (3)| +create procedure bad_into(out param int) +select x from t3 into param| +call bad_into(@x)| +ERROR 42000: Result consisted of more than one row +drop procedure bad_into| +drop table t3| create procedure proc1() set @x = 42| create function func1() returns int diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 5bddc8b204e..6e4cd1a62b5 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -25,6 +25,23 @@ create procedure syntaxerror(t int)| #--error 1126 #create function foo returns real soname "foo.so"| + +--disable_warnings +drop table if exists t3| +--enable_warnings +create table t3 ( x int )| +insert into t3 values (2), (3)| + +create procedure bad_into(out param int) + select x from t3 into param| + +--error 1172 +call bad_into(@x)| + +drop procedure bad_into| +drop table t3| + + create procedure proc1() set @x = 42|