Commit 41c4c932 authored by unknown's avatar unknown

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0

into sanja.is.com.ua:/home/bell/mysql/bk/work-error-5.0


sql/sql_yacc.yy:
  Auto merged
parents 1e623bb9 43785537
delete from mysql.proc; delete from mysql.proc;
create function .f1() returns int return 1;
create procedure .p1() select 1, database();
create procedure p1() select 2, database();
alter procedure .p1 sql security invoker;
select .f1();
.f1()
1
call .p1();
1 database()
1 test
call p1();
2 database()
2 test
select f1();
ERROR 42000: FUNCTION test.f1 does not exist
select db,name,type,security_type from mysql.proc;
db name type security_type
f1 FUNCTION DEFINER
p1 PROCEDURE INVOKER
test p1 PROCEDURE DEFINER
drop function .f1;
drop procedure .p1;
drop procedure p1;
create procedure syntaxerror(t int)| 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 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)| create procedure syntaxerror(t int)|
......
...@@ -37,8 +37,8 @@ show create table t9; ...@@ -37,8 +37,8 @@ show create table t9;
Table Create Table Table Create Table
t9 CREATE TABLE `t9` ( t9 CREATE TABLE `t9` (
`a` int(11) NOT NULL auto_increment, `a` int(11) NOT NULL auto_increment,
`b` char(16) NOT NULL default '', `b` char(16) NOT NULL,
`c` int(11) NOT NULL default '0', `c` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
alter table t9 rename t8, add column d int not null; alter table t9 rename t8, add column d int not null;
...@@ -58,9 +58,9 @@ show create table mysqltest.t9; ...@@ -58,9 +58,9 @@ show create table mysqltest.t9;
Table Create Table Table Create Table
t9 CREATE TABLE `t9` ( t9 CREATE TABLE `t9` (
`a` int(11) NOT NULL auto_increment, `a` int(11) NOT NULL auto_increment,
`b` char(16) NOT NULL default '', `b` char(16) NOT NULL,
`c` int(11) NOT NULL default '0', `c` int(11) NOT NULL,
`d` int(11) NOT NULL default '0', `d` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
drop database mysqltest; drop database mysqltest;
...@@ -68,19 +68,19 @@ create table t1 (a int not null) engine=myisam; ...@@ -68,19 +68,19 @@ create table t1 (a int not null) engine=myisam;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0' `a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int; alter table t1 add b int;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0', `a` int(11) NOT NULL,
`b` int(11) default NULL `b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0', `a` int(11) NOT NULL,
`b` int(11) default NULL `b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
...@@ -24,7 +24,7 @@ DROP TABLE t1; ...@@ -24,7 +24,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 (a double); CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES (-9e999999); INSERT INTO t1 VALUES ('-9e999999');
# The following replaces is here because some systems replaces the above # The following replaces is here because some systems replaces the above
# double with '-inf' and others with MAX_DOUBLE # double with '-inf' and others with MAX_DOUBLE
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES) --replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
......
...@@ -5,29 +5,6 @@ ...@@ -5,29 +5,6 @@
# Make sure we don't have any procedures left. # Make sure we don't have any procedures left.
delete from mysql.proc; delete from mysql.proc;
# A test of "global" procedures, i.e. not belonging to any database.
create function .f1() returns int return 1;
create procedure .p1() select 1, database();
create procedure p1() select 2, database();
alter procedure .p1 sql security invoker;
# This is ok:
select .f1();
call .p1();
call p1();
# This is not ok:
--error 1305
select f1();
select db,name,type,security_type from mysql.proc;
drop function .f1;
drop procedure .p1;
drop procedure p1;
delimiter |; delimiter |;
# This should give three syntax errors (sometimes crashed; bug #643) # This should give three syntax errors (sometimes crashed; bug #643)
......
...@@ -3611,13 +3611,24 @@ purposes internal to the MySQL server", MYF(0)); ...@@ -3611,13 +3611,24 @@ purposes internal to the MySQL server", MYF(0));
case SQLCOM_CREATE_PROCEDURE: case SQLCOM_CREATE_PROCEDURE:
case SQLCOM_CREATE_SPFUNCTION: case SQLCOM_CREATE_SPFUNCTION:
{ {
uint namelen;
char *name;
if (!lex->sphead) if (!lex->sphead)
{ {
res= -1; // Shouldn't happen res= -1; // Shouldn't happen
break; break;
} }
uint namelen;
char *name= lex->sphead->name(&namelen); if (! lex->sphead->m_db.str)
{
send_error(thd,ER_NO_DB_ERROR);
delete lex->sphead;
lex->sphead= 0;
goto error;
}
name= lex->sphead->name(&namelen);
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
if (lex->sphead->m_type == TYPE_ENUM_FUNCTION) if (lex->sphead->m_type == TYPE_ENUM_FUNCTION)
{ {
...@@ -3627,7 +3638,7 @@ purposes internal to the MySQL server", MYF(0)); ...@@ -3627,7 +3638,7 @@ purposes internal to the MySQL server", MYF(0));
{ {
net_printf(thd, ER_UDF_EXISTS, name); net_printf(thd, ER_UDF_EXISTS, name);
delete lex->sphead; delete lex->sphead;
lex->sphead=0; lex->sphead= 0;
goto error; goto error;
} }
} }
...@@ -3637,7 +3648,7 @@ purposes internal to the MySQL server", MYF(0)); ...@@ -3637,7 +3648,7 @@ purposes internal to the MySQL server", MYF(0));
{ {
net_printf(thd, ER_SP_NORETURN, name); net_printf(thd, ER_SP_NORETURN, name);
delete lex->sphead; delete lex->sphead;
lex->sphead=0; lex->sphead= 0;
goto error; goto error;
} }
......
...@@ -1273,12 +1273,7 @@ create: ...@@ -1273,12 +1273,7 @@ create:
; ;
sp_name: sp_name:
'.' IDENT_sys IDENT_sys '.' IDENT_sys
{
$$= new sp_name($2);
$$->init_qname(YYTHD);
}
| IDENT_sys '.' IDENT_sys
{ {
$$= new sp_name($1, $3); $$= new sp_name($1, $3);
$$->init_qname(YYTHD); $$->init_qname(YYTHD);
...@@ -4461,18 +4456,6 @@ simple_expr: ...@@ -4461,18 +4456,6 @@ simple_expr:
{ $$= new Item_func_round($3,$5,1); } { $$= new Item_func_round($3,$5,1); }
| TRUE_SYM | TRUE_SYM
{ $$= new Item_int((char*) "TRUE",1,1); } { $$= new Item_int((char*) "TRUE",1,1); }
| '.' ident '(' udf_expr_list ')'
{
LEX *lex= Lex;
sp_name *name= new sp_name($2);
name->init_qname(YYTHD);
sp_add_fun_to_lex(Lex, name);
if ($4)
$$= new Item_func_sp(name, *$4);
else
$$= new Item_func_sp(name);
}
| ident '.' ident '(' udf_expr_list ')' | ident '.' ident '(' udf_expr_list ')'
{ {
LEX *lex= Lex; LEX *lex= Lex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment