maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08785
Re: GSoc2015: MDEV-8356 first patch
Hi Diwas,
On Fri, Jul 03, 2015 at 02:54:28PM +0530, Diwas Joshi wrote:
> hello sergey, I have fixed the issues from the previous patch in this one.
>
Please find some feedback below. After you have addressed it, please commit the
change and push it to your tree.
The next task to focus on after this one is MDEV-8389.
> diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
> index 897895e..cacfeea 100644
> --- a/mysql-test/r/sp-error.result
> +++ b/mysql-test/r/sp-error.result
> @@ -2866,12 +2866,6 @@ SELECT @msg;
> DROP FUNCTION f1;
> DROP FUNCTION f2;
> DROP TABLE t1;
> -CREATE FUNCTION f1(a INT, b VARCHAR(11))
> -RETURNS TABLE t1(id INT, name VARCHAR(11))
> -BEGIN
> -INSERT INTO t1 SELECT id, name FROM t2 WHERE id = a;
> -END|
> -ERROR 42000: This version of MariaDB doesn't yet support 'Table functions'
> SELECT * FROM f1('xyz');
> ERROR 42000: This version of MariaDB doesn't yet support 'Queries using Table Functions'
> SELECT * FROM t1, f1('xyz',t1.a);
> diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
> index 3f28df9..2a931b1 100644
> --- a/mysql-test/r/sp.result
> +++ b/mysql-test/r/sp.result
> @@ -7937,3 +7937,17 @@ return 1;
> end |
> ERROR 0A000: Not allowed to return a result set from a function
> drop table t1,t2;
> +# Tests for Table functions
> +CREATE FUNCTION f1(a INT, b VARCHAR(11))
> +RETURNS TABLE t1(id INT, name VARCHAR(11))
> +BEGIN
> +INSERT INTO t1 SELECT id, name FROM t2 WHERE id = a;
> +END|
Please add "--vertical_results" here so that the SELECT results are printed
vertically. It will be easier to see what the return value is.
> +SELECT * FROM mysql.proc WHERE db = database() and name = 'f1';
> +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
> +test f1 FUNCTION f1 SQL CONTAINS_SQL NO DEFINER a INT, b VARCHAR(11) TABLE t1(id int(11), name varchar(11)) BEGIN
> +INSERT INTO t1 SELECT id, name FROM t2 WHERE id = a;
> +END root@localhost 2015-07-03 12:18:04 2015-07-03 12:18:04 latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
> +INSERT INTO t1 SELECT id, name FROM t2 WHERE id = a;
> +END
> +DROP FUNCTION f1;
--
BR
Sergei
--
Sergei Petrunia, Software Developer
MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog
References