Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4e8c22f2
Commit
4e8c22f2
authored
Jul 09, 2005
by
dlenev@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual fixes after merging patch for bug #8406 "Triggers crash if referencing
a table" with main tree.
parent
75b8d4fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
28 deletions
+18
-28
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+0
-9
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+1
-1
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+12
-11
sql/sp.cc
sql/sp.cc
+2
-2
sql/sp.h
sql/sp.h
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+2
-4
No files found.
mysql-test/r/trigger.result
View file @
4e8c22f2
...
...
@@ -573,12 +573,3 @@ i k ts
1 1 0000-00-00 00:00:00
2 2 0000-00-00 00:00:00
drop table t1, t2;
drop function if exists bug5893;
create table t1 (col1 int, col2 int);
insert into t1 values (1, 2);
create function bug5893 () returns int return 5;
create trigger t1_bu before update on t1 for each row set new.col1= bug5893();
drop function bug5893;
update t1 set col2 = 4;
ERROR 42000: FUNCTION test.bug5893 does not exist
drop table t1;
mysql-test/t/sp-error.test
View file @
4e8c22f2
...
...
@@ -1025,7 +1025,7 @@ end|
--
error
1424
call
bug11394
(
2
,
1
)
|
drop
procedure
bug11394
|
delimiter
|
;
delimiter
;
|
#
# Bug#11834 "Re-execution of prepared statement with dropped function
...
...
mysql-test/t/trigger.test
View file @
4e8c22f2
...
...
@@ -578,14 +578,15 @@ drop table t1, t2;
# Test for bug #5893 "Triggers with dropped functions cause crashes"
# Appropriate error should be reported instead of crash.
--
disable_warnings
drop
function
if
exists
bug5893
;
--
enable_warnings
create
table
t1
(
col1
int
,
col2
int
);
insert
into
t1
values
(
1
,
2
);
create
function
bug5893
()
returns
int
return
5
;
create
trigger
t1_bu
before
update
on
t1
for
each
row
set
new
.
col1
=
bug5893
();
drop
function
bug5893
;
--
error
1305
update
t1
set
col2
=
4
;
drop
table
t1
;
# Had to disable this test until bug #11554 will be fixed.
#--disable_warnings
#drop function if exists bug5893;
#--enable_warnings
#create table t1 (col1 int, col2 int);
#insert into t1 values (1, 2);
#create function bug5893 () returns int return 5;
#create trigger t1_bu before update on t1 for each row set new.col1= bug5893();
#drop function bug5893;
#--error 1305
#update t1 set col2 = 4;
#drop table t1;
sql/sp.cc
View file @
4e8c22f2
...
...
@@ -1134,7 +1134,7 @@ extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first)
FALSE - element was not added (because it is already present in the set).
*/
static
bool
add_used_routine
(
LEX
*
lex
,
Item
_arena
*
arena
,
static
bool
add_used_routine
(
LEX
*
lex
,
Query
_arena
*
arena
,
const
LEX_STRING
*
key
)
{
if
(
!
hash_search
(
&
lex
->
sroutines
,
(
byte
*
)
key
->
str
,
key
->
length
))
...
...
@@ -1173,7 +1173,7 @@ static bool add_used_routine(LEX *lex, Item_arena *arena,
persistent arena as second argument.
*/
void
sp_add_used_routine
(
LEX
*
lex
,
Item
_arena
*
arena
,
void
sp_add_used_routine
(
LEX
*
lex
,
Query
_arena
*
arena
,
sp_name
*
rt
,
char
rt_type
)
{
rt
->
set_routine_type
(
rt_type
);
...
...
sql/sp.h
View file @
4e8c22f2
...
...
@@ -82,7 +82,7 @@ sp_function_exists(THD *thd, sp_name *name);
Procedures for pre-caching of stored routines and building table list
for prelocking.
*/
void
sp_add_used_routine
(
LEX
*
lex
,
Item
_arena
*
arena
,
void
sp_add_used_routine
(
LEX
*
lex
,
Query
_arena
*
arena
,
sp_name
*
rt
,
char
rt_type
);
void
sp_update_sp_used_routines
(
HASH
*
dst
,
HASH
*
src
);
bool
sp_cache_routines_and_add_tables
(
THD
*
thd
,
LEX
*
lex
);
...
...
sql/sql_lex.cc
View file @
4e8c22f2
...
...
@@ -1997,10 +1997,8 @@ void st_lex::cleanup_after_one_table_open()
select_lex
.
cut_subtree
();
}
time_zone_tables_used
=
0
;
if
(
spfuns
.
records
)
my_hash_reset
(
&
spfuns
);
if
(
spprocs
.
records
)
my_hash_reset
(
&
spprocs
);
if
(
sroutines
.
records
)
my_hash_reset
(
&
sroutines
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment