diff options
author | unknown <malff/marcsql@weblab.(none)> | 2006-10-09 09:59:02 -0700 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2006-10-09 09:59:02 -0700 |
commit | e1e0f829e6ac97c6bb4aaf1f919fde481a2a1a0c (patch) | |
tree | e478379d54c7a6b3e5a0fdc92710d775bdbc0dfb /mysql-test/t/sp.test | |
parent | afdae2f3b7245b5242ef27ff850365cd4a43dd93 (diff) | |
download | mariadb-git-e1e0f829e6ac97c6bb4aaf1f919fde481a2a1a0c.tar.gz |
Bug#21462 (Stored procedures with no arguments require parenthesis)
The syntax of the CALL statement, to invoke a stored procedure, has been
changed to make the use of parenthesis optional in the argument list.
With this change, "CALL p;" is equivalent to "CALL p();".
While the SQL spec does not explicitely mandate this syntax, supporting it
is needed for practical reasons, for integration with JDBC / ODBC connectors.
Also, warnings in the sql/sql_yacc.yy file, which were not reported by Bison 2.1
but are now reported by Bison 2.2, have been fixed.
The warning found were:
bison -y -p MYSQL -d --debug --verbose sql_yacc.yy
sql_yacc.yy:653.9-18: warning: symbol UNLOCK_SYM redeclared
sql_yacc.yy:656.9-17: warning: symbol UNTIL_SYM redeclared
sql_yacc.yy:658.9-18: warning: symbol UPDATE_SYM redeclared
sql_yacc.yy:5169.11-5174.11: warning: unused value: $2
sql_yacc.yy:5208.11-5220.11: warning: unused value: $5
sql_yacc.yy:5221.11-5234.11: warning: unused value: $5
conflicts: 249 shift/reduce
"unused value: $2" correspond to the $$=$1 assignment in the 1st {} block
in table_ref -> join_table {} {},
which does not procude a result ($$) for the rule but an intermediate $2
value for the action instead.
"unused value: $5" are similar, with $$ assignments in {} actions blocks
which are not for the final reduce.
mysql-test/r/sp.result:
New test case for Bug#21462
mysql-test/t/sp.test:
New test case for Bug#21462
sql/sql_yacc.yy:
"CALL p;" syntax for calling a stored procedure
Fixed bison 2.2 warnings.
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r-- | mysql-test/t/sp.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 87d19baf888..ffbbf56d3ac 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6420,6 +6420,39 @@ SELECT bug21493(Member_ID) FROM t3| DROP FUNCTION bug21493| DROP TABLE t3,t4| +# +# Bug#21462 Stored procedures with no arguments require parenthesis +# + +--disable_warnings +drop procedure if exists proc_21462_a| +drop procedure if exists proc_21462_b| +--enable_warnings + +create procedure proc_21462_a() +begin + select "Called A"; +end| + +create procedure proc_21462_b(x int) +begin + select "Called B"; +end| + +call proc_21462_a| +call proc_21462_a()| +-- error ER_SP_WRONG_NO_OF_ARGS +call proc_21462_a(1)| + +-- error ER_SP_WRONG_NO_OF_ARGS +call proc_21462_b| +-- error ER_SP_WRONG_NO_OF_ARGS +call proc_21462_b()| +call proc_21462_b(1)| + +drop procedure proc_21462_a| +drop procedure proc_21462_b| + --echo End of 5.0 tests |