1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-03 05:41:09 +03:00
Files
mariadb/mysql-test/r
unknown ad104d5bfd Bug#28318 CREATE FUNCTION (UDF) requires a schema
Bug#29816 Syntactically wrong query fails with misleading error message

The core problem is that an SQL-invoked function name can be a <schema
qualified routine name> that contains no <schema name>, but the mysql
parser insists that all stored procedures (function, procedures and
triggers) must have a <schema name>, which is not true for functions.
This problem is especially visible when trying to create a function
or when a query contains a syntax error after a function call (in the
same query), both will fail with a "No database selected" message if
the session is not attached to a particular schema, but the first
one should succeed and the second fail with a "syntax error" message.

Part of the fix is to revamp the sp name handling so that a schema
name may be omitted for functions -- this means that the internal
function name representation may not have a dot, which represents
that the function doesn't have a schema name. The other part is
to place schema checks after the type (function, trigger or procedure)
of the routine is known.


mysql-test/r/sp-error.result:
  Add test case result for Bug#29816
mysql-test/r/udf.result:
  Add test case result for Bug#28318
mysql-test/t/sp-error.test:
  Add test case for Bug#29816
mysql-test/t/udf.test:
  Add test case for Bug#28318
sql/sp.cc:
  Copy the (last) nul byte of the stored routine key and move name parsing
  code to the sp_name class constructor.
sql/sp_head.cc:
  Revamp routine name parsing for when no schema is specified and
  omit dot from the qualified name if the routine is not associated
  with a scheme name.
sql/sp_head.h:
  Name parsing got bigger, uninline by moving to a single unit -- the sp_head.cc
  file.
sql/sql_yacc.yy:
  Only copy the schema name if one is actually set and check for schema
  name presence only where it's necessary.
2007-10-09 20:46:33 -03:00
..
2007-05-17 19:38:34 +03:00
2007-06-16 13:05:07 +05:00
2007-05-30 10:56:18 +03:00
2007-05-24 15:35:43 +05:00
2007-08-03 15:57:14 +05:00
2007-07-23 23:35:43 -07:00
2007-06-28 16:03:01 -07:00
2007-07-06 11:35:10 -07:00
2007-07-06 11:35:10 -07:00
2007-06-17 11:43:49 -07:00
2007-07-05 18:24:48 +03:00
2007-05-12 00:46:07 +04:00
2007-07-31 11:10:03 +05:00
2007-07-23 23:35:43 -07:00
2007-06-07 20:25:22 +02:00
2007-07-31 11:10:03 +05:00
2007-07-11 18:45:35 -07:00
2007-07-06 03:43:23 +05:00
2007-08-13 15:46:11 +02:00
2007-06-17 22:04:01 +02:00
2007-07-02 01:28:20 +04:00
2007-06-29 22:05:43 +04:00
2007-06-21 16:55:52 +02:00
2007-05-24 15:35:43 +05:00
2007-05-31 17:30:56 +05:00
2007-08-15 10:24:18 -07:00
2007-06-06 18:55:21 +05:00
2007-07-22 18:26:16 -07:00
2007-07-12 00:03:08 +05:00
2007-06-03 15:56:48 +04:00