summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/sp-imp-spec.txt4
-rw-r--r--mysql-test/r/sp.result12
-rw-r--r--mysql-test/t/sp.test19
-rw-r--r--scripts/mysql_create_system_tables.sh4
-rw-r--r--scripts/mysql_fix_privilege_tables.sql8
-rw-r--r--sql/sp.cc1
6 files changed, 42 insertions, 6 deletions
diff --git a/Docs/sp-imp-spec.txt b/Docs/sp-imp-spec.txt
index 24a47aa2c38..ac17a375926 100644
--- a/Docs/sp-imp-spec.txt
+++ b/Docs/sp-imp-spec.txt
@@ -1057,9 +1057,9 @@
CREATE TABLE proc (
db char(64) binary DEFAULT '' NOT NULL,
- name char(64) binary DEFAULT '' NOT NULL,
+ name char(64) DEFAULT '' NOT NULL,
type enum('FUNCTION','PROCEDURE') NOT NULL,
- specific_name char(64) binary DEFAULT '' NOT NULL,
+ specific_name char(64) DEFAULT '' NOT NULL,
language enum('SQL') DEFAULT 'SQL' NOT NULL,
sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL,
is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 620f22aca68..1f3064605bc 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1000,6 +1000,18 @@ select bug2674()|
bug2674()
262136
drop function bug2674|
+create procedure bug3259_1 () begin end|
+create procedure BUG3259_2 () begin end|
+create procedure Bug3259_3 () begin end|
+call BUG3259_1()|
+call BUG3259_1()|
+call bug3259_2()|
+call Bug3259_2()|
+call bug3259_3()|
+call bUG3259_3()|
+drop procedure bUg3259_1|
+drop procedure BuG3259_2|
+drop procedure BUG3259_3|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 943e150ce1f..69433514728 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1159,6 +1159,25 @@ create function bug2674 () returns int
select bug2674()|
drop function bug2674|
+#
+# BUG#3259
+#
+
+create procedure bug3259_1 () begin end|
+create procedure BUG3259_2 () begin end|
+create procedure Bug3259_3 () begin end|
+
+call BUG3259_1()|
+call BUG3259_1()|
+call bug3259_2()|
+call Bug3259_2()|
+call bug3259_3()|
+call bUG3259_3()|
+
+drop procedure bUg3259_1|
+drop procedure BuG3259_2|
+drop procedure BUG3259_3|
+
#
# Some "real" examples
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index d20d745d514..06999b81ca1 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -290,9 +290,9 @@ if test ! -f $mdata/proc.frm
then
c_p="$c_p CREATE TABLE proc ("
c_p="$c_p db char(64) binary DEFAULT '' NOT NULL,"
- c_p="$c_p name char(64) binary DEFAULT '' NOT NULL,"
+ c_p="$c_p name char(64) DEFAULT '' NOT NULL,"
c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL,"
- c_p="$c_p specific_name char(64) binary DEFAULT '' NOT NULL,"
+ c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL,"
c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL,"
c_p="$c_p sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL,"
c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 115236948c9..e64bf59353f 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -141,9 +141,9 @@ unique index (name)
CREATE TABLE IF NOT EXISTS proc (
db char(64) binary DEFAULT '' NOT NULL,
- name char(64) binary DEFAULT '' NOT NULL,
+ name char(64) DEFAULT '' NOT NULL,
type enum('FUNCTION','PROCEDURE') NOT NULL,
- specific_name char(64) binary DEFAULT '' NOT NULL,
+ specific_name char(64) DEFAULT '' NOT NULL,
language enum('SQL') DEFAULT 'SQL' NOT NULL,
sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL,
is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL,
@@ -179,3 +179,7 @@ CREATE TABLE IF NOT EXISTS proc (
comment char(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
) comment='Stored Procedures';
+
+# Correct the name fields to not binary
+ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
+ MODIFY specific_name char(64) DEFAULT '' NOT NULL;
diff --git a/sql/sp.cc b/sql/sp.cc
index ede6cfeb84b..2be9ceeaad3 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -637,6 +637,7 @@ sp_drop_db_routines(THD *thd, char *db)
else
{
ret= SP_DELETE_ROW_FAILED;
+ nxtres= 0;
break;
}
} while (! (nxtres= table->file->index_next_same(table->record[0],