1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Implemented the stored procedure data access characteristics:

NO SQL
CONTAINS SQL (default)
READS SQL DATA
MODIFIES SQL DATA

These are needed as hints for the replication.
(Before this, we did have the default in the mysql.proc table, but no support in the parser.)


mysql-test/r/sp.result:
  Modified test cases for new data access characteristics.
mysql-test/t/sp.test:
  Modified test cases for new data access characteristics.
scripts/mysql_create_system_tables.sh:
  We now support all the SP data access characteristics (not just CONTAINS SQL).
scripts/mysql_fix_privilege_tables.sql:
  We now support all the SP data access characteristics (not just CONTAINS SQL).
sql/lex.h:
  New tokens for SP data access characteristics.
sql/sp.cc:
  Store, print and support alter of data access characteristics.
sql/sp_head.cc:
  Added SP_ prefix to some symbols.
sql/sql_lex.h:
  Added SP_ prefix to some symbols, and added SP data access enum.
sql/sql_yacc.yy:
  Parse SP data access characteristics.
  (And allow "alter ... language sql", mostly as a formality, it was accidently
   put in the wrong clause before.)
This commit is contained in:
unknown
2004-10-14 18:07:09 +02:00
parent b57122b39e
commit a750003f57
9 changed files with 145 additions and 35 deletions

View File

@ -877,10 +877,17 @@ drop table t3|
drop procedure cur2|
create procedure chistics()
language sql
modifies sql data
not deterministic
sql security definer
comment 'Characteristics procedure test'
insert into t1 values ("chistics", 1)|
insert into t1 values ("chistics", 1)|
show create procedure chistics|
Procedure sql_mode Create Procedure
chistics CREATE PROCEDURE `test`.`chistics`()
MODIFIES SQL DATA
COMMENT 'Characteristics procedure test'
insert into t1 values ("chistics", 1)
call chistics()|
select * from t1|
id data
@ -890,6 +897,7 @@ alter procedure chistics sql security invoker name chistics2|
show create procedure chistics2|
Procedure sql_mode Create Procedure
chistics2 CREATE PROCEDURE `test`.`chistics2`()
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
insert into t1 values ("chistics", 1)
@ -899,14 +907,24 @@ language sql
deterministic
sql security invoker
comment 'Characteristics procedure test'
return 42|
return 42|
show create function chistics|
Function sql_mode Create Function
chistics CREATE FUNCTION `test`.`chistics`() RETURNS int
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics procedure test'
return 42
select chistics()|
chistics()
42
alter function chistics name chistics2 comment 'Characteristics function test'|
alter function chistics name chistics2
no sql
comment 'Characteristics function test'|
show create function chistics2|
Function sql_mode Create Function
chistics2 CREATE FUNCTION `test`.`chistics2`() RETURNS int
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT 'Characteristics function test'

View File

@ -978,12 +978,14 @@ drop procedure cur2|
# The few characteristics we parse
create procedure chistics()
language sql
not deterministic
sql security definer
comment 'Characteristics procedure test'
insert into t1 values ("chistics", 1)|
language sql
modifies sql data
not deterministic
sql security definer
comment 'Characteristics procedure test'
insert into t1 values ("chistics", 1)|
show create procedure chistics|
# Call it, just to make sure.
call chistics()|
select * from t1|
@ -993,15 +995,18 @@ show create procedure chistics2|
drop procedure chistics2|
create function chistics() returns int
language sql
deterministic
sql security invoker
comment 'Characteristics procedure test'
return 42|
language sql
deterministic
sql security invoker
comment 'Characteristics procedure test'
return 42|
show create function chistics|
# Call it, just to make sure.
select chistics()|
alter function chistics name chistics2 comment 'Characteristics function test'|
alter function chistics name chistics2
no sql
comment 'Characteristics function test'|
show create function chistics2|
drop function chistics2|