summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-07 23:00:33 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-07 23:00:33 +0300
commit32755eb50eec5887c8fb69eabf8fc0912661b75a (patch)
treec9bde6be21ea745c36c5f515deac2d1c9e5d9a4e
parent838ccf19faf77993f4d820afd1a142241311e472 (diff)
parentb2670a6722f0f175a5248fa56fcd009d3b71d54a (diff)
downloadmariadb-git-32755eb50eec5887c8fb69eabf8fc0912661b75a.tar.gz
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
-rw-r--r--mysql-test/r/sp-error.result23
-rw-r--r--mysql-test/r/symlink.result16
-rw-r--r--mysql-test/t/mysqldump.test2
-rw-r--r--mysql-test/t/sp-error.test23
-rw-r--r--sql/sql_parse.cc19
-rw-r--r--sql/sql_yacc.yy19
6 files changed, 25 insertions, 77 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 540a5652197..0a679957e44 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1,27 +1,4 @@
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)|
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)|
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 08d75d8b562..53d0f63aea2 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -37,8 +37,8 @@ show create table t9;
Table Create Table
t9 CREATE TABLE `t9` (
`a` int(11) NOT NULL auto_increment,
- `b` char(16) NOT NULL default '',
- `c` int(11) NOT NULL default '0',
+ `b` char(16) NOT NULL,
+ `c` int(11) NOT NULL,
PRIMARY KEY (`a`)
) 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;
@@ -58,9 +58,9 @@ show create table mysqltest.t9;
Table Create Table
t9 CREATE TABLE `t9` (
`a` int(11) NOT NULL auto_increment,
- `b` char(16) NOT NULL default '',
- `c` int(11) NOT NULL default '0',
- `d` int(11) NOT NULL default '0',
+ `b` char(16) NOT NULL,
+ `c` int(11) NOT NULL,
+ `d` int(11) NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
drop database mysqltest;
@@ -68,19 +68,19 @@ create table t1 (a int not null) engine=myisam;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL default '0'
+ `a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL default '0',
+ `a` int(11) NOT NULL,
`b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL default '0',
+ `a` int(11) NOT NULL,
`b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 945680e7c29..e8bb98d5ae0 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -24,7 +24,7 @@ DROP TABLE t1;
#
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
# double with '-inf' and others with MAX_DOUBLE
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 46700293578..6970523ad31 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -5,29 +5,6 @@
# Make sure we don't have any procedures left.
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 |;
# This should give three syntax errors (sometimes crashed; bug #643)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 59b45400c2a..53b5e8f3a00 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3611,13 +3611,24 @@ purposes internal to the MySQL server", MYF(0));
case SQLCOM_CREATE_PROCEDURE:
case SQLCOM_CREATE_SPFUNCTION:
{
+ uint namelen;
+ char *name;
+
if (!lex->sphead)
{
res= -1; // Shouldn't happen
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
if (lex->sphead->m_type == TYPE_ENUM_FUNCTION)
{
@@ -3627,7 +3638,7 @@ purposes internal to the MySQL server", MYF(0));
{
net_printf(thd, ER_UDF_EXISTS, name);
delete lex->sphead;
- lex->sphead=0;
+ lex->sphead= 0;
goto error;
}
}
@@ -3637,7 +3648,7 @@ purposes internal to the MySQL server", MYF(0));
{
net_printf(thd, ER_SP_NORETURN, name);
delete lex->sphead;
- lex->sphead=0;
+ lex->sphead= 0;
goto error;
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 46c77f39341..0a72e5b7991 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1273,12 +1273,7 @@ create:
;
sp_name:
- '.' IDENT_sys
- {
- $$= new sp_name($2);
- $$->init_qname(YYTHD);
- }
- | IDENT_sys '.' IDENT_sys
+ IDENT_sys '.' IDENT_sys
{
$$= new sp_name($1, $3);
$$->init_qname(YYTHD);
@@ -4461,18 +4456,6 @@ simple_expr:
{ $$= new Item_func_round($3,$5,1); }
| TRUE_SYM
{ $$= 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 ')'
{
LEX *lex= Lex;